Code for the paper "Sniper Backdoor: Single Client Targeted Backdoor Attack in Federated Learning". SaTML'23.
python main.py --lr 0.001 --dataname cifar100 --n_clients 10 --iid --dir <path> --n_epochs 23 --pretrained
python main.py --lr 0.001 --dataname cifar100 --n_clients 10 --iid --dir <path> --n_epochs 23 --pretrained
pyhon synthetic_data.py --dataname cifar100 --dir <path> --n_clients 10 --iid
pyhon synthetic_data.py --dataname cifar100 --dir <path> --n_clients 10
python shadow_network.py --dataname cifar100 --n_epochs 23 --pretrained --dir <path> --fake_dir <results path> --iid
python shadow_network.py --dataname cifar100 --n_epochs 23 --pretrained --dir <path> --fake_dir <results path>
python client_identification.py --epochs 100 --n_clients 10 --dir <path> --dir_shadow <shadow network path> --dataname cifar100
If we want to inject a dynamic backdoor we should use trojanzoo or other third party code. For static backdoors use:
python backdoor.py --dataname mnist --n_clients 5 --client_id <id> --source_label 1 --target_label 7