
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Improving Postprandial Glucose Forecasting using Diagnosis-Aware Stacked Learning
Corresponding Author(s) : Fatma Indriani
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vol. 11, No. 2, May 2026 (Article in Progress)
Abstract
Predicting glucose levels after a meal (postprandial glucose) can help anticipate abnormal responses and improve diabetes management. Yet such prediction remains difficult because post-meal glucose depends on multiple interacting factors, including prior glucose trends, meal composition, and recent activity. This study develops machine learning models to forecast short-term post-meal glucose levels using the CGMacros dataset, which combines continuous glucose monitoring (CGM) data from Dexcom and Libre sensors with meal macronutrient annotations and activity measurements. Several feature combinations and regression models were evaluated to identify an optimal representation. Results show that combining baseline glucose statistics with meal composition yields the lowest error across all regressors. Building on this feature configuration, a stacked learning framework was implemented in which a global model provides initial predictions refined by diagnosis-specific CatBoost regressors for Healthy, Pre-diabetes, and Type 2 Diabetes groups. Across 18 configurations spanning two sensors and three horizons (30, 60, 120 minutes), stacking reduced normalized RMSE by 3.5% ± 3.7 on average, with the strongest improvements at 120-minute horizons (mean 5.5%) and for linear global models (up to 13.6% reduction). Gains varied by diagnosis group and sensor type, highlighting the importance of device-aware validation. These results demonstrate that diagnosis-aware stacking enhances both accuracy and robustness, offering a practical foundation for personalized glucose forecasting in digital health systems.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- D. Zeevi et al., “Personalized Nutrition by Prediction of Glycemic Responses,” Cell, vol. 163, no. 5, pp. 1079–1094, Nov. 2015, doi: 10.1016/j.cell.2015.11.001.
- G. Cappon, M. Vettoretti, G. Sparacino, and A. Facchinetti, “Continuous Glucose Monitoring Sensors for Diabetes Management: A Review of Technologies and Applications.,” Diabetes Metab J, vol. 43, no. 4, pp. 383–397, Aug. 2019, doi: 10.4093/dmj.2019.0121.
- M. Vettoretti, G. Cappon, A. Facchinetti, and G. Sparacino, “Advanced Diabetes Management Using Artificial Intelligence and Continuous Glucose Monitoring Sensors,” Sensors, vol. 20, no. 14, p. 3870, Jul. 2020, doi: 10.3390/s20143870.
- T. Zhu, L. Kuang, K. Li, J. Zeng, P. Herrero, and P. Georgiou, “Blood Glucose Prediction in Type 1 Diabetes Using Deep Learning on the Edge,” in 2021 IEEE International Symposium on Circuits and Systems (ISCAS), IEEE, May 2021, pp. 1–5. doi: 10.1109/ISCAS51556.2021.9401083.
- H. Nemat, H. Khadem, J. Elliott, and M. Benaissa, “Data-driven blood glucose level prediction in type 1 diabetes: a comprehensive comparative analysis,” Sci Rep, vol. 14, no. 1, p. 21863, Sep. 2024, doi: 10.1038/s41598-024-70277-x.
- A. Bertachi et al., “Prediction of Nocturnal Hypoglycemia in Adults with Type 1 Diabetes under Multiple Daily Injections Using Continuous Glucose Monitoring and Physical Activity Monitor,” Sensors, vol. 20, no. 6, p. 1705, Mar. 2020, doi: 10.3390/s20061705.
- B. Alkalifah, M. T. Shaheen, J. Alotibi, T. Alsubait, and H. Alhakami, “Evaluation of machine learning-based regression techniques for prediction of diabetes levels fluctuations,” Heliyon, vol. 11, no. 1, p. e41199, Jan. 2025, doi: 10.1016/j.heliyon.2024.e41199.
- S. Bergford et al., “The Type 1 Diabetes and EXercise Initiative: Predicting Hypoglycemia Risk During Exercise for Participants with Type 1 Diabetes Using Repeated Measures Random Forest,” Diabetes Technol Ther, vol. 25, no. 9, pp. 602–611, Sep. 2023, doi: 10.1089/dia.2023.0140.
- D. E. Kladov, V. B. Berikov, J. F. Semenova, and V. V. Klimontov, “Machine Learning Algorithms Based on Time Series Pre-Clustering for Nocturnal Glucose Prediction in People with Type 1 Diabetes,” Diagnostics, vol. 14, no. 21, p. 2427, Oct. 2024, doi: 10.3390/diagnostics14212427.
- A. Neumann, Y. Zghal, M. A. Cremona, A. Hajji, M. Morin, and M. Rekik, “A Data-Driven Personalized Approach to Predict Blood Glucose Levels in Type-1 Diabetes Patients Exercising in Free-Living Conditions,” 2024. doi: 10.2139/ssrn.4777350.
- N. Ren, X. Zhao, and X. Zhang, “Mortality prediction in ICU Using a Stacked Ensemble Model,” Comput Math Methods Med, vol. 2022, pp. 1–12, Nov. 2022, doi: 10.1155/2022/3938492.
- M. Z. Wadghiri, A. Idri, T. El Idrissi, and H. Hakkoum, “Ensemble blood glucose prediction in diabetes mellitus: A review,” Comput Biol Med, vol. 147, p. 105674, Aug. 2022, doi: 10.1016/j.compbiomed.2022.105674.
- A. Alotaibi, “Ensemble Deep Learning Approaches in Health Care: A Review,” Computers, Materials & Continua, vol. 82, no. 3, pp. 3741–3771, 2025, doi: 10.32604/cmc.2025.061998.
- J. Song, T. J. Oh, and Y. Song, “Individual Postprandial Glycemic Responses to Meal Types by Different Carbohydrate Levels and Their Associations with Glycemic Variability Using Continuous Glucose Monitoring,” Nutrients, vol. 15, no. 16, p. 3571, Aug. 2023, doi: 10.3390/nu15163571.
- B. M. Ahmed, M. E. Ali, M. M. Masud, M. R. Azad, and M. Naznin, “After-meal blood glucose level prediction for type-2 diabetic patients,” Heliyon, vol. 10, no. 7, p. e28855, Apr. 2024, doi: 10.1016/j.heliyon.2024.e28855.
- S. Hotta, M. Kytö, S. Koivusalo, S. Heinonen, and P. Marttinen, “Optimizing postprandial glucose prediction through integration of diet and exercise: Leveraging transfer learning with imbalanced patient data,” PLoS One, vol. 19, no. 8, p. e0298506, Aug. 2024, doi: 10.1371/journal.pone.0298506.
- R. Gutierrez-Osuna, D. Kerr, B. Mortazavi, and A. Das, “CGMacros: a scientific dataset for personalized nutrition and diet monitoring,” Scientific Data (under review), 2025.
- H. Šinkovec, G. Heinze, R. Blagus, and A. Geroldinger, “To tune or not to tune, a case study of ridge logistic regression in small or sparse datasets,” BMC Med Res Methodol, vol. 21, no. 1, p. 199, Dec. 2021, doi: 10.1186/s12874-021-01374-y.
- Y. Hu et al., “Support Vector Regression Model for Determining Optimal Parameters of HfAlO-Based Charge Trapping Memory Devices,” Electronics (Basel), vol. 12, no. 14, p. 3139, Jul. 2023, doi: 10.3390/electronics12143139.
- G. N., P. Jain, A. Choudhury, P. Dutta, K. Kalita, and P. Barsocchi, “Random Forest Regression-Based Machine Learning Model for Accurate Estimation of Fluid Flow in Curved Pipes,” Processes, vol. 9, no. 11, p. 2095, Nov. 2021, doi: 10.3390/pr9112095.
- B. Chen, Y. Chen, and H. Chen, “An Interpretable CatBoost Model Guided by Spectral Morphological Features for the Inversion of Coastal Water Quality Parameters,” Water (Basel), vol. 16, no. 24, p. 3615, Dec. 2024, doi: 10.3390/w16243615.
- A. D. Hartanto, Y. Nur Kholik, and Y. Pristyanto, “Stock Price Time Series Data Forecasting Using the Light Gradient Boosting Machine (LightGBM) Model,” JOIV : International Journal on Informatics Visualization, vol. 7, no. 4, p. 2270, Dec. 2023, doi: 10.62527/joiv.7.4.1740.
- F. Pedregosa et al., “Scikit-learn: Machine Learning in Python,” Jun. 2018.
- L. Prokhorenkova, G. Gusev, A. Vorobev, A. V. Dorogush, and A. Gulin, “CatBoost: unbiased boosting with categorical features,” in Proceedings of the 32nd International Conference on Neural Information Processing Systems, in NIPS’18. Red Hook, NY, USA: Curran Associates Inc., 2018, pp. 6639–6649.
- G. Ke et al., “LightGBM: A Highly Efficient Gradient Boosting Decision Tree.” [Online]. Available: https://github.com/Microsoft/LightGBM.
- G. Liu, L. Brooks, J. Canty, D. Lu, J. Y. Jin, and J. Lu, “Deep‐NCA: A deep learning methodology for performing noncompartmental analysis of pharmacokinetic data,” CPT Pharmacometrics Syst Pharmacol, vol. 13, no. 5, pp. 870–879, May 2024, doi: 10.1002/psp4.13124.
- D. D. Rufo, T. G. Debelee, A. Ibenthal, and W. G. Negera, “Diagnosis of Diabetes Mellitus Using Gradient Boosting Machine (LightGBM),” Diagnostics, vol. 11, no. 9, p. 1714, Sep. 2021, doi: 10.3390/diagnostics11091714.
References
D. Zeevi et al., “Personalized Nutrition by Prediction of Glycemic Responses,” Cell, vol. 163, no. 5, pp. 1079–1094, Nov. 2015, doi: 10.1016/j.cell.2015.11.001.
G. Cappon, M. Vettoretti, G. Sparacino, and A. Facchinetti, “Continuous Glucose Monitoring Sensors for Diabetes Management: A Review of Technologies and Applications.,” Diabetes Metab J, vol. 43, no. 4, pp. 383–397, Aug. 2019, doi: 10.4093/dmj.2019.0121.
M. Vettoretti, G. Cappon, A. Facchinetti, and G. Sparacino, “Advanced Diabetes Management Using Artificial Intelligence and Continuous Glucose Monitoring Sensors,” Sensors, vol. 20, no. 14, p. 3870, Jul. 2020, doi: 10.3390/s20143870.
T. Zhu, L. Kuang, K. Li, J. Zeng, P. Herrero, and P. Georgiou, “Blood Glucose Prediction in Type 1 Diabetes Using Deep Learning on the Edge,” in 2021 IEEE International Symposium on Circuits and Systems (ISCAS), IEEE, May 2021, pp. 1–5. doi: 10.1109/ISCAS51556.2021.9401083.
H. Nemat, H. Khadem, J. Elliott, and M. Benaissa, “Data-driven blood glucose level prediction in type 1 diabetes: a comprehensive comparative analysis,” Sci Rep, vol. 14, no. 1, p. 21863, Sep. 2024, doi: 10.1038/s41598-024-70277-x.
A. Bertachi et al., “Prediction of Nocturnal Hypoglycemia in Adults with Type 1 Diabetes under Multiple Daily Injections Using Continuous Glucose Monitoring and Physical Activity Monitor,” Sensors, vol. 20, no. 6, p. 1705, Mar. 2020, doi: 10.3390/s20061705.
B. Alkalifah, M. T. Shaheen, J. Alotibi, T. Alsubait, and H. Alhakami, “Evaluation of machine learning-based regression techniques for prediction of diabetes levels fluctuations,” Heliyon, vol. 11, no. 1, p. e41199, Jan. 2025, doi: 10.1016/j.heliyon.2024.e41199.
S. Bergford et al., “The Type 1 Diabetes and EXercise Initiative: Predicting Hypoglycemia Risk During Exercise for Participants with Type 1 Diabetes Using Repeated Measures Random Forest,” Diabetes Technol Ther, vol. 25, no. 9, pp. 602–611, Sep. 2023, doi: 10.1089/dia.2023.0140.
D. E. Kladov, V. B. Berikov, J. F. Semenova, and V. V. Klimontov, “Machine Learning Algorithms Based on Time Series Pre-Clustering for Nocturnal Glucose Prediction in People with Type 1 Diabetes,” Diagnostics, vol. 14, no. 21, p. 2427, Oct. 2024, doi: 10.3390/diagnostics14212427.
A. Neumann, Y. Zghal, M. A. Cremona, A. Hajji, M. Morin, and M. Rekik, “A Data-Driven Personalized Approach to Predict Blood Glucose Levels in Type-1 Diabetes Patients Exercising in Free-Living Conditions,” 2024. doi: 10.2139/ssrn.4777350.
N. Ren, X. Zhao, and X. Zhang, “Mortality prediction in ICU Using a Stacked Ensemble Model,” Comput Math Methods Med, vol. 2022, pp. 1–12, Nov. 2022, doi: 10.1155/2022/3938492.
M. Z. Wadghiri, A. Idri, T. El Idrissi, and H. Hakkoum, “Ensemble blood glucose prediction in diabetes mellitus: A review,” Comput Biol Med, vol. 147, p. 105674, Aug. 2022, doi: 10.1016/j.compbiomed.2022.105674.
A. Alotaibi, “Ensemble Deep Learning Approaches in Health Care: A Review,” Computers, Materials & Continua, vol. 82, no. 3, pp. 3741–3771, 2025, doi: 10.32604/cmc.2025.061998.
J. Song, T. J. Oh, and Y. Song, “Individual Postprandial Glycemic Responses to Meal Types by Different Carbohydrate Levels and Their Associations with Glycemic Variability Using Continuous Glucose Monitoring,” Nutrients, vol. 15, no. 16, p. 3571, Aug. 2023, doi: 10.3390/nu15163571.
B. M. Ahmed, M. E. Ali, M. M. Masud, M. R. Azad, and M. Naznin, “After-meal blood glucose level prediction for type-2 diabetic patients,” Heliyon, vol. 10, no. 7, p. e28855, Apr. 2024, doi: 10.1016/j.heliyon.2024.e28855.
S. Hotta, M. Kytö, S. Koivusalo, S. Heinonen, and P. Marttinen, “Optimizing postprandial glucose prediction through integration of diet and exercise: Leveraging transfer learning with imbalanced patient data,” PLoS One, vol. 19, no. 8, p. e0298506, Aug. 2024, doi: 10.1371/journal.pone.0298506.
R. Gutierrez-Osuna, D. Kerr, B. Mortazavi, and A. Das, “CGMacros: a scientific dataset for personalized nutrition and diet monitoring,” Scientific Data (under review), 2025.
H. Šinkovec, G. Heinze, R. Blagus, and A. Geroldinger, “To tune or not to tune, a case study of ridge logistic regression in small or sparse datasets,” BMC Med Res Methodol, vol. 21, no. 1, p. 199, Dec. 2021, doi: 10.1186/s12874-021-01374-y.
Y. Hu et al., “Support Vector Regression Model for Determining Optimal Parameters of HfAlO-Based Charge Trapping Memory Devices,” Electronics (Basel), vol. 12, no. 14, p. 3139, Jul. 2023, doi: 10.3390/electronics12143139.
G. N., P. Jain, A. Choudhury, P. Dutta, K. Kalita, and P. Barsocchi, “Random Forest Regression-Based Machine Learning Model for Accurate Estimation of Fluid Flow in Curved Pipes,” Processes, vol. 9, no. 11, p. 2095, Nov. 2021, doi: 10.3390/pr9112095.
B. Chen, Y. Chen, and H. Chen, “An Interpretable CatBoost Model Guided by Spectral Morphological Features for the Inversion of Coastal Water Quality Parameters,” Water (Basel), vol. 16, no. 24, p. 3615, Dec. 2024, doi: 10.3390/w16243615.
A. D. Hartanto, Y. Nur Kholik, and Y. Pristyanto, “Stock Price Time Series Data Forecasting Using the Light Gradient Boosting Machine (LightGBM) Model,” JOIV : International Journal on Informatics Visualization, vol. 7, no. 4, p. 2270, Dec. 2023, doi: 10.62527/joiv.7.4.1740.
F. Pedregosa et al., “Scikit-learn: Machine Learning in Python,” Jun. 2018.
L. Prokhorenkova, G. Gusev, A. Vorobev, A. V. Dorogush, and A. Gulin, “CatBoost: unbiased boosting with categorical features,” in Proceedings of the 32nd International Conference on Neural Information Processing Systems, in NIPS’18. Red Hook, NY, USA: Curran Associates Inc., 2018, pp. 6639–6649.
G. Ke et al., “LightGBM: A Highly Efficient Gradient Boosting Decision Tree.” [Online]. Available: https://github.com/Microsoft/LightGBM.
G. Liu, L. Brooks, J. Canty, D. Lu, J. Y. Jin, and J. Lu, “Deep‐NCA: A deep learning methodology for performing noncompartmental analysis of pharmacokinetic data,” CPT Pharmacometrics Syst Pharmacol, vol. 13, no. 5, pp. 870–879, May 2024, doi: 10.1002/psp4.13124.
D. D. Rufo, T. G. Debelee, A. Ibenthal, and W. G. Negera, “Diagnosis of Diabetes Mellitus Using Gradient Boosting Machine (LightGBM),” Diagnostics, vol. 11, no. 9, p. 1714, Sep. 2021, doi: 10.3390/diagnostics11091714.