Giter Club home page Giter Club logo

robust-features-code's Introduction

ResNet ImageNet Code

This repository provides code for both training and using the restricted robust resnet models from the paper:

There Is No Free Lunch In Adversarial Robustness (But There Are Unexpected Benefits)
Dimitris Tsipras*, Shibani Santurkar*, Logan Engstrom*, Alexander Turner, Aleksander Madry
https://arxiv.org/abs/1805.12152

We show that adversarial robustness often inevitablely results in accuracy loss. The silver lining: adversarial training induces more semantically meaningful gradients and gives adversarial examples with GAN-like trajectories:

General overview

Before trying to run anything:

  • Run ./setup.sh.
  • Get a downloaded version of the ImageNet training set. By default the code looks for this directory in the environmental variable INET_DIR. For example, run export INET_DIR=/scratch/datasets/imagenet/.

The code is organized so that you can:

  • Train your own robust restricted ImageNet models (via ez_train.sh)
  • Produce adversarial examples and visualize gradients, with example code in example_use.ipynb
  • Reproduce the ImageNet examples seen in the paper (via make_viz.sh).

Pretrained models

This repository comes with (after following the instructions) three restricted ImageNet pretrained models:

  • data/train_224_nat_slim corresponds to a naturally trained model
  • data/train_224_robust_eps_0.005_lp_inf_slim corresponds to an linf adv trained model with eps 0.005
  • data/train_224_robust_eps_1.0_lp_2_slim corresponds to an l2 adv trained model with eps 1.0

You will need to set the model ckpt directory in the various scripts/ipynb files where appropriate if you want to complete any nontrivial tasks.

robust-features-code's People

Contributors

lengstrom avatar ludwigschubert avatar

Watchers

 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.