# jhansudoapt/se-lstm-mcu architecture

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

- Interactive diagram: https://gitdiagram.com/jhansudoapt/se-lstm-mcu
- Repository: https://github.com/jhansudoapt/se-lstm-mcu

## Overview

This repository is a weather time-series forecasting research project: it cleans and normalizes temperature and humidity data, trains several neural forecasting architectures, compares their test performance, and prepares selected models for MCU use. The README documents the broad workflow and capabilities; sampled code confirms preprocessing, sequence-based training, metrics, and plots. Training scripts and data are duplicated across directories, so the exact handoff between processed splits and each training run is not fully established.

Main entry points: [`Models/ModelsComparison`](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Models/ModelsComparison) (Trained models), [`Scripts/Code/data`](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Scripts/Code/data) (Training splits), [`Scripts/ProcessData/ProcessData.py`](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/ProcessData/ProcessData.py) (Clean and split), [`Scripts/Code/LSTM.py`](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/LSTM.py) (LSTM forecaster)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preparation["Data preparation"]
  node_raw[("Raw weather data")]
  node_preprocessor["Clean and split<br/>[ProcessData.py]"]
  node_prepared[("Processed splits")]
  node_localdata[("Training splits")]
end

subgraph group_forecasting["Forecast models"]
  node_lstm["LSTM forecaster<br/>[LSTM.py]"]
  node_selstm["SE-LSTM forecaster<br/>[SE-LSTM.py]"]
  node_lmu["LMU forecaster<br/>[LMU.py]"]
  node_tcn["TCN forecaster<br/>[TCN_MCU.py]"]
  node_cnnlstm["CNN-LSTM forecaster<br/>[CNN_LSTM.py]"]
  node_tpalstm["TPA-LSTM forecaster<br/>[TPA-LSTM.py]"]
  node_embeddings["Embedding experiments<br/>[EvolutionEmb.py]"]
  node_trained[("Trained models")]
end

subgraph group_evaluation["Evaluation"]
  node_metrics["Comparison metrics"]
  node_plots["Performance plots"]
end

subgraph group_deployment["MCU deployment"]
  node_mcu_models["MCU model files"]
  node_implementation["Arduino implementation<br/>[RapidTest.ino]"]
end

node_researcher(("Project user"))

node_researcher -->|"runs preprocessing"| node_preprocessor
node_raw -->|"loads data"| node_preprocessor
node_preprocessor -->|"writes splits"| node_prepared
node_prepared -.->|"duplicated as"| node_localdata
node_researcher -->|"runs training"| node_lstm
node_researcher -->|"runs training"| node_selstm
node_researcher -->|"runs training"| node_lmu
node_researcher -->|"runs training"| node_tcn
node_researcher -->|"runs training"| node_cnnlstm
node_researcher -->|"runs training"| node_tpalstm
node_researcher -->|"runs experiment"| node_embeddings
node_localdata -->|"loads splits"| node_lstm
node_localdata -->|"loads splits"| node_selstm
node_localdata -->|"loads splits"| node_lmu
node_localdata -->|"loads splits"| node_tcn
node_localdata -->|"loads splits"| node_cnnlstm
node_localdata -->|"loads splits"| node_tpalstm
node_localdata -->|"loads splits"| node_embeddings
node_lstm -->|"saves model"| node_trained
node_selstm -->|"saves model"| node_trained
node_lmu -->|"saves model"| node_trained
node_tcn -->|"saves model"| node_trained
node_cnnlstm -->|"saves model"| node_trained
node_tpalstm -->|"saves model"| node_trained
node_trained -->|"evaluated in"| node_metrics
node_trained -->|"compared in"| node_plots
node_trained -.->|"converted for MCU"| node_mcu_models
node_mcu_models -.->|"used by"| node_implementation

