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

Skip to content

SamanKhamesian/GLIMMER

Repository files navigation

GLIMMER

Glucose Level Indicator Model with Modified Error Rate

Managing Type 1 Diabetes (T1D) demands constant vigilance as individuals strive to regulate their blood glucose levels to avert the dangers of dysglycemia (i.e., hyperglycemia and hypoglycemia). Despite the advent of sophisticated technologies such as automated insulin delivery (AID) systems, achieving optimal glycemic control remains a formidable task. AID systems integrate data from wearable devices including continuous subcutaneous insulin infusion (CSII) pumps and continuous glucose monitors (CGMs), offering promise in reducing variability and improving time-in-range.

However, these systems often fail to prevent dysglycemia, partly due to limitations in prediction algorithms that lack the precision to anticipate impending glycemic excursions. This gap highlights the need for more advanced blood glucose forecasting methods.

We address this need with GLIMMERGlucose Level Indicator Model with Modified Error Rate — an architecture-agnostic and modular machine learning framework for improved forecasting accuracy. GLIMMER integrates a custom loss function that emphasizes accuracy during dysglycemia by optimizing region-specific penalties through a genetic algorithm.

We evaluate GLIMMER on two datasets: the publicly available OhioT1DM dataset and a newly collected dataset (AZT1D) involving 25 individuals with T1D. Our extensive analyses show that GLIMMER consistently improves glucose forecasting performance over baseline architectures, enhancing RMSE (Root-Mean-Square Error) and MAE (Mean-Absolute-Error) by up to 24.6% and 29.6%, respectively. Additionally, GLIMMER achieves a recall of 98.4% and an F1-score of 86.8% in predicting dysglycemic events, demonstrating its effectiveness in high-risk regions.

Compared to state-of-the-art models with millions of parameters—such as TimesNet (18.7M), BG-BERT (2.1M), and Gluformer (11.2M)—GLIMMER achieves comparable accuracy while using only 10K parameters, demonstrating its efficiency as a lightweight, architecture-agnostic solution for glycemic forecasting.


📁 Dataset Setup

1. OhioT1DM Dataset


2. AZT1D Dataset


⚙️ Environment Setup

  • Python version: 3.10

  • Install dependencies:

    Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate

    Then install required packages:

    pip install -r requirements.txt

    requirements.txt includes:

    matplotlib==3.9.2
    numpy==2.1.3
    pandas==2.2.3
    scikit_learn==1.5.2
    scipy==1.14.1
    seaborn==0.13.2
    tensorflow==2.18.0
    

🚀 Run the Code

To start training and evaluating the model, run:

python main.py

Before running, make sure to manually set the model type in main.py (e.g., "transformer" or "cnn_lstm").


📖 Citation

If you use GLIMMER in your work, please cite:

@article{khamesian2025type,
  title={Type 1 diabetes management using glimmer: Glucose level indicator model with modified error rate},
  author={Khamesian, Saman and Arefeen, Asiful and Grando, Maria Adela and Thompson, Bithika M and Ghasemzadeh, Hassan},
  journal={arXiv preprint arXiv:2502.14183},
  year={2025}
}

About

Type 1 Diabetes Management using GLIMMER: Glucose Level Indicator Model with Modified Error Rate

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages