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.
git clone https://github.com/haichen-ber/pytorch_ares.git
pip install -r requirements.txt
The requirements.txt includes its dependencies.
pytorch_ares/
data/
: The code supports cifar10 and imagenet datasets.test/
: Some toyexamples for testing adversarial attack methods and adversarial defense methods.pytorch_ares/
dataset_torch/
: Data processing for cifar10 and imagenet datasets.attack_torch/
: PyTorch implementation of some adversarial attack methods.cifar10_model/
: PyTorch implementation of some adversarial defense models on the cifar10 dataset.defense_torch/
: PyTorch implementation of some defense methods.third_party/
: Other open source repositories.attack_benchmark/
: Adversarial robustness benchmarks for image classification.
TRADES: Theoretically Principled Trade-off between Robustness and Accuracy
FS-AT: Defense Against Adversarial Attacks Using Feature Scattering-based Adversarial Training
Pre-Training: Using Pre-Training Can Improve Model Robustness and Uncertainty
AT-HE: Boosting Adversarial Training with Hypersphere Embedding
Robust Overfitting: Overfitting in adversarially robust deep learning
FastAT: Fast is better than free: Revisiting adversarial training
AWP: Adversarial Weight Perturbation Helps Robust Generalization
Label Smoothing: Bag of Tricks for Adversarial Training
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