We have modified the original BadCLIP code to include SABRE-FL in it.

1. First setup BadClip: https://github.com/jiawangbai/BadCLIP

2. Install necessary requirements and make sure badclip is running fine. You would need to install dassl in the process and download some datasets. Set paths accordingly.

3. Replace badclip.py in BadCLIP/trainers with our version of badclip.py

4. Replace trainer.py in BadCLIP/Dassl.pytorch/dassl/engine/trainer.py with our trainer.py

5. set paths and settings in BadCLIP/scripts/badclip/caltech101_train.sh

6. modify forward_backward() function according to the settings in badclip.py. Around line 457

7. modify client num in trainer.py in the train function at around line 260 and line 578. in the train function (around line 250), you can select aggregation type.

8. use classifier_cross.py to train classifier and store it. You will later need to load it in badclip.py to use as the detector.

9. run bash caltech101_train.sh for various experiments. you can modify settings and variables as per the requirement.