attack.LowFrequency
- class LowFrequency[source]
Bases:
BadNet
Rethinking the backdoor attacks’ triggers: A frequency perspective
link : https://github.com/YiZeng623/frequency-backdoor
basic structure:
config args, save_path, fix random seed
set the clean train data and clean test data
set the attack img transform and label transform
set the backdoor attack data and backdoor test data
set the device, model, criterion, optimizer, training schedule.
attack or use the model to do finetune with 5% clean data
save the attack result for defense
attack = LowFrequency() attack.attack()
Note
@inproceedings{zeng2021rethinking_lf, title={Rethinking the backdoor attacks’ triggers: A frequency perspective}, author={Zeng, Yi and Park, Won and Mao, Z Morley and Jia, Ruoxi}, booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision}, year={2021}}
- Parameters:
attack (string) – name of attack, use to match the transform and set the saving prefix of path.
attack_target (Int) – target class No. in all2one attack
attack_label_trans (str) – which type of label modification in backdoor attack
pratio (float) – the poison rate
bd_yaml_path (string) – path for yaml file provide additional default attributes
lowFrequencyPatternPath (string) – path for low frequency pattern
resource_folder_path (string) – where the resource folder is
**kwargs (optional) – Additional attributes.