Property Inference Attacks on Convolutional Neural Networks:Influence and Implications of Target Model’s Complexity
Authors: Mathias Parisot, Balazs Pejo, and Dayana Spagnuelo
This repository is the official implementation of Property Inference Attacks on Convolutional Neural Networks:Influence and Implications of Target Model’s Complexity.
This repository was tested using Python 3 only, please make sure not to use Python 2. To install the dependencies:
pip install -r requirements.txt
In case you want to train and evaluate the shadow models, you will also need to download CelebA. For some reasons, downloading CelebA via Pytorch didn't work, so here is how to download CelebA manualy:
- on the CelebA webpage, got to their Google drive directory. The disposition of the directory is as follow:
Img/
Anno/
Eval/
README.txt
- go to
Img/
and download the zip fileimg_align_celeba.zip
- go to
Ano/
and download all the.txt
files, there should be 5 - go to
Eval/
and doanloadlist_eval_partition.txt
- Move all the downloaded files into
data/celeba
and extractimg_align_celeba.zip
. After that,data/celeba
should look as follow:
img_align_celeba/
identity_CelebA.txt
img_align_celeba.zip
list_attr_celeba.txt
list_bbox_celeba.txt
list_eval_partition.txt
list_landmarks_align_celeba.txt
list_landmarks_celeba.txt
Once this is done, you can follow the next sections to train and test the shadow and attack models.
To train the shadow models (architecture 1, 2, 3, and 4 from the paper), run this command:
python train_shadow.py --models a1 a2 a3 a4 --csv template_output.csv
To train the attack models, run this command:
python train_attack.py --csv template_output.csv
For more specific parameters, please check the command line arguments of the respective files.
After training the shadow models, you can evaluate their performance on CelebA by running:
python test_shadow.py --shadow_csv template_output.csv
After training the attack models, you can evaluate their performance on the shadow model test dataset by running:
python test_attack.py --csv template_output.csv