SCLBD / BackdoorBench

Other
415 stars 70 forks source link

Attack my own datasets made with videos. #20

Closed knight4u13 closed 1 year ago

knight4u13 commented 1 year ago

I want to attack my own datasets filled with videos using badnets or others, so can you tell me how to run the codes or modify the corresponding codes?

CHR-ray commented 1 year ago

I am not quite familiar with video tasks. But I think you should at least modify the following parts:

  1. For dataset, utils/aggregate_block/dataset_and_transform_generate.py, especially dataset_and_transform_generate function.
  2. For data poison, utils/aggregate_block/bd_attack_generate.py. (All direct data poisoning process on images should be modified due to different data format, and also, some of data modification requires official torch function or class in image transforms, so you may need to find some alternative)
  3. For core dataset class, utils/bd_dataset_v2.py (this is the core function to realize the data poisoning process, please make sure you understand them all and modify all parts related to image file format)

For saving, loading, and training part, I am not quite sure. But I think they are more flexible and may not need los of modification.

Notice that, all above applies to both data poisoning and training controllable attacks. BUT, for training controllable attacks, they share less with other attack methods, so you may need to modify more codes due to their different training settings.