# cleverhans-lab/cleverhans

An adversarial example library for constructing attacks, building defenses, and benchmarking both

Repository: https://github.com/cleverhans-lab/cleverhans
Canonical: https://ross.abutalabs.com/products/cleverhans
Language: Jupyter Notebook
License: MIT
License Family: permissive
Topics: machine-learning, security, benchmarking
Last push: 2024-04-10T13:26:10+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3640, "days_push": 875, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6450, forks 1395 (observed 2026-08-28T04:09:43.483797+00:00)

## What it is
CleverHans is a Python library for benchmarking machine learning systems' vulnerability to adversarial examples, providing reference implementations of attacks and defenses. It supports JAX, PyTorch, and TensorFlow 2, with tutorials demonstrating its features.

## Use cases
- benchmark my model's robustness to adversarial examples
- generate adversarial attacks against a neural network
- test defenses against adversarial perturbations
- implement FGSM or PGD attacks in PyTorch
- evaluate ML model security before deployment
- compare attack success rates across frameworks

## When to choose
- you need reference implementations of well-known adversarial attacks (FGSM, PGD, etc.)
- you want to benchmark model robustness across JAX, PyTorch, or TF2
- you are researching adversarial ML and want a citable, standard baseline library

## When to avoid
- you need production-grade defense mechanisms rather than research reference code
- you require active feature development or frequent updates
- you need adversarial robustness tooling outside the supported frameworks (e.g., scikit-learn models)

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, security, benchmarking, testing
- domain: machine-learning, security, deep-learning, artificial-intelligence
- platform: python
- tags: adversarial-examples, adversarial-attacks, adversarial-defenses, robustness, pytorch, tensorflow, jax, model-evaluation

## Member repositories
- cleverhans-lab/cleverhans (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:43.483797+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:44:39.946939+00:00, confidence not recorded.
  - readme: https://github.com/cleverhans-lab/cleverhans (fetched 2026-08-28T04:09:43.483797+00:00, sha 4873aa345c92)
  - registry_pypi: https://pypi.org/pypi/cleverhans/json (fetched 2026-08-29T08:41:21.810312+00:00, sha 2a745327c54f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
