Code Monkey home page Code Monkey logo

gdpa's Introduction

Generative Dynamic Patch Attack

This reposityory contains the PyTorch implementation of our paper "Generative Dynamic Patch Attack".

Requirements

PyTorch >= 1.6.0

TensorBoard >= 2.2.1

tqdm

Quick Start

Download the data and CE trained model of VGGFace from:

https://github.com/tongwu2020/phattacks/releases/tag/Data%26Model

Download the data of ImageNet from:

http://www.image-net.org/


  1. Dynamic patch attack with GDPA:
python gdpa.py --dataset [imagenet|vggface] --data_path [FOLDER_NAME] 

If on VGGFace, please add --vgg_model_path [MODEL_PATH]

optional arguments:
  --patch_size            size of adversarial patch
  --alpha                 $\alpha$ in paper
  --beta                  $\beta$ in paper
  --exp                   exp name in logging
  --epochs                epochs for training
  --lr_gen                learning rate
  --batch_size            batch size
  --device                cuda or cpu
  1. Adversarial training with GDPA-AT:
python gdpa_at.py --data_path [FOLDER_NAME] --vgg_model_path [MODEL_PATH] 

optional arguments:
  --patch_size            size of adversarial patch
  --beta                  $\beta$ in paper
  --lr_gen                learning rate for generator
  --lr_clf                learning rate for classifier
  --save_freq             frequency of saving the model
  --epochs                epochs for training
  --batch_size            batch size
  --device                cuda or cpu
  --enable_testing        testing during training
  1. Visulize ASRs and adversarial images with tensorboard:
tensorboard --logdir logs/exp/gdpa/
tensorboard --logdir logs/exp/gdpa_at/

Citation

If you find this repository useful, please cite our paper:

@article{xiang2021gdpa,
    title={Generative Dynamic Patch Attack},
    author={Xiang Li and Shihao Ji},
    journal={British Machine Vision Conference (BMVC)},
    year={2021}
}

gdpa's People

Contributors

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