mgbam commited on
Commit
2ca95e9
·
verified ·
1 Parent(s): eac21ef

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +120 -91
README.md CHANGED
@@ -1,91 +1,120 @@
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: blue
5
+ colorTo: green
6
+ pinned: true
7
+ emoji: 🕊️
8
+ license: mit
9
+ ---
10
+
11
+ # 🕊️ Sundew Diabetes Commons
12
+ ### Free, compassionate care for every person, everywhere
13
+
14
+ > **Our promise:** Diabetes care should be hopeful, human, and free. Sundew Diabetes Commons is an open platform that blends real‑time monitoring, full‑cycle treatment support, and community empowerment. Powered by Sundews bioinspired adaptive intelligence, it’s designed for clinics, caregivers, and families who refuse to let cost or infrastructure stand in the way of wellness.
15
+
16
+ ---
17
+
18
+ ## 🌍 Why we built this
19
+
20
+ - **Half a billion** people live with diabetes; far too many go untreated because care is expensive or hard to reach.
21
+ - **Daily life is demanding**: glucose checks, medication schedules, activity, meals, stress, sleep, and emotional health all intersect.
22
+ - **We can do better**. Sundew’s adaptive gating conserves energy and compute so life-saving insights stay available—even on low-cost devices in remote communities.
23
+
24
+ **Sundew Diabetes Commons** unites monitoring, prediction, lifestyle guidance, and social support into a single, open resource.
25
+
26
+ ---
27
+
28
+ ## 🧠 What’s inside
29
+
30
+ | Pillar | How Sundew helps | Included tools |
31
+ | ------ | ---------------- | -------------- |
32
+ | **Early sensing** | Continuous glucose & vitals intake with Sundew’s adaptive gating | CGM/FGM ingestion, wearable streams, manual diaries |
33
+ | **Full-cycle treatment** | Medication titration, IOB/COB tracking, doctor-ready summaries | Medication planner, automated visit reports, clinician handoff sheets |
34
+ | **Lifestyle & mental health** | Nutrition cues, sleep & activity nudges, mood check‑ins | Recipe library, culturally aware meal prompts, gratitude journal |
35
+ | **Community & access** | Shareable alerts, family dashboards, clinic-ready APIs | Caregiver SMS, telehealth hooks, clinic kiosks |
36
+ | **Equitable coverage** | Works offline, in low-bandwidth, and on <$50 hardware | Lightweight Sundew runtimes, SMS/USSD pipeline, solar-ready builds |
37
+ | **Open innovation** | Everything open-source; mentors & global volunteers welcome | APIs, data guides, governance playbook, deployment recipes |
38
+
39
+ ---
40
+
41
+ ## 🏗️ Platform architecture
42
+
43
+ 1. **Data fabric** Streams CGM sensors, wearables, and manual logs into a unified timeline.
44
+ 2. **Adaptive core** Sundew PipelineRuntime gates “heavy” analytics (e.g., ensemble risk scoring) to save power.
45
+ 3. **Insight engines** Predict hypoglycemia/hyperglycemia, learn daily rhythms, measure recovery, flag medication gaps.
46
+ 4. **Whole-life lens** Combines medication, movement, nutrition, sleep, mood, and social support.
47
+ 5. **Storytelling layer** Visual tools that translate data into empathetic care guidance for clinicians and families.
48
+ 6. **Community commons** – APIs, sample deployments, and stewardship to keep care local and contextual.
49
+
50
+ ---
51
+
52
+ ## 🌟 What’s new in this edition
53
+
54
+ - **Humanitarian thresholds** (maternal populations, paediatrics, low-resource clinics) now configurable through structured configs.
55
+ - **Bypass safety**, so critical vitals alert even if a probabilistic gate would have skipped them.
56
+ - **Energy telemetry** exposes percent + raw joules + projected days, for better solar/battery planning.
57
+ - **Streamlit prototypes** for quick demos and advanced clinics (see `sundew_diabetes_watch_streamlit_app_prototype.py` and `app.py`).
58
+ - **Unit-tested humanitarian monitor** ensuring bypass safety and energy accounting stay correct.
59
+
60
+ ---
61
+
62
+ ## 🚀 Quick start (free & open)
63
+
64
+ ```bash
65
+ git clone https://github.com/your-org/sundew-algorithms.git
66
+ cd sundew_algorithms/diabetes/sundew_diabetes_watch
67
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
68
+ pip install -r requirements.txt
69
+ streamlit run app.py
70
+ Short on resources? Try our lightweight prototype:
71
+
72
+ bash
73
+
74
+ streamlit run ../sundew_diabetes_watch_streamlit_app_prototype.py
75
+ Everything runs locally, free of charge. No license fees. No cloud lock-in.
76
+
77
+ 💝 For clinics, communities, and families
78
+ Community health workers – Offline-first kits with SMS/USSD alerting and printable action sheets.
79
+ Clinics & hospitals API integrations, dashboard widgets, and HL7/FHIR-ready summaries.
80
+ Family caregivers Mobile progress stories, medication reminders, and shared calendars.
81
+ Researchers & students Open notebooks, synthetic datasets, fairness dashboards, reproducibility guides.
82
+ 🔄 Full-cycle support
83
+ Assess Real-time sensing, rapid detection, contextual risk scoring.
84
+ Act – Personalized treatment and lifestyle recommendations with clear steps.
85
+ Adapt – PI-controlled thresholds recalibrate around each person’s unique rhythms.
86
+ Advance – Telemetry and reports feed continuous improvement across clinics and communities.
87
+ 🔐 Privacy, ethics & equity
88
+ Works offline by default; nothing leaves the device unless you opt in.
89
+ De-identified sharing governed by a community-first data pledge.
90
+ Cultural & gender sensitivity baked into messaging and workflows.
91
+ Internationalization support (linguistically and locally customizable).
92
+ Bias monitoring & fairness metrics included in dashboards.
93
+ 🛠️ Build with us
94
+ How to help What to do
95
+ 🌱 Contribute code Issues tagged help-wanted. We pair mentors with first-time contributors.
96
+ 🤝 Localize Add new languages, culturally relevant recipes, and lifestyle guidance.
97
+ 📊 Share data Contribute synthetic or consenting real-world datasets for benchmarking.
98
+ 📚 Teach Host community workshops—even offline. Slides and curricula included.
99
+ 💬 Advocate Partner with NGOs, ministries of health, or grassroots clinics to deploy kits.
100
+ We maintain a Sundew Commons Governance Playbook to keep decisions transparent, equitable, and community-driven.
101
+
102
+ 🔭 Roadmap highlights
103
+ 💬 Conversational guidance in major world languages
104
+ 🧬 Integration with affordable CGM/FGM hardware
105
+ 👶 Specialized modules for paediatric and maternal care
106
+ 🧘 AI-driven mindfulness & mental health support
107
+ 🔌 Drop-in bridge for national EHR/EMR ecosystems
108
+ 🌐 Regional deployment programs led by local stewards
109
+ 📝 License
110
+ MIT – because diabetes care should be free.
111
+
112
+ 🙏 Gratitude
113
+ To the clinicians, caregivers, researchers, volunteers, and families shaping this commons: we see you, we thank you, and we’re building this with you.
114
+
115
+ Sundew Diabetes Commons – powered by empathy, science, and the belief that healthcare belongs to everyone.
116
+
117
+ vbnet
118
+
119
+
120
+ Let me know if you’d like help applying this rewrite to the repo or tailoring it for a specific deployment!