# biyonghiyon/ctrs architecture

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

- Interactive diagram: https://gitdiagram.com/biyonghiyon/ctrs
- Repository: https://github.com/biyonghiyon/ctrs

## Overview

SSA-MRN is a research codebase for pansharpening: it combines high-resolution PAN imagery with low-resolution multispectral imagery to reconstruct high-resolution multispectral images, then compares model structures, losses, and training conditions. The main workflow is experiment scripts loading PanCollection data, training a selected model, and evaluating reconstruction quality with RR/FR metrics. The graph also preserves the major model-ablation branches described in the README. Source excerpts show key data, model, and evaluation dependencies; links for unsampled training flows rely on README documentation.

Main entry points: [`SSA-MRN/src/ssamrn/models/ssa_mrn.py`](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/ssa_mrn.py) (SSA-MRN backbone), [`SSA-MRN/src/ssamrn/metrics.py`](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/metrics.py) (Quality metrics), [`SSA-MRN/src/ssamrn/data/pancollection.py`](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/data/pancollection.py) (PanCollection loader), [`SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b1_b2_one_cell.py) (B1/B2 runs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data handling"]
  node_pan_data["PanCollection loader<br/>[pancollection.py]"]
  node_observation["Sensor observation<br/>[observation.py]"]
end

subgraph group_models["Reconstruction models"]
  node_base_model["SSA-MRN backbone<br/>[ssa_mrn.py]"]
  node_interp["23-tap interpolation<br/>[interp23.py]"]
  node_pan_variants["PAN variants<br/>[pan_variants.py]"]
  node_ssa_fusion["SSA fusion ablations<br/>[ssa_fusion.py]"]
  node_structure["Structure variants"]
  node_coarse_anchor["Coarse anchor variants<br/>[coarse_anchor.py]"]
end

subgraph group_experiments["Research experiments"]
  node_experiment_runners["Experiment runners"]
  node_kaggle_core["Kaggle experiments<br/>[kaggle_one_cell.py]"]
  node_kaggle_b1b2["B1/B2 runs"]
  node_kaggle_resume["B1/B2 resume"]
  node_kaggle_bandlimit["Bandlimit runs"]
  node_kaggle_wavelet["Wavelet runs"]
  node_kaggle_controlled["Controlled runs"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluator["RR/FR evaluation<br/>[evaluate_a6000.py]"]
  node_metrics["Quality metrics<br/>[metrics.py]"]
  node_verification["Result verification"]
end

node_researcher(("Researcher"))

node_researcher -->|"configures runs"| node_experiment_runners
node_experiment_runners -->|"loads samples"| node_pan_data
node_experiment_runners -.->|"trains models"| node_base_model
node_experiment_runners -->|"evaluates candidates"| node_evaluator
node_kaggle_core -->|"loads samples"| node_pan_data
node_kaggle_core -->|"builds model"| node_base_model
node_kaggle_core -->|"computes metrics"| node_metrics
node_kaggle_b1b2 -->|"builds core"| node_base_model
node_kaggle_b1b2 -->|"models feedback"| node_observation
node_kaggle_b1b2 -->|"loads samples"| node_pan_data
node_kaggle_b1b2 -->|"computes metrics"| node_metrics
node_kaggle_resume -->|"builds model"| node_base_model
node_kaggle_resume -->|"audits observation"| node_observation
node_kaggle_resume -->|"loads samples"| node_pan_data
node_kaggle_resume -->|"computes metrics"| node_metrics
node_kaggle_bandlimit -->|"builds model"| node_base_model
node_kaggle_bandlimit -->|"audits observation"| node_observation
node_kaggle_bandlimit -->|"loads samples"| node_pan_data
node_kaggle_bandlimit -->|"computes metrics"| node_metrics
node_kaggle_wavelet -->|"computes metrics"| node_metrics
node_kaggle_controlled -->|"builds model"| node_base_model
node_kaggle_controlled -->|"computes metrics"| node_metrics
node_pan_variants -->|"extends backbone"| node_base_model
node_pan_variants -->|"uses interpolation"| node_interp
node_pan_variants -->|"uses sensor model"| node_observation
node_ssa_fusion -->|"extends backbone"| node_base_model
node_structure -->|"extends backbone"| node_base_model
node_coarse_anchor -->|"extends variants"| node_structure
node_evaluator -->|"selects variants"| node_pan_variants
node_evaluator -->|"scores outputs"| node_metrics
node_verification -.->|"checks outputs"| node_kaggle_core

click node_experiment_runners "https://github.com/biyonghiyon/ctrs/tree/main/SSA-MRN/scripts"
click node_kaggle_core "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_one_cell.py"
click node_kaggle_b1b2 "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b1_b2_one_cell.py"
click node_kaggle_resume "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py"
click node_kaggle_bandlimit "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py"
click node_kaggle_wavelet "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_a0_a1_one_cell.py"
click node_kaggle_controlled "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b0_b1_k4_controlled_one_cell.py"
click node_pan_data "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/data/pancollection.py"
click node_observation "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/observation.py"
click node_base_model "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/ssa_mrn.py"
click node_interp "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/interp23.py"
click node_pan_variants "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/pan_variants.py"
click node_ssa_fusion "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/ssa_fusion.py"
click node_structure "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/windows_structure.py"
click node_coarse_anchor "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/coarse_anchor.py"
click node_evaluator "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/evaluate_a6000.py"
click node_metrics "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/metrics.py"
click node_verification "https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/verify_kaggle_result.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_pan_data,node_observation toneBlue
class node_base_model,node_interp,node_pan_variants,node_ssa_fusion,node_structure,node_coarse_anchor toneAmber
class node_experiment_runners,node_kaggle_core,node_kaggle_b1b2,node_kaggle_resume,node_kaggle_bandlimit,node_kaggle_wavelet,node_kaggle_controlled toneMint
class node_evaluator,node_metrics,node_verification toneRose
class node_researcher toneIndigo
```

## Components

### Data handling

- [PanCollection loader](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/data/pancollection.py): `SSA-MRN/src/ssamrn/data/pancollection.py`
- [Sensor observation](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/observation.py): `SSA-MRN/src/ssamrn/observation.py`

### Reconstruction models

- [SSA-MRN backbone](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/ssa_mrn.py): `SSA-MRN/src/ssamrn/models/ssa_mrn.py`
- [23-tap interpolation](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/interp23.py): `SSA-MRN/src/ssamrn/models/interp23.py`
- [PAN variants](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/pan_variants.py): `SSA-MRN/src/ssamrn/models/pan_variants.py`
- [SSA fusion ablations](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/ssa_fusion.py): `SSA-MRN/src/ssamrn/models/ssa_fusion.py`
- [Structure variants](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/windows_structure.py): `SSA-MRN/src/ssamrn/models/windows_structure.py`
- [Coarse anchor variants](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/models/coarse_anchor.py): `SSA-MRN/src/ssamrn/models/coarse_anchor.py`

### Research experiments

- [Experiment runners](https://github.com/biyonghiyon/ctrs/tree/main/SSA-MRN/scripts): `SSA-MRN/scripts`
- [Kaggle experiments](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_one_cell.py): `SSA-MRN/scripts/kaggle_one_cell.py`
- [B1/B2 runs](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b1_b2_one_cell.py): `SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`
- [B1/B2 resume](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py): `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`
- [Bandlimit runs](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py): `SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py`
- [Wavelet runs](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_a0_a1_one_cell.py): `SSA-MRN/scripts/kaggle_a0_a1_one_cell.py`
- [Controlled runs](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/kaggle_b0_b1_k4_controlled_one_cell.py): `SSA-MRN/scripts/kaggle_b0_b1_k4_controlled_one_cell.py`

### Evaluation

- [RR/FR evaluation](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/evaluate_a6000.py): `SSA-MRN/scripts/evaluate_a6000.py`
- [Quality metrics](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/src/ssamrn/metrics.py): `SSA-MRN/src/ssamrn/metrics.py`
- [Result verification](https://github.com/biyonghiyon/ctrs/blob/main/SSA-MRN/scripts/verify_kaggle_result.py): `SSA-MRN/scripts/verify_kaggle_result.py`

### Other components

- **Researcher**

## Connections

- Researcher → Experiment runners: configures runs
- Experiment runners → PanCollection loader: loads samples (evidence: `SSA-MRN/scripts/a6000_suite.py`)
- Experiment runners → SSA-MRN backbone: trains models (evidence: `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`)
- Experiment runners → RR/FR evaluation: evaluates candidates (evidence: `SSA-MRN/scripts/windows_coarse_anchor_suite.py`)
- Kaggle experiments → PanCollection loader: loads samples (evidence: `SSA-MRN/scripts/kaggle_one_cell.py`)
- Kaggle experiments → SSA-MRN backbone: builds model (evidence: `SSA-MRN/scripts/kaggle_one_cell.py`)
- Kaggle experiments → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_one_cell.py`)
- B1/B2 runs → SSA-MRN backbone: builds core (evidence: `SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`)
- B1/B2 runs → Sensor observation: models feedback (evidence: `SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`)
- B1/B2 runs → PanCollection loader: loads samples (evidence: `SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`)
- B1/B2 runs → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_b1_b2_one_cell.py`)
- B1/B2 resume → SSA-MRN backbone: builds model (evidence: `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`)
- B1/B2 resume → Sensor observation: audits observation (evidence: `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`)
- B1/B2 resume → PanCollection loader: loads samples (evidence: `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`)
- B1/B2 resume → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_b1_b2_100_resume_one_cell.py`)
- Bandlimit runs → SSA-MRN backbone: builds model (evidence: `SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py`)
- Bandlimit runs → Sensor observation: audits observation (evidence: `SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py`)
- Bandlimit runs → PanCollection loader: loads samples (evidence: `SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py`)
- Bandlimit runs → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_bandlimit_k4_cell.py`)
- Wavelet runs → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_a0_a1_one_cell.py`)
- Controlled runs → SSA-MRN backbone: builds model (evidence: `SSA-MRN/scripts/kaggle_b0_b1_k4_controlled_one_cell.py`)
- Controlled runs → Quality metrics: computes metrics (evidence: `SSA-MRN/scripts/kaggle_b0_b1_k4_controlled_one_cell.py`)
- PAN variants → SSA-MRN backbone: extends backbone (evidence: `SSA-MRN/src/ssamrn/models/pan_variants.py`)
- PAN variants → 23-tap interpolation: uses interpolation (evidence: `SSA-MRN/src/ssamrn/models/pan_variants.py`)
- PAN variants → Sensor observation: uses sensor model (evidence: `SSA-MRN/src/ssamrn/models/pan_variants.py`)
- SSA fusion ablations → SSA-MRN backbone: extends backbone (evidence: `SSA-MRN/src/ssamrn/models/ssa_fusion.py`)
- Structure variants → SSA-MRN backbone: extends backbone (evidence: `SSA-MRN/src/ssamrn/models/windows_structure.py`)
- Coarse anchor variants → Structure variants: extends variants (evidence: `SSA-MRN/src/ssamrn/models/coarse_anchor.py`)
- RR/FR evaluation → PAN variants: selects variants (evidence: `SSA-MRN/scripts/evaluate_a6000.py`)
- RR/FR evaluation → Quality metrics: scores outputs (evidence: `SSA-MRN/scripts/evaluate_a6000.py`)
- Result verification → Kaggle experiments: checks outputs
