# vishwanath-06/pulsepod architecture

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

- Interactive diagram: https://gitdiagram.com/vishwanath-06/pulsepod
- Repository: https://github.com/vishwanath-06/pulsepod

## Overview

PulsePod is an ECG arrhythmia detection system with a Streamlit inference dashboard and a research workflow for preparing data and training CNN, CNN-LSTM, and spiking-neural-network models. The principal user workflow selects a model and test-beat count, loads a pretrained model and test data, then simulates beat-by-beat inference with confidence, uncertainty, plots, and alerts. The graph also preserves documented dataset preparation and model-training stages. Some research and dashboard internals are unsampled; those links are included only where the README or excerpts support them.

Main entry points: [`models`](https://github.com/vishwanath-06/pulsepod/tree/main/models) (Pretrained Models), [`app.py`](https://github.com/vishwanath-06/pulsepod/blob/main/app.py) (Streamlit Dashboard), [`data/create_unified_test_set.py`](https://github.com/vishwanath-06/pulsepod/blob/main/data/create_unified_test_set.py) (Test Set Merger), [`research/03_data_augmentation_stratification.py`](https://github.com/vishwanath-06/pulsepod/blob/main/research/03_data_augmentation_stratification.py) (MIT-BIH Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["ECG Data"]
  node_mit_processing["MIT-BIH Processing"]
  node_aug_split["Augment and Split"]
  node_unified_data[("Unified Test Set")]
  node_test_merge["Test Set Merger"]
end

subgraph group_research["Research Pipeline"]
  node_training["Model Training"]
end

subgraph group_models["Models"]
  node_model_zoo[("Pretrained Models")]
  node_cnn["CNN Classifier<br/>[app.py]"]
  node_cnn_lstm["CNN-LSTM Classifier<br/>[app.py]"]
  node_snn["Spiking Classifier<br/>[app.py]"]
end

subgraph group_dashboard["Inference Dashboard"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_test_loader["Test Data Loader<br/>[app.py]"]
  node_model_loader["Model Loader<br/>[app.py]"]
  node_simulation["Beat Simulation<br/>[app.py]"]
  node_alerts["Alerts and Logs<br/>[app.py]"]
  node_visualization["Live Visualizations<br/>[app.py]"]
end

node_operator(("Dashboard User"))
node_mit_records[("MIT-BIH Records")]
node_ptb_records[("PTB-XL Records")]

node_mit_records -->|"processes records"| node_mit_processing
node_mit_processing -->|"segments beats"| node_aug_split
node_aug_split -.->|"prepares training data"| node_training
node_mit_records -->|"supplies test data"| node_test_merge
node_ptb_records -->|"supplies test data"| node_test_merge
node_test_merge -->|"writes combined set"| node_unified_data
node_training -->|"trains models"| node_model_zoo
node_operator -->|"starts simulation"| node_dashboard
node_dashboard -->|"selects model"| node_model_loader
node_model_loader -->|"loads weights"| node_model_zoo
node_dashboard -->|"loads test data"| node_test_loader
node_test_loader -.->|"reads test set"| node_unified_data
node_dashboard -->|"runs simulation"| node_simulation
node_simulation -->|"checks alerts"| node_alerts
node_simulation -->|"renders results"| node_visualization
node_cnn -.->|"has saved weights"| node_model_zoo
node_cnn_lstm -.->|"has saved weights"| node_model_zoo
node_snn -.->|"has saved weights"| node_model_zoo

click node_mit_processing "https://github.com/vishwanath-06/pulsepod/blob/main/research/03_data_augmentation_stratification.py"
click node_aug_split "https://github.com/vishwanath-06/pulsepod/blob/main/research/03_data_augmentation_stratification.py"
click node_unified_data "https://github.com/vishwanath-06/pulsepod/tree/main/data/unified_test_set"
click node_test_merge "https://github.com/vishwanath-06/pulsepod/blob/main/data/create_unified_test_set.py"
click node_training "https://github.com/vishwanath-06/pulsepod/blob/main/research/04_model_training_experiments.ipynb"
click node_model_zoo "https://github.com/vishwanath-06/pulsepod/tree/main/models"
click node_cnn "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_cnn_lstm "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_snn "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_dashboard "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_test_loader "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_model_loader "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_simulation "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_alerts "https://github.com/vishwanath-06/pulsepod/blob/main/app.py"
click node_visualization "https://github.com/vishwanath-06/pulsepod/blob/main/app.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_mit_processing,node_aug_split,node_unified_data,node_test_merge,node_operator toneBlue
class node_training,node_mit_records,node_ptb_records toneAmber
class node_model_zoo,node_cnn,node_cnn_lstm,node_snn toneMint
class node_dashboard,node_test_loader,node_model_loader,node_simulation,node_alerts,node_visualization toneRose
```

## Components

### ECG Data

- [MIT-BIH Processing](https://github.com/vishwanath-06/pulsepod/blob/main/research/03_data_augmentation_stratification.py): `research/03_data_augmentation_stratification.py`
- [Augment and Split](https://github.com/vishwanath-06/pulsepod/blob/main/research/03_data_augmentation_stratification.py): `research/03_data_augmentation_stratification.py`
- [Unified Test Set](https://github.com/vishwanath-06/pulsepod/tree/main/data/unified_test_set): `data/unified_test_set`
- [Test Set Merger](https://github.com/vishwanath-06/pulsepod/blob/main/data/create_unified_test_set.py): `data/create_unified_test_set.py`

### Research Pipeline

- [Model Training](https://github.com/vishwanath-06/pulsepod/blob/main/research/04_model_training_experiments.ipynb): `research/04_model_training_experiments.ipynb`

### Models

- [Pretrained Models](https://github.com/vishwanath-06/pulsepod/tree/main/models): `models`
- [CNN Classifier](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [CNN-LSTM Classifier](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Spiking Classifier](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`

### Inference Dashboard

- [Streamlit Dashboard](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Test Data Loader](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Model Loader](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Beat Simulation](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Alerts and Logs](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`
- [Live Visualizations](https://github.com/vishwanath-06/pulsepod/blob/main/app.py): `app.py`

### Other components

- **Dashboard User**
- **MIT-BIH Records**
- **PTB-XL Records**

## Connections

- MIT-BIH Records → MIT-BIH Processing: processes records (evidence: `research/03_data_augmentation_stratification.py`)
- MIT-BIH Processing → Augment and Split: segments beats (evidence: `research/03_data_augmentation_stratification.py`)
- Augment and Split → Model Training: prepares training data
- MIT-BIH Records → Test Set Merger: supplies test data (evidence: `data/create_unified_test_set.py`)
- PTB-XL Records → Test Set Merger: supplies test data (evidence: `data/create_unified_test_set.py`)
- Test Set Merger → Unified Test Set: writes combined set (evidence: `data/create_unified_test_set.py`)
- Model Training → Pretrained Models: trains models (evidence: `README.md`)
- Dashboard User → Streamlit Dashboard: starts simulation (evidence: `README.md`)
- Streamlit Dashboard → Model Loader: selects model (evidence: `app.py`)
- Model Loader → Pretrained Models: loads weights (evidence: `app.py`)
- Streamlit Dashboard → Test Data Loader: loads test data (evidence: `app.py`)
- Test Data Loader → Unified Test Set: reads test set
- Streamlit Dashboard → Beat Simulation: runs simulation (evidence: `app.py`)
- Beat Simulation → Alerts and Logs: checks alerts (evidence: `app.py`)
- Beat Simulation → Live Visualizations: renders results (evidence: `app.py`)
- CNN Classifier → Pretrained Models: has saved weights
- CNN-LSTM Classifier → Pretrained Models: has saved weights
- Spiking Classifier → Pretrained Models: has saved weights
