Giter Club home page Giter Club logo

adversarialdeformation's Introduction

ADef

This repository contains an implementation of the ADef algorithm for creating adversarial deformations for image classifiers. Given an image and a classifier, it computes a minimal vector field such that when used to deform the original image, the resulting deformed image is misclassified by the classifier. The algorithm is described in the paper

ADef: an Iterative Algorithm to Construct Adversarial Deformations,
by Rima Alaifari, Giovanni S. Alberti, and Tandri Gauksson (preprint: https://arxiv.org/abs/1804.07729).

Here is an example image of a zero being deformed into what the classifier believes to be an eight. The vector field corresponding to the deformation is shown on the original image.
alt text

Run

Requirements: Implemented in PyTorch 0.4.0, using Python 3.6 with numpy, scipy and matplotlib.

Run python demo_imagenet.py to get an example of ADef acting on a pre-trained Inception v3 (or ResNet 101) model. If not already present, this will download the model's parameters (Inception v3: 104 MB, and ResNet 101: 170 MB).

Run python train_mnist.py to quickly train a CNN for MNIST classification (change n_epochs for precision), and then execute python demo_mnist.py to get an example of ADef acting on that model. This will result in downloading the MNIST database into resources/ (55 MB).

adversarialdeformation's People

Contributors

mashmallowwor avatar

Stargazers

Andi Zhang avatar Shuhai Zhang avatar  avatar Shenghsin Tai avatar

Watchers

James Cloos avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.