Home

Awesome

Sleeper Agent: Scalable Hidden Trigger Backdoors for Neural Networks Trained from Scratch

This code is the official PyTroch implementation of the Sleeper Agent. Our implementation is based on Industrial Scale Data Poisoning via Gradient Matching.

Overview

Dependencies

USAGE

The wrapper for the Sleeper Agent can be found in sleeper_agent.py. To craft poisons on CIFAR-10 and ResNet18 with the default values, you can use the following command:

python sleeper_agent.py

There are a bunch of optional arguments in the forest/options.py. Here are some of them:

ImageNet

To craft poisons on ImageNet and ResNet18 you can use the following sample command:

python sleeper_agent.py --patch_size 30 --budget 0.0005 --pbatch 128 --epochs 80 --sources 50 --dataset ImageNet --pretrained_model --data_path /your/path/to/ImageNet --source_gradient_batch 300

Citations

Please cite the Sleeper Agent paper:

@article{souri2021sleeper,
  title={Sleeper Agent: Scalable Hidden Trigger Backdoors for Neural Networks Trained from Scratch},
  author={Souri, Hossein and Goldblum, Micah and Fowl, Liam and Chellappa, Rama and Goldstein, Tom},
  journal={arXiv preprint arXiv:2106.08970},
  year={2021}
}