# bethgelab/foolbox

A Python toolbox to create adversarial examples that fool neural networks in PyTorch, TensorFlow, and JAX

Repository: https://github.com/bethgelab/foolbox
Canonical: https://ross.abutalabs.com/products/foolbox
Homepage: https://foolbox.jonasrauber.de
Language: Python
License: MIT
License Family: permissive
Topics: adversarial-examples, machine-learning, python, adversarial-attacks, pytorch, tensorflow, jax, keras
Last push: 2025-12-03T08:37:14+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 55, release rhythm 8, longevity 100
- inputs: {"age_days": 3367, "days_push": 273, "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 2972, forks 442 (observed 2026-08-28T04:07:32.827878+00:00)

## What it is
Foolbox is a Python library for generating adversarial examples that fool deep neural networks, with state-of-the-art gradient-based and decision-based attacks. Built on EagerPy, it runs natively on PyTorch, TensorFlow, and JAX models with a single codebase and batch support.

## Use cases
- generate adversarial examples to fool a neural network
- benchmark robustness of my PyTorch model against attacks
- run PGD attacks on an ImageNet classifier
- test model robustness in TensorFlow or JAX
- evaluate robust accuracy across multiple epsilon values
- compare gradient-based and decision-based adversarial attacks

## When to choose
- you need adversarial attacks that work natively across PyTorch, TensorFlow, and JAX
- you want a well-documented, actively maintained attack toolbox with batch support
- you need state-of-the-art gradient-based and decision-based attacks in one library

## When to avoid
- you need adversarial training/defense methods rather than attacks
- you work with frameworks other than PyTorch, TensorFlow, or JAX
- you only need a simple FGSM one-liner and don't want a full toolbox

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

## Member repositories
- bethgelab/foolbox (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.827878+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-30T07:31:37.790776+00:00, confidence not recorded.
  - readme: https://github.com/bethgelab/foolbox (fetched 2026-08-28T04:07:32.827878+00:00, sha 8c3181f1d057)
  - homepage: https://foolbox.jonasrauber.de (fetched 2026-08-29T09:46:57.509980+00:00, sha 3e2c756ca1b6)
  - site_page: https://foolbox.jonasrauber.de/guide/getting-started.html (fetched 2026-08-29T09:46:57.519186+00:00, sha 9d3e6aa3f2ae)
  - registry_pypi: https://pypi.org/pypi/foolbox/json (fetched 2026-08-29T09:46:57.521510+00:00, sha 9281e9e7b6a4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
