Skip to main content

Vision Unlearning: a tool for Machine Unlearning in Computer Vision

Project description

Vision Unlearning

Mypy Pycodestyle Pytest Coverage Publish Package to PyPI

Documentation

Installation

pip install vision-unlearning

Compatible with python 3.10 to 3.12.

What is Vision Unlearning?

Vision Unlearning provides a standard interface for unlearning algorithms, datasets, metrics, and evaluation methodologies commonly used in Machine Unlearning for vision-related tasks, such as image classification and image generation.

It bridges the gap between research/theory and engineering/practice, making it easier to apply machine unlearning techniques effectively.

Vision Unlearning is designed to be:

  • Easy to use
  • Easy to extend
  • Architecture-agnostic
  • Application-agnostic

Who is it for?

Researchers

For Machine Unlearning researchers, Vision Unlearning helps with:

  • Using the same data splits as other works, including the correct segmentation of forget-retain data and generating data with the same prompts.
  • Choosing the appropriate metrics for each task.
  • Configuring evaluation setups in a standardized manner.

Practitioners

For practitioners, Vision Unlearning provides:

  • Easy access to state-of-the-art unlearning algorithms.
  • A standardized interface to experiment with different algorithms.

Tutorials

The source code for these tutorials is in tutorials/, but their outputs were cleaned to avoid burdening the repo. The links above contain Google Drive stored executions with the full outputs.

For developers: every time there is a relevant modification in the codebase, please run the affected tutorials, save the notebook to Drive, clear the output before commiting.

Benchmarks

Vision-Unlearning provides easy access to evaluation benchmarks.

Across all benchmarks, a standardized set of files/media/metadata/content is provided following the structure described in the Appendix 2 of I-CARE paper. As such, they are compatible with Forgety.

I-CARE

Even though the feasibility demonstration of the I-CARE methodology is not per se a full-fledged benchmark, it is exposed by Vision-Unlearning as one. Three independent tasks are analyzed (forgetting people, scenes, and dog breeds) across three unlearning methods from the state-of-the-art (UCE, SPARE, MUNBa). Data, models, metrics and computed results are provided its HuggingFace repository. See code details in vision_unlearning/benchmarks/I_care.

This work analyzes how unlearning one entity (the emitter) affects the performance on other closely-related entities (the receivers). Each task is defined by carefully selecting a diverse and representative set of entities (concepts that will undergo unlearning). Each entity is annotated with relevant attributes, and separately unlearned using different unlearning methods. Each unlearned model is then used to generate images for all entities, allowing fine-grained analysis of the effects caused by the unlearning process. Last but not least, all entities contain the same amount of images and were carefully selected so as to be balanced across at least 2 attributes.

Unlearn Canvas

TODO... still under construction...

For more information on the benchmark itself, please refer to their repository https://github.com/OPTML-Group/UnlearnCanvas.

Data, models, metrics and computed results used by Vision-Unlearning are [or will be] provided this HuggingFace repository. See code details in vision_unlearning/benchmarks/u_care.

Holistic Unlearning Benchmark (HUB)

TODO... still under construction...

For more information on the benchmark itself, please refer to their paper: https://arxiv.org/abs/2410.05664

Data, models, metrics and computed results used by Vision-Unlearning are [or will be] provided this HuggingFace repository. See code details in vision_unlearning/benchmarks/hub_care.

Forgety

Forgety is a related project built on top of this library, providing a web-based graphical UI.

Main Interfaces

Vision Unlearning standardizes the following components:

  • Metric: Evaluates a model (e.g., FID, CLIP Score, MIA, NudeNet, etc.).
  • Unlearner: Encapsulates the unlearning algorithm.
  • Dataset: Encapsulates the dataset, including data splitting.

Additionally, common tasks and evaluation setups are provided as example notebooks. Several platform integrations, such as Hugging Face and Weights & Biases, are also included.

uml

Citation

We don't have yet a paper specifically about the library. Instead, please cite the Zenodo DOI that releases the data for the testbeds:

@dataset{vision_unlearning_evaluation_testbeds,
  author       = {Benitez Pereira, Leonardo Santiago and
                  Mola, Natnael and
                  R. Kelsch, Carolina and
                  Vaze, Soham},
  title        = {Vision Unlearning Evaluation Testbeds},
  month        = feb,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {0.1.0},
  doi          = {10.5281/zenodo.18649818},
  url          = {https://doi.org/10.5281/zenodo.18649818},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_unlearning-1.0.0.tar.gz (958.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vision_unlearning-1.0.0-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file vision_unlearning-1.0.0.tar.gz.

File metadata

  • Download URL: vision_unlearning-1.0.0.tar.gz
  • Upload date:
  • Size: 958.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for vision_unlearning-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6f2ea124ab868eea2313804433ef48a6a7bd02ba89b82a9436c508dd34025572
MD5 a168e4ba8966bb7e22a6254b57c78ccd
BLAKE2b-256 9eb4964949c0d5f41cd81e74cfa0b664db97628d74fe83fe3129fef72a7d3dd9

See more details on using hashes here.

File details

Details for the file vision_unlearning-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vision_unlearning-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43a2d89091e876b5077f5d4caa057752e8e990409369feee329e7a3107950494
MD5 657e0badd8ba61b6886dbb94f99d0cf7
BLAKE2b-256 058461f47f469d88342355e834fe3561f05d87ea21124696925cfa21156053ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page