Abstract
Progress in the biomedical field through the use of deep learning is hindered by the lack of interpretability of the models. In this paper, we study the RETAIN architecture for the forecasting of future glucose values for diabetic people. Thanks to its two-level attention mechanism, the RETAIN model is interpretable while remaining as efficient as standard neural networks. We evaluate the model on a real-world type-2 diabetic population and we compare it to a random forest model and a LSTM-based recurrent neural network. Our results show that the RETAIN model outperforms the former and equals the latter on common accuracy metrics and clinical acceptability metrics, thereby proving its legitimacy in the context of glucose level forecasting. Furthermore, we propose tools to take advantage of the RETAIN interpretable nature. As informative for the patients as for the practitioners, it can enhance the understanding of the predictions made by the model and improve the design of future glucose predictive models.
Introduction
Managing diabetes requires a constant balancing act where patients must predict how their blood glucose will react to food, exercise, and insulin to avoid dangerous glycemic events. While deep learning models like LSTMs are excellent at forecasting these fluctuations, they are notoriously opaque "black boxes." In clinical settings, interpretability is crucial; a doctor or patient needs to understand if a predicted glucose crash was triggered by a recent insulin bolus or a long-standing trend. This paper addresses this gap by implementing the RETAIN (REverse Time AttentioN) architecture, which builds interpretability directly into its structure without sacrificing predictive performance.
Methodology
The researchers adapted the RETAIN architecture, originally designed for clinical classification, for the task of glucose regression. The core innovation of RETAIN is its two-level attention mechanism, which allows the model to assign weights to both time steps and specific input features.
As shown in Figure 1, the architecture utilizes:
- Time-level attention ($\alpha$): This determines which specific moments in the past (e.g., 10 minutes vs. 2 hours ago) are most relevant to the current prediction.
- Variable-level attention ($\beta$): This determines which specific input features (e.g., carbohydrate intake vs. previous glucose levels) drive the prediction at those moments.
The study utilized the IDIAB dataset, consisting of 5 patients with Type-2 diabetes monitored for 31 days in real-world conditions. The model used a 3-hour history of Continuous Glucose Monitoring (CGM) data, carbohydrate (CHO) intake, and insulin infusions to predict glucose levels 30 minutes into the future. RETAIN was benchmarked against Random Forest (RF) and LSTM models.
Results and Interpretability
RETAIN achieved performance parity with the gold-standard LSTM. In terms of Root-Mean-Squared Error (RMSE), RETAIN scored 17.60 mg/dL, nearly identical to the LSTM’s 17.52 mg/dL, and both significantly outperformed the Random Forest (19.23 mg/dL). Clinical acceptability, measured via Continuous Glucose-Error Grid Analysis (CG-EGA), showed RETAIN had a low rate of erroneous predictions (2.90%), comparable to the LSTM (2.87%).
The primary advantage of RETAIN is its transparency. By calculating "absolute normalized contribution values," the authors quantified the impact of each input over time, revealing how the model's "thought process" evolves.
As shown in Figure 2, the model exhibits rapid information decay. Attention to insulin and carbohydrate data drops significantly after 30–60 minutes, while it maintains a longer memory for glucose trends. This suggests that for short-term forecasting, looking back further than one hour provides diminishing returns for certain variables. Additionally, the model places high importance on the glucose value recorded immediately before an event (like a meal), using it as a baseline to calculate expected swings.
Discussion and Future Directions
This research demonstrates that RETAIN provides the "best of both worlds": the accuracy of deep learning with the transparency of simpler models. However, limitations remain, including the small sample size of five Type-2 diabetes patients and reliance on manually logged insulin/carb data.
Future work will involve testing on larger datasets, such as the Ohio T1DM dataset, and incorporating additional physiological signals like heart rate and physical activity. Interestingly, the authors found that "forward" time attention worked better for glucose prediction than the "reverse" order originally proposed for RETAIN, suggesting that temporal dynamics in physiological forecasting may require specific architectural tuning.
Summary updated