- python 3.8.16
- pytorch 1.13 + cu11.7
- timm 0.9.7
- numpy 1.24.3
- scipy 1.10.1
- pretrainedmodels 0.7.4
- pandas 2.0.1
-
Prepare Data: We have placed the ImageNet-compatible dataset under the './dataset' folder.
-
Prepare model: Download pretrained PyTorch models tf to torch , which are converted from widely used Tensorflow models. Then, the model source code and weight are respectively place in './torch_nets' and './torch_nets_weight'.
These models include inception-v3, inception-v4, inception-resnet-v2, resnet152, resnet50, resnet101.
In addition, adversarial models include adv_inception_v3(Inc-v3adv), ens3_adv_inception_v3(Inc-v3ens3), ens4_adv_inception_v3(Inc_v3ens4), ens_adv_inception_resnet_v2(IncRes-v2ens)
-
Generate adversarial examples
Using
attack.pyto implement our "EIT" attack, you can run this attack as followingpython attack.py --output_dir outputs --batch_size 10
make sure to run GPU enviroment. And adversarial examples will be generated in './outputs'.
-
Evaluations on normally trained models
please run 'main.py' evaluate the attack success ratepython main.py --adv_dir "./outputs" -
Evaluations on adversarial trained models
similar, run 'main.py' evaluate the attack success rate
-
Evaluations on Visual transformers models
please run 'verify.py' evaluate the attack success rate
python verify.py --adv_dir "./outputs" -
Defense methods
