Skip to content

About

EIT ICPR 2024 已接受!

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

A Whale Falls, All Thrive: Mitigating Attention Gap To Improve Adversarial Transferability

requirements

  • 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

Run attacks

  • 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.py to implement our "EIT" attack, you can run this attack as following

    python 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 rate

    python 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

    • JPEG: Refer to here
    • FD: Refer to here
    • Bit-Red: Refer to here
    • NRP: purifier=NRP, dynamic=True, base_model=Inc-v3ens3. Download it from corresponding official repo.

Result

EIT

Acknowledgments

Code refers to TAIG , SSA , STM , PGN

About

EIT ICPR 2024 已接受!

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages