All Projects → thu-ml → Ares

thu-ml / Ares

Licence: mit
A Python library for adversarial machine learning focusing on benchmarking adversarial robustness.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Ares

Cloud Game
Web-based Cloud Gaming service for Retro Game
Stars: ✭ 1,374 (+727.71%)
Mutual labels:  nes
Nes Js
JavaScript NES(Famicom) emulator
Stars: ✭ 131 (-21.08%)
Mutual labels:  nes
Ml Course
Starter code of Prof. Andrew Ng's machine learning MOOC in R statistical language
Stars: ✭ 154 (-7.23%)
Mutual labels:  pca
Grevit
Grevit - Build your BIM Model in Grasshopper or SketchUp
Stars: ✭ 104 (-37.35%)
Mutual labels:  bim
Msmbuilder
🏗 Statistical models for biomolecular dynamics 🏗
Stars: ✭ 118 (-28.92%)
Mutual labels:  pca
Droidsound
Droidsound-E. Download links in README.md
Stars: ✭ 136 (-18.07%)
Mutual labels:  nes
Vizuka
Explore high-dimensional datasets and how your algo handles specific regions.
Stars: ✭ 100 (-39.76%)
Mutual labels:  pca
Millfork
Millfork: a middle-level programming language targeting 6502- and Z80-based microcomputers and home consoles
Stars: ✭ 163 (-1.81%)
Mutual labels:  nes
Svm Classification Localization
HoG, PCA, PSO, Hard Negative Mining, Sliding Window, Edge Boxes, NMS
Stars: ✭ 130 (-21.69%)
Mutual labels:  pca
Miscellaneous R Code
Code that might be useful to others for learning/demonstration purposes, specifically along the lines of modeling and various algorithms. Now almost entirely superseded by the models-by-example repo.
Stars: ✭ 146 (-12.05%)
Mutual labels:  pca
Isl Python
Solutions to labs and excercises from An Introduction to Statistical Learning, as Jupyter Notebooks.
Stars: ✭ 108 (-34.94%)
Mutual labels:  pca
Novathesquirrel
an open source NES platformer game
Stars: ✭ 115 (-30.72%)
Mutual labels:  nes
Nes Rust
NES emulator written in Rust + WASM
Stars: ✭ 141 (-15.06%)
Mutual labels:  nes
Nes.swift
An NES emulator written in Swift
Stars: ✭ 103 (-37.95%)
Mutual labels:  nes
Nsfplay
Nintendo NES sound file NSF music player
Stars: ✭ 155 (-6.63%)
Mutual labels:  nes
Laines
Cycle-accurate NES emulator in ~1000 lines of code
Stars: ✭ 1,365 (+722.29%)
Mutual labels:  nes
Cadeditor
NES Universal Level Editor (Chip & Dale, Darkwing Duck, Duck Tales, Duck Tales 2, MegaMan 4, Chip & Dale 2, Tale Spin, Little Mermaid, Jungle Book, Flintstones and many others)
Stars: ✭ 134 (-19.28%)
Mutual labels:  nes
Nes
A Javascript NES Emulator
Stars: ✭ 168 (+1.2%)
Mutual labels:  nes
Flownes
🎮 An NES emulator written in ES2015+ with flowtype
Stars: ✭ 160 (-3.61%)
Mutual labels:  nes
Machine Learning In R
Workshop (6 hours): preprocessing, cross-validation, lasso, decision trees, random forest, xgboost, superlearner ensembles
Stars: ✭ 144 (-13.25%)
Mutual labels:  pca

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.

We benchmark the adversarial robustness using 15 attacks and 16 defenses under complete threat models, which is described in the following paper

Benchmarking Adversarial Robustness on Image Classification (CVPR 2020, Oral)

Yinpeng Dong, Qi-An Fu, Xiao Yang, Tianyu Pang, Hang Su, Zihao Xiao, and Jun Zhu.

Feature overview:

  • Built on TensorFlow, and support TensorFlow & PyTorch models with the same interface.
  • Support many attacks in various threat models.
  • Provide ready-to-use pre-trained baseline models (8 on ImageNet & 8 on CIFAR10).
  • Provide efficient & easy-to-use tools for benchmarking models.

Citation

If you find ARES useful, you could cite our paper on benchmarking adversarial robustness using all models, all attacks & defenses supported in ARES. We provide a BibTeX entry of this paper below:

@inproceedings{dong2020benchmarking,
  title={Benchmarking Adversarial Robustness on Image Classification},
  author={Dong, Yinpeng and Fu, Qi-An and Yang, Xiao and Pang, Tianyu and Su, Hang and Xiao, Zihao and Zhu, Jun},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  pages={321--331},
  year={2020}
}

Installation

Since ARES is still under development, please clone the repository and install the package:

git clone https://github.com/thu-ml/ares
cd ares/
pip install -e .

The requirements.txt includes its dependencies, you might want to change PyTorch's version as well as TensorFlow 1's version. TensorFlow 1.13 or later should work fine.

As for python version, Python 3.5 or later should work fine.

The Boundary attack and the Evolutionary attack require mpi4py and a working MPI with enough localhost slots. For example, you could set the OMPI_MCA_rmaps_base_oversubscribe environment variable to yes for OpenMPI.

Download Datasets & Model Checkpoints

By default, ARES would save datasets and model checkpoints under the ~/.ares directory. You could override it by setting the ARES_RES_DIR environment variable to an alternative location.

We support 2 datasets: CIFAR-10 and ImageNet.

To download the CIFAR-10 dataset, please run:

python3 ares/dataset/cifar10.py

To download the ImageNet dataset, please run:

python3 ares/dataset/imagenet.py

for instructions.

ARES includes third party models' code in the third_party/ directory as git submodules. Before you use these models, you need to initialize these submodules:

git submodule init
git submodule update --depth 1

The example/cifar10 directory and example/imagenet directories include wrappers for these models. Run the model's .py file to download its checkpoint or view instructions for downloading. For example, if you want to download the ResNet56 model's checkpoint, please run:

python3 example/cifar10/resnet56.py

Documentation

We provide API docs as well as tutorials at https://thu-ml-ares.rtfd.io/.

Quick Examples

ARES provides command line interface to run benchmarks. For example, to run distortion benchmark on ResNet56 model for CIFAR-10 dataset using CLI:

python3 -m ares.benchmark.distortion_cli --method mim --dataset cifar10 --offset 0 --count 1000 --output mim.npy example/cifar10/resnet56.py --distortion 0.1 --goal ut --distance-metric l_inf --batch-size 100 --iteration 10 --decay-factor 1.0 --logger

This command would find the minimal adversarial distortion achieved using the MIM attack with decay factor of 1.0 on the example/cifar10/resnet56.py model with L∞ distance and save the result to mim.npy.

For more examples and usages (e.g. how to define new models), please browse our documentation website mentioned before.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].