This code is for reproducing the results in the paper, Parsimonious Black-Box Adversarial Attacks via Efficient Combinatorial Optimization, accepted at ICML 2019.
@inproceedings{moonICML19,
title= {Parsimonious Black-Box Adversarial Attacks via Efficient Combinatorial Optimization},
author={Moon, Seungyong and An, Gaon and Song, Hyun Oh},
booktitle = {International Conference on Machine Learning (ICML)},
year={2019}
}
- Python 3.5
- TensorFlow 1.4.0 (with GPU support)
- opencv-python
- Pillow
- Download Cifar-10 dataset from and decompress it.
wget https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
tar -xvzf cifar-10-python.tar.gz
- Download an adversarially trained model from MadryLab and decompress it.
wget https://www.dropbox.com/s/g4b6ntrp8zrudbz/adv_trained.zip
unzip adv_trained.zip
- Set
DATA_DIR
andMODEL_DIR
incifar10/main.py
to the locations of the dataset and the model respectively.
- Download ImageNet validation dataset (images and corresponding labels). Note that the validation images must be contained within a folder named
val
and the filename of validation labels must beval.txt
.
- For images
mkdir val
wget http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_val.tar
tar -xf ILSVRC2012_img_val.tar -C val
- For labels
wget http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
tar -xvzf caffe_ilsvrc12.tar.gz val.txt
-
Place the directory
val
and the fileval.txt
in the same directory. -
Download a pretrained Inception-v3 model from Tensorflow model library and decompress it.
wget http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz
tar -xvzf inception_v3_2016_08_28.tar.gz
- Set
IMAGENET_PATH
inimagenet/main.py
andMODEL_DIR
inimagenet/tools/inception_v3_imagenet.py
to the locations of the dataset and the model respectively.
- Cifar-10 untargeted attack
cd cifar10
python main.py --epsilon 8 --max_queries 20000
- ImageNet untargeted attack
cd imagenet
python main.py --epsilon 0.05 --max_queries 10000
- ImageNet targeted attack
cd imagenet
python main.py --targeted --epsilon 0.05 --max_queries 100000
This work was partially supported by Samsung Advanced Institute of Technology and Institute for Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2019-0-01367, BabyMind).
MIT License