Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,85 +7,90 @@ pinned: true
|
|
| 7 |
emoji: πΏ
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
-
# πΏ Sundew Diabetes Watch β
|
| 11 |
|
| 12 |
-
**Mission:**
|
| 13 |
|
| 14 |
-
This app
|
| 15 |
-
|
|
|
|
| 16 |
- π **Real-time energy tracking** with bio-inspired regeneration
|
| 17 |
-
- π― **PI
|
| 18 |
- π **Bootstrap confidence intervals** for statistical validation
|
| 19 |
-
- π¬ **
|
| 20 |
- π€ **Ensemble model** (LogReg + RandomForest + GBM)
|
| 21 |
- πΎ **Telemetry export** for hardware validation workflows
|
| 22 |
-
- π **89.8% energy savings**
|
| 23 |
|
| 24 |
## β
Proven Results
|
| 25 |
|
| 26 |
-
Tested on 216 continuous glucose monitoring events (18 hours):
|
| 27 |
-
|
| 28 |
-
- **
|
| 29 |
-
- **
|
| 30 |
-
- **
|
|
|
|
| 31 |
|
| 32 |
## π Quick Start
|
| 33 |
|
| 34 |
-
1. **Try the demo
|
| 35 |
-
2. **Upload
|
| 36 |
-
3. **
|
| 37 |
-
4. **Experiment
|
| 38 |
|
| 39 |
-
## How It Works
|
| 40 |
|
| 41 |
-
1. **Upload CGM
|
| 42 |
-
2. **Custom
|
| 43 |
-
3. **Sundew
|
| 44 |
-
4. **PI
|
| 45 |
-
5. **Energy
|
| 46 |
-
6. **Statistical
|
| 47 |
-
7. **Telemetry
|
| 48 |
|
| 49 |
-
## Live Visualizations
|
| 50 |
|
| 51 |
-
- **Glucose
|
| 52 |
-
- **Significance vs
|
| 53 |
-
- **Energy
|
| 54 |
-
- **
|
| 55 |
-
- **Performance
|
| 56 |
-
- **Alerts
|
| 57 |
|
| 58 |
-
## Configuration Presets
|
| 59 |
|
| 60 |
-
- **custom_health_hd82
|
| 61 |
-
- **tuned_v2
|
| 62 |
-
- **auto_tuned
|
| 63 |
-
- **conservative
|
| 64 |
-
- **energy_saver
|
| 65 |
|
| 66 |
> **Disclaimer:** Research prototype. Not medical advice. Not FDA/CE approved.
|
| 67 |
|
| 68 |
-
## Developing Locally
|
| 69 |
|
| 70 |
```bash
|
| 71 |
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
| 72 |
pip install -r requirements.txt
|
| 73 |
streamlit run app_advanced.py
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
- **Risk Factors**: 6-component diabetes-specific significance model
|
| 81 |
-
- **Control**: PI threshold adaptation with energy pressure feedback
|
| 82 |
-
- **Energy Model**: Random regeneration (1.0β3.0 per tick) + realistic costs
|
| 83 |
-
- **Validation**: Bootstrap resampling (1000 iterations) for 95% CI
|
| 84 |
|
| 85 |
-
|
| 86 |
|
| 87 |
-
|
| 88 |
-
- [Documentation](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/edit/main/README.md)
|
| 89 |
-
- [Paper](https://arxiv.org/abs/your-paper-here) (coming soon)
|
| 90 |
|
| 91 |
-
Built with β€οΈ for underserved communities worldwide
|
|
|
|
| 7 |
emoji: πΏ
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
+
# πΏ Sundew Diabetes Watch β Advanced Edition
|
| 11 |
|
| 12 |
+
**Mission:** Deliver low-cost, energy-aware diabetes risk monitoring for everyone β with a special focus on communities across Africa.
|
| 13 |
|
| 14 |
+
This app demonstrates the **full capabilities of Sundewβs bio-inspired adaptive algorithms**, including:
|
| 15 |
+
|
| 16 |
+
- β¨ **PipelineRuntime** with a custom `DiabetesSignificanceModel`
|
| 17 |
- π **Real-time energy tracking** with bio-inspired regeneration
|
| 18 |
+
- π― **PI-control threshold adaptation** with live visualization
|
| 19 |
- π **Bootstrap confidence intervals** for statistical validation
|
| 20 |
+
- π¬ **Six-factor diabetes risk** computation (glycemic deviation, velocity, IOB, COB, activity, variability)
|
| 21 |
- π€ **Ensemble model** (LogReg + RandomForest + GBM)
|
| 22 |
- πΎ **Telemetry export** for hardware validation workflows
|
| 23 |
+
- π **89.8% energy savings** versus always-on inference (validated on real CGM data)
|
| 24 |
|
| 25 |
## β
Proven Results
|
| 26 |
|
| 27 |
+
Tested on 216 continuous glucose monitoring events (β18 hours):
|
| 28 |
+
|
| 29 |
+
- **Activation rate:** 10.2% (22/216 events) β intelligently selective
|
| 30 |
+
- **Energy savings:** 89.8% β essential for battery-powered wearables
|
| 31 |
+
- **Risk detection:** Correctly identifies hypoglycemia (<70 mg/dL) and hyperglycemia (>180 mg/dL)
|
| 32 |
+
- **Adaptive thresholds:** PI controller dynamically adjusts from 0.10 β 0.95 based on glucose patterns
|
| 33 |
|
| 34 |
## π Quick Start
|
| 35 |
|
| 36 |
+
1. **Try the demo:** [Sundew Diabetes Watch](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch)
|
| 37 |
+
2. **Upload data:** Use your CSV or the [sample_diabetes_data.csv](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/blob/main/sample_diabetes_data.csv)
|
| 38 |
+
3. **Observe:** Real-time significance scoring, threshold adaptation, and energy tracking
|
| 39 |
+
4. **Experiment:** Tweak Energy Pressure, Gate Temperature, and presets
|
| 40 |
|
| 41 |
+
## π οΈ How It Works
|
| 42 |
|
| 43 |
+
1. **Upload CGM data** with columns: `timestamp, glucose_mgdl, carbs_g, insulin_units, steps, hr`
|
| 44 |
+
2. **Custom significance model** computes a multi-factor diabetes risk score
|
| 45 |
+
3. **Sundew gating** decides when to run the heavy ensemble model
|
| 46 |
+
4. **PI control** auto-adjusts thresholds to maintain target activation
|
| 47 |
+
5. **Energy management** uses bio-inspired regeneration and realistic costs
|
| 48 |
+
6. **Statistical validation** via bootstrap 95% CIs (F1, Precision, Recall)
|
| 49 |
+
7. **Telemetry export** (JSON) for power-measurement correlation
|
| 50 |
|
| 51 |
+
## πΊ Live Visualizations
|
| 52 |
|
| 53 |
+
- **Glucose levels:** Continuous CGM stream
|
| 54 |
+
- **Significance vs. threshold:** See the PI controller adapt in real time
|
| 55 |
+
- **Energy level:** Bio-inspired regeneration over time
|
| 56 |
+
- **Risk components (Γ6):** Interpretable breakdown of the score
|
| 57 |
+
- **Performance dashboard:** F1, Precision, Recall with confidence intervals
|
| 58 |
+
- **Alerts:** High-risk notifications
|
| 59 |
|
| 60 |
+
## π§ Configuration Presets
|
| 61 |
|
| 62 |
+
- **custom_health_hd82:** Healthcare-optimized (β82% energy savings, ~0.196 recall)
|
| 63 |
+
- **tuned_v2:** Balanced general-purpose baseline
|
| 64 |
+
- **auto_tuned:** Dataset-adaptive configuration
|
| 65 |
+
- **conservative:** Maximum savings (lower activation)
|
| 66 |
+
- **energy_saver:** Battery-optimized for edge devices
|
| 67 |
|
| 68 |
> **Disclaimer:** Research prototype. Not medical advice. Not FDA/CE approved.
|
| 69 |
|
| 70 |
+
## π» Developing Locally
|
| 71 |
|
| 72 |
```bash
|
| 73 |
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
|
| 74 |
pip install -r requirements.txt
|
| 75 |
streamlit run app_advanced.py
|
| 76 |
+
π§ Technical Details
|
| 77 |
+
Algorithm: Sundew bio-inspired adaptive gating
|
| 78 |
+
|
| 79 |
+
Model: Ensemble (LogReg + RandomForest + GBM)
|
| 80 |
+
|
| 81 |
+
Risk factors: Six-component diabetes-specific significance model
|
| 82 |
+
|
| 83 |
+
Control: PI threshold adaptation with energy-pressure feedback
|
| 84 |
+
|
| 85 |
+
Energy model: Random regeneration (1.0β3.0 per tick) + realistic costs
|
| 86 |
|
| 87 |
+
Validation: Bootstrap resampling (1,000 iterations) for 95% CI
|
| 88 |
|
| 89 |
+
π References
|
| 90 |
+
Sundew Algorithms
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
Documentation
|
| 93 |
|
| 94 |
+
Paper (coming soon)
|
|
|
|
|
|
|
| 95 |
|
| 96 |
+
Built with β€οΈ for underserved communities worldwide.
|