mcdickenson / adversarial-nets

Code for blog post exploring adversarial perturbations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

adversarial-nets

Code for a blog post exploring adversarial perturbations

Based on Universal adversarial perturbations (code).

Setup

First, set up your environment with your Google Cloud credentials according to the instructions here.

Then, install the required packages using Anaconda:

$ conda env create -f environment.yml
$ source activate adversarial
# No conda-installable version of this package currently available
$ pip install --upgrade google-cloud

Scripts

  • preprocess_images.py: Crop and scale images from Arxiv tarball to the required size
  • perturb.py: Create perturbed versions of each image
  • label.py: Label images via Google Cloud Vision API
  • analysis.py: Evaluate labels

Usage

$ python py/perturb.py
$ python py/label.py
$ python py/analysis.py

About

Code for blog post exploring adversarial perturbations

License:MIT License


Languages

Language:Python 100.0%