# pp-00-pp/machine-unlearning-trustworthy-ai architecture

> Architecture diagram of the GitHub repository pp-00-pp/machine-unlearning-trustworthy-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pp-00-pp/machine-unlearning-trustworthy-ai
- Repository: https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai

## Overview

This repository is a CIFAR-10 machine-unlearning experiment, not a general-purpose application. Researchers create a controlled forget set, train comparison models, apply NegGrad+ to an original model, evaluate forgetting and retained utility, then compare results against retraining and visualize trade-offs. The scripts are standalone; the excerpts show artifact reads and writes in some stages, but not a complete invocation pipeline, so unverified handoffs are omitted or marked dashed.

Main entry points: [`results`](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/tree/main/results) (Experiment artifacts), [`src/unlearn_neggrad_plus.py`](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/unlearn_neggrad_plus.py) (NegGrad+ unlearning), [`src/create_corruption.py`](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/create_corruption.py) (Create corruption), [`src/evaluate_original.py`](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_original.py) (Original evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_corruption["Create corruption"]
end

subgraph group_models["Model experiments"]
  node_baseline["Baseline training<br/>[train_baseline.py]"]
  node_corrupted_train["Corrupted training<br/>[train_corrupted.py]"]
  node_retraining["Reference retraining<br/>[train_retrained.py]"]
  node_unlearning["NegGrad+ unlearning"]
end

subgraph group_evaluation["Evaluation and comparison"]
  node_eval_original["Original evaluation"]
  node_eval_unlearned["Unlearned evaluation"]
  node_eval_retrained["Reference evaluation"]
  node_model_compare["Behavior comparison<br/>[compare_models.py]"]
end

subgraph group_reporting["Results and reporting"]
  node_artifact_store[("Experiment artifacts")]
  node_summary["Result summary"]
  node_plots["Trade-off plots<br/>[plot_results.py]"]
end

node_researcher(("Researcher"))
node_cifar[("CIFAR-10")]

node_researcher -->|"runs experiment"| node_corruption
node_researcher -->|"runs experiment"| node_baseline
node_researcher -->|"runs experiment"| node_corrupted_train
node_researcher -->|"runs experiment"| node_retraining
node_researcher -->|"runs experiment"| node_unlearning
node_cifar -->|"provides labels"| node_corruption
node_corruption -->|"writes forget data"| node_artifact_store
node_cifar -->|"provides dataset"| node_corrupted_train
node_cifar -->|"provides dataset"| node_retraining
node_artifact_store -->|"supplies forget data"| node_unlearning
node_artifact_store -->|"supplies original model"| node_unlearning
node_unlearning -->|"writes model and metrics"| node_artifact_store
node_cifar -->|"provides evaluation data"| node_eval_original
node_cifar -->|"provides evaluation data"| node_eval_unlearned
node_cifar -->|"provides evaluation data"| node_eval_retrained
node_eval_original -->|"writes evaluation"| node_artifact_store
node_eval_unlearned -->|"writes evaluation"| node_artifact_store
node_eval_retrained -->|"writes evaluation"| node_artifact_store
node_artifact_store -.->|"supplies model outputs"| node_model_compare
node_model_compare -->|"writes comparison"| node_artifact_store
node_artifact_store -->|"supplies results"| node_summary
node_artifact_store -.->|"supplies plotted values"| node_plots
node_summary -->|"reports findings"| node_researcher
node_plots -->|"visualizes trade-offs"| node_researcher

click node_corruption "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/create_corruption.py"
click node_artifact_store "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/tree/main/results"
click node_baseline "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_baseline.py"
click node_corrupted_train "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_corrupted.py"
click node_retraining "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_retrained.py"
click node_unlearning "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/unlearn_neggrad_plus.py"
click node_eval_original "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_original.py"
click node_eval_unlearned "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_unlearned.py"
click node_eval_retrained "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_retrained.py"
click node_model_compare "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/compare_models.py"
click node_summary "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/summarize_results.py"
click node_plots "https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/plot_results.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_corruption toneBlue
class node_baseline,node_corrupted_train,node_retraining,node_unlearning,node_cifar toneAmber
class node_eval_original,node_eval_unlearned,node_eval_retrained,node_model_compare toneMint
class node_artifact_store,node_summary,node_plots toneRose
class node_researcher toneIndigo
```

## Components

### Data preparation

- [Create corruption](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/create_corruption.py): `src/create_corruption.py`

### Model experiments

- [Baseline training](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_baseline.py): `src/train_baseline.py`
- [Corrupted training](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_corrupted.py): `src/train_corrupted.py`
- [Reference retraining](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/train_retrained.py): `src/train_retrained.py`
- [NegGrad+ unlearning](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/unlearn_neggrad_plus.py): `src/unlearn_neggrad_plus.py`

### Evaluation and comparison

- [Original evaluation](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_original.py): `src/evaluate_original.py`
- [Unlearned evaluation](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_unlearned.py): `src/evaluate_unlearned.py`
- [Reference evaluation](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/evaluate_retrained.py): `src/evaluate_retrained.py`
- [Behavior comparison](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/compare_models.py): `src/compare_models.py`

### Results and reporting

- [Experiment artifacts](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/tree/main/results): `results`
- [Result summary](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/summarize_results.py): `src/summarize_results.py`
- [Trade-off plots](https://github.com/pp-00-pp/machine-unlearning-trustworthy-ai/blob/main/src/plot_results.py): `src/plot_results.py`

### Other components

- **Researcher**
- **CIFAR-10**

## Connections

- Researcher → Create corruption: runs experiment (evidence: `README.md`)
- Researcher → Baseline training: runs experiment (evidence: `README.md`)
- Researcher → Corrupted training: runs experiment (evidence: `README.md`)
- Researcher → Reference retraining: runs experiment (evidence: `README.md`)
- Researcher → NegGrad+ unlearning: runs experiment (evidence: `README.md`)
- CIFAR-10 → Create corruption: provides labels (evidence: `src/create_corruption.py`)
- Create corruption → Experiment artifacts: writes forget data (evidence: `src/create_corruption.py`)
- CIFAR-10 → Corrupted training: provides dataset (evidence: `src/train_corrupted.py`)
- CIFAR-10 → Reference retraining: provides dataset (evidence: `src/train_retrained.py`)
- Experiment artifacts → NegGrad+ unlearning: supplies forget data (evidence: `src/unlearn_neggrad_plus.py`)
- Experiment artifacts → NegGrad+ unlearning: supplies original model (evidence: `src/unlearn_neggrad_plus.py`)
- NegGrad+ unlearning → Experiment artifacts: writes model and metrics (evidence: `src/unlearn_neggrad_plus.py`)
- CIFAR-10 → Original evaluation: provides evaluation data (evidence: `src/evaluate_original.py`)
- CIFAR-10 → Unlearned evaluation: provides evaluation data (evidence: `src/evaluate_unlearned.py`)
- CIFAR-10 → Reference evaluation: provides evaluation data (evidence: `src/evaluate_retrained.py`)
- Original evaluation → Experiment artifacts: writes evaluation (evidence: `src/evaluate_original.py`)
- Unlearned evaluation → Experiment artifacts: writes evaluation (evidence: `src/evaluate_unlearned.py`)
- Reference evaluation → Experiment artifacts: writes evaluation (evidence: `src/evaluate_retrained.py`)
- Experiment artifacts → Behavior comparison: supplies model outputs
- Behavior comparison → Experiment artifacts: writes comparison (evidence: `src/compare_models.py`)
- Experiment artifacts → Result summary: supplies results (evidence: `src/summarize_results.py`)
- Experiment artifacts → Trade-off plots: supplies plotted values
- Result summary → Researcher: reports findings (evidence: `README.md`)
- Trade-off plots → Researcher: visualizes trade-offs (evidence: `README.md`)
