ngoc-nguyen-0 / LOKT_neurips2023

9 stars 3 forks source link

[Neurips-2023] Implementation of paper "Label-Only Model Inversion Attacks via Knowledge Transfer"

[Paper] | Project page

1. Setup Environment

This code has been tested with Python 3.7, PyTorch 1.11.0 and Cuda 11.3.

conda create -n MI python=3.7

conda activate MI

pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113

pip install -r requirements.txt

2. Prepare Dataset & Checkpoints

3. Train TACGAN

Other arguments will be automatically updated when you train the TACGAN and surrogate models.

python train_tacgan.py \
--alpha=1.5 \
--cGAN \
--config_exp ./config/exp/FaceNet64_celeba.json \
--is_wandb 

4. Train surrogate model

python create_dataset.py \
--config_exp ./config/exp/FaceNet64_celeba.json 
python train_surrogate_model.py \
--is_wandb \
--config_exp ./config/exp/FaceNet64_celeba.json \
--surrogate_model_id 0 

Modify surrogate_model_id to change the architectures of the surrogate model. We provide 3 architectures for surrogate models:

5. Attack and evaluation

python plg_tacgan.py \
--inv_loss_type=margin \
--save_dir='results_facenet64' \
--classid='0,1,2' \
--config_exp ./config/exp/FaceNet64_celeba.json \
python evaluation.py \
--save_dir='results_facenet64' \
--classid='0,1,2' \
--config_exp ./config/exp/FaceNet64_celeba.json \

Acknowledgements

We gratefully acknowledge the following works:

Reference

[1] Yuan, Xiaojian, et al. "Pseudo Label-Guided Model Inversion Attack via Conditional Generative Adversarial Network." AAAI (2023).