Git Product home page Git Product logo

tsaa's Introduction

Transferable Sparse Adversarial Attack

Pytorch Implementation of our CVPR2022 paper "Transferable Sparse Adversarial Attack".

Table of Contents

  1. Dependencies
  2. Pretrained-Generators
  3. Datasets
  4. Training/Eval

Dependencies

  1. Install pytorch. This repo is tested with pytorch==1.6.0.
  2. Install python packages using following command:
pip install -r requirements.txt

This repo is tested with python==3.8.5.

Pretrained-Generators

Download pretrained adversarial generators from here.

Adversarial generators are trained against following two models.

  • Inceptionv3
  • ResNet50

These models are trained on ImageNet and available in Pytorch.

Datasets

  • Training data:

  • Evaluations data:

    • randomly selected 5k images from ImageNet Validation Set. You can download evaluations data from here.

Training

Run the following command

  python train.py --train_dir [path_to_train] --model_type incv3 --eps 255 --target -1

This will start trainig a generator trained on one dataset (--train_dir) against Inceptionv3 (--model_type) under perturbation budget $\ell_\infty$=255 (--eps) in a non-targeted setting (--target).

Evaluations

Run the following command

  python eval.py --test_dir [path_to_val] --model_type incv3 --model_t res50 --eps 255 --target 971 --checkpoint [path_to_checkpoint]

This will load a generator trained against Inceptionv3 (--model_type) and evaluate clean and adversarial accuracy of ResNet50 (--model_t) under perturbation budget 255 (--eps) in a targeted setting (--target).

Citation

If you find this repo useful, please cite our paper.

@InProceedings{He_2022_CVPR,
    author    = {He, Ziwen and Wang, Wei and Dong, Jing and Tan, Tieniu},
    title     = {Transferable Sparse Adversarial Attack},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2022},
    pages     = {14963-14972}
}

tsaa's People

Contributors

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