This repository contains the Tensorflow implementation of "Defense against Universal Adversarial Perturbations"(CVPR2018)
- Python 2.7
- Tensorflow 1.4.0
-
Download Inception PRN models from google drive.
-
Edit TESTING script, set
--data_dir
to the direcotry of clean images, set--perturb_dir
to the base pertubation directory, and set--pert_test_dir
to the TESTING perturbation folder.
Directory structure of -data_dir
:
ILSVRC2012_img
├── 1
│ ├── ILSVRC2012_val_00000756.png
│ ├── ILSVRC2012_val_00001260.png
│ ├── ILSVRC2012_val_00006145.png
│ └── ...
├── 2
├── 3
├── ...
└── 1000
Directory structure of --pert_test_dir
:
inception_L2_Pert
├── perturbation_map_1.npy
├── perturbation_map_2.npy
└── ...
- Run TESTING script.
-
Edit TRAINING configuration. Set
--data_dir
to clean images, note thatdata_dir_1
~data_dir_4
are the corner-cropped images used as data augmentation.perturb_dir
andpert_train_dir
have similar reference as in TESTING. -
Run TRAINING script.