This repository containts the Pytorch implementation for Defense-GAN: Protecting Classifiers Against Adversarial Attacks Using Generative Models, by Samangouei, P., Kabkab, M., & Chellappa, R., at ICLR 2018.
We use CIFAR10 dataset to test models. Also, we use Foolbox to generate three different type of adversarial examples.
Adversarial Attacks
- Fast Gradient Sign Method(FGSM) : Explaining and Harnessing Adversarial Examples
- DeepFool(DF) : DeepFool: A Simple and Accurate Method to Fool Deep Neural Networks
- Saliency Map Attacks(SM) : The Limitations of Deep Learning in Adversarial Settings
cifar10_train.ipynb
: train CNN model to classify CIFAR10 dataset
cifar10_test.ipynb
: test trained CNN model into clean images and adversarial examples
generate_adversarial_examples.ipynb
: generate adversarial examples - FGSM, DF, and SM
train_wgan_cifar10.py
: train WGAN model
cifar10_Defense-GAN.ipynb
: test defense-GAN algorithm against adversarial examples
Examples
python train_wgan_cifar10.py
python defense.py --data_path data/ --iterations 20000 --deviceD 0 --deviceG 1
You can see more detailed arguments.
python train_wgan_cifar10.py -h