Code Monkey home page Code Monkey logo

adversarial-reprogramming-tensorflow's Introduction

Adversarial Reprogramming of Neural Networks

TensorFlow implementation of Adversarial Reprogramming of Neural Networks https://arxiv.org/abs/1806.11146

Setup

Prerequisites

Getting Started

  • Clone this repo:
git clone [email protected]:lizhuorong/Adversarial-Reprogramming-tensorflow.git
cd Adversarial-Reprogramming-tensorflow

Download the imagenet models

Download the following pre-trained models and put them into './model':

Datasets

  • MNIST dataset will be automatically downloaded after running the scripts.
  • CIFAR-10. Training on CIFAR-10 have not been implemented yet. However, it is easy to adapt to more datasets and imagenet models.

Train

Simply run the following command:

 python main.py 

You can train adversarial images for other ImageNet classifiers as well.
For example, if you want to adversarially reprogram Inception-ResNet-v2, first you need to insert from nets import inception_resnet_v2 in model.py.
Then run:

 python main.py --network_name inception_resnet_v2
  • More available networks can be found in the subfolder ./nets, which is derived from slim.
  • Checkpoint files will be saved in ./train and you are able to continue training your model from the previous epoch.
  • Sampled images can be found in ./sample. Following are the examples that repurposing the ImageNet classifiers to MNIST classficaion. ( top: Inception_V3 ; bottom : Resnet_v2_50)

Test

Test will be performed immediately after training finished.

Results

The performance of adversarially reprogramming the trained ImageNet classifiers to perform MNIST classification. Table gives test accuracy of reprogrammed networks on an MNIST classification task.

ImageNet Model MNIST
Resnet_v2_50 0.9586
Inception_v3 0.9745

Acknowledgments

Code referred to a Pytorch implementation.

adversarial-reprogramming-tensorflow's People

Contributors

lizhuorong avatar

Watchers

 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.