Optimal Strategies Against Generative Attacks
This repository contains the official code for the paper:
Optimal Strategies Against Generative Attacks
Roy Mor, Erez Peterfreund, Matan Gavish, Amir Globerson
This work was published as an oral presentation in the International Conference of Learning Representations (ICLR), 2020.
See requirements.txt for the required packages to using this repo.
In this section, we describe how to use the theoretic game value functions and plot several game value plots as seen in the paper and presentation.
$ python theory/theoretic_game_value.py -m 1 -n 5 -k 10 -d 10
$ python plots/plot_game_value_of_n_over_m_for_diff_d.py
$ python plots/plot_game_value_of_n_over_m_for different_rho_values.py
$ python plots/plot_game_value_of_rho_delta.py --d 100 --plot_type nash_game_value
$ python plots/plot_game_value_of_rho_delta.py --d 100 --plot_type ml_attacker_game_value
$ python plots/plot_game_value_of_rho_delta.py --d 100 --plot_type game_value_diff_ml_vs_opt
To see the rest of the optional arguments you can run:
$ python train_gim_on_gaussians.py -o <output directory path>
The program will create the following directories:
$ python train_gim_on_gaussians.py --help
\
\
\
\
You can monitor the training progress with tensorboard by running:
$ tensorboard --logdir <output directory path>/tb/
To train GIM on images you first need to create an image dataset in the following directory structure:
\
Where:
\
\
\
hierarchy originated from the structure of the Omniglot and Voxceleb2 dataset.
\
You can create both train (‘dev’ in the raw Voxceleb2 dataset) and val (‘test’ in the raw Voxceleb2 dataset) Voxceleb2 datasets using:
$ python data_handling/prepare_voxceleb_dataset.py --src_vid_ds_root <path to the raw voxceleb2 video directory at .../test/mp4/ or /dev/mp4> --dst_img_ds_root <path to the new dataset>
For omniglot, simply divide the dataset to train and val directories (see paper for splits and augmentation).
Once you have a dataset, you can train GIM using the following command line:
$ python python train_gim_on_imgs.py -o <output dir> --dataset_root <root dir of dataset> --dataset_type <omniglot or voxceleb2>
To see the rest of the optional arguments and the hyper-parametrs we used in the paper for training GIM on omniglot and voxceleb2 you can run:
$ python train_gim_on_imgs.py --help
The program will create the following directories:
\
\
\
\
You can monitor the training progress with tensorboard by running:
$ tensorboard --logdir <output dir>/tb/
To evaluate GIM on the authentication task run:
$ python authentication_eval/eval_gim_on_authentication.py --ds_root <dataset root> --gim_exp_dir <GIM experiment output directory>
This will create a .csv file with the authentication results of GIM vs. GIM, GIM vs. Replay, and GIM vs. RS, as seen in the paper.
To see the rest of the optional arguments you can run:
$ python authentication_eval/eval_gim_on_authentication.py --help
@inproceedings{
Mor2020Optimal,
title={Optimal Strategies Against Generative Attacks},
author={Roy Mor and Erez Peterfreund and Matan Gavish and Amir Globerson},
booktitle={International Conference on Learning Representations},
year={2020},
url={https://openreview.net/forum?id=BkgzMCVtPB}
}