Interpretable Multihorizon Glucose Forecasting for Assessing Nutritional Information Impact in Type 1 Diabetes Management: Model Development and Validation Study

Abstract Background Type 1 diabetes is characterized by absolute insulin deficiency, requiring exogenous insulin therapy to maintain blood glucose levels within safe ranges. Postprandial glucose control remains particularly challenging, and current meal-related strategies are mainly based on carbohydrate intake. However, other macronutrients, such as fats and proteins, may also influence the magnitude and timing of the glycemic response and are not usually incorporated into glucose forecasting models. Objective This study aims to develop and evaluate multihorizon blood glucose forecasting models to assess the impact of incorporating detailed nutritional information, with particular emphasis on the postprandial period and to analyze how the contribution of different nutrients varies across prediction horizons. Methods We trained temporal fusion transformer (TFT) models on continuous glucose monitoring, insulin, and meal data with different combinations of nutritional variables from 351 adults with type 1 diabetes (15,601 meals) to predict glucose values up to 4 hours ahead. Carbohydrates were used as the baseline nutritional input, and additional configurations included fats, proteins, sugars, and complex carbohydrates. Model performance was evaluated globally and in predictions initiated at meal intake. Prediction horizons were grouped into early and late intervals, corresponding to 0-2 hours and 2-4 hours, respectively. The interpretability mechanisms of the TFT and integrated gradients method were used to analyze the relative contribution of nutritional variables. Results Models incorporating additional nutritional information generally outperformed the carbohydrate-only baseline. In the global analysis, the combination of carbohydrates, fats, and proteins achieved the best performance in the early prediction interval, reducing mean root mean squared error (RMSE) and mean absolute error (MAE) from 30.48 mg/dL and 21.02 mg/dL to 29.23 mg/dL and 20.15 mg/dL. At late intervals, distinguishing between complex carbohydrates and sugars, together with fats and proteins, provided the best performance, reducing mean RMSE and MAE from 45.34 mg/dL and 34.73 mg/dL to 43.24 mg/dL and 32.65 mg/dL. A similar temporal dependency pattern was observed in the postprandial evaluation and was partially supported by the interpretability analysis. Conclusions These findings suggest that incorporating a more comprehensive representation of meal composition may modestly improve postprandial glucose forecasting. Horizon-specific attribution patterns indicated that the models used nutritional inputs differently across the forecast horizon; however, these findings should not be interpreted as causal or physiological effects of individual nutrients. Further external and prospective validation is required before the potential clinical utility of these models can be assessed.

Authors

Publication Details

Journal
JMIR AI
Published
2026-09-21
DOI
https://doi.org/10.2196/105049
Primary Topic
Diabetes Management and Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
article

Interpretable Multihorizon Glucose Forecasting for Assessing Nutritional Information Impact in Type 1 Diabetes Management: Model Development and Validation Study

David Subías, Gema García-Sáez, M. Elena Hernando, Mercedes Rigla et al.
JMIR AI
Diabetes Management and Research
article

Interpretable Multihorizon Glucose Forecasting for Assessing Nutritional Information Impact in Type 1 Diabetes Management: Model Development and Validation Study

David Subías, Gema García-Sáez, M. Elena Hernando, Mercedes Rigla, Carlos Gallardo-García
article en

Abstract

Abstract Background Type 1 diabetes is characterized by absolute insulin deficiency, requiring exogenous insulin therapy to maintain blood glucose levels within safe ranges. Postprandial glucose control remains particularly challenging, and current meal-related strategies are mainly based on carbohydrate intake. However, other macronutrients, such as fats and proteins, may also influence the magnitude and timing of the glycemic response and are not usually incorporated into glucose forecasting models. Objective This study aims to develop and evaluate multihorizon blood glucose forecasting models to assess the impact of incorporating detailed nutritional information, with particular emphasis on the postprandial period and to analyze how the contribution of different nutrients varies across prediction horizons. Methods We trained temporal fusion transformer (TFT) models on continuous glucose monitoring, insulin, and meal data with different combinations of nutritional variables from 351 adults with type 1 diabetes (15,601 meals) to predict glucose values up to 4 hours ahead. Carbohydrates were used as the baseline nutritional input, and additional configurations included fats, proteins, sugars, and complex carbohydrates. Model performance was evaluated globally and in predictions initiated at meal intake. Prediction horizons were grouped into early and late intervals, corresponding to 0-2 hours and 2-4 hours, respectively. The interpretability mechanisms of the TFT and integrated gradients method were used to analyze the relative contribution of nutritional variables. Results Models incorporating additional nutritional information generally outperformed the carbohydrate-only baseline. In the global analysis, the combination of carbohydrates, fats, and proteins achieved the best performance in the early prediction interval, reducing mean root mean squared error (RMSE) and mean absolute error (MAE) from 30.48 mg/dL and 21.02 mg/dL to 29.23 mg/dL and 20.15 mg/dL. At late intervals, distinguishing between complex carbohydrates and sugars, together with fats and proteins, provided the best performance, reducing mean RMSE and MAE from 45.34 mg/dL and 34.73 mg/dL to 43.24 mg/dL and 32.65 mg/dL. A similar temporal dependency pattern was observed in the postprandial evaluation and was partially supported by the interpretability analysis. Conclusions These findings suggest that incorporating a more comprehensive representation of meal composition may modestly improve postprandial glucose forecasting. Horizon-specific attribution patterns indicated that the models used nutritional inputs differently across the forecast horizon; however, these findings should not be interpreted as causal or physiological effects of individual nutrients. Further external and prospective validation is required before the potential clinical utility of these models can be assessed.

JMIR AIVol. 5
Zero hunger
Openalex Percentile: Top 10%
Diabetes Management and Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.