# nunnajaswant-ship-it/skinshield architecture

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

- Interactive diagram: https://gitdiagram.com/nunnajaswant-ship-it/skinshield
- Repository: https://github.com/nunnajaswant-ship-it/skinshield

## Overview

SkinShield is documented as an offline, multimodal skin-triage device, but this repository primarily contains dataset and model research scripts—not an end-to-end device inference application. The documented user workflow combines a lesion image, symptom text, and sensor readings; conditions the inputs; runs a contagion gate before disease identification; and provides referral guidance. The graph also shows the implemented research stages and ONNX export. Device and dashboard capabilities are README-documented; their implementation is not present in the sampled source.

Main entry points: [`hardware`](https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware) (Edge inference runtime), [`codes/train_dermlip.py`](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/train_dermlip.py) (DermLIP training), [`codes/curate_derm1m.py`](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/curate_derm1m.py) (Derm1M curation), [`codes/export_onnx.py`](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/export_onnx.py) (ONNX export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dataset["Dataset preparation"]
  node_curation["Derm1M curation<br/>[curate_derm1m.py]"]
  node_class_verify["Class verification"]
end

subgraph group_research["Model research"]
  node_training["DermLIP training<br/>[train_dermlip.py]"]
  node_gate["Contagion gate<br/>[stage1_gate.py]"]
  node_gate_report["Gate evaluation<br/>[stage1_report.py]"]
  node_disease_id["Disease identification"]
  node_deleak["Caption de-leaking<br/>[stage2_deleak.py]"]
  node_trimodal["Trimodal evaluation"]
  node_zero_shot["Zero-shot breadth"]
  node_queue["Research queue<br/>[run_queue.py]"]
end

subgraph group_deployment["Edge deployment"]
  node_onnx["ONNX export<br/>[export_onnx.py]"]
  node_edge_runtime["Edge inference runtime"]
end

subgraph group_device["Triage device"]
  node_capture["Multimodal input"]
  node_sensor_dashboard["Sensor dashboard"]
  node_referral["Triage and referral<br/>[README.md]"]
end

node_user(("Patient or worker"))
node_derm1m[("Derm1M source")]
node_artifacts["Research artifacts"]

node_user -.->|"provides inputs"| node_capture
node_capture -.->|"feeds sensor readings"| node_sensor_dashboard
node_sensor_dashboard -.->|"supplies sensor data"| node_edge_runtime
node_user -.->|"provides image and text"| node_edge_runtime
node_edge_runtime -.->|"produces guidance"| node_referral
node_derm1m -.->|"provides metadata"| node_class_verify
node_derm1m -.->|"provides images and labels"| node_curation
node_curation -->|"prepares training data"| node_training
node_training -.->|"writes model outputs"| node_artifacts
node_gate -->|"writes gate features"| node_artifacts
node_gate_report -->|"reads cached features"| node_artifacts
node_disease_id -->|"writes feature caches"| node_artifacts
node_deleak -->|"writes clean features"| node_artifacts
node_trimodal -->|"reads clean features"| node_artifacts
node_zero_shot -->|"writes evaluation results"| node_artifacts
node_queue -->|"writes queue results"| node_artifacts
node_training -->|"supplies model components"| node_onnx
node_onnx -.->|"exports inference graphs"| node_edge_runtime
node_edge_runtime -.->|"routes triage outcome"| node_referral

click node_capture "https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware"
click node_sensor_dashboard "https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware"
click node_curation "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/curate_derm1m.py"
click node_class_verify "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/g1_verify_classes.py"
click node_training "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/train_dermlip.py"
click node_gate "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage1_gate.py"
click node_gate_report "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage1_report.py"
click node_disease_id "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2_disease_id.py"
click node_deleak "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2_deleak.py"
click node_trimodal "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2plus_trimodal.py"
click node_zero_shot "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/zeroshot_breadth.py"
click node_queue "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/run_queue.py"
click node_onnx "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/export_onnx.py"
click node_edge_runtime "https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware"
click node_referral "https://github.com/nunnajaswant-ship-it/skinshield/blob/main/README.md"

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_curation,node_class_verify toneBlue
class node_training,node_gate,node_gate_report,node_disease_id,node_deleak,node_trimodal,node_zero_shot,node_queue,node_derm1m toneAmber
class node_onnx,node_edge_runtime toneMint
class node_capture,node_sensor_dashboard,node_referral,node_user toneRose
class node_artifacts toneIndigo
```

## Components

### Dataset preparation

- [Derm1M curation](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/curate_derm1m.py): `codes/curate_derm1m.py`
- [Class verification](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/g1_verify_classes.py): `codes/g1_verify_classes.py`

### Model research

- [DermLIP training](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/train_dermlip.py): `codes/train_dermlip.py`
- [Contagion gate](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage1_gate.py): `codes/stage1_gate.py`
- [Gate evaluation](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage1_report.py): `codes/stage1_report.py`
- [Disease identification](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2_disease_id.py): `codes/stage2_disease_id.py`
- [Caption de-leaking](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2_deleak.py): `codes/stage2_deleak.py`
- [Trimodal evaluation](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/stage2plus_trimodal.py): `codes/stage2plus_trimodal.py`
- [Zero-shot breadth](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/zeroshot_breadth.py): `codes/zeroshot_breadth.py`
- [Research queue](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/run_queue.py): `codes/run_queue.py`

### Edge deployment

- [ONNX export](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/codes/export_onnx.py): `codes/export_onnx.py`
- [Edge inference runtime](https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware): `hardware`

### Triage device

- [Multimodal input](https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware): `hardware`
- [Sensor dashboard](https://github.com/nunnajaswant-ship-it/skinshield/tree/main/hardware): `hardware`
- [Triage and referral](https://github.com/nunnajaswant-ship-it/skinshield/blob/main/README.md): `README.md`

### Other components

- **Patient or worker**
- **Derm1M source**
- **Research artifacts**

## Connections

- Patient or worker → Multimodal input: provides inputs (evidence: `README.md`)
- Multimodal input → Sensor dashboard: feeds sensor readings (evidence: `README.md`)
- Sensor dashboard → Edge inference runtime: supplies sensor data (evidence: `README.md`)
- Patient or worker → Edge inference runtime: provides image and text (evidence: `README.md`)
- Edge inference runtime → Triage and referral: produces guidance (evidence: `README.md`)
- Derm1M source → Class verification: provides metadata (evidence: `codes/g1_verify_classes.py`)
- Derm1M source → Derm1M curation: provides images and labels (evidence: `codes/curate_derm1m.py`)
- Derm1M curation → DermLIP training: prepares training data (evidence: `codes/train_dermlip.py`)
- DermLIP training → Research artifacts: writes model outputs (evidence: `README.md`)
- Contagion gate → Research artifacts: writes gate features (evidence: `codes/stage1_gate.py`)
- Gate evaluation → Research artifacts: reads cached features (evidence: `codes/stage1_report.py`)
- Disease identification → Research artifacts: writes feature caches (evidence: `codes/stage2_disease_id.py`)
- Caption de-leaking → Research artifacts: writes clean features (evidence: `codes/stage2_deleak.py`)
- Trimodal evaluation → Research artifacts: reads clean features (evidence: `codes/stage2plus_trimodal.py`)
- Zero-shot breadth → Research artifacts: writes evaluation results (evidence: `codes/zeroshot_breadth.py`)
- Research queue → Research artifacts: writes queue results (evidence: `codes/run_queue.py`)
- DermLIP training → ONNX export: supplies model components (evidence: `codes/export_onnx.py`)
- ONNX export → Edge inference runtime: exports inference graphs (evidence: `README.md`)
- Edge inference runtime → Triage and referral: routes triage outcome (evidence: `README.md`)
