# hussein-ahmad-ahmad/reliability-first-stgnn-benchmark architecture

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

- Interactive diagram: https://gitdiagram.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark
- Repository: https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark

## Overview

This repository is a reliability-focused benchmark for seven spatiotemporal graph neural networks on three traffic datasets. Its principal workflow configures and trains/evaluates forecasting models, then compares point-forecast accuracy across seeds and datasets. Separate analysis branches address uncertainty calibration, sensor-ablation robustness, explanations, and compute. The tree and README establish these capabilities; many analysis implementations were not excerpted, so their internal calls and wiring are not asserted.

Main entry points: [`configs`](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/configs) (Experiment configs), [`src/models/model_registry.py`](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/models/model_registry.py) (Model registry), [`framework/basicts/runners/base_epoch_runner.py`](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/framework/basicts/runners/base_epoch_runner.py) (Training runner), [`src/uncertainty`](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/src/uncertainty) (Uncertainty tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_forecast["Forecasting benchmark"]
  node_configs["Experiment configs"]
  node_datasets[("Traffic data<br/>[loaders.py]")]
  node_graph["Graph construction"]
end

subgraph group_models["Model architectures"]
  node_d2stgnn["D2STGNN<br/>[d2stgnn_arch.py]"]
  node_mtgnn["MTGNN<br/>[mtgnn_arch.py]"]
  node_megacrn["MegaCRN<br/>[megacrn_arch.py]"]
  node_stae["STAEformer<br/>[staeformer_arch.py]"]
  node_stgcn["STGCN-Cheb<br/>[stgcn_arch.py]"]
  node_stid["STID<br/>[stid_arch.py]"]
  node_stnorm["STNorm<br/>[stnorm_arch.py]"]
end

subgraph group_reliability["Reliability analysis"]
  node_uncertainty["Uncertainty tools"]
  node_conformal["Conformal intervals"]
  node_dropout["Sensor ablation"]
end

subgraph group_explain["Model explanations"]
  node_xai["Explainability"]
end

subgraph group_framework["Shared framework"]
  node_runner["Training runner"]
  node_scalers["Data scaling"]
  node_metrics["Forecast metrics"]
  node_registry["Model registry<br/>[model_registry.py]"]
  node_basicts_data["Forecast datasets"]
end

node_user(("Benchmark user"))

node_user -->|"selects runs"| node_configs
node_configs -.->|"configures training"| node_runner
node_datasets -.->|"builds graphs"| node_graph
node_runner -.->|"evaluates forecasts"| node_metrics
node_user -->|"analyzes calibration"| node_uncertainty
node_user -->|"tests robustness"| node_dropout
node_user -->|"inspects explanations"| node_xai
node_configs -->|"selects model"| node_d2stgnn
node_configs -->|"selects model"| node_mtgnn
node_configs -->|"selects model"| node_megacrn
node_configs -->|"selects model"| node_stae
node_configs -->|"selects model"| node_stgcn
node_configs -->|"selects model"| node_stid
node_configs -->|"selects model"| node_stnorm
node_uncertainty -.->|"generates intervals"| node_conformal
node_runner -.->|"uses scaling"| node_scalers
node_registry -.->|"registers model"| node_d2stgnn
node_registry -.->|"registers model"| node_mtgnn
node_registry -.->|"registers model"| node_megacrn
node_registry -.->|"registers model"| node_stae
node_registry -.->|"registers model"| node_stgcn
node_registry -.->|"registers model"| node_stid
node_registry -.->|"registers model"| node_stnorm

click node_configs "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/configs"
click node_datasets "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/data/loaders.py"
click node_graph "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/data/graph_construction.py"
click node_runner "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/framework/basicts/runners/base_epoch_runner.py"
click node_scalers "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/framework/basicts/scaler"
click node_metrics "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/framework/basicts/metrics"
click node_d2stgnn "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/D2STGNN/arch/d2stgnn_arch.py"
click node_mtgnn "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/MTGNN/arch/mtgnn_arch.py"
click node_megacrn "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/MegaCRN/arch/megacrn_arch.py"
click node_stae "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STAEformer/arch/staeformer_arch.py"
click node_stgcn "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STGCNChebGraphConv/arch/stgcn_arch.py"
click node_stid "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STID/arch/stid_arch.py"
click node_stnorm "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STNorm/arch/stnorm_arch.py"
click node_uncertainty "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/src/uncertainty"
click node_conformal "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/scripts/generate_conformal_intervals.py"
click node_dropout "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/pipelines/run_sensor_dropout.py"
click node_xai "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/src/explainability"
click node_registry "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/models/model_registry.py"
click node_basicts_data "https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/framework/basicts/data/simple_tsc_dataset.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_configs,node_datasets,node_graph,node_user toneBlue
class node_d2stgnn,node_mtgnn,node_megacrn,node_stae,node_stgcn,node_stid,node_stnorm toneAmber
class node_uncertainty,node_conformal,node_dropout toneMint
class node_xai toneRose
class node_runner,node_scalers,node_metrics,node_registry,node_basicts_data toneIndigo
```

## Components

### Forecasting benchmark

- [Experiment configs](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/configs): `configs`
- [Traffic data](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/data/loaders.py): `src/data/loaders.py`
- [Graph construction](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/data/graph_construction.py): `src/data/graph_construction.py`

### Model architectures

- [D2STGNN](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/D2STGNN/arch/d2stgnn_arch.py): `models/D2STGNN/arch/d2stgnn_arch.py`
- [MTGNN](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/MTGNN/arch/mtgnn_arch.py): `models/MTGNN/arch/mtgnn_arch.py`
- [MegaCRN](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/MegaCRN/arch/megacrn_arch.py): `models/MegaCRN/arch/megacrn_arch.py`
- [STAEformer](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STAEformer/arch/staeformer_arch.py): `models/STAEformer/arch/staeformer_arch.py`
- [STGCN-Cheb](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STGCNChebGraphConv/arch/stgcn_arch.py): `models/STGCNChebGraphConv/arch/stgcn_arch.py`
- [STID](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STID/arch/stid_arch.py): `models/STID/arch/stid_arch.py`
- [STNorm](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/models/STNorm/arch/stnorm_arch.py): `models/STNorm/arch/stnorm_arch.py`

### Reliability analysis

- [Uncertainty tools](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/src/uncertainty): `src/uncertainty`
- [Conformal intervals](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/scripts/generate_conformal_intervals.py): `scripts/generate_conformal_intervals.py`
- [Sensor ablation](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/pipelines/run_sensor_dropout.py): `pipelines/run_sensor_dropout.py`

### Model explanations

- [Explainability](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/src/explainability): `src/explainability`

### Shared framework

- [Training runner](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/framework/basicts/runners/base_epoch_runner.py): `framework/basicts/runners/base_epoch_runner.py`
- [Data scaling](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/framework/basicts/scaler): `framework/basicts/scaler`
- [Forecast metrics](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/tree/main/framework/basicts/metrics): `framework/basicts/metrics`
- [Model registry](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/src/models/model_registry.py): `src/models/model_registry.py`
- [Forecast datasets](https://github.com/hussein-ahmad-ahmad/reliability-first-stgnn-benchmark/blob/main/framework/basicts/data/simple_tsc_dataset.py): `framework/basicts/data/simple_tsc_dataset.py`

### Other components

- **Benchmark user**

## Connections

- Benchmark user → Experiment configs: selects runs (evidence: `README.md`)
- Experiment configs → Training runner: configures training
- Traffic data → Graph construction: builds graphs
- Training runner → Forecast metrics: evaluates forecasts
- Benchmark user → Uncertainty tools: analyzes calibration (evidence: `README.md`)
- Benchmark user → Sensor ablation: tests robustness (evidence: `README.md`)
- Benchmark user → Explainability: inspects explanations (evidence: `README.md`)
- Experiment configs → D2STGNN: selects model (evidence: `configs/D2STGNN/PEMS-BAY_seed43.py`)
- Experiment configs → MTGNN: selects model (evidence: `configs/MTGNN/PEMS-BAY_seed43.py`)
- Experiment configs → MegaCRN: selects model (evidence: `configs/MegaCRN/METR-LA_seed43.py`)
- Experiment configs → STAEformer: selects model (evidence: `configs/STAEformer/METR-LA_seed43.py`)
- Experiment configs → STGCN-Cheb: selects model (evidence: `configs/STGCNChebGraphConv/PEMS-BAY_seed43.py`)
- Experiment configs → STID: selects model (evidence: `configs/STID/PEMS-BAY_seed43.py`)
- Experiment configs → STNorm: selects model (evidence: `configs/STNorm/METR-LA_seed43.py`)
- Uncertainty tools → Conformal intervals: generates intervals (evidence: `src/uncertainty/calibration.py`)
- Training runner → Data scaling: uses scaling
- Model registry → D2STGNN: registers model
- Model registry → MTGNN: registers model
- Model registry → MegaCRN: registers model
- Model registry → STAEformer: registers model
- Model registry → STGCN-Cheb: registers model
- Model registry → STID: registers model
- Model registry → STNorm: registers model
