-
Prepare your poison dataset
- Assure unpreprocessed data in config.yaml is correct
- In config.yaml, change poison.p_class and poison.p_inclass
- In config.yaml, change poison_train_path and poison_test_path
- Run
python data_preprocess_my_poison.py
-
Poison the model
- Specify the benign pre-trained model path. In here, we use the pre-trained model that well performed in TIMIT dataset. At following path
./checkpoints/TIMIT_baseline/final_epoch_950_batch_id_283.model
. Set it to config.yaml: model-->model_path - config.yaml: train-->restore as True
- config.yaml: data-->train_path as the poison dataset. For example,
./train_set/train_PT_15_95
- config.yaml: train-->log_file and checkpoint_dir
- config.yaml: model_name --> [model]
- Run
python train_embedder.py
- Specify the benign pre-trained model path. In here, we use the pre-trained model that well performed in TIMIT dataset. At following path
-
Evaluate the model (benign purpose)
- config.yaml: training --> False
- config.yaml: model_name --> [model]
- config.yaml: data: test_path: './test_T_enroll'
- config.yaml: model: model_path: './checkpoints/T_PT_15_95/ckpt_epoch_500_batch_id_283.pth'
- Run
python train_embedder.py
-
Evaluate the ASR (attack purpose)
- config.yaml: data: test_path: './test_T_enroll'
- config.yaml: model_name --> [model]
- config.yaml: model: model_path: './checkpoints/T_PT_15_95/ckpt_epoch_500_batch_id_283.pth'
- config.yaml: poison: poison_test_path: "./test_set/test_PT_15_95"
- Run
python trigger_attack_all.py
-
Evaluate the ASR (on poisoned train speakers)
- config.yaml: data: test_path: './train_T'
- config.yaml: model: model_path: './checkpoints/T_PT_15_95/ckpt_epoch_500_batch_id_283.pth'
- config.yaml: poison: poison_test_path: "./test_set/test_PT_15_95"
- config.yaml: test: TR: True
- config.yaml: test: PS: Poison speaker id report path
- Run
python trigger_attack_all.py