MCPcopy Index your code
hub / github.com/Alan-Qin/Transfer_attack_RAP

github.com/Alan-Qin/Transfer_attack_RAP @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
9 symbols 26 edges 1 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Boosting the Transferability of Adversarial Attacks with Reverse Adversarial Perturbation (NeurIPS 2022)

PyTorch implementation for the state-of-art transfer attack: Reverse Adversarial Perturbation (RAP).

Boosting the Transferability of Adversarial Attacks with Reverse Adversarial Perturbation

Zeyu Qin, Yanbo Fan, Yi Liu, Li Shen, Yong Zhang, Jue Wang, Baoyuan Wu

In NeurIPS 2022.


Codes:

  • rap_attack.py: full version

The examples:

  • targeted attack with DI and logit loss from ResNet-50

    ```

    python /targeted_attack/rap_attack.py --num_data_augmentation 1 --targeted --transpoint 400 --seed 9018 --source_model resnet_50 --loss_function MaxLogit --DI --max_iterations 300 ```

  • RAP targeted attack with DI and logit loss from ResNet-50

    python /targeted_attack/rap_attack.py --num_data_augmentation 1 --targeted --transpoint 0 --seed 9018 --source_model resnet_50 --loss_function MaxLogit --DI --max_iterations 300

  • RAP-LS targeted attack with DI and logit loss from ResNet-50

    python /targeted_attack/rap_attack.py --num_data_augmentation 1 --targeted --transpoint 100 --seed 9018 --source_model resnet_50 --loss_function MaxLogit --DI --max_iterations 300

The parameters of config:

- targeted attack or not : --targeted or None
- source model: -- source_model (resnet_50, densenet, inception, vgg16)
- random seed: --seed 1234
- interation number of outer minimization: --max_iterations 
- MI or not: --MI or None
- DI or not: --DI or None
- TI or not: --TI or None
- SI or not: (--SI and --m2 5) or None 
- Admix or not: 
  (--m1 3 an --m2 5) or None
  --strength 0.2
- transpoint:
  --transpoint 400: baseline method
  --transpoint 0: baseline+RAP
  --transpoint 100: baseline+RAP-LS
- loss function: --loss_function: CE or MaxLogit for outer minimization
- epsilon of attacks: --adv_epsilon: 16/255, the perturbation budget for - inner maximization
  --adv_steps: 8, the step for inner maximization

This code is based on source code from NeurIPS 2021 paper , "On Success and Simplicity: A Second Look at Transferable Targeted Attacks". The used dataset is also contained in their repository. Please consider leaving a :star: on their repository.

Core symbols most depended-on inside this repo

logging
called by 31
rap_attack.py
DI
called by 2
rap_attack.py
pgd
called by 2
rap_attack.py
makedir
called by 1
rap_attack.py
load_ground_truth
called by 1
rap_attack.py
gkern
called by 1
rap_attack.py
forward
called by 0
rap_attack.py

Shape

Function 6
Method 2
Class 1

Languages

Python100%

Modules by API surface

rap_attack.py9 symbols

For agents

$ claude mcp add Transfer_attack_RAP \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact