GithubHelp home page GithubHelp logo

yangzhoufly / mister_ed Goto Github PK

View Code? Open in Web Editor NEW

This project forked from revbucket/mister_ed

0.0 1.0 0.0 5.66 MB

Pytorch Adversarial Attack Framework

Python 92.25% Jupyter Notebook 7.56% Shell 0.03% Lua 0.16%

mister_ed's Introduction

mister_ed

This repository is intended to be a well-groomed pytorch mirror of cleverhans. There's a rich literature on exploiting vulnerabilities in the robustness of neural nets, though the following resources make for a good introduction to the subject:

The remainder of this README will focus on how to set up mister_ed to build your own adversarial examples/defenses and offer a brief tour of the contents of the repository. The hope is that by leveraging mister_ed, you'll be able to sidestep much of the machinery used in adversarial examples and get straight to building new attacks and defenses.

Setting up mister_ed

Dependencies

This library uses Pytorch >=0.4 on python 2,3 to perform differentiation and other common computation required by machine learning models. Follow the link above to perform installation. It is also recommended that you leverage GPU's to speed up computation, though generating adversarial attacks (particularly on MNIST/CIFAR10) are typically less expensive than classical neural net training.

Installation

The best way to set up mister_ed right now is to clone this git repository.

git clone https://github.com/revbucket/mister_ed

and if you manage python packages with pip, the requirements can be installed via pip install -r requirements.txt

Feel free to fork and play with the code.

Config + CIFAR10 setup

To get started immediately, you'll need to ensure that you have access to a pretrained network, and a dataset. We'll use CIFAR10 as an example dataset. Configuration parameters are stored in mister_ed/config.json. The important parameters to set up right now are dataset_path and model_path.

  • dataset_path: if you already have datasets on your machine, simply set this to the directory where they live. Datasets can be downloaded using standard pytorch.torchvision methods.
  • model_path: if you already have pretrained pytorch models on your machine, simply set this to the directory where they live. Pretrained models are saved as files ending in .th, using the standard torch.save(model.state_dict(), ...) method.

To get you going as quickly as possible, run the

python scripts/setup_cifar.py script to do the following:

  1. Ensure all dependencies are installed correctly
  2. Ensure that CIFAR data can be accessed locally
  3. Ensure that a functional classifier for CIFAR has been loaded. By default, pretrained CIFAR10 resnets from Yerlan Idelbayev are used.

Then there are tutorials_{1,2,3}.ipynb located in notebooks/ that contain an overview of this repository's contents and how to get started!

mister_ed's People

Contributors

revbucket avatar tianweiy avatar surbhi18 avatar sysml-quantify-perception avatar

Watchers

James Cloos 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.