File size: 3,821 Bytes
0becf23
 
 
 
 
 
 
 
 
79f64ed
0becf23
 
79f64ed
 
 
 
 
 
 
54884d0
79f64ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23dc95b
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
title: UnlearningComparator
emoji: ๐Ÿข
colorFrom: indigo
colorTo: blue
sdk: static
pinned: false
license: mit
short_description: Machine Unlearning Visual Playground
thumbnail: img/teaser.gif  # ์ธ๋„ค์ผ์„ ์œ„ํ•ด ์ด ์ค„์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. (2๋ฒˆ ํ•ญ๋ชฉ ์ฐธ๊ณ )
---

# ๐Ÿงน Machine Unlearning Comparator
*Under review* ย 

![Teaser Animation](https://raw.githubusercontent.com/gnueaj/machine-unlearning-comparator/main/img/teaser.gif)

Machine Unlearning Comparator is a **web-based visual-analytics toolkit** for **seeing, testing, and comparing** how unlearning methods balance the three MU principlesโ€”**accuracy, efficiency, and privacy**โ€”from class- to layer-level detail.

![Unlearning Comparator Workflow](https://raw.githubusercontent.com/gnueaj/machine-unlearning-comparator/main/img/fig_workflow_github.png)

---

## ๐Ÿ”— Demo & Video

- **Live demo** โ†’ [Machine Unlearning Comparator](https://gnueaj.github.io/Machine-Unlearning-Comparator/) ย 
- **5-min overview** โ†’ [Youtube](https://youtu.be/yAyAYp2msDk?si=Q-8IgVlrk8uSBceu)
ย  
---

## ๐Ÿš€ Why use the Comparator?

| Pain Point | How the Comparator helps |
|------------|--------------------------|
| Fragmented evaluations | **One workflow โ€” Build โ†’ Screen โ†’ Contrast โ†’ Attack** โ€” keeps every run tidy and repeatable. |
| Raw numbers hide behavior | Combine metrics & visuals: **Class-wise Accuracy chart, Prediction Matrix, Embedding Space, Layer-wise Similarity chart**. |
| "Did it really forget?" | Built-in **membership-inference attacks** and an aggregated **privacy score** reveal lingering signals. |
| Baselines vary by paper | Compare against **standard baselines** or plug in your own method via two Python hooks. |

---

## โœจ Key Features

### Multi-Level Comparison
* **Metrics View** โ€“ follow Unlearning/Retaining Accuracy, Run Time (RT), and the worst-case privacy score in one glance. ย 
* **Embedding Space** โ€“ twin UMAPs show how feature clusters shift after unlearning. ย 
* **Layer-wise Similarity** โ€“ CKA curves pinpoint layers that still encode the forget class. ย 
* **Attack Simulation** โ€“ sweep thresholds, flag high-risk samples, and inspect logits interactively.

### Built-in Baselines
| Method | Idea (aligned with the paper) |
|--------|------------------------------|
| **Fine-Tuning (FT)** | Continue training on the **retain set** only, leveraging catastrophic forgetting of the forget set. |
| **Gradient Ascent (GA)** | Update weights to **maximize loss** on the forget set, actively "unteaching" it. |
| **Random Labeling (RL)** | Assign **random labels** to the forget set then fine-tune, so the model treats those samples as noise. |
| **SCRUB** | Use **knowledge distillation** with selective forgetting, preserving important parameters while removing forget class information. |
| **SalUn** | Apply **gradient saliency masking** to selectively update weights based on their importance for the forget class. |

### Custom Method API
Add your algorithm, register it, and the UI will automatically expose metrics, embeddings, and privacy attacks.

---

## โšก Quick Start

### Backend
\`\`\`bash
# 1 Install deps & enter env
hatch shell
# 2 Run the API
hatch run start
\`\`\`

### Frontend
\`\`\`bash
# 1 Install deps
pnpm install
# 2 Launch the UI
pnpm start
\`\`\`

---

## Related Resources
- **ResNet-18 CIFAR-10 MU checkpoints** โ†’ <https://huggingface.co/jaeunglee/resnet18-cifar10-unlearning>
- **ResNet-18 FashionMNIST MU checkpoints** โ†’ <https://huggingface.co/Yurim0507/resnet18-fashionmnist-unlearning>
- **ViT-Base CIFAR-10 MU checkpoints** โ†’ <https://huggingface.co/Yurim0507/vit-base-16-cifar10-unlearning>

## ๐Ÿ“„ Paper
[Unlearning Comparator: A Visual Analytics System for Comparative Evaluation of Machine Unlearning Methods](https://arxiv.org/abs/2508.12730)