Qianfulanteam / pytorch_ares

5 stars 0 forks source link

pytorch_ares

This repository contains the code for ARES (Adversarial Robustness Evaluation for Safety), a Python library for adversarial machine learning research focusing on benchmarking adversarial robustness on image classification correctly and comprehensively.

Installation

Adversarial attack

Adversarial defense

Example to run the codes

ARES provides command line interface to run benchmarks. For example, you can test the attack success rate of fgsm on resnet18 on the cifar10 dataset:

cd test/
python test_fgsm.py --dataset_name cifar10

There are 4 run_***.py files in the attack_benchmark folder that evaluate the adversarial robustness benchmarks on the cifar10 and imagenet datasets. For example, if you want to evaluate the robustness of the defense model on the cifar10 dataset, you can run the following command line:

cd attack_benchmark/ 
python run_cifar10_defense.py