Skip to content

chenxi52/self-supervised-attack

Repository files navigation

Self-supervised Contrastive Learning Based Universarial Black-box Attack

intro:

CPC from

Implementation of Representation Learning with Contrastive Predictive Coding Paper (https://arxiv.org/abs/1807.03748).

linkCPC github

Preparing

  • Download ILSVRC2012_img_val and save it in .\data dir

  • The choosen validation set is written in selected_data.csv

|-data
  |-ILSVRC2012_img_val
  |  |-n01484850
  |  |-...
  |  └─...
  └─selected_data.csv   

Usage

  • Run train.py file to train the CPC encoder and save weight.

  • Run CpcAttack.py to generate adv examples and evaluate them.

    e.g. run the attack 14 iterations using momentum 1.1 on gpu3 and evaluate on model vgg19_bn

  python CpcAttack.py --model vgg19_bn --iters 14 --gpu 3 --momentum 1.1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages