mgbam commited on
Commit
c34ce9a
Β·
verified Β·
1 Parent(s): afba4df

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -51
README.md CHANGED
@@ -7,85 +7,90 @@ 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
- - 🌍 **89.8% energy savings** vs always-on inference (validated on real CGM data)
23
 
24
  ## βœ… Proven Results
25
 
26
- Tested on 216 continuous glucose monitoring events (18 hours):
27
- - **Activation Rate**: 10.2% (22/216 events) β€” intelligently selective
28
- - **Energy Savings**: 89.8% β€” critical for battery-powered wearables
29
- - **Risk Detection**: Correctly identifies hypoglycemia (<70 mg/dL) and hyperglycemia (>180 mg/dL)
30
- - **Adaptive Thresholds**: PI controller dynamically adjusts from 0.1 to 0.95 based on glucose patterns
 
31
 
32
  ## πŸš€ Quick Start
33
 
34
- 1. **Try the demo**: Visit [Sundew Diabetes Watch](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch)
35
- 2. **Upload sample data**: Download [sample_diabetes_data.csv](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/blob/main/sample_diabetes_data.csv) (or use the synthetic example)
36
- 3. **Watch it work**: See real-time significance scoring, threshold adaptation, and energy tracking
37
- 4. **Experiment**: Adjust Energy Pressure, Gate Temperature, and preset configurations
38
 
39
- ## How It Works
40
 
41
- 1. **Upload CGM Data**: CSV with `timestamp, glucose_mgdl, carbs_g, insulin_units, steps, hr`
42
- 2. **Custom Significance Model**: Computes multi-factor diabetes risk score
43
- 3. **Sundew Gating**: Adaptively decides when to run heavy ensemble model
44
- 4. **PI Control**: Threshold auto-adjusts to maintain target activation rate
45
- 5. **Energy Management**: Bio-inspired regeneration + realistic consumption costs
46
- 6. **Statistical Validation**: Bootstrap 95% CI for F1, Precision, Recall
47
- 7. **Telemetry Export**: JSON download for hardware power measurement correlation
48
 
49
- ## Live Visualizations
50
 
51
- - **Glucose Levels**: Real-time CGM data
52
- - **Significance vs Threshold**: Watch the PI controller adapt!
53
- - **Energy Level**: Bio-inspired regeneration visualization
54
- - **6-Factor Risk Components**: Interpretable diabetes scoring breakdown
55
- - **Performance Dashboard**: F1, Precision, Recall with confidence intervals
56
- - **Alerts**: High-risk event notifications
57
 
58
- ## Configuration Presets
59
 
60
- - **custom_health_hd82**: Healthcare-optimized (82% energy savings, 0.196 recall)
61
- - **tuned_v2**: Balanced general-purpose baseline
62
- - **auto_tuned**: Dataset-adaptive configuration
63
- - **conservative**: Maximum energy savings (low activation)
64
- - **energy_saver**: Battery-optimized for edge devices
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
- ## Technical Details
77
 
78
- - **Algorithm**: Sundew bio-inspired adaptive gating
79
- - **Model**: Ensemble (LogReg + RandomForest + GBM)
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
- ## References
86
 
87
- - [Sundew Algorithms](https://github.com/oluwafemidiakhoa/sundew_algorithms)
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.