GithubHelp home page GithubHelp logo

ami's Introduction

Attacks Meet Interpretability

This repository is for NeurIPS 2018 spotlight paper Attacks Meet Interpretability: Attribute-steered Detection of Adversarial Samples.

Prerequisite

Setup

  • Please download VGG-Face caffe model from here.
  • Unzip the model under data/ folder.

Usage

Attribute Mutation

In attribute_mutation.ipynb, attribute-substituted and attribute-preserved images are produced for the base image. Four attributes are encoded with indices from 0 to 3. See the following table for details. Please use attributes[index] for corresponding attributes.

Attribute Index
left eye 0
right eye 1
nose 2
mouth 3

Two actions are also encoded with indices, which is listed in the following table. Please use actions[index] for corresponding actions.

Action Index
substitution 0
preservation 1

Generated images are saved in folder data/attribute_mutated/[attribute]_[action]/.

Attribute Witness Extraction

Attribute witnesses are extracted layer by layer based on attribute-substituted and attribute-preserved images. Please find the implementation in witness_extraction.ipynb. Extracted witnesses are saved in folder data/witnesses/.

Attribute-steered Model

With extracted attribute witnesses, neuron weakening and strengthening are applied for each input during execution. Adversary detection is achieved by observing the final prediction from attribute-steered model comparing to the original model. Detailed implementation is in adversary_detection.ipynb.

7 adversarial attacks are included in folder data/attacks. Please change attack_path in the code to test on different attacks.

Citation

Please cite for any purpose of usage.

@inproceedings{NeurIPS2018_7998,
    title={Attacks Meet Interpretability: Attribute-steered Detection of Adversarial Samples},
    author={Tao, Guanhong and Ma, Shiqing and Liu, Yingqi and Zhang, Xiangyu},
    booktitle={Advances in Neural Information Processing Systems 31},
    pages = {7728--7739},
    year={2018}
}

ami's People

Contributors

amiattribute avatar

Watchers

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