How idkhowtocodefr/tinyml-heart-health-monitoring-dashboard works
This is a heart-health monitoring dashboard: clinicians enter patient vitals, the Streamlit prediction page sends them to the FastAPI service, and the service returns a weighted five-model classification and confidence. Related workflows expose SHAP explanations, prediction history, dataset analytics, model retraining, and C-code export for embedded targets. The backend’s persistence layer records predictions in SQLite and optionally synchronizes that database with the Hugging Face Hub. The graph also preserves the documented edge and MLOps capabilities; unsampled page and route internals are represented only where the README or sampled code supports them.
Main entry points: main.py FastAPI Routes · 1_Predict_Dashboard.py Prediction UI · database.py History Persistence · ensemble.py Soft-Voting Ensemble
Components 20
Clinical Dashboard
- Prediction UI
frontend/pages/1_Predict_Dashboard.py - Data Analytics
frontend/pages/2_Data_Analytics.py - Patient History
frontend/pages/4_Patient_History.py - MLOps Settings
frontend/pages/5_MLOps_Settings.py - Edge Deployment
frontend/pages/3_Edge_Deployment.py
API and Inference
- FastAPI Routes
backend/main.py - Feature Preprocessing
backend/preprocessing.py - Soft-Voting Ensemble
backend/ensemble.py - Five Classifiers
model - SHAP Explanation
backend/main.py
Data and Operations
- History Persistence
backend/database.py - SQLite History
backend/patient_history.db - Hub Dataset Store
- Patient Dataset
data/patient_dataset.csv - Dataset Retraining
backend/main.py
TinyML Export
- C-Code Export
backend/main.py - Generated C Header
Other components
- Clinician
- Embedded Target
- Dataset Upload
Connections 28
- Clinician → Prediction UI: enters vitals
- Prediction UI → FastAPI Routes: requests prediction
- FastAPI Routes → Feature Preprocessing: prepares features
- FastAPI Routes → Soft-Voting Ensemble: requests prediction
- Soft-Voting Ensemble → Five Classifiers: loads classifiers
- Soft-Voting Ensemble → FastAPI Routes: returns consensus
- FastAPI Routes → History Persistence: logs prediction
- Patient History → FastAPI Routes: requests history
- FastAPI Routes → History Persistence: fetches history
- History Persistence → SQLite History: reads and writes
- History Persistence → Hub Dataset Store: syncs database
- Clinician → Data Analytics: views analytics
- Data Analytics → FastAPI Routes: requests dataset
- FastAPI Routes → Patient Dataset: reads dataset
- Clinician → MLOps Settings: submits dataset
- Dataset Upload → MLOps Settings: provides CSV
- MLOps Settings → FastAPI Routes: requests retraining
- FastAPI Routes → Dataset Retraining: runs retraining
- Dataset Retraining → Patient Dataset: updates dataset
- Clinician → Edge Deployment: selects model
- Edge Deployment → FastAPI Routes: requests export
- FastAPI Routes → C-Code Export: exports model
- C-Code Export → Five Classifiers: loads selected model
- C-Code Export → Generated C Header: generates C code
- Generated C Header → Embedded Target: deploys firmware
- Prediction UI → FastAPI Routes: requests explanation
- FastAPI Routes → SHAP Explanation: computes SHAP
- SHAP Explanation → Prediction UI: returns impacts