Our codebase accesses the datasets from ./data/ and checkpoints from ./results/checkpoints/ by default.
├── ...
├── data
│
├── checkpoints
│
├── results
│
├── main.py
├── ...
We use official CIFAR10 and ImageNet100 datasets for training.
All of the adversarial data are generated using torchattacks.
The training and testing datasets are available here.
Download these datasets and unzip them in the /data folder.
Generate noise by gen_noise.py and extract distribution by gen_dist.py. You can directly download the distribution from Baidu Disk or Google Disk. Put distributions under 'data/dist/'.
We offer checkpoints for testing. Download these checkpoints in the /checkpoints folder.
| Dataset | Attack | Checkpoints |
|---|---|---|
| CIFAR-10 | Linf | ckpt |
| ImageNet100 | Linf | ckpt |
python main.py
--config configs/datasets/general/DIS_CIFAR10.yml
configs/pipelines/train/DIS_train_CIFAR10.yml
--force_merge True
--preprocessor.name base
python main.py
--config configs/datasets/general/DIS_ImageNet100.yml
configs/pipelines/train/DIS_train_ImageNet100.yml
--force_merge True
--preprocessor.name ImageNet
python main.py
--config configs/datasets/DIS_CIFAR10.yml
configs/pipelines/test/DIS_test_CIFAR10.yml
--force_merge True
--preprocessor.name base
python main.py
--config configs/datasets/DIS_ImageNet100.yml
configs/pipelines/test/DIS_test_ImageNet100.yml
--force_merge True
--preprocessor.name ImageNet
## Dependencies
python 3.8.8, PyTorch = 1.10.0, cudatoolkit = 11.7, torchvision, tqdm, scikit-learn, mmcv, numpy, opencv-python, dlib, Pillow
@article{wang2023detecting,
title={Detecting adversarial faces using only real face self-perturbations},
author={Wang, Qian and Xian, Yongqin and Ling, Hefei and Zhang, Jinyuan and Lin, Xiaorui and Li, Ping and Chen, Jiazhong and Yu, Ning},
journal={arXiv preprint arXiv:2304.11359},
year={2023}
}