Spaces:
Running
Running
A newer version of the Gradio SDK is available:
6.1.0
metadata
title: Sundew Health Demo
sdk: gradio
sdk_version: 6.0.2
app_file: app_space_wow.py
pinned: false
Sundew Health Monitor
Neurosymbolic, energy-aware AI for continuous ECG monitoring
Combines adaptive gating, ML inference, and symbolic reasoning to deliver trustworthy, energy-efficient medical biosignal monitoring.
Key Features
- 85% energy reduction via Sundew gating algorithm
- Explainable alerts through symbolic rule chains
- Real-time streaming with WebSocket support
- Multi-patient dashboard for clinical monitoring
- Production-ready API with comprehensive SDK
Quick Start
Docker (Recommended)
docker-compose up --build
API: http://localhost:8000 | Docs: http://localhost:8000/docs
Local Development
pip install -e . --extra-index-url https://download.pytorch.org/whl/cpu
alembic upgrade head
uvicorn app.main:app --reload
Live Demo
python app_space_live.py
Architecture
ECG Stream β Sundew Gating β ML Inference β Rule Engine β Alert
(50-90% reduction) (PyTorch CNN) (Symbolic)
Three-stage neurosymbolic pipeline:
- Gating - Adaptive windowing with significance scoring
- Inference - Energy-efficient neural network
- Rules - Medical knowledge base for explainability
API Endpoints
POST /ecg/infer- Run full pipelineWS /ws/ecg/{patient_id}- Real-time streamingGET /dashboard/stats- System metricsGET /dashboard/patients- Patient summariesGET /dashboard/alerts- Alert queue
SDK Usage
from sundew_sdk import SundewClient
client = SundewClient(base_url="http://localhost:8000")
result = client.infer_ecg(
patient_id="p001",
signal=[...],
age=72,
has_prior_stroke=False
)
print(f"{result['label']} | Alert: {result['alert_level']}")
See sdk/example_client.py for complete examples.
Benchmarking
Evaluate against MIT-BIH Arrhythmia Database:
bash scripts/run_full_benchmark.sh
Metrics tracked:
- Accuracy, Precision, Recall, F1
- FLOPs reduction
- Energy savings
- Latency
Results saved to benchmarks/results/
Documentation
- DEPLOYMENT.md - Production deployment guide
- LAUNCH.md - Complete feature overview
- CLAUDE.md - Architecture documentation
Technology Stack
- Backend: FastAPI, SQLAlchemy, Alembic
- ML: PyTorch, Adaptive Sparse Training
- Algorithms: Sundew (gating), symbolic reasoning
- Database: PostgreSQL (production), SQLite (dev)
- Demo: Gradio