Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

eval-learn

A benchmarking framework for evaluating concept-unlearning techniques in text-to-image diffusion models.

Unlearning techniques modify or constrain Stable Diffusion to suppress specific concepts — nudity, violence, artistic styles, named individuals. eval-learn provides a common interface to run, compare, and evaluate these techniques under consistent conditions.


Techniques

Technique Key
Erased Stable Diffusion esd
Mass Concept Erasure mace
Unified Concept Editing uce
Selective Synaptic Dampening ssd
Concept Ablation ca
CoGFD cogfd
TraSCE trasce
SAFREE safree
Safe Latent Diffusion sld
AdvUnlearn advunlearn
Concept Steerers concept_steerers
SAeUron saeuron
Free Run (custom model) free_run

Metrics

Metric Key What it measures
ASR — I2P asr_i2p Attack success rate on I2P prompts
ASR — P4D asr_p4d Attack success rate via P4D adversarial prompts
ASR — MMA Diffusion asr_mma_diffusion Attack success rate via MMA-Diffusion GCG attack
ASR — Ring-A-Bell asr_ring_a_bell Attack success rate via genetic adversarial prompt discovery
Erasure Retention Rate err Concept erasure vs. unrelated concept retention
FID fid Image quality vs. COCO reference
CLIP Score clip_score Prompt-image alignment
UA-IRA ua_ira Unsafe concept alignment vs. retain concept alignment
TIFA tifa Text-image faithfulness via VQA

Installation

1. Install eval-learn

pip install eval-learn

2. Install technique packages

Technique implementations are hosted on Hugging Face. Clone the repo once, pull LFS files, then install only what you need:

git clone https://huggingface.co/datasets/Unlearningltd/Packages
cd Packages
git lfs pull
pip install -e esd/
pip install -e mace/
pip install -e uce/
pip install -e ssd/
pip install -e ca/
pip install -e cogfd/
pip install -e trasce/
pip install -e saeuron/
pip install -e safree/
pip install -e concept-steerers/
pip install -e advunlearn/

SLD is built into eval-learn via the diffusers library and requires no extra install.

3. Install metric packages

From the cloned Packages directory (see step 2 above):

pip install -e p4d/
pip install -e mma_diff/
pip install -e RING_A_BELL/
pip install -e Q16/
# NudeNet (nudity ASR)
pip install "eval-learn[asr]"

# FID / COCO metrics
pip install "eval-learn[fid,coco]"

4. Hugging Face authentication

Create a .env file in the directory you run eval-learn run from:

HF_TOKEN=your_token_here

Quick start

Benchmarks are defined in a JSON or YAML config file:

{
  "output_dir": "results/esd_nudity",
  "technique": {
    "name": "esd",
    "config": { "erase_concept": "nudity", "train_method": "noxattn", "device": "cuda" }
  },
  "metrics": [
    { "name": "asr_i2p",    "config": { "concept_name": "nudity", "device": "cuda" } },
    { "name": "fid",        "config": { "device": "cuda" } },
    { "name": "clip_score", "config": { "device": "cuda" } }
  ]
}

Run it:

eval-learn run --config config.json

Results are written to output_dir as JSON.

Useful commands

eval-learn plugins   # list installed techniques and metrics
eval-learn models    # show the base model each technique targets

Examples

The examples/ directory contains ready-to-run configs for all techniques across nudity and violence concepts:

examples/
  nudity/     one config per technique (esd.json, mace.json, ...)
  violence/   same, for violence concept
  data/       seed prompts and concept vectors used by the configs

Run all nudity benchmarks in sequence:

python nudity_unlearning_demo.py

Run all violence benchmarks:

python nudity_unlearning_demo_violence.py

Documentation

Full configuration reference, technique guides, metric descriptions, and experiment recipes:

https://eval-learn.readthedocs.io

Package on PyPI: https://pypi.org/project/eval-learn/

Key pages:


License

MIT

Release files for eval-learn 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eval-learn 0.1.6
File Size Uploaded
eval_learn-0.1.6.tar.gz 292.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eval-learn 0.1.6
File Interpreter ABI Platform
eval_learn-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 622.5 kB

Release files / eval_learn-0.1.6.tar.gz

Download URL eval_learn-0.1.6.tar.gz
Size 292.4 kB
Tags Source
SHA-256 checksum
How to use checksums
78dca06572826076727c67ac3a154c177165e9a15e719a7828c5c7af5908b0a7
BLAKE2b-256 checksum
How to use checksums
9ebccdc3a48b41620f6e685f14e4d6d4109d595239fbb3024960666760f84a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.

Transparency log

Release files / eval_learn-0.1.6-py3-none-any.whl

Download URL eval_learn-0.1.6-py3-none-any.whl
Size 330.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9df55e937c4c89b97eef3518ba7253daa1bca14d61addf27ac6d3bcb6a3b38ae
BLAKE2b-256 checksum
How to use checksums
cb34aeb29efb06cee42bf208cfdfcecbf8fe3c9c10e270c729bb970a9d4f8623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 24, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page