# sisl-uri/deepcurer architecture

> Architecture diagram of the GitHub repository sisl-uri/deepcurer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sisl-uri/deepcurer
- Repository: https://github.com/sisl-uri/deepcurer

## Overview

DeepCurer is a research workflow for creating backdoored classifiers and mitigating them with adversarial proxies and progressive neuron pruning. The principal path is: prepare data, poison and train a model, detect the target label and generate proxy examples, rank batch-normalization neurons, then prune while tracking clean accuracy and attack success. The README documents the workflow and supported attacks/datasets; source excerpts show key calls and implementations. Some orchestration is unsampled, so links supported only by the source index are identified as such through their evidence path.

Main entry points: [`deepcurer.py`](https://github.com/sisl-uri/deepcurer/blob/main/deepcurer.py) (DeepCurer orchestration), [`backdoor_training.py`](https://github.com/sisl-uri/deepcurer/blob/main/backdoor_training.py) (Backdoor training), [`pruning.py`](https://github.com/sisl-uri/deepcurer/blob/main/pruning.py) (Progressive pruning), [`train_test.py`](https://github.com/sisl-uri/deepcurer/blob/main/train_test.py) (Model evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_cifar_prep["CIFAR preparation<br/>[cifar10.py]"]
  node_dataset[("Image datasets")]
end

subgraph group_attack["Attack training"]
  node_trigger_ops["Attack triggers"]
  node_poison_data["Poisoned datasets"]
  node_training["Backdoor training"]
end

subgraph group_defense["DeepCurer defense"]
  node_defense_run["DeepCurer orchestration<br/>[deepcurer.py]"]
  node_proxy_gen["Adversarial proxies"]
  node_proxy_data[("Proxy dataset")]
  node_neuron_rank["Neuron ranking<br/>[pruning_only.py]"]
  node_progressive_prune["Progressive pruning<br/>[pruning.py]"]
  node_prune_only["Pruning routines<br/>[pruning_only.py]"]
  node_mitigated_model["Sanitized model"]
end

subgraph group_models["Model and evaluation"]
  node_classifier["ResNet models<br/>[resnet.py]"]
  node_vgg_model["VGG model<br/>[vgg.py]"]
  node_checkpoint["Model checkpoint"]
  node_evaluation["Model evaluation<br/>[train_test.py]"]
end

node_engineer(("Research user"))

node_engineer -->|"prepares data"| node_cifar_prep
node_cifar_prep -->|"organizes CIFAR-10"| node_dataset
node_engineer -->|"trains attack"| node_training
node_training -->|"selects trigger"| node_trigger_ops
node_training -->|"builds poisoned data"| node_poison_data
node_training -.->|"loads dataset"| node_dataset
node_training -.->|"constructs classifier"| node_classifier
node_training -.->|"supports architecture"| node_vgg_model
node_training -->|"saves checkpoint"| node_checkpoint
node_engineer -->|"runs defense"| node_defense_run
node_defense_run -->|"loads checkpoint"| node_checkpoint
node_defense_run -->|"generates proxies"| node_proxy_gen
node_defense_run -.->|"uses attack trigger"| node_trigger_ops
node_defense_run -->|"builds test data"| node_poison_data
node_defense_run -->|"creates proxy set"| node_proxy_data
node_defense_run -->|"requests ranking"| node_neuron_rank
node_neuron_rank -->|"measures effects"| node_evaluation
node_defense_run -.->|"runs pruning"| node_progressive_prune
node_progressive_prune -->|"evaluates candidates"| node_evaluation
node_progressive_prune -.->|"produces model"| node_mitigated_model
node_defense_run -.->|"tests classifier"| node_evaluation

click node_cifar_prep "https://github.com/sisl-uri/deepcurer/blob/main/cifar10.py"
click node_trigger_ops "https://github.com/sisl-uri/deepcurer/blob/main/backdoor_triggers.py"
click node_poison_data "https://github.com/sisl-uri/deepcurer/blob/main/poison_dataset_generator.py"
click node_training "https://github.com/sisl-uri/deepcurer/blob/main/backdoor_training.py"
click node_classifier "https://github.com/sisl-uri/deepcurer/blob/main/resnet.py"
click node_vgg_model "https://github.com/sisl-uri/deepcurer/blob/main/vgg.py"
click node_defense_run "https://github.com/sisl-uri/deepcurer/blob/main/deepcurer.py"
click node_proxy_gen "https://github.com/sisl-uri/deepcurer/blob/main/generating_adverserial_examples.py"
click node_neuron_rank "https://github.com/sisl-uri/deepcurer/blob/main/pruning_only.py"
click node_progressive_prune "https://github.com/sisl-uri/deepcurer/blob/main/pruning.py"
click node_prune_only "https://github.com/sisl-uri/deepcurer/blob/main/pruning_only.py"
click node_evaluation "https://github.com/sisl-uri/deepcurer/blob/main/train_test.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_cifar_prep,node_dataset,node_engineer toneBlue
class node_trigger_ops,node_poison_data,node_training toneAmber
class node_defense_run,node_proxy_gen,node_proxy_data,node_neuron_rank,node_progressive_prune,node_prune_only,node_mitigated_model toneMint
class node_classifier,node_vgg_model,node_checkpoint,node_evaluation toneRose
```

## Components

### Data preparation

- [CIFAR preparation](https://github.com/sisl-uri/deepcurer/blob/main/cifar10.py): `cifar10.py`
- **Image datasets**

### Attack training

- [Attack triggers](https://github.com/sisl-uri/deepcurer/blob/main/backdoor_triggers.py): `backdoor_triggers.py`
- [Poisoned datasets](https://github.com/sisl-uri/deepcurer/blob/main/poison_dataset_generator.py): `poison_dataset_generator.py`
- [Backdoor training](https://github.com/sisl-uri/deepcurer/blob/main/backdoor_training.py): `backdoor_training.py`

### DeepCurer defense

- [DeepCurer orchestration](https://github.com/sisl-uri/deepcurer/blob/main/deepcurer.py): `deepcurer.py`
- [Adversarial proxies](https://github.com/sisl-uri/deepcurer/blob/main/generating_adverserial_examples.py): `generating_adverserial_examples.py`
- **Proxy dataset**
- [Neuron ranking](https://github.com/sisl-uri/deepcurer/blob/main/pruning_only.py): `pruning_only.py`
- [Progressive pruning](https://github.com/sisl-uri/deepcurer/blob/main/pruning.py): `pruning.py`
- [Pruning routines](https://github.com/sisl-uri/deepcurer/blob/main/pruning_only.py): `pruning_only.py`
- **Sanitized model**

### Model and evaluation

- [ResNet models](https://github.com/sisl-uri/deepcurer/blob/main/resnet.py): `resnet.py`
- [VGG model](https://github.com/sisl-uri/deepcurer/blob/main/vgg.py): `vgg.py`
- **Model checkpoint**
- [Model evaluation](https://github.com/sisl-uri/deepcurer/blob/main/train_test.py): `train_test.py`

### Other components

- **Research user**

## Connections

- Research user → CIFAR preparation: prepares data (evidence: `README.md`)
- CIFAR preparation → Image datasets: organizes CIFAR-10 (evidence: `cifar10.py`)
- Research user → Backdoor training: trains attack (evidence: `README.md`)
- Backdoor training → Attack triggers: selects trigger (evidence: `backdoor_training.py`)
- Backdoor training → Poisoned datasets: builds poisoned data (evidence: `backdoor_training.py`)
- Backdoor training → Image datasets: loads dataset
- Backdoor training → ResNet models: constructs classifier (evidence: `backdoor_training.py`)
- Backdoor training → VGG model: supports architecture (evidence: `backdoor_training.py`)
- Backdoor training → Model checkpoint: saves checkpoint (evidence: `README.md`)
- Research user → DeepCurer orchestration: runs defense (evidence: `README.md`)
- DeepCurer orchestration → Model checkpoint: loads checkpoint (evidence: `deepcurer.py`)
- DeepCurer orchestration → Adversarial proxies: generates proxies (evidence: `deepcurer.py`)
- DeepCurer orchestration → Attack triggers: uses attack trigger (evidence: `deepcurer.py`)
- DeepCurer orchestration → Poisoned datasets: builds test data (evidence: `deepcurer.py`)
- DeepCurer orchestration → Proxy dataset: creates proxy set (evidence: `README.md`)
- DeepCurer orchestration → Neuron ranking: requests ranking (evidence: `deepcurer.py`)
- Neuron ranking → Model evaluation: measures effects (evidence: `pruning_only.py`)
- DeepCurer orchestration → Progressive pruning: runs pruning (evidence: `deepcurer.py`)
- Progressive pruning → Model evaluation: evaluates candidates (evidence: `pruning.py`)
- Progressive pruning → Sanitized model: produces model
- DeepCurer orchestration → Model evaluation: tests classifier (evidence: `deepcurer.py`)
