This repository contains the data and code for clean label backdoor attack and defense.
- Python == 3.7
pip install -r requirements.txt
If you want to run the Sentence Rewriting model for your data, you need to download the weights.
- Download Sentence Rewriting model, and put it into the
T5
directory.
python run_gen_test.py --do_test
Alternatively, you can train your own model.
python run_gen.py --do_train --do_eval --do_eval_bleu
cd to clean_label_backdoor_attack and download BERT weights :
python attack/sst_clean.py
python attack/sst_door.py
python attack/sst_attack.py
cd to clean_label_backdoor_attack_defense and generate the isolated sample index:
python attack/sst_t_sne.py
The remaining steps are consistent with the Attack model.
If you have any issues or questions about this repo, feel free to contact [email protected].