This repository contains the official PyTorch implementation of the following paper at ACMMM 2023:
Exploring Inconsistent Knowledge Distillation for Object Detection with Data Augmentation
Jiawei Liang, Siyuan Liang, Aishan Liu, Ke Ma, Jingzhi Li, Xiaochun Cao
https://arxiv.org/abs/2209.09841
- Install python (python == 3.8)
- Install pytorch (pytorch == 2.0.0)
- Install mmcv_full (mmcv_full == 1.6.0)
- Install mmdetection (mmdetection == 2.25.0) from source code
git clone https://github.com/JWLiang007/IKD.git cd IKD/ pip install -r requirements/optional.txt pip install -v -e .
- Download MS COCO2017 dataset
- Unzip COCO dataset into data/coco/ in mmdetection/
- Download pretrained teacher model retinanet_x101_64x4d_fpn_1x_coco_20200130-366f5af1.pth from the repository of mmdetection
- Put the downloaded pretrained model into checkpoints/ in mmdetection/
# single GPU
python tools/ta_GT.py configs/retinanet/retinanet_x101_64x4d_fpn_1x_coco.py checkpoints/retinanet_x101_64x4d_fpn_1x_coco_20200130-366f5af1.pth --method difgsm --show-dir data/adv_rtn_coco_8_5 --gen_adv_aug --eps 8 --alpha 2 --steps 5
# multi GPU
bash tools/dist_adv.sh configs/retinanet/retinanet_x101_64x4d_fpn_1x_coco.py checkpoints/retinanet_x101_64x4d_fpn_1x_coco_20200130-366f5af1.pth 8 --method difgsm --show-dir data/adv_rtn_coco_8_5 --gen_adv_aug --eps 8 --alpha 2 --steps 5
#single GPU
# Step 1: train with DFA
python tools/train.py configs/fgd/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py
# Step 2: resume from epoch 16 and train without DFA
python tools/train.py configs/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py --resume-from work_dirs/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco/epoch_16.pth
#multi GPU
# Step 1: train with DFA
bash tools/dist_train.sh configs/fgd/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py 8
# Step 2: resume from epoch 16 and train without DFA
bash tools/dist_train.sh configs/fgd/fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py 8 --resume-from work_dirs/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco/epoch_16.pth
#single GPU
python tools/test.py configs/fgd/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py $PATH_CHECKPOINT --eval bbox
#multi GPU
bash tools/dist_test.sh configs/fgd/DFA_fgd_retina_rx101_64x4d_distill_retina_r50_fpn_2x_coco.py $PATH_CHECKPOINT 8 --eval bbox
Index | Method | ASR | ASR Drop |
---|---|---|---|
1 | Victim | 96.7 | - |
2 | NAD | 82.88 | 13.82 |
3 | Ours | 78.26 | 18.44(↑33%) |
For more recent progress in backdoor defense, please refers to the following repo:
https://github.com/JWLiang007/BD_DeCLIP.git
and switches to the bd branch.
Our code is based on the project MMDetection.