https://github.com/DreamyRainforest/Class_Activation_Mapping_Ensemble_Attack
https://github.com/DreamyRainforest/Class_Activation_Mapping_Ensemble_Attack
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/DreamyRainforest/Class_Activation_Mapping_Ensemble_Attack
- Owner: DreamyRainforest
- Created: 2023-08-10T08:22:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-10T11:43:32.000Z (over 2 years ago)
- Last Synced: 2024-09-11T08:52:08.372Z (over 1 year ago)
- Language: Python
- Size: 534 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-MLSecOps - Class_Activation_Mapping_Ensemble_Attack
README
# Class_Activation_Mapping_Ensemble_Attack
# Requirements:
Python 3.7.16
torch 1.8.0+cu111
torchvision 0.9.0+cu111
tqdm 4.65.0
numpy 1.21.6
pillow 9.5.0
# Experiments:
The code consists of three Python scripts. Before running the code, you need to complete the following two steps:
Download Data: Download the data from the provided link (https://pan.baidu.com/s/1NlenXev0cN1l55ZSVQ-_nw; password: d6tn) and place it in the benign_image/ directory.
Calculate Class Activation Maps (CAM): Compute the class activation maps and place them in the CAM/ directory.
# Running the code
untaregt_attack_example.py:Non-targeted attack
taregt_attack_example.py:targeted attack
victim_one.py: test
# Acknowledgments:
Code refer to
https://github.com/Harry24k/adversarial-attacks-pytorch
https://github.com/frgfm/torch-cam
https://github.com/erbloo/dr_cvpr20
https://github.com/RobustBench/robustbench