Skip to content

shuaizhao95/backdoor_attack_and_defense

Repository files navigation

Introduction

This repository contains the data and code for clean label backdoor attack and defense.

Requirements

  • Python == 3.7
  • pip install -r requirements.txt

Poisoned Sample Generation

If you want to run the Sentence Rewriting model for your data, you need to download the weights.

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

Train the Clean Victim Model.

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

Train the Clean Defense Model.

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.

Contact

If you have any issues or questions about this repo, feel free to contact [email protected].

About

clean label backdoor attack and defense

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published