click node_raw "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Data/Raw"
click node_preprocessor "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/ProcessData/ProcessData.py"
click node_prepared "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Data/Processed"
click node_localdata "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Scripts/Code/data"
click node_lstm "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/LSTM.py"
click node_selstm "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/SE-LSTM.py"
click node_lmu "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/LMU.py"
click node_tcn "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/TCN_MCU.py"
click node_cnnlstm "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/CNN_LSTM.py"
click node_tpalstm "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/TPA-LSTM.py"
click node_embeddings "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/EvolutionEmb.py"
click node_trained "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Models/ModelsComparison"
click node_metrics "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Results"
click node_plots "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Figures"
click node_mcu_models "https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Models/ModelsOnMCUs"
click node_implementation "https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Implementation/RapidTest.ino"

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_raw,node_preprocessor,node_prepared,node_localdata,node_researcher toneBlue
class node_lstm,node_selstm,node_lmu,node_tcn,node_cnnlstm,node_tpalstm,node_embeddings,node_trained toneAmber
class node_metrics,node_plots toneMint
class node_mcu_models,node_implementation toneRose
```

## Components

### Data preparation

- [Raw weather data](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Data/Raw): `Data/Raw`
- [Clean and split](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/ProcessData/ProcessData.py): `Scripts/ProcessData/ProcessData.py`
- [Processed splits](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Data/Processed): `Data/Processed`
- [Training splits](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Scripts/Code/data): `Scripts/Code/data`

### Forecast models

- [LSTM forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/LSTM.py): `Scripts/Code/LSTM.py`
- [SE-LSTM forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/SE-LSTM.py): `Scripts/Code/SE-LSTM.py`
- [LMU forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/LMU.py): `Scripts/Code/LMU.py`
- [TCN forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/TCN_MCU.py): `Scripts/Code/TCN_MCU.py`
- [CNN-LSTM forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/CNN_LSTM.py): `Scripts/Code/CNN_LSTM.py`
- [TPA-LSTM forecaster](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/TPA-LSTM.py): `Scripts/Code/TPA-LSTM.py`
- [Embedding experiments](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Code/EvolutionEmb.py): `Scripts/Code/EvolutionEmb.py`
- [Trained models](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Models/ModelsComparison): `Models/ModelsComparison`

### Evaluation

- [Comparison metrics](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Results): `Results`
- [Performance plots](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Figures): `Figures`

### MCU deployment

- [MCU model files](https://github.com/jhansudoapt/se-lstm-mcu/tree/master/Models/ModelsOnMCUs): `Models/ModelsOnMCUs`
- [Arduino implementation](https://github.com/jhansudoapt/se-lstm-mcu/blob/master/Scripts/Implementation/RapidTest.ino): `Scripts/Implementation/RapidTest.ino`

### Other components

- **Project user**

## Connections

- Project user → Clean and split: runs preprocessing
- Raw weather data → Clean and split: loads data
- Clean and split → Processed splits: writes splits
- Processed splits → Training splits: duplicated as
- Project user → LSTM forecaster: runs training
- Project user → SE-LSTM forecaster: runs training
- Project user → LMU forecaster: runs training
- Project user → TCN forecaster: runs training
- Project user → CNN-LSTM forecaster: runs training
- Project user → TPA-LSTM forecaster: runs training
- Project user → Embedding experiments: runs experiment
- Training splits → LSTM forecaster: loads splits
- Training splits → SE-LSTM forecaster: loads splits
- Training splits → LMU forecaster: loads splits
- Training splits → TCN forecaster: loads splits
- Training splits → CNN-LSTM forecaster: loads splits
- Training splits → TPA-LSTM forecaster: loads splits
- Training splits → Embedding experiments: loads splits
- LSTM forecaster → Trained models: saves model
- SE-LSTM forecaster → Trained models: saves model
- LMU forecaster → Trained models: saves model
- TCN forecaster → Trained models: saves model
- CNN-LSTM forecaster → Trained models: saves model
- TPA-LSTM forecaster → Trained models: saves model
- Trained models → Comparison metrics: evaluated in
- Trained models → Performance plots: compared in
- Trained models → MCU model files: converted for MCU
- MCU model files → Arduino implementation: used by
