# atplab-lums/wave-gms architecture

> Architecture diagram of the GitHub repository atplab-lums/wave-gms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atplab-lums/wave-gms
- Repository: https://github.com/atplab-lums/wave-gms

## Overview

Wave-GMS is a medical-image segmentation research repository. Its documented workflow prepares image/mask datasets, trains a multi-resolution encoder and latent-mapping model with Tiny-VAE latent alignment, then produces segmentation masks and metrics at inference. The supplied tree contains the dataset loader, configuration files, and utility modules, but not the training, inference, or model implementation directories described by the README. Those capabilities are shown as documented components with unknown paths; their internal call relationships cannot be verified here.

Main entry points: [`data/image_dataset.py`](https://github.com/atplab-lums/wave-gms/blob/main/data/image_dataset.py) (Image dataset loader), [`utils/instantiate_model.py`](https://github.com/atplab-lums/wave-gms/blob/main/utils/instantiate_model.py) (VAE factory), [`configs`](https://github.com/atplab-lums/wave-gms/tree/main/configs) (Dataset configs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset input"]
  node_dataset_files["Image and mask files"]
  node_dataset_splits["Dataset splits"]
  node_image_dataset["Image dataset loader<br/>[image_dataset.py]"]
end

subgraph group_model["Segmentation model"]
  node_wave_encoder["Wavelet encoder"]
  node_tiny_vae["Tiny-VAE"]
  node_latent_mapping["Latent mapping model"]
  node_latent_alignment["Latent alignment loss"]
end

subgraph group_run["Training and inference"]
  node_configs["Dataset configs"]
  node_training["Training workflow"]
  node_inference["Inference workflow"]
  node_predictions["Predicted masks"]
  node_metrics["Segmentation metrics"]
end

subgraph group_support["Runtime utilities"]
  node_logger["Logging setup<br/>[get_logger.py]"]
  node_model_factory["VAE factory"]
  node_scheduler["Warmup cosine scheduler<br/>[lr_scheduler.py]"]
  node_checkpoint_tools["Checkpoint and training helpers<br/>[tools.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"prepares"| node_dataset_files
node_researcher -->|"provides splits"| node_dataset_splits
node_dataset_files -->|"loads pairs"| node_image_dataset
node_dataset_splits -->|"selects samples"| node_image_dataset
node_researcher -->|"tunes settings"| node_configs
node_image_dataset -.->|"supplies batches"| node_training
node_configs -->|"configures"| node_training
node_training -->|"trains"| node_wave_encoder
node_training -->|"trains"| node_latent_mapping
node_training -->|"uses"| node_tiny_vae
node_training -->|"optimizes"| node_latent_alignment
node_wave_encoder -->|"aligns latents"| node_latent_alignment
node_tiny_vae -->|"provides reference"| node_latent_alignment
node_wave_encoder -->|"provides latents"| node_latent_mapping
node_researcher -->|"runs validation"| node_inference
node_inference -.->|"loads samples"| node_image_dataset
node_inference -->|"encodes images"| node_wave_encoder
node_inference -->|"maps latents"| node_latent_mapping
node_inference -->|"writes masks"| node_predictions
node_inference -->|"computes scores"| node_metrics
node_model_factory -->|"instantiates"| node_tiny_vae
node_model_factory -->|"instantiates"| node_wave_encoder

click node_image_dataset "https://github.com/atplab-lums/wave-gms/blob/main/data/image_dataset.py"
click node_configs "https://github.com/atplab-lums/wave-gms/tree/main/configs"
click node_logger "https://github.com/atplab-lums/wave-gms/blob/main/utils/get_logger.py"
click node_model_factory "https://github.com/atplab-lums/wave-gms/blob/main/utils/instantiate_model.py"
click node_scheduler "https://github.com/atplab-lums/wave-gms/blob/main/utils/lr_scheduler.py"
click node_checkpoint_tools "https://github.com/atplab-lums/wave-gms/blob/main/utils/tools.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_dataset_files,node_dataset_splits,node_image_dataset toneBlue
class node_wave_encoder,node_tiny_vae,node_latent_mapping,node_latent_alignment toneAmber
class node_configs,node_training,node_inference,node_predictions,node_metrics toneMint
class node_logger,node_model_factory,node_scheduler,node_checkpoint_tools toneRose
class node_researcher toneIndigo
```

## Components

### Dataset input

- **Image and mask files**
- **Dataset splits**
- [Image dataset loader](https://github.com/atplab-lums/wave-gms/blob/main/data/image_dataset.py): `data/image_dataset.py`

### Segmentation model

- **Wavelet encoder**
- **Tiny-VAE**
- **Latent mapping model**
- **Latent alignment loss**

### Training and inference

- [Dataset configs](https://github.com/atplab-lums/wave-gms/tree/main/configs): `configs`
- **Training workflow**
- **Inference workflow**
- **Predicted masks**
- **Segmentation metrics**

### Runtime utilities

- [Logging setup](https://github.com/atplab-lums/wave-gms/blob/main/utils/get_logger.py): `utils/get_logger.py`
- [VAE factory](https://github.com/atplab-lums/wave-gms/blob/main/utils/instantiate_model.py): `utils/instantiate_model.py`
- [Warmup cosine scheduler](https://github.com/atplab-lums/wave-gms/blob/main/utils/lr_scheduler.py): `utils/lr_scheduler.py`
- [Checkpoint and training helpers](https://github.com/atplab-lums/wave-gms/blob/main/utils/tools.py): `utils/tools.py`

### Other components

- **Researcher**

## Connections

- Researcher → Image and mask files: prepares (evidence: `README.md`)
- Researcher → Dataset splits: provides splits (evidence: `README.md`)
- Image and mask files → Image dataset loader: loads pairs (evidence: `data/image_dataset.py`)
- Dataset splits → Image dataset loader: selects samples (evidence: `data/image_dataset.py`)
- Researcher → Dataset configs: tunes settings (evidence: `README.md`)
- Image dataset loader → Training workflow: supplies batches
- Dataset configs → Training workflow: configures (evidence: `README.md`)
- Training workflow → Wavelet encoder: trains (evidence: `README.md`)
- Training workflow → Latent mapping model: trains (evidence: `README.md`)
- Training workflow → Tiny-VAE: uses (evidence: `README.md`)
- Training workflow → Latent alignment loss: optimizes (evidence: `README.md`)
- Wavelet encoder → Latent alignment loss: aligns latents (evidence: `README.md`)
- Tiny-VAE → Latent alignment loss: provides reference (evidence: `README.md`)
- Wavelet encoder → Latent mapping model: provides latents (evidence: `README.md`)
- Researcher → Inference workflow: runs validation (evidence: `README.md`)
- Inference workflow → Image dataset loader: loads samples
- Inference workflow → Wavelet encoder: encodes images (evidence: `README.md`)
- Inference workflow → Latent mapping model: maps latents (evidence: `README.md`)
- Inference workflow → Predicted masks: writes masks (evidence: `README.md`)
- Inference workflow → Segmentation metrics: computes scores (evidence: `README.md`)
- VAE factory → Tiny-VAE: instantiates (evidence: `utils/instantiate_model.py`)
- VAE factory → Wavelet encoder: instantiates (evidence: `utils/instantiate_model.py`)
