# leticiarosimporto/msi-deeplearning architecture

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

- Interactive diagram: https://gitdiagram.com/leticiarosimporto/msi-deeplearning
- Repository: https://github.com/leticiarosimporto/msi-deeplearning

## Overview

MSI-DeepLearning processes multispectral imagery from band registration and HDF5 dataset creation through model training and evaluation, with spectral inspection as an analysis branch. The README documents the overall workflow; excerpts show registration utilities, HDF5 loading, augmentation, model definitions, and training. The dataset-builder and several analysis/training entry points were not excerpted, so their connections are limited to documented relationships.

Main entry points: [`deep_utils/training.py`](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/training.py) (Training loop), [`register_MSI_ECC.py`](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/register_MSI_ECC.py) (ECC registration), [`deep_utils/msi_dataset.py`](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/msi_dataset.py) (MSI dataset loader), [`parrallel_ECC.py`](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/parrallel_ECC.py) (Parallel ECC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_registration["Band registration"]
  node_serial["ECC registration"]
  node_parallel["Parallel ECC<br/>[parrallel_ECC.py]"]
end

subgraph group_data["Dataset preparation"]
  node_ms_tools["Image utilities<br/>[ms_tools.py]"]
  node_dataset_builder["HDF5 builder"]
  node_cube_save["Cube serialization<br/>[msi_image_utils.py]"]
  node_hdf5[("HDF5 cubes")]
  node_msi_dataset["MSI dataset loader<br/>[msi_dataset.py]"]
  node_hsi_dataset["Hyperspectral loader<br/>[HsiDataset.py]"]
  node_augment["Band-preserving augmentation<br/>[data_augment.py]"]
  node_cube_utils["Cube utilities<br/>[msi_image_utils.py]"]
end

subgraph group_learning["Model learning"]
  node_resnet["ResNet models<br/>[ResNets.py]"]
  node_msi_resnet["Depthwise ResNet<br/>[MSI_RESNET.py]"]
  node_trainer["Training loop<br/>[training.py]"]
  node_evaluator["Model evaluation<br/>[testing.py]"]
end

subgraph group_analysis["Spectral analysis"]
  node_spectra["Spectral extraction"]
  node_spectral_tools["Spectral tools<br/>[ms_tools.py]"]
end

node_user(("Researcher"))
node_raw["Raw band images"]

node_user -->|"registers bands"| node_serial
node_user -->|"registers in parallel"| node_parallel
node_raw -.->|"supplies images"| node_serial
node_serial -->|"assembles bands"| node_ms_tools
node_parallel -->|"assembles bands"| node_ms_tools
node_user -->|"builds dataset"| node_dataset_builder
node_dataset_builder -->|"saves datacubes"| node_cube_save
node_cube_save -->|"writes cubes"| node_hdf5
node_msi_dataset -->|"reads datacubes"| node_hdf5
node_hsi_dataset -->|"reads samples"| node_hdf5
node_msi_dataset -.->|"applies augmentation"| node_augment
node_user -->|"trains model"| node_trainer
node_trainer -->|"updates parameters"| node_resnet
node_trainer -.->|"updates parameters"| node_msi_resnet
node_user -->|"tests model"| node_evaluator
node_user -->|"extracts spectra"| node_spectra
node_spectra -->|"loads cube utilities"| node_cube_utils
node_user -->|"inspects spectra"| node_spectral_tools

click node_serial "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/register_MSI_ECC.py"
click node_parallel "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/parrallel_ECC.py"
click node_ms_tools "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/ms_tools.py"
click node_dataset_builder "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/make_msi_dataset.py"
click node_cube_save "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/msi_image_utils.py"
click node_msi_dataset "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/msi_dataset.py"
click node_hsi_dataset "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/HsiDataset.py"
click node_augment "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/data_augment.py"
click node_resnet "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/ResNets.py"
click node_msi_resnet "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/MSI_RESNET.py"
click node_trainer "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/training.py"
click node_evaluator "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/testing.py"
click node_spectra "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/h5_to_spectral_mean.py"
click node_spectral_tools "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/ms_tools.py"
click node_cube_utils "https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/msi_image_utils.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_serial,node_parallel toneBlue
class node_ms_tools,node_dataset_builder,node_cube_save,node_hdf5,node_msi_dataset,node_hsi_dataset,node_augment,node_cube_utils toneAmber
class node_resnet,node_msi_resnet,node_trainer,node_evaluator toneMint
class node_spectra,node_spectral_tools toneRose
class node_user,node_raw toneIndigo
```

## Components

### Band registration

- [ECC registration](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/register_MSI_ECC.py): `register_MSI_ECC.py`
- [Parallel ECC](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/parrallel_ECC.py): `parrallel_ECC.py`

### Dataset preparation

- [Image utilities](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/ms_tools.py): `ms_utils/ms_tools.py`
- [HDF5 builder](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/make_msi_dataset.py): `make_msi_dataset.py`
- [Cube serialization](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/msi_image_utils.py): `ms_utils/msi_image_utils.py`
- **HDF5 cubes**
- [MSI dataset loader](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/msi_dataset.py): `deep_utils/msi_dataset.py`
- [Hyperspectral loader](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/HsiDataset.py): `deep_utils/HsiDataset.py`
- [Band-preserving augmentation](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/data_augment.py): `deep_utils/data_augment.py`
- [Cube utilities](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/msi_image_utils.py): `ms_utils/msi_image_utils.py`

### Model learning

- [ResNet models](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/ResNets.py): `deep_utils/ResNets.py`
- [Depthwise ResNet](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/MSI_RESNET.py): `deep_utils/MSI_RESNET.py`
- [Training loop](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/training.py): `deep_utils/training.py`
- [Model evaluation](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/deep_utils/testing.py): `deep_utils/testing.py`

### Spectral analysis

- [Spectral extraction](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/h5_to_spectral_mean.py): `h5_to_spectral_mean.py`
- [Spectral tools](https://github.com/leticiarosimporto/msi-deeplearning/blob/main/ms_utils/ms_tools.py): `ms_utils/ms_tools.py`

### Other components

- **Researcher**
- **Raw band images**

## Connections

- Researcher → ECC registration: registers bands (evidence: `README.md`)
- Researcher → Parallel ECC: registers in parallel (evidence: `README.md`)
- Raw band images → ECC registration: supplies images
- ECC registration → Image utilities: assembles bands (evidence: `register_MSI_ECC.py`)
- Parallel ECC → Image utilities: assembles bands (evidence: `parrallel_ECC.py`)
- Researcher → HDF5 builder: builds dataset (evidence: `README.md`)
- HDF5 builder → Cube serialization: saves datacubes
- Cube serialization → HDF5 cubes: writes cubes (evidence: `ms_utils/msi_image_utils.py`)
- MSI dataset loader → HDF5 cubes: reads datacubes (evidence: `deep_utils/msi_dataset.py`)
- Hyperspectral loader → HDF5 cubes: reads samples (evidence: `deep_utils/HsiDataset.py`)
- MSI dataset loader → Band-preserving augmentation: applies augmentation
- Researcher → Training loop: trains model (evidence: `README.md`)
- Training loop → ResNet models: updates parameters (evidence: `deep_utils/training.py`)
- Training loop → Depthwise ResNet: updates parameters
- Researcher → Model evaluation: tests model (evidence: `README.md`)
- Researcher → Spectral extraction: extracts spectra (evidence: `README.md`)
- Spectral extraction → Cube utilities: loads cube utilities (evidence: `h5_to_spectral_mean.py`)
- Researcher → Spectral tools: inspects spectra (evidence: `README.md`)
