IDKHowToCodeFr commited on
Commit
3079b37
·
verified ·
1 Parent(s): a7697db

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +29 -35
README.md CHANGED
@@ -8,8 +8,8 @@ pinned: false
8
  ---
9
 
10
  <div align="center">
11
- <h1>🫀 HeartFlow OS</h1>
12
- <p><strong>Edge-Native Cardiovascular Telemetry & MLOps Engine</strong></p>
13
 
14
  <p>
15
  <img src="https://img.shields.io/badge/Next.js-16+-black.svg?style=for-the-badge&logo=next.js" alt="Next.js" />
@@ -22,58 +22,52 @@ pinned: false
22
 
23
  ---
24
 
25
- ## 📖 Overview
26
 
27
- HeartFlow OS is a production-grade telemetry application engineered for **real-time cardiovascular inference**. It bridges the gap between cloud-scale machine learning and low-power embedded devices.
28
 
29
- By ingesting high-frequency patient vitals over WebSockets, evaluating them against a distributed machine-learning ensemble, and physically compiling these models into zero-dependency C-code, HeartFlow OS provides an end-to-end pipeline from clinical dashboard to microcontroller execution.
30
-
31
- ## ⚡ Tech Stack
32
-
33
- | Domain | Technologies Used | Purpose |
34
  | :--- | :--- | :--- |
35
- | **Frontend** | Next.js 16 (App Router), React 19, Framer Motion | High-throughput, 60fps telemetry rendering and UI |
36
- | **Backend Core** | FastAPI, Python 3.10+, Uvicorn | Async WebSocket orchestration and RESTful MLOps APIs |
37
- | **Machine Learning** | Scikit-Learn, SHAP | Soft-voting ensemble (RF, SVM, KNN, LogReg, MLP) |
38
- | **Database** | SQLite, `aiosqlite` | Non-blocking, asynchronous prediction logging |
39
- | **Edge Compiler** | Custom Python AST Transpiler | Generates `malloc`-free, INT8 quantized C-code for MCUs |
40
-
41
- ## ✨ Key Features
42
 
43
- - **60Hz Telemetry Interface**: A brutally fast Next.js dashboard leveraging React 19 and native WebSockets to render SVG telemetry sweeps without dropping frames.
44
- - **Edge Inference & TinyML**: Transpiles complex `scikit-learn` decision boundaries into highly optimized, dependency-free C-code designed for constrained environments (bypassing dynamic memory allocation).
45
- - **INT8 Quantization Engine**: Algorithmically scales 64-bit floating-point weights to 8-bit integers, shrinking the flash memory footprint by up to **75%** without meaningful accuracy loss.
46
- - **Soft-Voting ML Ensemble**: Fuses predictions from five distinct model architectures to generate resilient probability distributions rather than opaque binary classifications.
47
- - **Zero-Downtime MLOps**: Exposes a `/retrain` pipeline allowing for dynamic CSV uploads. It automatically imputes missing data, scales features, and retrains the entire ensemble in a background thread—hot-swapping the intelligence engine without interrupting active WebSocket streams.
48
 
49
- ## 🏗 System Architecture
 
 
 
 
50
 
51
- The architecture adheres to a strictly decoupled design pattern split across the React client, FastAPI core, and C-compiler edge.
52
 
53
- For a comprehensive deep-dive into data flows, system topography, and Mermaid diagrams, please read the [**Architecture Guide**](./ARCHITECTURE.md).
54
 
55
- ## 🚀 Quickstart
56
 
57
- ### 1. Initialize the Core (Backend)
58
 
59
- Requires Python 3.10 or higher.
60
 
61
  ```bash
62
  cd backend
63
  python -m venv .venv
64
- source .venv/bin/activate # On Windows: .\.venv\Scripts\activate
65
  pip install -r requirements.txt
66
 
67
- # Initialize the SQLite database and train the baseline ensemble
68
  python models.py
69
 
70
- # Launch the async server
71
  uvicorn main:app --reload --port 8000
72
  ```
73
 
74
- ### 2. Initialize the Client (Frontend)
75
 
76
- Requires Node.js 18 or higher.
77
 
78
  ```bash
79
  cd frontend
@@ -81,8 +75,8 @@ npm install
81
  npm run dev
82
  ```
83
 
84
- Navigate to `http://localhost:3000` to monitor live telemetry streams, access MLOps retraining pipelines, and export your INT8 TinyML headers.
85
 
86
- ## 📄 License
87
 
88
- Distributed under the MIT License. See `LICENSE` for more information.
 
8
  ---
9
 
10
  <div align="center">
11
+ <h1>HeartFlow OS</h1>
12
+ <p><strong>Cardiovascular Telemetry & MLOps Engine</strong></p>
13
 
14
  <p>
15
  <img src="https://img.shields.io/badge/Next.js-16+-black.svg?style=for-the-badge&logo=next.js" alt="Next.js" />
 
22
 
23
  ---
24
 
25
+ HeartFlow OS takes real-time patient vitals via WebSockets, runs them through an scikit-learn ensemble, and outputs probability distributions for cardiovascular conditions. It also transpiles these models into standalone C headers you can flash directly to constrained edge devices like an ESP32.
26
 
27
+ ## Components
28
 
29
+ | Domain | Tech | Details |
 
 
 
 
30
  | :--- | :--- | :--- |
31
+ | **Frontend** | Next.js 16, React 19 | Renders 60Hz telemetry streams using WebSockets and SVG |
32
+ | **Backend** | FastAPI, Python 3.10 | Handles WebSocket routing and MLOps API endpoints |
33
+ | **ML** | Scikit-Learn | Soft-voting ensemble (RF, SVM, KNN, LogReg, MLP) |
34
+ | **Database** | SQLite, `aiosqlite` | Non-blocking telemetry and prediction logging |
35
+ | **Compiler** | Custom AST Transpiler | Generates INT8 quantized, `malloc`-free C code |
 
 
36
 
37
+ ## Features
 
 
 
 
38
 
39
+ - **Live Telemetry**: Streams data at 60Hz via WebSockets to a React 19 dashboard.
40
+ - **Edge Compilation**: Converts trained scikit-learn models into C headers. The generated code requires no dependencies and does not use dynamic memory allocation.
41
+ - **Quantization**: Scales 64-bit float weights down to 8-bit integers, reducing flash memory usage by ~75%.
42
+ - **Soft-Voting**: Combines predictions from 5 different models to output a probability distribution.
43
+ - **Background Retraining**: Upload new CSV data to `/retrain` and the backend will impute missing values, retrain the models in a background thread, and update the live ensemble without dropping active socket connections.
44
 
45
+ ## Architecture
46
 
47
+ See [ARCHITECTURE.md](./ARCHITECTURE.md) for data flow diagrams and the file map.
48
 
49
+ ## Quickstart
50
 
51
+ ### 1. Backend
52
 
53
+ Requires Python 3.10+.
54
 
55
  ```bash
56
  cd backend
57
  python -m venv .venv
58
+ source .venv/bin/activate # Windows: .\.venv\Scripts\activate
59
  pip install -r requirements.txt
60
 
61
+ # Train initial models and seed the DB
62
  python models.py
63
 
64
+ # Start the server
65
  uvicorn main:app --reload --port 8000
66
  ```
67
 
68
+ ### 2. Frontend
69
 
70
+ Requires Node.js 18+.
71
 
72
  ```bash
73
  cd frontend
 
75
  npm run dev
76
  ```
77
 
78
+ Open `http://localhost:3000` to view the dashboard, upload new data, or export C headers.
79
 
80
+ ## License
81
 
82
+ MIT License. See `LICENSE`.