Spaces:
Sleeping
Sleeping
updated readme
Browse files- README copy.md +208 -157
README copy.md
CHANGED
@@ -1,230 +1,281 @@
|
|
1 |
---
|
2 |
-
title: GlycoAI - AI Glucose Insights
|
3 |
emoji: π©Ί
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.44.0
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
-
license:
|
11 |
tags:
|
12 |
-
-
|
13 |
- diabetes
|
14 |
-
- glucose
|
15 |
-
- ai
|
16 |
-
- medical
|
|
|
|
|
17 |
- gradio
|
18 |
-
-
|
19 |
-
- agent-demo-track
|
20 |
-
- dexcom
|
21 |
-
- cgm
|
22 |
-
#agent-demo-track
|
23 |
---
|
24 |
|
25 |
-
# π©Ί
|
26 |
|
27 |
-
**
|
28 |
|
29 |
-
[](https://gradio.app/)
|
31 |
-
[](https://github.com/your-repo/glycoai)
|
229 |
|
230 |
-
|
|
|
1 |
---
|
2 |
+
title: GlycoAI - AI-Powered Glucose Insights
|
3 |
emoji: π©Ί
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.44.0
|
8 |
+
app_file: app.py
|
9 |
pinned: false
|
10 |
+
license: apache-2.0
|
11 |
tags:
|
12 |
+
- agent-demo-track
|
13 |
- diabetes
|
14 |
+
- glucose-monitoring
|
15 |
+
- healthcare-ai
|
16 |
+
- medical-analysis
|
17 |
+
- dexcom-api
|
18 |
+
- mistral-ai
|
19 |
- gradio
|
20 |
+
- demo
|
|
|
|
|
|
|
|
|
21 |
---
|
22 |
|
23 |
+
# GlycoAI π©Ί - AI-Powered Glucose Insights
|
24 |
|
25 |
+
> **Transform your glucose data into actionable health insights with intelligent AI analysis**
|
26 |
|
27 |
+
[](https://opensource.org/licenses/Apache-2.0)
|
28 |
[](https://gradio.app/)
|
29 |
+
[](https://huggingface.co/spaces)
|
30 |
+
[](https://mistral.ai/)
|
31 |
|
32 |
## π Overview
|
33 |
|
34 |
+
GlycoAI is an advanced AI-powered application that analyzes continuous glucose monitoring (CGM) data to provide personalized diabetes management insights. Using state-of-the-art AI agents powered by Mistral AI, GlycoAI transforms complex glucose patterns into clear, actionable recommendations for better diabetes control.
|
35 |
|
36 |
+
### π― Key Features
|
37 |
|
38 |
+
- **π€ Intelligent AI Agent**: Conversational AI that understands glucose patterns and provides personalized insights
|
39 |
+
- **π Comprehensive Analysis**: 14-day glucose trend analysis with clinical metrics (Time in Range, GMI, CV)
|
40 |
+
- **π Demo Users**: Four realistic patient profiles showcasing different glucose management scenarios
|
41 |
+
- **π Dexcom Integration**: OAuth-authenticated connection to Dexcom Sandbox API
|
42 |
+
- **π Interactive Visualizations**: Color-coded glucose charts with target range overlays
|
43 |
+
- **β οΈ Smart Notifications**: Real-time alerts for concerning glucose patterns
|
44 |
+
- **π₯ Clinical Focus**: Evidence-based recommendations aligned with diabetes care standards
|
45 |
|
46 |
+
## π Live Demo
|
47 |
|
48 |
+
**Try GlycoAI now:** [https://huggingface.co/spaces/your-username/glycoai](https://huggingface.co/spaces/your-username/glycoai)
|
|
|
|
|
|
|
49 |
|
50 |
+
### π Demo Users Available
|
51 |
|
52 |
+
1. **Sarah Thompson** - G7 Mobile - β οΈ **Unstable Control** (Demonstrates crisis management)
|
53 |
+
2. **Marcus Rodriguez** - ONE+ Mobile - Type 2 Diabetes with Dawn Phenomenon
|
54 |
+
3. **Jennifer Chen** - G6 Mobile - Athletic lifestyle with excellent control
|
55 |
+
4. **Robert Williams** - G6 Receiver - Experienced user with good management
|
|
|
56 |
|
57 |
+
## π οΈ Technology Stack
|
|
|
|
|
|
|
58 |
|
59 |
+
- **Frontend**: Gradio 4.44.0 with custom CSS styling
|
60 |
+
- **AI Engine**: Mistral AI for intelligent glucose pattern analysis
|
61 |
+
- **Data Processing**: Pandas, NumPy for glucose data analysis
|
62 |
+
- **Visualization**: Plotly for interactive glucose charts
|
63 |
+
- **API Integration**: Dexcom API with OAuth 2.0 authentication
|
64 |
+
- **Deployment**: Hugging Face Spaces
|
|
|
65 |
|
66 |
+
## π₯ Clinical Significance
|
67 |
|
68 |
+
### Metrics Analyzed
|
69 |
+
- **Time in Range (TIR)**: Target >70% (70-180 mg/dL)
|
70 |
+
- **Time Below Range (TBR)**: Target <4% (<70 mg/dL)
|
71 |
+
- **Time Above Range (TAR)**: Target <25% (>180 mg/dL)
|
72 |
+
- **Glucose Management Indicator (GMI)**: Estimated A1C
|
73 |
+
- **Coefficient of Variation (CV)**: Target <36% (glucose variability)
|
74 |
|
75 |
+
### AI Capabilities
|
76 |
+
- **Pattern Recognition**: Identifies dawn phenomenon, post-meal spikes, nocturnal hypoglycemia
|
77 |
+
- **Safety Prioritization**: Emphasizes hypoglycemia prevention and severe glucose excursions
|
78 |
+
- **Personalized Recommendations**: Tailored advice based on individual glucose patterns
|
79 |
+
- **Clinical Context**: Provides education on diabetes management principles
|
80 |
|
81 |
+
## π§ Installation & Setup
|
|
|
|
|
|
|
82 |
|
83 |
+
### For Local Development
|
|
|
|
|
|
|
84 |
|
85 |
+
```bash
|
86 |
+
# Clone the repository
|
87 |
+
git clone https://github.com/your-username/glycoai.git
|
88 |
+
cd glycoai
|
89 |
|
90 |
+
# Install dependencies
|
91 |
+
pip install -r requirements.txt
|
92 |
|
93 |
+
# Set up environment variables
|
94 |
+
cp .env.example .env
|
95 |
+
# Edit .env with your API keys:
|
96 |
+
# MISTRAL_API_KEY=your_mistral_api_key_here
|
97 |
+
# DEXCOM_CLIENT_ID=your_dexcom_client_id (optional)
|
98 |
+
# DEXCOM_CLIENT_SECRET=your_dexcom_client_secret (optional)
|
99 |
|
100 |
+
# Run the application
|
101 |
+
python app.py
|
102 |
+
```
|
103 |
|
104 |
+
### Environment Variables
|
105 |
|
106 |
+
| Variable | Description | Required |
|
107 |
+
|----------|-------------|----------|
|
108 |
+
| `MISTRAL_API_KEY` | Mistral AI API key for chat functionality | β
Yes |
|
109 |
+
| `DEXCOM_CLIENT_ID` | Dexcom developer client ID | β Optional |
|
110 |
+
| `DEXCOM_CLIENT_SECRET` | Dexcom developer client secret | β Optional |
|
|
|
111 |
|
112 |
+
## π Usage Guide
|
113 |
|
114 |
+
### 1. **Select Data Source**
|
115 |
+
- Choose from 4 demo users for instant testing
|
116 |
+
- Or connect via Dexcom Sandbox OAuth (requires developer credentials)
|
|
|
|
|
117 |
|
118 |
+
### 2. **Load Glucose Data**
|
119 |
+
- Click "Load 14-Day Glucose Data" button
|
120 |
+
- Watch for notification indicating data quality and patterns
|
|
|
|
|
121 |
|
122 |
+
### 3. **Analyze with AI**
|
123 |
+
- Navigate to "Chat with AI" tab
|
124 |
+
- Click on suggested prompts or ask custom questions
|
125 |
+
- Get personalized insights about glucose patterns
|
|
|
126 |
|
127 |
+
### 4. **Explore Visualizations**
|
128 |
+
- View interactive 14-day glucose trends
|
129 |
+
- Examine detailed statistics and clinical metrics
|
130 |
+
- Understand time-in-range analysis
|
131 |
|
132 |
+
## π― Use Cases
|
|
|
|
|
|
|
133 |
|
134 |
+
### For Healthcare Providers
|
135 |
+
- **Patient Education**: Explain glucose patterns in accessible language
|
136 |
+
- **Treatment Planning**: Identify areas for intervention
|
137 |
+
- **Progress Monitoring**: Track improvement over time
|
138 |
+
- **Clinical Documentation**: Generate insights for medical records
|
139 |
|
140 |
+
### For Patients & Caregivers
|
141 |
+
- **Self-Management**: Understand personal glucose patterns
|
142 |
+
- **Medication Timing**: Optimize treatment schedules
|
143 |
+
- **Lifestyle Adjustments**: Learn about food and exercise impacts
|
144 |
+
- **Safety Awareness**: Recognize dangerous patterns
|
145 |
|
146 |
+
### For Researchers & Developers
|
147 |
+
- **Algorithm Development**: Study glucose pattern recognition
|
148 |
+
- **AI Applications**: Explore conversational health AI
|
149 |
+
- **Data Analysis**: Understand CGM data processing
|
150 |
+
- **Clinical Decision Support**: Build evidence-based tools
|
151 |
|
152 |
+
## π¬ Technical Details
|
153 |
|
154 |
+
### Data Processing Pipeline
|
155 |
+
1. **Data Ingestion**: Accepts Dexcom API format or generates realistic mock data
|
156 |
+
2. **Preprocessing**: Validates timestamps, handles missing values, calculates trends
|
157 |
+
3. **Statistical Analysis**: Computes clinical metrics using standardized formulas
|
158 |
+
4. **Pattern Recognition**: Identifies glucose variability, meal responses, and anomalies
|
159 |
+
5. **AI Context Building**: Structures data for intelligent conversation
|
160 |
|
161 |
+
### AI Agent Architecture
|
162 |
+
- **Context Awareness**: Maintains conversation state with glucose data context
|
163 |
+
- **Clinical Knowledge**: Trained on diabetes management best practices
|
164 |
+
- **Safety Focus**: Prioritizes urgent recommendations for dangerous patterns
|
165 |
+
- **Personalization**: Adapts advice to individual glucose characteristics
|
166 |
|
167 |
+
## π Demo Scenarios
|
168 |
|
169 |
+
### Sarah Thompson - Crisis Management
|
170 |
+
- **Scenario**: Highly unstable glucose with frequent dangerous excursions
|
171 |
+
- **TIR**: ~45% (concerning)
|
172 |
+
- **CV**: ~52% (very high variability)
|
173 |
+
- **AI Response**: Urgent safety recommendations and healthcare provider consultation
|
174 |
|
175 |
+
### Marcus Rodriguez - Dawn Phenomenon
|
176 |
+
- **Scenario**: Type 2 diabetes with morning glucose elevation
|
177 |
+
- **Pattern**: Consistent 6-8 AM glucose rises
|
178 |
+
- **AI Response**: Medication timing optimization and morning routine adjustments
|
|
|
|
|
|
|
179 |
|
180 |
+
### Jennifer Chen - Athletic Lifestyle
|
181 |
+
- **Scenario**: Active individual with exercise-related glucose variations
|
182 |
+
- **Pattern**: Exercise-induced lows and recovery patterns
|
183 |
+
- **AI Response**: Pre/post-workout glucose management strategies
|
184 |
|
185 |
+
### Robert Williams - Experienced Management
|
186 |
+
- **Scenario**: Long-term diabetes with good overall control
|
187 |
+
- **Focus**: Fine-tuning and maintaining excellent management
|
188 |
+
- **AI Response**: Advanced optimization strategies and pattern maintenance
|
189 |
|
190 |
+
## π‘οΈ Privacy & Security
|
|
|
191 |
|
192 |
+
- **Data Processing**: All analysis performed in real-time, no permanent storage
|
193 |
+
- **API Security**: OAuth 2.0 authentication for Dexcom integration
|
194 |
+
- **Privacy by Design**: No personal health information retained between sessions
|
195 |
+
- **Compliance**: Designed with HIPAA principles in mind
|
196 |
+
- **Transparency**: Open-source approach for algorithm audibility
|
197 |
|
198 |
+
## β οΈ Medical Disclaimer
|
199 |
|
200 |
+
**IMPORTANT**: GlycoAI is for informational and educational purposes only. This application:
|
201 |
+
|
202 |
+
- **IS NOT** a medical device or diagnostic tool
|
203 |
+
- **DOES NOT** replace professional medical advice
|
204 |
+
- **SHOULD NOT** be used for treatment decisions without healthcare provider consultation
|
205 |
+
- **REQUIRES** users to always consult their healthcare team before making management changes
|
206 |
+
|
207 |
+
Always follow your healthcare provider's guidance for diabetes management.
|
208 |
|
209 |
## π€ Contributing
|
210 |
|
211 |
+
We welcome contributions from the healthcare AI, diabetes technology, and open-source communities!
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
+
### Ways to Contribute
|
214 |
+
- π **Bug Reports**: Submit issues with detailed reproduction steps
|
215 |
+
- π‘ **Feature Requests**: Suggest new capabilities or improvements
|
216 |
+
- π§ **Code Contributions**: Submit pull requests with enhancements
|
217 |
+
- π **Documentation**: Improve guides, examples, and explanations
|
218 |
+
- π§ͺ **Testing**: Help validate algorithms with diverse glucose patterns
|
219 |
|
220 |
+
### Development Guidelines
|
221 |
+
- Follow clinical evidence-based recommendations
|
222 |
+
- Prioritize patient safety in all features
|
223 |
+
- Maintain code quality with comprehensive testing
|
224 |
+
- Document clinical rationale for algorithm decisions
|
225 |
|
226 |
+
## π License
|
227 |
|
228 |
+
This project is licensed under the **Apache License 2.0** - see the [LICENSE](LICENSE) file for details.
|
229 |
|
230 |
+
```
|
231 |
+
Copyright 2024 GlycoAI Contributors
|
232 |
|
233 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
234 |
+
you may not use this file except in compliance with the License.
|
235 |
+
You may obtain a copy of the License at
|
236 |
|
237 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
238 |
|
239 |
+
Unless required by applicable law or agreed to in writing, software
|
240 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
241 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
242 |
+
See the License for the specific language governing permissions and
|
243 |
+
limitations under the License.
|
244 |
+
```
|
245 |
+
|
246 |
+
## π Acknowledgments
|
247 |
+
|
248 |
+
- **Mistral AI** for providing the intelligent conversation capabilities
|
249 |
+
- **Dexcom** for continuous glucose monitoring technology and API access
|
250 |
+
- **Diabetes Community** for inspiration and clinical insights
|
251 |
+
- **Open Source Community** for tools and frameworks that make this possible
|
252 |
+
- **Healthcare Providers** who guide evidence-based diabetes management
|
253 |
+
|
254 |
+
## π Support & Contact
|
255 |
|
256 |
+
- **Issues**: [GitHub Issues](https://github.com/your-username/glycoai/issues)
|
257 |
+
- **Discussions**: [GitHub Discussions](https://github.com/your-username/glycoai/discussions)
|
258 |
+
- **Documentation**: [Project Wiki](https://github.com/your-username/glycoai/wiki)
|
259 |
+
- **Email**: [email protected]
|
260 |
|
261 |
+
## π Roadmap
|
262 |
+
|
263 |
+
### Upcoming Features
|
264 |
+
- **Multi-language Support**: Expand accessibility globally
|
265 |
+
- **Advanced Pattern Recognition**: Machine learning-based anomaly detection
|
266 |
+
- **Integration Expansion**: Support for additional CGM devices
|
267 |
+
- **Clinical Decision Support**: Enhanced recommendations for healthcare providers
|
268 |
+
- **Mobile Optimization**: Improved mobile device experience
|
269 |
+
- **API Development**: RESTful API for third-party integrations
|
270 |
+
|
271 |
+
### Research Directions
|
272 |
+
- **Federated Learning**: Privacy-preserving model improvements
|
273 |
+
- **Predictive Analytics**: Glucose forecasting capabilities
|
274 |
+
- **Behavioral Analysis**: Lifestyle factor correlation
|
275 |
+
- **Population Health**: Aggregate insights for public health
|
276 |
+
|
277 |
+
---
|
278 |
|
279 |
+
**Made with β€οΈ for the diabetes community**
|
|
|
280 |
|
281 |
+
*Empowering better glucose management through intelligent AI analysis*
|