AI-powered system for early prediction of Gestational Diabetes Mellitus (GDM) using machine learning and WhatsApp chatbot integration. Developed to support maternal health in low-resource settings.
Machine Learning-Driven Prediction of Gestational Diabetes Mellitus (GDM) with WhatsApp Chatbot Integration
## Project Overview
This project uses machine learning to predict the risk of **Gestational Diabetes Mellitus (GDM)** among pregnant women and integrates the predictive model into a **WhatsApp chatbot** for early risk detection in low-resource settings such as Zimbabwe.
The chatbot allows users to input health data (like BMI, blood pressure, and family history) and instantly receive a GDM risk score generated by a trained machine learning model.
## Objectives
- Develop a predictive model for early GDM detection using non-invasive features.
- Identify key maternal risk factors contributing to GDM.
- Integrate the model into a WhatsApp chatbot for real-time risk assessment.
## Machine Learning Approach
Dataset:Kaggle — 3,525 records of pregnant women with 17 clinical and demographic features.
Algorithms Tested: Random Forest, Logistic Regression, Decision Tree, Support Vector Machine, XGBoost
| Model | Accuracy | Precision | Recall | F1-score |
|--------|-----------|-----------|---------|-----------|
| Random Forest | 92% | 91% | 90% | 90% |
| Logistic Regression | 87% | 85% | 86% | 85% |
| Decision Tree | 88% | 86% | 88% | 87% |
| SVM | 90% | 91% | 89% | 90% |
| XGBoost (Best) | 96% | 94% | 95% | 94% |
---
## Technologies Used
- Programming: Python
- Libraries:Scikit-Learn, Pandas, NumPy, Matplotlib, Seaborn, XGBoost
- Frameworks: FastAPI (for model deployment)
- Database:SQLite
- Integration:WhatsApp API
- Environment: Google Colab, Visual Studio Code
---
## 💬 WhatsApp Chatbot Integration
- Built a FastAPI backend for model prediction endpoints.
- Integrated with WhatsApp API to collect user input and return GDM risk predictions in real time.
- Used SQLite databaseto log user data and model outcomes for monitoring.
## Results
- The XGBoost model achieved 96% accuracy.
- The chatbot successfully provided real-time, accurate risk assessments duri …