Giter Club home page Giter Club logo

translation-invariant-attacks's Introduction

Translation-Invariant Attacks

Introduction

This repository contains the code for Evading Defenses to Transferable Adversarial Examples by Translation-Invariant Attacks (CVPR 2019 Oral).

Method

We proposed a translation-invariant (TI) attack method to generate more transferable adversarial examples. This method is implemented by convolving the gradient with a pre-defined kernel in each attack iteration, and can be integrated into any gradient-based attack method.

Run the code

First download the models. You can also use other models by changing the model definition part in the code. Then run the following command

bash run_attack.sh input_dir output_dir 16

where original images are stored in input_dir with .png format, and the generated adversarial images are saved in output_dir. We used the Python 2.7 and Tensorflow 1.12 versions.

Results

We consider eight STOA defense models on ImageNet:

We attacked these models by the fast gradient sign method (FGSM), momentum iterative fast gradient sign method (MI-FGSM), diverse input method (DIM), and their translation-invariant versions as TI-FGSM, TI-MI-FGSM, and TI-DIM. We generated adversarial examples for the ensemble of Inception V3, Inception V4, Inception ResNet V2, and ResNet V2 152 with epsilon 16. The success rates against the eight defenses are:

Citation

If you use our method for attacks in your research, please consider citing

@inproceedings{dong2019evading,
  title={Evading Defenses to Transferable Adversarial Examples by Translation-Invariant Attacks},
  author={Dong, Yinpeng and Pang, Tianyu and Su, Hang and Zhu, Jun},
  booktitle={Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition},
  year={2019}
}

Implementation

Models

The models can be downloaded at Inception V3, Inception V4, Inception ResNet V2, and ResNet V2 152.

If you want to attack other models, you can replace the model definition part to your own models.

Hyper-parameters

  • For TI-FGSM, set num_iter=1, momentum=0.0, prob=0.0;
  • For TI-MI-FGSM, set num_iter=10, momentum=1.0, prob=0.0;
  • For TI-DIM, set num_iter=10, momentum=1.0, prob=0.7;

translation-invariant-attacks's People

Contributors

dongyp13 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.