# yadavdevam481-ops/dermassit-gen architecture

> Architecture diagram of the GitHub repository yadavdevam481-ops/dermassit-gen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yadavdevam481-ops/dermassit-gen
- Repository: https://github.com/yadavdevam481-ops/dermassit-gen

## Overview

DermAssist-GEN is a research workflow for preparing HAM10000 data, training and evaluating a seven-class skin-lesion image classifier, and producing/evaluating synthetic dermoscopy images with conditional GAN or Stable Diffusion LoRA models. The demo exposes classification and generation guidance; it does not implement the README’s claimed treatment prescription, and its generation tab does not generate images itself. Paths follow the supplied flat tree; model and dataset internals are represented only where sampled source supports them.

Main entry points: [`train_classifier.py`](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_classifier.py) (Classifier training), [`evaluate_classifier.py`](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/evaluate_classifier.py) (Classifier evaluation), [`classifier.py`](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/classifier.py) (EfficientNet classifier), [`prepare_ham10000.py`](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/prepare_ham10000.py) (Dataset preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["HAM10000 data"]
  node_indexing["Dataset preparation"]
  node_index["Split image index"]
  node_dataset["Dermoscopy dataset<br/>[dataset.py]"]
end

subgraph group_classification["Image classification"]
  node_classifier["EfficientNet classifier<br/>[classifier.py]"]
  node_losses["Training losses<br/>[losses.py]"]
  node_classifier_train["Classifier training"]
  node_demo["Research demo<br/>[app.py]"]
end

subgraph group_synthesis["Image synthesis"]
  node_gan_train["Conditional GAN training<br/>[train_gan.py]"]
  node_gan_model["Conditional GAN<br/>[cgan.py]"]
  node_gan_generate["GAN image generation<br/>[generate_gan.py]"]
  node_diff_train["LoRA training"]
  node_diff_generate["Diffusion generation"]
  node_synthetic["Synthetic images"]
end

subgraph group_evaluation["Research evaluation"]
  node_classifier_eval["Classifier evaluation"]
  node_metrics["Classification metrics<br/>[metrics.py]"]
  node_generation_eval["Generation evaluation"]
end

node_researcher(("Researcher"))
node_ham["HAM10000 files"]
node_base_model["Stable Diffusion model"]
node_real_images["Real image set"]

node_researcher -->|"provides metadata"| node_indexing
node_ham -->|"provides images"| node_indexing
node_indexing -->|"writes splits"| node_index
node_index -->|"indexes images"| node_dataset
node_dataset -->|"loads batches"| node_classifier_train
node_classifier_train -->|"trains"| node_classifier
node_classifier_train -->|"uses"| node_losses
node_classifier_train -->|"scores validation"| node_metrics
node_researcher -->|"uploads image"| node_demo
node_demo -->|"classifies"| node_classifier
node_classifier -->|"returns probabilities"| node_demo
node_index -->|"indexes training images"| node_gan_train
node_gan_train -->|"trains"| node_gan_model
node_gan_generate -->|"loads checkpoint"| node_gan_model
node_gan_generate -->|"writes images"| node_synthetic
node_index -->|"indexes training images"| node_diff_train
node_ham -->|"supplies image files"| node_diff_train
node_base_model -.->|"provides pretrained weights"| node_diff_train
node_diff_generate -.->|"loads pretrained pipeline"| node_base_model
node_diff_generate -->|"writes images"| node_synthetic
node_synthetic -.->|"augments training data"| node_dataset
node_researcher -->|"requests evaluation"| node_classifier_eval
node_index -->|"indexes evaluation images"| node_classifier_eval
node_classifier_eval -->|"loads checkpoint"| node_classifier
node_classifier_eval -->|"computes metrics"| node_metrics
node_researcher -->|"requests evaluation"| node_generation_eval
node_real_images -->|"provides reference images"| node_generation_eval
node_synthetic -->|"provides generated images"| node_generation_eval

click node_indexing "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/prepare_ham10000.py"
click node_dataset "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/dataset.py"
click node_classifier "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/classifier.py"
click node_losses "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/losses.py"
click node_classifier_train "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_classifier.py"
click node_demo "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/app.py"
click node_gan_train "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_gan.py"
click node_gan_model "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/cgan.py"
click node_gan_generate "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/generate_gan.py"
click node_diff_train "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_diffusion_lora.py"
click node_diff_generate "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/generate_diffusion.py"
click node_classifier_eval "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/evaluate_classifier.py"
click node_metrics "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/metrics.py"
click node_generation_eval "https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/evaluate_generation.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_indexing,node_index,node_dataset toneBlue
class node_classifier,node_losses,node_classifier_train,node_demo toneAmber
class node_gan_train,node_gan_model,node_gan_generate,node_diff_train,node_diff_generate,node_synthetic toneMint
class node_classifier_eval,node_metrics,node_generation_eval toneRose
class node_researcher,node_ham,node_base_model,node_real_images toneIndigo
```

## Components

### HAM10000 data

- [Dataset preparation](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/prepare_ham10000.py): `prepare_ham10000.py`
- **Split image index**
- [Dermoscopy dataset](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/dataset.py): `dataset.py`

### Image classification

- [EfficientNet classifier](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/classifier.py): `classifier.py`
- [Training losses](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/losses.py): `losses.py`
- [Classifier training](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_classifier.py): `train_classifier.py`
- [Research demo](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/app.py): `app.py`

### Image synthesis

- [Conditional GAN training](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_gan.py): `train_gan.py`
- [Conditional GAN](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/cgan.py): `cgan.py`
- [GAN image generation](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/generate_gan.py): `generate_gan.py`
- [LoRA training](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/train_diffusion_lora.py): `train_diffusion_lora.py`
- [Diffusion generation](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/generate_diffusion.py): `generate_diffusion.py`
- **Synthetic images**

### Research evaluation

- [Classifier evaluation](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/evaluate_classifier.py): `evaluate_classifier.py`
- [Classification metrics](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/metrics.py): `metrics.py`
- [Generation evaluation](https://github.com/yadavdevam481-ops/dermassit-gen/blob/main/evaluate_generation.py): `evaluate_generation.py`

### Other components

- **Researcher**
- **HAM10000 files**
- **Stable Diffusion model**
- **Real image set**

## Connections

- Researcher → Dataset preparation: provides metadata
- HAM10000 files → Dataset preparation: provides images
- Dataset preparation → Split image index: writes splits
- Split image index → Dermoscopy dataset: indexes images
- Dermoscopy dataset → Classifier training: loads batches
- Classifier training → EfficientNet classifier: trains
- Classifier training → Training losses: uses
- Classifier training → Classification metrics: scores validation
- Researcher → Research demo: uploads image
- Research demo → EfficientNet classifier: classifies
- EfficientNet classifier → Research demo: returns probabilities
- Split image index → Conditional GAN training: indexes training images
- Conditional GAN training → Conditional GAN: trains
- GAN image generation → Conditional GAN: loads checkpoint
- GAN image generation → Synthetic images: writes images
- Split image index → LoRA training: indexes training images
- HAM10000 files → LoRA training: supplies image files
- Stable Diffusion model → LoRA training: provides pretrained weights
- Diffusion generation → Stable Diffusion model: loads pretrained pipeline
- Diffusion generation → Synthetic images: writes images
- Synthetic images → Dermoscopy dataset: augments training data
- Researcher → Classifier evaluation: requests evaluation
- Split image index → Classifier evaluation: indexes evaluation images
- Classifier evaluation → EfficientNet classifier: loads checkpoint
- Classifier evaluation → Classification metrics: computes metrics
- Researcher → Generation evaluation: requests evaluation
- Real image set → Generation evaluation: provides reference images
- Synthetic images → Generation evaluation: provides generated images
