/DBIA

This is the source code for DBIA. Our paper is accepted by IEEE ICME2023.

Primary LanguagePythonMIT LicenseMIT

The code for DBIA on DeiT

Environment

  • PyTorch 1.7.0+ and torchvision 0.8.1+ and pytorch-image-models 0.3.2

Data Preparation

  • Imagenet2012 validation set data is placed in ./data/imagenet2012/val

data preparation

Starting Poisoning

  • Generate the background picture required for training trigger
      python preprocess.py
  • Background picture and blend_ tensor.pt is stored in ./savedfigure

Reversing Trigger

  • First, write the path of blend_tensor.pt on line 38 of the file activate_trigger.py
      python activate_trigger.py
  • Trigger pictures are stored in the triggers folder

Training Poisoning Model

  • First, write the path of the selected trigger on line 35 of the file tensors_dataset.py
      python backdoor_main.py

Citation

  • If it helps you, you can cite our paper as below:
      @article{lv2021dbia,
      title={Dbia: Data-free backdoor injection attack against transformer networks},
      author={Lv, Peizhuo and Ma, Hualong and Zhou, Jiachen and Liang, Ruigang and Chen, Kai and Zhang, Shengzhi and Yang, Yunfei},
      journal={arXiv preprint arXiv:2111.11870},
      year={2021}
    }