GitHub

Code for our ICML'19 paper: Interpreting Adversarially Trained Convolutional Neural Networks, by Tianyuan Zhang, Zhanxing Zhu.

How to run

If you want to run code on your own, I only provide codes on Caltech-256. We do not upload the dataset and trainned networks due to the fact that they are storage consuming. Training(Adversarial Training) scripts in this repo is not well writen, I suugest you to use your own scripts, or scripts provided in this repo

Caltech-256

The four most important python files for Caltech-256

They are all in /code/baseline/ :

main.py, attack.py, utils.py dataset.py

  1. main.py trains CNNs. It contains sufficient comments to understand how to customize your trainings.
  2. attack.py implements PGD and FGSM attackers.
  3. utils.py implements SmoothGrad
  4. dataset.py implements Saturation and Patch-shuffle operation. For style transfer, you have to use code provided in https://github.com/rgeirhos/Stylized-ImageNet/tree/master/code
  5. stAdv.py in code/spatial-transform.adv.train/ implements Spatially transformed attack.

How to run

  1. Dowload the data from http://www.vision.caltech.edu/Image_Datasets/Caltech101/Caltech101.html to /code/Caltech256/data
  2. cd data and run Partition.py to generate training set and test set.
  3. cd code/baseline and run main.py to train standard CNNs
  4. cd code/pgd.inf.eps8 and run main.py to adversarially train CNNs against a

Read the original on github.com ↗