Thanks to visit codestin.com
Credit goes to github.com

Skip to content

arjunravi26/Glucose-Monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩸 Glucose Level Prediction from Physiological Time-Series Data

Welcome to the Glucose Level Prediction project. This repository provides a machine learning solution to predict future blood glucose levels based on physiological signals using XGBoost. It also includes a Streamlit web application that allows users to interact with the model in real-time.


📌 Table of Contents

  1. Overview
  2. Dataset Description
  3. Data Preprocessing
  4. Model Architecture
  5. Evaluation Metrics
  6. Sample Results
  7. Web Application (Streamlit)
  8. Getting Started
  9. Folder Structure
  10. License

🔍 Overview

This project aims to predict the blood glucose level (mmol/L) one hour into the future using a variety of physiological time-series features such as:

  • Insulin intake
  • Carbohydrate consumption
  • Heart rate
  • Step count
  • Calories burned
  • Activity level

The goal is to assist individuals and healthcare professionals in proactively managing blood glucose levels.


📁 Dataset Description

The dataset consists of time-lagged features representing past physiological readings. For instance:

  • bg-0:15, hr-0:30, insulin-1:00, etc. represent the value at 15 minutes, 30 minutes, or 1 hour ago.
  • The target column is bg+1:00, representing the glucose level 1 hour into the future.

Main Features:

Feature Description
bg Blood glucose level (mmol/L)
insulin Insulin units taken
carbs Carbohydrates consumed (grams)
hr Heart rate (bpm)
steps Number of steps
cals Calories burned
activity Categorical activity level

🧹 Data Preprocessing

Preprocessing steps included:

  • Feature Aggregation: Time-series features were aggregated (mean, std, etc.).
  • Missing Value Handling: Mean imputation grouped by participant (p_num).
  • Categorical Conversion: The activity feature was converted to the mode value per row.
  • Scaling: Numerical features were optionally scaled for model input.

🤖 Model Architecture

We use XGBoost Regressor, a powerful gradient boosting model suitable for tabular data.

  • Input: Cleaned physiological feature set
  • Output: Predicted glucose level (bg+1:00)
  • Training: Hyperparameters tuned using cross-validation

📊 Evaluation Metrics

Metric Description Example Value
MAE Mean Absolute Error 1.01
RMSE Root Mean Squared Error 1.65

These metrics help us assess the model's performance and its deviation from true glucose values.


📈 Sample Results

Visualizations provided:

  • Feature Importance Plot (from XGBoost)
  • 📈 Actual vs Predicted Glucose Levels
  • 📊 Error Distribution Histogram

These results demonstrate the interpretability and reliability of the model.


🌐 Web Application (Streamlit)

An interactive frontend built with Streamlit allows users to input their physiological parameters and get a real-time prediction of their blood glucose level.

🎮 Features:

  • Displays predicted glucose level
  • Easy-to-use and lightweight

🔧 How to Run

  1. Clone the repository:
git clone https://github.com/arjunravi26/Glucose-Monitoring.git
cd Glucose-Monitoring
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the Streamlit app:
streamlit run main.py

📁 Folder Structure

Glucose-Monitoring/
├── data/                   # Dataset files
├── models/                 # Trained model files
├── notebooks/              # Jupyter notebooks for EDA & training
├── app/                    # Streamlit app files
├── main.py                 # Entry point for Streamlit app
├── utils.py                # Helper functions
├── requirements.txt        # Dependencies
└── README.md               # Project overview

🧾 License

This project is licensed under the MIT License. Feel free to use, modify, and share with credit.


📬 Contact

For questions, feedback, or collaboration:


"Empowering personal health through predictive intelligence."

About

Glucose Monitoring system to monitor patients and notify whenever glucose goes high.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages