Code Monkey home page Code Monkey logo

svre's Introduction

Stochastic Variance Reduced Ensemble (SVRE)

This repository contains code to reproduce results from the paper: Stochastic Variance Reduced Ensemble Adversarial Attack for Boosting the Adversarial Transferability(CVPR2022). We provide an example of the SVRE method, and the complete experimental code and data will be released soon.

Datasets And models

To run the code, you should download pre-trained models and the data.

Please place pre-trained models under the models/ directory.

Please unzip the data and place the data under the dataset/ directory.

Requirements

  • Python >= 3.6.5

  • Tensorflow-gpu >= 1.14.0

  • Numpy >= 1.15.4

  • opencv >= 3.4.2

  • scipy >= 1.1.0

  • pandas >= 1.0.1

  • imageio >= 2.6.1

File Description

  • SVRE-I-FGSM.py,Ens-I-FGSM.py,SVRE-MI-FGSM.py,Ens-MI-FGSM.py : Generate adversarial examples.

  • eval.py: Eval the efficacy of attack methods.

  • ./models: Pre-trained models.

  • ./nets: Code for model architecture.

  • ./dataset: The images used in the experiment and their label information.

Experiments

We provide an example of generating the adversarial examples on the ensemble of four normally trained models, ie. Inc-v3, Inc-v4, Res-15 and IncRes-v2, and test the transferability of the crafted adversaries on defense models.

To generate adversarial exmples of SVRE-I-FGSM and Ens-I-FGSM:

CUDA_VISIBLE_DEVICES=[gpu id] python SVRE-I-FGSM.py
CUDA_VISIBLE_DEVICES=[gpu id] python Ens-I-FGSM.py

To eval the efficacy of SVRE-I-FGSM and Ens-I-FGSM:

CUDA_VISIBLE_DEVICES=[gpu id] python eval.py  --eval_file ./results/SVRE-I-FGSM/
CUDA_VISIBLE_DEVICES=[gpu id] python eval.py  --eval_file ./results/Ens-I-FGSM/

Acknowledgements

In order to ensure that our personal information is not leaked, we obtain the download link of the model from open source repositories, eg. SI-NI-FGSM. We thank the authors for sharing.

svre's People

Contributors

xyf-lsy avatar jhl-hust 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.