Practical overview
When it fits
Use CleverHans when you have a machine-learning model and want reference attack or defense implementations for adversarial-robustness experiments.
Who it is for
- Machine-learning researchers evaluating model robustness
- Developers constructing adversarial examples or prototyping defenses
- Educators and learners following the project’s MNIST and CIFAR-10 tutorials
Documented uses
- Benchmark a model’s vulnerability to adversarial examples.
- Construct adversarial examples using attack implementations.
- Explore or evaluate defenses against adversarial attacks.
- Study FGSM and PGD examples in the supplied tutorials.
Requirements & limits
The repository is public and MIT-licensed. Installation is documented through pip or by cloning the repository.
- A JAX, PyTorch or TensorFlow 2 installation is a prerequisite.
- The repository prioritizes implementing attacks in PyTorch while welcoming contributions for all three listed frameworks.
- Tutorials can change without warning and are not treated as part of the library API.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install CleverHans with a supported framework
Set up the library after installing one of its documented machine-learning framework prerequisites.
Before you start
- Python environment
- At least one of JAX, PyTorch or TensorFlow 2
Steps
Install JAX, PyTorch or TensorFlow 2.
Install CleverHans with the command below.
pip install cleverhans
Expected outcome
CleverHans is installed from the latest version uploaded to PyPI.
Guide limitations
- The documented test setup lists Python 3.6, JAX 0.2, PyTorch 1.7 and TensorFlow 2.4 on Ubuntu 18.04; other setups are not specified as tested.
- The guide covers installation, not execution of a benchmark.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 15 October 2026
- Original website title
- cleverhans-lab/cleverhans · Official homepage title · retained in its source language

