mgbam commited on
Commit
ba81f60
Β·
verified Β·
1 Parent(s): ba8082c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +90 -90
README.md CHANGED
@@ -1,91 +1,91 @@
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
- - 🌍 **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/anthropics/sundew-algorithms)
88
- - [Documentation](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/blob/main/CLAUDE.md)
89
- - [Paper](https://arxiv.org/abs/your-paper-here) (coming soon)
90
-
91
  Built with ❀️ for underserved communities worldwide
 
1
+ ---
2
+ title: Sundew Diabetes Commons
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
+ - 🌍 **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/anthropics/sundew-algorithms)
88
+ - [Documentation](https://huggingface.co/spaces/mgbam/sundew_diabetes_watch/blob/main/CLAUDE.md)
89
+ - [Paper](https://arxiv.org/abs/your-paper-here) (coming soon)
90
+
91
  Built with ❀️ for underserved communities worldwide