Giter Site home page Giter Site logo

fgsm's Introduction

Explaining and Harnessing Adversarial Examples(FGSM) - ICLR 2015

This is the implementation in pytorch of FGSM based Explaining and Harnessing Adversarial Examples(2015)

Use Two dataset : MNIST(fc layer*2), CIFAR10(googleNet)

quick start


python fgsm.py

Example


# Run this commend for more information or help
$python fgsm.py -h
usage: fgsm.py [-h] [--batch-size N] [--test-batch-size N] [--epochs N] [--lr LR] [--gamma M] [--no-cuda]
               [--log-interval N] [--epsilon EPSILON] [--dataset-normalize] [--network NETWORK] [--save-model]
               [--dataset DATASET]

PyTorch FGSM

optional arguments:
  -h, --help           show this help message and exit
  --batch-size N       input batch size for training (default: 64)
  --test-batch-size N  input batch size for testing (default: 1000)
  --epochs N           number of epochs to train (default: 5)
  --lr LR              learning rate (default: 0.001)
  --gamma M            Learning rate step gamma (default: 0.7)
  --no-cuda            disables CUDA training
  --log-interval N     how many batches to wait before logging training status
  --epsilon EPSILON    epsilon(perturbation) of adversarial attack
  --dataset-normalize  input whether normalize or not (default: False)
  --network NETWORK    input Network type (Selected: fc, conv, drop, googlenet / default: 'fc')
  --save-model         For Saving the current Model
  --dataset DATASET    choose dataset : mnist or cifar

# MNIST Example
$python fgsm.py

# CIAR-10 Example
$python fgsm.py --dataset cifar


Result

MNIST DataSet

Shallow model(fc layer x 2) - epsilon: 0.25

  • use default argument(hyperparameter)
  1. Test Accuracy : 99%
  2. Adversarial Test Accuracy: 1%
  3. Misclassification : 9696/10000

CIFAR-10 DataSet

GoogleNet - epsilon: 0.25

  • use default argument(epoch 20)
  1. Test Accuracy : 82%
  2. Adversarial Test Accuracy: 10%
  3. Misclassification : 9191/10000
  • epoch 1000
  1. Test Accuracy : 91%
  2. Adverarial Test Accuracy: 12%
  3. Misclassification: 8775/10000

fgsm's People

Contributors

lhyejin avatar

Watchers

 avatar  avatar  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.