This repository contains the tensorflow implementation of our paper: On Generation of Adversarial Examples using Convex Programming.
Citation:
@INPROCEEDINGS{balda2018adversarialconvex,
title={On Generation of Adversarial Examples using Convex Programming},
author={Emilio Rafael Balda and Arash Behboodi and Rudolf Mathar},
booktitle={52th Asilomar Conference on Signals, Systems, and Computers},
year={2018},
month={Oct},
organization={IEEE}
}
- Python 3
- TensorFlow >= 1.4
For benchmarking we use the following pre-trained models and datasets:
- MNIST dataset: A fully connected network with two hidden layers of size 150 and 100 respectively (test error = 1.7%), as well as the LeNet-5 architecture (test error = 0.9%).
- CIFAR-10 dataset: The Network In Network (NIN) architecture (test error = 13.8%), and a 40 layer DenseNet (test error = 5.2%).
There are 3 main scripts: main.py
, view_grahp.py
, and get_example_images.py
.
To create the visualization files (needed by tensorboard) for a pre-trained model, stored by default in ./pretrainedmodels/, use view_grahp.py
. For example:
python view_grahp.py --model2load=lenet
To compute the fooling ratio using the pretrained models use main.py
. For example:
python main.py --model2load=fcnn --n-images=1024 --max-epsilon=0.1
python main.py --model2load=lenet --n-images=1024 --max-epsilon=0.2
python main.py --model2load=nin --n-images=1024 --max-epsilon=0.03
python main.py --model2load=densenet --n-images=1024 --max-epsilon=0.01
These figures are stored in ./figures/ by default, the values that appear in these figrues are stored by default in ./results/ as csv files. To customize the loading/storing directories teake a look at
python main.py --help
For this use the --rho-mode
option of main.py
. For example:
python main.py --rho-mode --model2load=fcnn --n-images=2048
python main.py --rho-mode --model2load=lenet --n-images=2048
python main.py --rho-mode --model2load=nin --n-images=2048
or
python main.py --rho-mode --model2load=densenet --n-images=2048
The obtained values of the robustness metrics are stored in ./results/ by default.
To add example images into ./examples/ you may use get_example_images.py
. See
python get_example_images.py --help
for more information.
Please drop me an e-mail if you have any questions!