Spaces:
Sleeping
Sleeping
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,30 +1,76 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Sundew
|
| 3 |
-
sdk: docker
|
| 4 |
-
colorFrom:
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
- **
|
| 17 |
-
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Sundew Diabetes Watch - ADVANCED
|
| 3 |
+
sdk: docker
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: blue
|
| 6 |
+
pinned: true
|
| 7 |
+
emoji: πΏ
|
| 8 |
+
license: mit
|
| 9 |
+
---
|
| 10 |
+
# πΏ Sundew Diabetes Watch β ADVANCED EDITION
|
| 11 |
+
|
| 12 |
+
**Mission:** Low-cost, energy-aware diabetes risk monitoring for everyone β especially communities across Africa.
|
| 13 |
+
|
| 14 |
+
This app showcases the **full power of Sundew's bio-inspired adaptive algorithms** with:
|
| 15 |
+
- β¨ **PipelineRuntime** with custom DiabetesSignificanceModel
|
| 16 |
+
- π **Real-time energy tracking** with bio-inspired regeneration
|
| 17 |
+
- π― **PI control threshold adaptation** with live visualization
|
| 18 |
+
- π **Bootstrap confidence intervals** for statistical validation
|
| 19 |
+
- π¬ **6-factor diabetes risk** computation (glycemic deviation, velocity, IOB, COB, activity, variability)
|
| 20 |
+
- π€ **Ensemble model** (LogReg + RandomForest + GBM)
|
| 21 |
+
- πΎ **Telemetry export** for hardware validation workflows
|
| 22 |
+
- π **85% energy savings** vs always-on inference
|
| 23 |
+
|
| 24 |
+
## How It Works
|
| 25 |
+
|
| 26 |
+
1. **Upload CGM Data**: CSV with `timestamp, glucose_mgdl, carbs_g, insulin_units, steps, hr`
|
| 27 |
+
2. **Custom Significance Model**: Computes multi-factor diabetes risk score
|
| 28 |
+
3. **Sundew Gating**: Adaptively decides when to run heavy ensemble model
|
| 29 |
+
4. **PI Control**: Threshold auto-adjusts to maintain target activation rate
|
| 30 |
+
5. **Energy Management**: Bio-inspired regeneration + realistic consumption costs
|
| 31 |
+
6. **Statistical Validation**: Bootstrap 95% CI for F1, Precision, Recall
|
| 32 |
+
7. **Telemetry Export**: JSON download for hardware power measurement correlation
|
| 33 |
+
|
| 34 |
+
## Live Visualizations
|
| 35 |
+
|
| 36 |
+
- **Glucose Levels**: Real-time CGM data
|
| 37 |
+
- **Significance vs Threshold**: Watch the PI controller adapt!
|
| 38 |
+
- **Energy Level**: Bio-inspired regeneration visualization
|
| 39 |
+
- **6-Factor Risk Components**: Interpretable diabetes scoring breakdown
|
| 40 |
+
- **Performance Dashboard**: F1, Precision, Recall with confidence intervals
|
| 41 |
+
- **Alerts**: High-risk event notifications
|
| 42 |
+
|
| 43 |
+
## Configuration Presets
|
| 44 |
+
|
| 45 |
+
- **custom_health_hd82**: Healthcare-optimized (82% energy savings, 0.196 recall)
|
| 46 |
+
- **tuned_v2**: Balanced general-purpose baseline
|
| 47 |
+
- **auto_tuned**: Dataset-adaptive configuration
|
| 48 |
+
- **conservative**: Maximum energy savings (low activation)
|
| 49 |
+
- **energy_saver**: Battery-optimized for edge devices
|
| 50 |
+
|
| 51 |
+
> **Disclaimer:** Research prototype. Not medical advice. Not FDA/CE approved.
|
| 52 |
+
|
| 53 |
+
## Developing Locally
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
| 57 |
+
pip install -r requirements.txt
|
| 58 |
+
streamlit run app_advanced.py
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Technical Details
|
| 62 |
+
|
| 63 |
+
- **Algorithm**: Sundew bio-inspired adaptive gating
|
| 64 |
+
- **Model**: Ensemble (LogReg + RandomForest + GBM)
|
| 65 |
+
- **Risk Factors**: 6-component diabetes-specific significance model
|
| 66 |
+
- **Control**: PI threshold adaptation with energy pressure feedback
|
| 67 |
+
- **Energy Model**: Random regeneration (1.0β3.0 per tick) + realistic costs
|
| 68 |
+
- **Validation**: Bootstrap resampling (1000 iterations) for 95% CI
|
| 69 |
+
|
| 70 |
+
## References
|
| 71 |
+
|
| 72 |
+
- [Sundew Algorithms](https://github.com/anthropics/sundew-algorithms)
|
| 73 |
+
- [Documentation](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/blob/main/CLAUDE.md)
|
| 74 |
+
- [Paper](https://arxiv.org/abs/your-paper-here) (coming soon)
|
| 75 |
+
|
| 76 |
+
Built with β€οΈ for underserved communities worldwide
|