Spaces:
Runtime error
Runtime error
| title: Heartline | |
| emoji: π« | |
| sdk: gradio | |
| sdk_version: 5.33.0 | |
| app_file: app.py | |
| pinned: true | |
| short_description: Client-side cardiac home monitoring | |
| tags: | |
| - track:backyard | |
| - sponsor:openbmb | |
| - achievement:offgrid | |
| - achievement:welltuned | |
| - achievement:offbrand | |
| - achievement:llama | |
| - achievment:field-notes | |
| # Heartline π« | |
| **Cardiac home monitoring that runs entirely in your browser.** No cloud. No data leaving your device. No GPU required. | |
| Heartline lets patients log blood pressure readings, upload phonocardiogram audio from their phone, and generate a physician-ready clinical SOAP note β all processed locally using on-device AI. | |
| Read the blogpost here, honestly its better than the video or even the readme for explanations https://dev.to/pranay_narula_bdc02868409/huggingface-build-small-hackathon-my-first-health-sprint-39g5 | |
| --- | |
| ## What it does | |
| ### 1. Blood pressure tracking | |
| Log systolic, diastolic, and heart rate readings with timestamps and symptoms. A live trend chart and summary statistics (mean, SD, pulse pressure) update as you type. | |
| ### 2. ECG rhythm classification | |
| Upload a or audio recording captured by pressing your phone microphone to the left sternal border (4th-5th intercostal space). A custom-trained 5-class classifier runs entirely in the browser via **ONNX Runtime Web** with WebGPU acceleration and WASM fallback. It classifies: | |
| - Normal sinus rhythm (NSR) | |
| - Tachycardia | |
| - Bradycardia | |
| - Atrial fibrillation (AFib) | |
| - Premature ventricular contractions (PVC) | |
| ### 3. AI-generated SOAP note | |
| A ** Finetuned Version of MiniCPM 1B Q4_K_M GGUF using constitutional finetuning with deepseek v4 pro based on soap clinical notes: https://huggingface.co/SlitherCode/heartline-soap | |
| opensource on huggingface ** model runs in the browser via **wllama** (WebAssembly port of llama.cpp). It streams a physician-style Objective section incorporating all BP readings, heart rates, rhythm classifications, and patient history β tokens appear as they generate, no server involved. | |
| --- | |
| ## Tech stack | |
| | Component | Technology | | |
| |---|---| | |
| | ECG classifier | Custom PyTorch model exported to ONNX, runs via onnxruntime-web (WebGPU + WASM fallback) | | |
| | Clinical LLM | heartline-soap which is a finetuned version of MiniCPM 1B Q4_K_M GGUF via wllama v3.5.0 (WebAssembly llama.cpp) | | |
| | Frontend | Vanilla JS, zero framework, fully custom UI | | |
| | Backend | Gradio Server used as static file server only β zero backend inference | | |
| | Audio | AudioContext.decodeAudioData() β mel spectrogram β classifier | | |
| **Zero backend inference.** The Gradio server only serves index.html, heartline.onnx, and model_Q4_K_M.gguf. All AI runs client-side. | |
| --- | |
| ## Models used | |
| - **ECG classifier**: Custom 5-class CNN trained on PhysioNet phonocardiogram data. ~94 MB ONNX. | |
| - **Clinical summarizer**: MiniCPM 1B Q4_K_M quantized GGUF (~688 MB). Streams the SOAP Objective section directly in the browser via WebAssembly. | |
| --- | |
| ## Medical disclaimer | |
| Heartline is a research prototype and has not been evaluated or cleared by the FDA. It is not a substitute for professional medical advice, diagnosis, or treatment. Cardiac rhythm classifications are automated and may be inaccurate. If you are experiencing a medical emergency, call 911 or your local emergency number immediately. | |
| --- | |
| ## Demo | |
| > Demo video: https://youtu.be/xRb6cS7FfWY | |
| > Social post: https://www.linkedin.com/feed/update/urn:li:activity:7472434733075869696/ | |
| --- | |
| ## How to use | |
| 1. Fill in patient background (age, sex, conditions, medications) | |
| 2. Log blood pressure readings with heart rate | |
| 3. Upload a .wav audio recording from your phone (or use the provided synthetic samples) | |
| 4. Wait for the ECG classifier to run (a few seconds) | |
| 5. Generate the SOAP note β MiniCPM streams the clinical summary live in your browser | |
| Built for the **Build Small Hackathon** β Backyard AI track | |