Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients

Objective Diabetes mellitus is a chronic condition that requires constant blood glucose monitoring to prevent serious health risks. Accurate blood glucose prediction is essential for managing glucose fluctuations and reducing the risk of hypo- and hyperglycemic events. However, existing models often...

Full description

Saved in:
Bibliographic Details
Main Authors: Xin Xiong, XinLiang Yang, Yunying Cai, Yuxin Xue, JianFeng He, Heng Su
Format: Article
Language:English
Published: SAGE Publishing 2025-04-01
Series:Digital Health
Online Access:https://doi.org/10.1177/20552076251328980
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1849770183446495232
author Xin Xiong
XinLiang Yang
Yunying Cai
Yuxin Xue
JianFeng He
Heng Su
author_facet Xin Xiong
XinLiang Yang
Yunying Cai
Yuxin Xue
JianFeng He
Heng Su
author_sort Xin Xiong
collection DOAJ
description Objective Diabetes mellitus is a chronic condition that requires constant blood glucose monitoring to prevent serious health risks. Accurate blood glucose prediction is essential for managing glucose fluctuations and reducing the risk of hypo- and hyperglycemic events. However, existing models often face limitations in prediction horizon and accuracy. This study aims to develop a hybrid deep learning model combining Transformer and Long Short-Term Memory (LSTM) networks to improve prediction accuracy and extend the prediction horizon, using personalized patient information and continuous glucose monitoring data to support better real-time diabetes management. Methods In this study, we propose a hybrid deep learning model combining Transformer and LSTM networks to predict blood glucose levels for up to 120 min. The Transformer Encoder captures long-range dependencies, while the LSTM models short-term patterns. To improve feature extraction, we integrate Bidirectional LSTM and Transformer Encoder layers at multiple stages. We also use positional encoding, dropout layers, and a sliding window technique to reduce noise and manage temporal dependencies. Richer features, including meal composition and insulin dosage, are incorporated to enhance prediction accuracy. The model's performance is validated using real-world clinical data and error grid analysis. Results On clinical data, the model achieved root mean square error/mean absolute error of 10.157/6.377 (30-min), 10.645/6.417 (60-min), 13.537/7.283 (90-min), and 13.986/6.986 (120-min). On simulated data, the results were 1.793/1.376 (15-min), 2.049/1.311 (30-min), and 3.477/1.668 (60-min). Clark Grid Analysis showed that over 96% of predictions fell within the clinical safety zone up to 120 min, confirming its clinical feasibility. Conclusion This study demonstrates that the combined Transformer and LSTM model can effectively predict blood glucose concentration in type 1 diabetes patients with high accuracy and clinical applicability. The model provides a promising solution for personalized blood glucose management, contributing to the advancement of artificial intelligence technology in diabetes care.
format Article
id doaj-art-2aad3defe18c4b6eb55fbe66943ba59e
institution DOAJ
issn 2055-2076
language English
publishDate 2025-04-01
publisher SAGE Publishing
record_format Article
series Digital Health
spelling doaj-art-2aad3defe18c4b6eb55fbe66943ba59e2025-08-20T03:03:07ZengSAGE PublishingDigital Health2055-20762025-04-011110.1177/20552076251328980Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patientsXin Xiong0XinLiang Yang1Yunying Cai2Yuxin Xue3JianFeng He4Heng Su5 Faculty of Information Engineering and Automation, , Kunming, China Faculty of Information Engineering and Automation, , Kunming, China Department of Endocrinology, , The Affiliated Hospital of Kunming University of Science and Technology, Kunming, China Faculty of Information Engineering and Automation, , Kunming, China Faculty of Information Engineering and Automation, , Kunming, China Department of Endocrinology, , The Affiliated Hospital of Kunming University of Science and Technology, Kunming, ChinaObjective Diabetes mellitus is a chronic condition that requires constant blood glucose monitoring to prevent serious health risks. Accurate blood glucose prediction is essential for managing glucose fluctuations and reducing the risk of hypo- and hyperglycemic events. However, existing models often face limitations in prediction horizon and accuracy. This study aims to develop a hybrid deep learning model combining Transformer and Long Short-Term Memory (LSTM) networks to improve prediction accuracy and extend the prediction horizon, using personalized patient information and continuous glucose monitoring data to support better real-time diabetes management. Methods In this study, we propose a hybrid deep learning model combining Transformer and LSTM networks to predict blood glucose levels for up to 120 min. The Transformer Encoder captures long-range dependencies, while the LSTM models short-term patterns. To improve feature extraction, we integrate Bidirectional LSTM and Transformer Encoder layers at multiple stages. We also use positional encoding, dropout layers, and a sliding window technique to reduce noise and manage temporal dependencies. Richer features, including meal composition and insulin dosage, are incorporated to enhance prediction accuracy. The model's performance is validated using real-world clinical data and error grid analysis. Results On clinical data, the model achieved root mean square error/mean absolute error of 10.157/6.377 (30-min), 10.645/6.417 (60-min), 13.537/7.283 (90-min), and 13.986/6.986 (120-min). On simulated data, the results were 1.793/1.376 (15-min), 2.049/1.311 (30-min), and 3.477/1.668 (60-min). Clark Grid Analysis showed that over 96% of predictions fell within the clinical safety zone up to 120 min, confirming its clinical feasibility. Conclusion This study demonstrates that the combined Transformer and LSTM model can effectively predict blood glucose concentration in type 1 diabetes patients with high accuracy and clinical applicability. The model provides a promising solution for personalized blood glucose management, contributing to the advancement of artificial intelligence technology in diabetes care.https://doi.org/10.1177/20552076251328980
spellingShingle Xin Xiong
XinLiang Yang
Yunying Cai
Yuxin Xue
JianFeng He
Heng Su
Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
Digital Health
title Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
title_full Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
title_fullStr Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
title_full_unstemmed Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
title_short Exploring the potential of deep learning models integrating transformer and LSTM in predicting blood glucose levels for T1D patients
title_sort exploring the potential of deep learning models integrating transformer and lstm in predicting blood glucose levels for t1d patients
url https://doi.org/10.1177/20552076251328980
work_keys_str_mv AT xinxiong exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients
AT xinliangyang exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients
AT yunyingcai exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients
AT yuxinxue exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients
AT jianfenghe exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients
AT hengsu exploringthepotentialofdeeplearningmodelsintegratingtransformerandlstminpredictingbloodglucoselevelsfort1dpatients