Giter VIP home page Giter VIP logo

adversarial-example's Introduction

adversarial-example

Crafting Adversarial Examples with PyTorch

craft.py - Contains crafting algorithms such as Fast Gradient Sign Method (FGSM) and Jacobian-based Saliency Map Approach (JSMA)

Fast Gradient Sign Method with MNIST Datset

  1. train_mnist.py - Train a model with the original MNIST
  2. `craft_mnist_fgsm.py' - Craft adversarial exmaples by using FGSM

adversarial-example's People

Contributors

ast0414 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

adversarial-example's Issues

what are the expected dimensions of inputs for JSMA?

Hi,
I was trying to generate adversarial examples using Jacobian based saliency map method. I was using your implementation. First of all, I would like to know whether your implementation of JSMA is correct or not. Have you tested it? I just want to make sure that it is flawless.

I am using the pre-trained inceptionv3 model on pytorch and I would like to know what are the expected dimensions of inputs of jsma function. I pass 1X3X299X299 dimensional matrix as an input_tensor. I compute target_class as follows: y_target = torch.LongTensor([9]). Then I call jsma function as follows: jsma(inceptionv3, image_tensor, y_target, max_distortion=0.1). It runs successfully but when I compare output with image_tensor-both are same. This is not an expected output. Can you please guide me here? what went wrong?

Also, note that here input_features.size(1) will return 3 and it will be multiplied by 0.1 to calculate num_features, this will be 0.3. Therefore, only one iteration will be performed.
`

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.