supreme-unlearning 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- supreme_unlearning-0.1.0/LICENSE +21 -0
- supreme_unlearning-0.1.0/PKG-INFO +393 -0
- supreme_unlearning-0.1.0/README.md +326 -0
- supreme_unlearning-0.1.0/pyproject.toml +98 -0
- supreme_unlearning-0.1.0/setup.cfg +4 -0
- supreme_unlearning-0.1.0/setup.py +7 -0
- supreme_unlearning-0.1.0/supreme/__init__.py +93 -0
- supreme_unlearning-0.1.0/supreme/datasets/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/datasets/datasets.py +501 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/accuracy.py +17 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/activation_distance.py +66 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/completeness.py +90 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/jsdiv.py +45 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/layerwise_distance.py +64 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/membership_inference_attack.py +202 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/metrics_main.py +799 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/resource_consumption.py +605 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/time.py +33 -0
- supreme_unlearning-0.1.0/supreme/eval_metrics/zrf.py +85 -0
- supreme_unlearning-0.1.0/supreme/methods/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/methods/baselines/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/methods/baselines/original.py +3 -0
- supreme_unlearning-0.1.0/supreme/methods/baselines/retrain.py +66 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/assd.py +527 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/bad_teacher.py +240 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/finetune.py +31 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/jit.py +244 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/lfssd.py +404 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/neg_grad.py +39 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/random_labeling.py +122 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/scrub.py +318 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/ssd.py +404 -0
- supreme_unlearning-0.1.0/supreme/methods/unlearning_methods/unsir.py +273 -0
- supreme_unlearning-0.1.0/supreme/models/ResNet18.py +130 -0
- supreme_unlearning-0.1.0/supreme/models/ViT.py +37 -0
- supreme_unlearning-0.1.0/supreme/models/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/registry.py +369 -0
- supreme_unlearning-0.1.0/supreme/utils/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/compute_dataset_stats.py +169 -0
- supreme_unlearning-0.1.0/supreme/utils/debug_utils.py +640 -0
- supreme_unlearning-0.1.0/supreme/utils/fabric/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/fabric/callbacks.py +313 -0
- supreme_unlearning-0.1.0/supreme/utils/fabric/fabric_setup.py +526 -0
- supreme_unlearning-0.1.0/supreme/utils/fabric/loggers_setup.py +51 -0
- supreme_unlearning-0.1.0/supreme/utils/generic_utils.py +257 -0
- supreme_unlearning-0.1.0/supreme/utils/memory_utils.py +242 -0
- supreme_unlearning-0.1.0/supreme/utils/model_logging.py +292 -0
- supreme_unlearning-0.1.0/supreme/utils/parsers/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/parsers/common_args.py +60 -0
- supreme_unlearning-0.1.0/supreme/utils/process_tracker.py +399 -0
- supreme_unlearning-0.1.0/supreme/utils/project_config.py +712 -0
- supreme_unlearning-0.1.0/supreme/utils/training/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/training/train_main.py +699 -0
- supreme_unlearning-0.1.0/supreme/utils/training/training_utils.py +464 -0
- supreme_unlearning-0.1.0/supreme/utils/unlearning/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/unlearning/evaluation_utils.py +146 -0
- supreme_unlearning-0.1.0/supreme/utils/unlearning/unlearn_main.py +1850 -0
- supreme_unlearning-0.1.0/supreme/utils/unlearning/unlearning_utils.py +712 -0
- supreme_unlearning-0.1.0/supreme/utils/unlearning/update_checkpoint_paths.py +141 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/results_analysis/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/results_extraction/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/results_extraction/export_config.py +244 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/runtime/__init__.py +0 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/runtime/delete_runs_by_seed.py +166 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/runtime/move_retrain_to_stale.py +321 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/runtime/wandb_manager.py +1153 -0
- supreme_unlearning-0.1.0/supreme/utils/wandb_utils/runtime/wandb_setup.py +464 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/PKG-INFO +393 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/SOURCES.txt +74 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/dependency_links.txt +1 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/entry_points.txt +3 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/requires.txt +31 -0
- supreme_unlearning-0.1.0/supreme_unlearning.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Petros Andreou, Jamie Lanyon, Axel Finke, Georgina Cosma
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: supreme-unlearning
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A registry-based, multi-GPU framework for reproducible image-unlearning evaluation.
|
|
5
|
+
Author: Petros Andreou
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Petros Andreou, Jamie Lanyon, Axel Finke, Georgina Cosma
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/pedroandreou/supreme-unlearning
|
|
29
|
+
Project-URL: Repository, https://github.com/pedroandreou/supreme-unlearning
|
|
30
|
+
Keywords: machine-unlearning,deep-learning,pytorch,lightning-fabric,benchmark
|
|
31
|
+
Classifier: Programming Language :: Python :: 3
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Intended Audience :: Science/Research
|
|
34
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
35
|
+
Requires-Python: >=3.9
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
License-File: LICENSE
|
|
38
|
+
Requires-Dist: torch==2.1.0
|
|
39
|
+
Requires-Dist: torchvision==0.16.0
|
|
40
|
+
Requires-Dist: torchaudio==2.1.0
|
|
41
|
+
Requires-Dist: lightning==2.1.0
|
|
42
|
+
Requires-Dist: pytorch-lightning==2.1.0
|
|
43
|
+
Requires-Dist: transformers==4.35.0
|
|
44
|
+
Requires-Dist: numpy<2.0
|
|
45
|
+
Requires-Dist: scipy==1.13.1
|
|
46
|
+
Requires-Dist: scikit-learn==1.6.1
|
|
47
|
+
Requires-Dist: matplotlib==3.9.4
|
|
48
|
+
Requires-Dist: seaborn==0.13.2
|
|
49
|
+
Requires-Dist: wandb==0.25.1
|
|
50
|
+
Requires-Dist: python-dotenv==1.1.0
|
|
51
|
+
Requires-Dist: psutil
|
|
52
|
+
Requires-Dist: requests==2.28.2
|
|
53
|
+
Requires-Dist: urllib3<2.0.0
|
|
54
|
+
Requires-Dist: chardet==4.0.0
|
|
55
|
+
Requires-Dist: charset-normalizer==3.0.1
|
|
56
|
+
Requires-Dist: datetime==5.5
|
|
57
|
+
Provides-Extra: cuda
|
|
58
|
+
Requires-Dist: deepspeed==0.14.5; extra == "cuda"
|
|
59
|
+
Requires-Dist: bitsandbytes==0.42.0; extra == "cuda"
|
|
60
|
+
Requires-Dist: nvidia-ml-py==13.580.82; extra == "cuda"
|
|
61
|
+
Provides-Extra: tensorboard
|
|
62
|
+
Requires-Dist: tensorboard; extra == "tensorboard"
|
|
63
|
+
Provides-Extra: dev
|
|
64
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
65
|
+
Requires-Dist: debugpy; extra == "dev"
|
|
66
|
+
Dynamic: license-file
|
|
67
|
+
|
|
68
|
+
<div align="center">
|
|
69
|
+
|
|
70
|
+
<h3><strong>⚡ SUPREME - Standardised Unlearning Platform for REproducible Method Evaluation</strong></h3>
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
<p>
|
|
75
|
+
<strong>🔬 Tech Stack</strong><br>
|
|
76
|
+
<em>Core:</em>
|
|
77
|
+
<a href="#"><img src="https://img.shields.io/badge/python-3.9-blue.svg?logo=python&logoColor=white" alt="Python 3.9"></a>
|
|
78
|
+
<a href="https://pytorch.org/"><img src="https://img.shields.io/badge/PyTorch-EE4C2C?logo=pytorch&logoColor=white" alt="PyTorch"></a>
|
|
79
|
+
<a href="https://lightning.ai/docs/fabric/"><img src="https://img.shields.io/badge/Lightning_Fabric-792EE5?logo=lightning&logoColor=white" alt="Lightning Fabric"></a>
|
|
80
|
+
<a href="https://huggingface.co/docs/transformers/"><img src="https://img.shields.io/badge/HuggingFace-FFD21E?logo=huggingface&logoColor=black" alt="HuggingFace Transformers"></a>
|
|
81
|
+
<br>
|
|
82
|
+
<em>Accelerators:</em>
|
|
83
|
+
<a href="https://developer.nvidia.com/cuda-toolkit"><img src="https://img.shields.io/badge/CUDA_12.1-76B900?logo=nvidia&logoColor=white" alt="CUDA 12.1"></a>
|
|
84
|
+
<a href="https://developer.apple.com/metal/pytorch/"><img src="https://img.shields.io/badge/MPS-000000?logo=apple&logoColor=white" alt="MPS"></a>
|
|
85
|
+
<a href="https://pytorch.org/xla/"><img src="https://img.shields.io/badge/TPU_(XLA)-4285F4?logo=googlecloud&logoColor=white" alt="TPU via PyTorch XLA"></a>
|
|
86
|
+
<br>
|
|
87
|
+
<em>Distributed & precision:</em>
|
|
88
|
+
<a href="https://www.deepspeed.ai/"><img src="https://img.shields.io/badge/DeepSpeed-0078D4?logo=microsoft&logoColor=white" alt="DeepSpeed"></a>
|
|
89
|
+
<a href="https://huggingface.co/docs/bitsandbytes/"><img src="https://img.shields.io/badge/bitsandbytes-FFD21E?logo=huggingface&logoColor=black" alt="bitsandbytes"></a>
|
|
90
|
+
<a href="https://github.com/NVIDIA/TransformerEngine"><img src="https://img.shields.io/badge/TransformerEngine-76B900?logo=nvidia&logoColor=white" alt="NVIDIA TransformerEngine"></a>
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
<p>
|
|
94
|
+
<strong>🛠️ Tooling</strong><br>
|
|
95
|
+
<em>Experiment tracking:</em>
|
|
96
|
+
<a href="https://wandb.ai/"><img src="https://img.shields.io/badge/Weights_%26_Biases-FFBE00?logo=weightsandbiases&logoColor=black" alt="Weights & Biases"></a>
|
|
97
|
+
<a href="https://www.tensorflow.org/tensorboard"><img src="https://img.shields.io/badge/TensorBoard-FF6F00?logo=tensorflow&logoColor=white" alt="TensorBoard"></a>
|
|
98
|
+
<br>
|
|
99
|
+
<em>Environment:</em>
|
|
100
|
+
<a href="https://www.docker.com/"><img src="https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=white" alt="Docker"></a>
|
|
101
|
+
<a href="#"><img src="https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode" alt="Open in Dev Containers"></a>
|
|
102
|
+
<br>
|
|
103
|
+
<em>Debug & profile:</em>
|
|
104
|
+
<a href="https://github.com/microsoft/debugpy"><img src="https://img.shields.io/badge/debugpy-007ACC?logo=visualstudiocode&logoColor=white" alt="debugpy"></a>
|
|
105
|
+
<a href="https://github.com/plasma-umass/scalene"><img src="https://img.shields.io/badge/Scalene_Profiler-6A0DAD?logo=python&logoColor=white" alt="Scalene Profiler"></a>
|
|
106
|
+
<br>
|
|
107
|
+
<em>Code quality:</em>
|
|
108
|
+
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/Ruff-D7FF64?logo=ruff&logoColor=black" alt="Ruff"></a>
|
|
109
|
+
<a href="https://pre-commit.com/"><img src="https://img.shields.io/badge/pre--commit-FAB040?logo=precommit&logoColor=white" alt="pre-commit"></a>
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
<p>
|
|
113
|
+
<strong>📄 Publication</strong><br>
|
|
114
|
+
<a href="https://arxiv.org/abs/2606.00380"><img src="https://img.shields.io/badge/arXiv-2606.00380-b31b1b?logo=arxiv&logoColor=white" alt="arXiv Preprint"></a>
|
|
115
|
+
<a href="https://aiimlab.org/events/ECML_PKDD_2026_WIPE-OUT_2_Workshop_on_Machine_Unlearning_and_Privacy_Preservation.html"><img src="https://img.shields.io/badge/Under_Review-WIPE--OUT_2_(ECML--PKDD_2026)-yellow" alt="Under double-blind review at the WIPE-OUT 2 Workshop, ECML-PKDD 2026"></a>
|
|
116
|
+
<a href="https://pedroandreou.github.io/supreme-unlearning-page/"><img src="https://img.shields.io/badge/Project_Page-Live-2ea44f?logo=githubpages&logoColor=white" alt="Project Page"></a>
|
|
117
|
+
</p>
|
|
118
|
+
|
|
119
|
+
<p>
|
|
120
|
+
<strong>📦 Repository</strong><br>
|
|
121
|
+
<a href="https://pypi.org/project/supreme-unlearning/"><img src="https://img.shields.io/pypi/v/supreme-unlearning?logo=pypi&logoColor=white&label=PyPI" alt="PyPI"></a>
|
|
122
|
+
<a href="https://test.pypi.org/project/supreme-unlearning/"><img src="https://img.shields.io/badge/TestPyPI-supreme--unlearning-orange?logo=pypi&logoColor=white" alt="TestPyPI"></a>
|
|
123
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue" alt="MIT License"></a>
|
|
124
|
+
</p>
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## 📖 Overview
|
|
131
|
+
|
|
132
|
+
**SUPREME** is an open-source framework for evaluating *machine unlearning* methods on image classification tasks.
|
|
133
|
+
|
|
134
|
+
**What is machine unlearning?** Given a model that was trained on some data, machine unlearning removes the influence of a chosen subset of that data (a class, a sub-class, or a random sample of examples) *without* retraining the model from scratch. Doing this well is hard: a good unlearned model should behave as if it had never seen the forgotten data, while still classifying everything else accurately. Many methods have been proposed, and they need a fair, repeatable way to be compared.
|
|
135
|
+
|
|
136
|
+
**What SUPREME does.** It runs the same three-stage pipeline end to end for any registered combination of dataset, model, unlearning method, and evaluation metric:
|
|
137
|
+
|
|
138
|
+
1. **Train** a baseline model on the full dataset.
|
|
139
|
+
2. **Unlearn** the chosen subset using the selected unlearning method.
|
|
140
|
+
3. **Evaluate** the unlearned model against a from-scratch *retrained* baseline (trained only on the data that was kept), using a configurable set of metrics that cover forgetting, utility, privacy, behavioural/parametric equivalence, and efficiency.
|
|
141
|
+
|
|
142
|
+
It ships **5 datasets, 2 model architectures, 2 baselines, 9 unlearning methods, and 9 selectable evaluation metrics** (plus loss, reported automatically alongside accuracy), all selectable through command-line flags.
|
|
143
|
+
|
|
144
|
+
**What makes SUPREME different:**
|
|
145
|
+
|
|
146
|
+
- **Reproducible.** Recent work has shown that single-seed unlearning results can misrepresent a method's true behaviour. SUPREME runs the same experiment under multiple seeds, independently for the training, unlearning, and evaluation stages, so you measure distributions, not point estimates. The number of seeds at each stage is configurable per run.
|
|
147
|
+
- **Multi-GPU and multi-precision.** Built on PyTorch and Lightning Fabric. Distribution (DDP, FSDP, DeepSpeed ZeRO 1/2/3) applies to *all three stages*, with mixed-precision (fp16 / bf16) and NVIDIA / Apple Silicon / CPU back-ends.
|
|
148
|
+
- **Registry-based extensibility.** Add a dataset, model, unlearning method, or metric by implementing a small interface and registering its module path, with no framework changes required (see [`docs/extending.md`](docs/extending.md)).
|
|
149
|
+
- **Efficient.** When several experiments share the same training configuration, the model is trained once and reused across them, guarded by a file lock so parallel SLURM jobs and concurrent local runs stay consistent.
|
|
150
|
+
|
|
151
|
+
For the formal pipeline algorithm and mathematical notation (seed formulas, set definitions, operation signatures), see [`supreme/README.md`](supreme/README.md) and [`docs/notation.md`](docs/notation.md).
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 🗃️ Available Components
|
|
156
|
+
|
|
157
|
+
Registry-based components are **user-extensible** - implement the relevant interface and register the module path, either in-tree or **from your own package** (runtime API or packaging entry points, no edits to SUPREME). See [`docs/extending.md`](docs/extending.md). The components provided via Lightning Fabric cover the supported hardware and execution configurations.
|
|
158
|
+
|
|
159
|
+
### Registry-based (user-extensible)
|
|
160
|
+
|
|
161
|
+
| Component | Available implementations |
|
|
162
|
+
|---|---|
|
|
163
|
+
| **Datasets** | [CIFAR-10](supreme/datasets/datasets.py), [CIFAR-20](supreme/datasets/datasets.py), [CIFAR-100](supreme/datasets/datasets.py), [PinsFaceRecognition](supreme/datasets/datasets.py), [Caltech-101](supreme/datasets/datasets.py) |
|
|
164
|
+
| **Models** | [ResNet18](supreme/models/ResNet18.py), [Vision Transformer (ViT)](supreme/models/ViT.py) |
|
|
165
|
+
| **Baselines** | [Retrain](supreme/methods/baselines/retrain.py), [Original](supreme/methods/baselines/original.py) |
|
|
166
|
+
| **Unlearning methods** | [Fine-Tuning (FT)](supreme/methods/unlearning_methods/finetune.py), [Bad Teacher (BadT)](supreme/methods/unlearning_methods/bad_teacher.py), [Random Labels (RL)](supreme/methods/unlearning_methods/random_labeling.py), [UNSIR](supreme/methods/unlearning_methods/unsir.py), [SSD](supreme/methods/unlearning_methods/ssd.py), [LFSSD](supreme/methods/unlearning_methods/lfssd.py), [ASSD](supreme/methods/unlearning_methods/assd.py), [SCRUB](supreme/methods/unlearning_methods/scrub.py), [JIT](supreme/methods/unlearning_methods/jit.py) |
|
|
167
|
+
| **Evaluation metrics** | [Accuracy](supreme/eval_metrics/accuracy.py), [Loss/Error](supreme/utils/training/training_utils.py), [ZRF](supreme/eval_metrics/zrf.py), [Activation Distance](supreme/eval_metrics/activation_distance.py), [JS-Divergence](supreme/eval_metrics/jsdiv.py), [Layer-wise Distance](supreme/eval_metrics/layerwise_distance.py), [Membership Inference Attack](supreme/eval_metrics/membership_inference_attack.py), [Completeness](supreme/eval_metrics/completeness.py), [Resource Consumption](supreme/eval_metrics/resource_consumption.py), [Time](supreme/eval_metrics/time.py) |
|
|
168
|
+
| **Unlearning scenarios** | Full-class, Subclass, Random sample |
|
|
169
|
+
|
|
170
|
+
### Provided via Lightning Fabric
|
|
171
|
+
|
|
172
|
+
| Component | Available implementations |
|
|
173
|
+
|---|---|
|
|
174
|
+
| **Accelerators** | [CPU](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.accelerators.CPUAccelerator.html), [CUDA](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.accelerators.CUDAAccelerator.html), [MPS](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.accelerators.MPSAccelerator.html), [TPU](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.accelerators.XLAAccelerator.html) |
|
|
175
|
+
| **Precision modes** | [64-true, 32-true, 16-mixed, bf16-mixed, 16-true, bf16-true](https://lightning.ai/docs/fabric/2.1.0/fundamentals/precision.html), [transformer-engine, transformer-engine-float16](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.plugins.precision.TransformerEnginePrecision.html) (FP8), [nf4, nf4-dq, fp4, fp4-dq, int8, int8-training](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.plugins.precision.BitsandbytesPrecision.html) |
|
|
176
|
+
| **Distributed strategies** | [DDP](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.strategies.DDPStrategy.html), [FSDP](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.strategies.FSDPStrategy.html), [DeepSpeed](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.strategies.DeepSpeedStrategy.html) (ZeRO Stage 1/2/3) |
|
|
177
|
+
| **Loggers** | [Weights & Biases](https://docs.wandb.ai/guides/integrations/lightning), [TensorBoard](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.loggers.TensorBoardLogger.html), [CSV](https://lightning.ai/docs/fabric/2.1.0/api/generated/lightning.fabric.loggers.CSVLogger.html) |
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## ⚡ Quickstart
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# 1. Clone
|
|
185
|
+
git clone https://github.com/pedroandreou/supreme-unlearning.git
|
|
186
|
+
cd supreme-unlearning
|
|
187
|
+
|
|
188
|
+
# 2. Set up environment - the Makefile is the entry point for local dev: it creates
|
|
189
|
+
# the venv (named `unlearning` by default; override with VENV=<name>), installs the
|
|
190
|
+
# pinned deps + SUPREME (editable), and enables the git hook. (Prompts if it
|
|
191
|
+
# already exists; pass ON_EXISTING=reuse to skip.)
|
|
192
|
+
make cuda # NVIDIA GPU (Linux / WSL2). Apple Silicon / CPU: `make mps`
|
|
193
|
+
source unlearning/bin/activate
|
|
194
|
+
|
|
195
|
+
# 3. Configure W&B + HF tokens
|
|
196
|
+
cp .env.example .env
|
|
197
|
+
# edit .env with your WANDB_KEY, WANDB_USERNAME and HUGGING_FACE_HUB_TOKEN
|
|
198
|
+
|
|
199
|
+
# 4. Smoke test - one seed, one method, one dataset
|
|
200
|
+
bash supreme/run_local.sh \
|
|
201
|
+
--gpu 0 --models ViT --training-seeds 260 \
|
|
202
|
+
--methods retrain,finetune,ssd \
|
|
203
|
+
--strategies random_ --datasets Cifar10 \
|
|
204
|
+
--forget-percs 0.01
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Full environment setup (Docker Dev Container, MPS prerequisites, etc.) is documented in [`docs/environment_setup.md`](docs/environment_setup.md). The Docker image is NVIDIA-only (Linux / WSL2); macOS users follow the virtual-env path above.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## 🧪 Running Experiments
|
|
212
|
+
|
|
213
|
+
The pipeline runs **train → unlearn → evaluate** automatically. Re-running is safe: per-stage outputs (training checkpoints, unlearning checkpoints, already-logged W&B results) are detected and skipped.
|
|
214
|
+
|
|
215
|
+
### Local (workstation, GPU server, interactive cluster node)
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# All 10 seeds, all methods, all datasets - defaults
|
|
219
|
+
bash supreme/run_local.sh --gpu 0
|
|
220
|
+
|
|
221
|
+
# Filter the sweep
|
|
222
|
+
bash supreme/run_local.sh \
|
|
223
|
+
--gpu 0,1 \
|
|
224
|
+
--models ViT \
|
|
225
|
+
--training-seeds 260,261,262 \
|
|
226
|
+
--methods retrain,finetune,bad_teacher,ssd \
|
|
227
|
+
--strategies fullclass,random_ \
|
|
228
|
+
--datasets PinsFaceRecognition
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
| Flag | Description | Default |
|
|
232
|
+
|------|-------------|---------|
|
|
233
|
+
| `--gpu` | GPU ID(s) - `0` single, `0,1,2,3` multi-GPU | `0` |
|
|
234
|
+
| `--models` | `ResNet18`, `ViT` | both |
|
|
235
|
+
| `--training-seeds` | Comma-separated training seeds (outer loop, `I`). | `260`–`269` |
|
|
236
|
+
| `--unlearning-seeds` | Space-separated indices for `J` (e.g. `"0 1 2"` for `J=3`) | `"0"` (matched) |
|
|
237
|
+
| `--evaluation-seeds` | Space-separated indices for `K` | `"0"` (matched) |
|
|
238
|
+
| `--methods` | Unlearning methods to run | all 11 (2 baselines + 9 methods) |
|
|
239
|
+
| `--strategies` | `fullclass`, `subclass`, `random_` | all |
|
|
240
|
+
| `--datasets` | Datasets to use | all 5 |
|
|
241
|
+
| `--forget-percs` | Forget % for `random_` strategy | `0.001`–`0.10` |
|
|
242
|
+
|
|
243
|
+
### SLURM (HPC, login node)
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
# Preview the grid (no submission)
|
|
247
|
+
./supreme/run_slurm.sh --dry-run
|
|
248
|
+
|
|
249
|
+
# Submit all experiments, max 12 concurrent jobs
|
|
250
|
+
./supreme/run_slurm.sh --max-concurrent 12
|
|
251
|
+
|
|
252
|
+
# Subset
|
|
253
|
+
./supreme/run_slurm.sh \
|
|
254
|
+
--datasets Cifar10,Cifar20 \
|
|
255
|
+
--models ViT \
|
|
256
|
+
--training-seeds 260,261,262
|
|
257
|
+
|
|
258
|
+
# Multi-GPU DDP per job
|
|
259
|
+
./supreme/run_slurm.sh --gpus 4
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Each submitted job runs one `(seed, dataset, model)` cell independently; cells run in parallel across the cluster. Distributed-strategy selection (DDP / FSDP / DeepSpeed) is documented in [`docs/implementation_notes.md → Distributed Strategies`](docs/implementation_notes.md#distributed-strategies).
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## 🔁 Reproducing the paper
|
|
267
|
+
|
|
268
|
+
Reproducing the paper's numbers is a two-step process: run the experiment grid on Pins Face Recognition (both architectures, both scenarios, all 10 seeds) and then render the three paper LaTeX tables from the W&B-logged results using [`supreme/utils/wandb_utils/results_analysis/pins_paper_tables.ipynb`](supreme/utils/wandb_utils/results_analysis/pins_paper_tables.ipynb). The exact command, the table-rendering workflow, and the troubleshooting notes are documented in [`docs/reproducing_the_paper.md`](docs/reproducing_the_paper.md). For a runnable, step-by-step walkthrough (install → smoke test → full grid → tables → extending), see the notebook [`notebooks/reproduce_experiments.ipynb`](notebooks/reproduce_experiments.ipynb).
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## ➕ Extending SUPREME
|
|
273
|
+
|
|
274
|
+
SUPREME is pip-installable (`pip install supreme-unlearning`, imported as
|
|
275
|
+
`supreme`) and reusable as a library.
|
|
276
|
+
Register your own components from your own package - no edits to framework code:
|
|
277
|
+
|
|
278
|
+
```python
|
|
279
|
+
import supreme
|
|
280
|
+
|
|
281
|
+
supreme.register_unlearning_method("mymethod", "my_pkg.mymethod")
|
|
282
|
+
supreme.register_model("MyNet", "my_pkg.models:MyNet")
|
|
283
|
+
supreme.register_dataset("MyDS", "my_pkg.data:MyDS",
|
|
284
|
+
root="/data/myds", class_dict={"cat": 0, "dog": 1})
|
|
285
|
+
|
|
286
|
+
supreme.run_unlearning(["-method", "mymethod", "-net", "MyNet",
|
|
287
|
+
"-dataset", "MyDS", "-seed", "260"])
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
A runnable, end-to-end walkthrough from an external user's point of view -
|
|
291
|
+
`pip install supreme-unlearning` then register your own method/metric/model/dataset - is in
|
|
292
|
+
the notebook [`notebooks/custom_components.ipynb`](notebooks/custom_components.ipynb).
|
|
293
|
+
|
|
294
|
+
An installed plugin package can equivalently provide components via packaging
|
|
295
|
+
entry points (`supreme.models`, `supreme.unlearning_methods`, `supreme.metrics`,
|
|
296
|
+
`supreme.plugins`). The public API is `supreme.register_*`, `supreme.run_training`,
|
|
297
|
+
`supreme.run_unlearning`, and `supreme.project_config`; everything under
|
|
298
|
+
`supreme.utils.*` is internal.
|
|
299
|
+
|
|
300
|
+
Adding a dataset, model, method, or metric follows a consistent register-and-implement pattern. Walkthroughs and Fabric-integration rules live in [`docs/extending.md`](docs/extending.md):
|
|
301
|
+
|
|
302
|
+
| What to add | Walkthrough |
|
|
303
|
+
|---|---|
|
|
304
|
+
| New dataset | [`docs/extending.md → Adding a new dataset`](docs/extending.md#adding-a-new-dataset) |
|
|
305
|
+
| New model | [`docs/extending.md → Adding a new model`](docs/extending.md#adding-a-new-model) |
|
|
306
|
+
| New unlearning method | [`docs/extending.md → Adding a new unlearning method`](docs/extending.md#adding-a-new-unlearning-method) |
|
|
307
|
+
| New evaluation metric | [`docs/extending.md → Adding a new evaluation metric`](docs/extending.md#adding-a-new-evaluation-metric) |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 🤝 Contributing
|
|
312
|
+
|
|
313
|
+
Contributions are welcome - bug reports, new components, and documentation alike.
|
|
314
|
+
|
|
315
|
+
- **Found a bug or want a feature?** Open an issue - the
|
|
316
|
+
[bug-report and feature-request templates](.github/ISSUE_TEMPLATE) appear
|
|
317
|
+
automatically at
|
|
318
|
+
[New issue → choose a template](https://github.com/pedroandreou/supreme-unlearning/issues/new/choose).
|
|
319
|
+
- **Adding a dataset, model, method, or metric?** Most components register from
|
|
320
|
+
your own package with no framework edits - see
|
|
321
|
+
[`docs/extending.md`](docs/extending.md). You can ship it as a `pip`-installable
|
|
322
|
+
plugin or upstream it via a pull request.
|
|
323
|
+
- **Opening a pull request?** Run `make style` then `make quality` (the same
|
|
324
|
+
`ruff` lint + format checks CI runs), and follow the
|
|
325
|
+
[PR template](.github/PULL_REQUEST_TEMPLATE.md). Full workflow in the
|
|
326
|
+
[contributing guide](docs/contributing.md).
|
|
327
|
+
- **Share your method and results** in [`community/`](community/README.md) and add
|
|
328
|
+
a row to the [leaderboard](community/leaderboard.md).
|
|
329
|
+
|
|
330
|
+
CI ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)) lints, format-checks,
|
|
331
|
+
and validates the package build on every push and PR. A version tag like `v0.1.0`
|
|
332
|
+
triggers [`.github/workflows/publish.yml`](.github/workflows/publish.yml) to build
|
|
333
|
+
and publish the release to PyPI (a manual run targets TestPyPI as a dry-run), and
|
|
334
|
+
[`.github/workflows/docker.yml`](.github/workflows/docker.yml) builds the CUDA image
|
|
335
|
+
to GHCR. Notable changes per release are tracked in [`CHANGELOG.md`](CHANGELOG.md).
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## 📚 Documentation
|
|
340
|
+
|
|
341
|
+
| Document | Covers |
|
|
342
|
+
|---|---|
|
|
343
|
+
| [`docs/contributing.md`](docs/contributing.md) | How to report issues, add components, and open a pull request |
|
|
344
|
+
| [`CHANGELOG.md`](CHANGELOG.md) | Notable changes per release (Keep a Changelog / SemVer) |
|
|
345
|
+
| [`community/`](community/README.md) | Community-contributed methods, templates, and the results leaderboard |
|
|
346
|
+
| [`docs/notation.md`](docs/notation.md) | Symbol glossary - seeds, datasets, models, indices, counts |
|
|
347
|
+
| [`supreme/README.md`](supreme/README.md) | Formal algorithm specification (matched and decoupled protocols) |
|
|
348
|
+
| [`docs/environment_setup.md`](docs/environment_setup.md) | Virtual-env and Docker Dev Container setup, `.env` template, prerequisites |
|
|
349
|
+
| [`docs/reproducing_the_paper.md`](docs/reproducing_the_paper.md) | Single command for the paper's experiment grid plus the W&B-export-to-LaTeX-tables workflow |
|
|
350
|
+
| [`docs/script_arguments.md`](docs/script_arguments.md) | Full argument reference for `train_main.py` and `unlearn_main.py` |
|
|
351
|
+
| [`docs/extending.md`](docs/extending.md) | How to add new datasets, models, methods, and metrics |
|
|
352
|
+
| [`docs/tooling.md`](docs/tooling.md) | Debugger, profiler, Fabric callbacks, process tracker, split export, W&B exporter |
|
|
353
|
+
| [`docs/wandb_integration.md`](docs/wandb_integration.md) | W&B runtime behaviour: rank-0 logging, offline mode, sync workflow, metric synchronisation |
|
|
354
|
+
| [`docs/wandb_fields.md`](docs/wandb_fields.md) | Paper-to-W&B metric mapping and per-metric field paths |
|
|
355
|
+
| [`docs/implementation_notes.md`](docs/implementation_notes.md) | Distributed strategies, gradient handling, batch-size scaling, memory, known limitations |
|
|
356
|
+
| [`docs/adding_pinsfacerecognition.md`](docs/adding_pinsfacerecognition.md) | Manual Kaggle download for the Pins Face Recognition dataset |
|
|
357
|
+
| [`docs/future_work.md`](docs/future_work.md) | Planned extensions |
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## 📝 Citing this work
|
|
362
|
+
|
|
363
|
+
```bibtex
|
|
364
|
+
@misc{supreme2026,
|
|
365
|
+
title = {SUPREME: Standardised Unlearning Platform for REproducible Method Evaluation},
|
|
366
|
+
author = {Petros Andreou, Jamie Lanyon, Axel Finke, Georgina Cosma},
|
|
367
|
+
year = {2026},
|
|
368
|
+
eprint = {2606.00380},
|
|
369
|
+
archivePrefix = {arXiv},
|
|
370
|
+
primaryClass = {cs.LG},
|
|
371
|
+
url = {https://arxiv.org/abs/2606.00380}
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
This work was conducted at [Loughborough University](https://www.lboro.ac.uk/).
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## 📄 License
|
|
380
|
+
|
|
381
|
+
Released under the [MIT License](LICENSE).
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## ⭐ Star History
|
|
386
|
+
|
|
387
|
+
<a href="https://star-history.com/#pedroandreou/supreme-unlearning&Date">
|
|
388
|
+
<picture>
|
|
389
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pedroandreou/supreme-unlearning&type=Date&theme=dark" />
|
|
390
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=pedroandreou/supreme-unlearning&type=Date" />
|
|
391
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=pedroandreou/supreme-unlearning&type=Date" />
|
|
392
|
+
</picture>
|
|
393
|
+
</a>
|