Spaces:
Running
Running
| 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) | |
| ```bash | |
| docker-compose up --build | |
| ``` | |
| API: http://localhost:8000 | Docs: http://localhost:8000/docs | |
| ### Local Development | |
| ```bash | |
| pip install -e . --extra-index-url https://download.pytorch.org/whl/cpu | |
| alembic upgrade head | |
| uvicorn app.main:app --reload | |
| ``` | |
| ### Live Demo | |
| ```bash | |
| 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:** | |
| 1. **Gating** - Adaptive windowing with significance scoring | |
| 2. **Inference** - Energy-efficient neural network | |
| 3. **Rules** - Medical knowledge base for explainability | |
| ## API Endpoints | |
| - `POST /ecg/infer` - Run full pipeline | |
| - `WS /ws/ecg/{patient_id}` - Real-time streaming | |
| - `GET /dashboard/stats` - System metrics | |
| - `GET /dashboard/patients` - Patient summaries | |
| - `GET /dashboard/alerts` - Alert queue | |
| ## SDK Usage | |
| ```python | |
| 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 | |
| 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](DEPLOYMENT.md) - Production deployment guide | |
| - [LAUNCH.md](LAUNCH.md) - Complete feature overview | |
| - [CLAUDE.md](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 |