Source-linked AI summary
Convolutional Recurrent Neural Networks for Glucose Prediction
Kezhi Li, John Daniels, Chengyuan Liu, Pau Herrero, Pantelis Georgiou
TL;DR
Type 1 diabetes requires insulin therapy, while glucose prediction is complicated by variable insulin, meals, activities, stress, and individual responses. This paper proposes a convolutional recurrent neural network for glucose forecasting and reports superior predictive performance in simulated and clinical experiments, with local deployment on portable devices.
Problem
Type 1 diabetes impairs insulin production, requiring therapy, while glucose prediction must account for multiple variability factors and differing individual glycaemic responses.
Method
The proposed method trains an end-to-end multi-layer convolutional recurrent neural network on time-aligned CGM, carbohydrate, and insulin data, combining CNN feature extraction with LSTM-based sequential prediction.
Results
The CRNN achieved the best overall RMSE and MARD for 10 simulated cases at 30- and 60-minute horizons and showed superior performance in in silico and clinical experiments.
Takeaways & Limitations
The subject-specific CRNN can be applied locally or on portable devices, and its effective prediction time gives users more time to take action.
Takeaways & Limitations
Hypoglycaemia prediction degrades faster than hyperglycaemia prediction as the horizon increases, partly because fast-acting carbohydrates and aerobic exercise may be unaccounted for.
Abstract
from arXiv · showhide
Control of blood glucose is essential for diabetes management. Current digital therapeutic approaches for subjects with Type 1 diabetes mellitus (T1DM) such as the artificial pancreas and insulin bolus calculators leverage machine learning techniques for predicting subcutaneous glucose for improved control. Deep learning has recently been applied in healthcare and medical research to achieve state-of-the-art results in a range of tasks including disease diagnosis, and patient state prediction among others. In this work, we present a deep learning model that is capable of forecasting glucose levels with leading accuracy for simulated patient cases (RMSE = 9.38$\pm$0.71 [mg/dL] over a 30-minute horizon, RMSE = 18.87$\pm$2.25 [mg/dL] over a 60-minute horizon) and real patient cases (RMSE = 21.07$\pm$2.35 [mg/dL] for 30-minute, RMSE = 33.27$\pm$4.79\% for 60-minute). In addition, the model provides competitive performance in providing effective prediction horizon ($PH_{eff}$) with minimal time lag both in a simulated patient dataset ($PH_{eff}$ = 29.0$\pm$0.7 for 30-min and $PH_{eff}$ = 49.8$\pm$2.9 for 60-min) and in a real patient dataset ($PH_{eff}$ = 19.3$\pm$3.1 for 30-min and $PH_{eff}$ = 29.3$\pm$9.4 for 60-min). This approach is evaluated on a dataset of 10 simulated cases generated from the UVa/Padova simulator and a clinical dataset of 10 real cases each containing glucose readings, insulin bolus, and meal (carbohydrate) data. Performance of the recurrent convolutional neural network is benchmarked against four algorithms. The proposed algorithm is implemented on an Android mobile phone, with an execution time of $6$ms on a phone compared to an execution time of $780$ms on a laptop.
I. INTRODUCTION
The paper addresses glucose prediction for T1DM by proposing an end-to-end convolutional recurrent neural network that combines convolutional feature extraction with LSTM-based sequence modeling. It evaluates the approach on simulated and clinical data and targets portable diabetes-management applications.
- Glucose prediction can help people with T1DM act ahead of adverse glycaemic events, but glucose variability depends on insulin, meals, stress, activity, and individual responses.
- The proposed CRNN combines multi-layer convolutional feature extraction with an LSTM recurrent layer and fully connected regression layers.The model is trained end-to-end on time-aligned glucose, carbohydrate, and insulin data.
- The model is evaluated on simulated and clinical T1DM datasets and compared with SVR, LVX, ARX, and NNPG benchmark algorithms.
- The proposed multi-layer neural network is designed for implementation on portable devices, including smartphones, for diabetes management.
B. Data Setting
The study uses simulated and clinical glucose datasets with aligned glucose, meal, and insulin inputs. Its pipeline cleans the data, extracts temporal features with CNN layers, predicts future glucose with LSTM layers, and evaluates 30- and 60-minute horizons.
- B. Data Setting: The simulated dataset contains 10 unique adult cases with 360 days of data, variable meals and insulin entries, occasional exercise, and separate training and testing periods.
- III. METHODS: The CRNN preprocesses aligned glucose, carbohydrate, and insulin time series, applies CNN feature extraction, predicts with LSTM-based recurrent layers, and outputs future BG.The models are trained end-to-end for 30- and 60-minute prediction horizons.
- A. Outlier Detection and Filtering: Preprocessing removes unusual points through timestamp alignment, normalization, outlier detection, interpolation or extrapolation, and filtering.Clinical data uses a Gaussian filter, whereas the in-silico dataset is treated as already clean.
- A. Outlier Detection and Filtering: A sliding window of 24 samples covers the preceding 2 hours of three-dimensional glucose, carbohydrate, and insulin data.The window size balances prediction accuracy and computational complexity.
B. A Multi-layer Convolutional Network
The convolutional component processes aligned glucose, carbohydrate, and insulin time series to learn temporal features before recurrent prediction. Pooling reduces feature-map size and computation, while the final output incorporates the original CGM series.
- B. A Multi-layer Convolutional Network: The CNN receives concatenated, time-aligned multidimensional data and transforms them through convolutional and pooling layers.The inputs include glycaemic, carbohydrate, and insulin information after preprocessing.
- B. A Multi-layer Convolutional Network: A sliding window of size 24 is used for the input, and the first convolutional kernel has size 8.The CNN learns weights and patterns that represent the data for future time steps.
- B. A Multi-layer Convolutional Network: After convolution and pooling, a fully connected layer produces an output summed with a copy of the original CGM time series.This architecture is illustrated as the proposed CNN design.
- B. A Multi-layer Convolutional Network: Three convolutional layers extract feature maps, with max pooling down-sampling representations between convolutional operations.Pooling progressively reduces representation size and computation and can guard against overfitting.
C. A Modified Recurrent Layer
The recurrent component uses an LSTM-based sequence model modified to predict glucose changes rather than glucose values directly. A recovery step adds the current glucose baseline to obtain the predicted future glucose level.
- C. A Modified Recurrent Layer: The recurrent layer uses 64 LSTM cells with input, output, and forget gates to model sequential data.A dropout layer follows the LSTM to reduce overfitting during training.
- C. A Modified Recurrent Layer: The modified LSTM trains on the change between current glucose x(t) and future glucose x(t + 6), rather than directly on glucose values.Its input window contains blood glucose, meal, and insulin time series.
- C. A Modified Recurrent Layer: The predicted glucose level is recovered by adding the predicted glucose change to the baseline glucose value.This transform-and-recovery design converts change predictions into future glucose predictions.
- C. A Modified Recurrent Layer: During inference, the model outputs yt as the glucose-change signal while ht remains the internal state passed to the next time step.The modified output differs from a conventional LSTM output.
- C. A Modified Recurrent Layer: The final recurrent output feeds fully connected layers with 256 and 32 hidden neurons and a single-neuron glucose-change output.The fully connected network uses a linear activation in this paper.
D. Software and Hardware
The trained model is converted to TensorFlow Lite and deployed on mobile operating systems through an associated API and interpreter. The experiments used GPU-equipped computer hardware for training and inference.
- C. Modified Recurrent Layer: After training and validation, the algorithm is converted into a TensorFlow Lite model for deployment on Android or iOS devices.The mobile application loads the Lite model through an API and interpreter.
- C. Modified Recurrent Layer: The experiments used an Intel i7-7700K CPU, 32.0 GB memory, and an NVIDIA GeForce GTX 1080 Ti GPU.The program was written in Python 3.6 with CUDA 9.0 and TensorFlow.
IV. RESULTS
The evaluation compares CRNN forecasting with four baseline algorithms across 30- and 60-minute horizons. Accuracy, adverse-event detection, and effective prediction horizon are assessed because overall error metrics alone provide limited clinical insight.
- IV. RESULTS: Performance is compared with NNPG, SVR, LVX, and third-order ARX using identically preprocessed input data.The comparison covers both in-silico and clinical datasets over 30- and 60-minute prediction horizons.
- IV. RESULTS: RMSE and MARD serve as the primary indicators of predictive accuracy.These metrics provide an overall indication of prediction performance.
- IV. RESULTS: MCC evaluates whether algorithms detect hypoglycaemic or hyperglycaemic events.A true adverse event requires persistence in CGM data for at least 20 minutes, and positive denotes an event in the next or previous 30 or 60 minutes.
- IV. RESULTS: Effective prediction horizon accounts for algorithm responsiveness delays and is determined using cross-correlation of predicted and actual glucose readings.It complements accuracy metrics by measuring time delay in the predictions.
- IV. RESULTS: A single quantitative metric is insufficient, so the study evaluates prediction quality collectively across accuracy, event detection, and delay-related measures.Statistical comparisons use p-values after normality testing and paired t-tests.
B. In Silico Data
On 10 simulated adult cases, CRNN achieved the strongest overall predictive accuracy and improved effective prediction time relative to benchmark methods. Its responsiveness also helped track sharp glycaemic changes.
- +1.5min for 30-min and +5.6min for 60-min effective prediction time over LVX gave users more time to act.
- CRNN responded rapidly to sharp glycaemic uptrends and produced steeper predictions near peaks to reduce prediction lag.The model accounted for both sharp slopes and gradual increments in the glycaemic curve.
C. Clinical Data
Clinical-data evaluation showed mixed accuracy across methods, while CRNN generally provided the smallest lag and strongest long-horizon glucose prediction. Missing and erroneous measurements were interpolated or extrapolated but excluded from evaluation.
- Interpolated or extrapolated points used to address missing and erroneous clinical data were excluded from performance evaluation.
- CRNN had the best RMSE and MARD over a 30-minute horizon, although ARX and LVX had better MARD in some comparisons.
- CRNN exhibited the smallest prediction lag in the clinical-data evaluation.
- Over long horizons, CRNN provided the best glucose-level prediction and least lag among evaluated methods.SVR approached CRNN in effective prediction horizon, while LVX predicted adverse events better but gave users 9 minutes less time to act.
- The full CRNN achieved the best ablation performance, with both CNN and LSTM components contributing to the final result.
- 22.28 ± 2.67 (30) and 35.56 ± 4.55 (60) RMSE were achieved using one month of training data, with slight improvement from longer training periods.
V. DISCUSSION
The discussion attributes the lower performance on real subjects than virtual subjects primarily to greater real-data complexity, with missing and interpolated data potentially contributing further. The proposed method showed strong RMSE performance under matched-input comparisons.
- Real-subject performance was less satisfactory than virtual-subject performance, primarily because real data are more complex than simulator-generated data.The authors also identify data gaps and interpolation or extrapolation as possible contributors to the reduction.
- 9.38mg/dL mean RMSE was achieved in silico, the best result among SVR, LVX, and 3rd order ARX.
- Benchmark comparisons used the same inputs, including CGM, meal, and insulin data, while enhanced NNPG was supplied with these additional inputs.
C. Application on resource-constrained mobile platforms
The CRNN can be deployed on portable devices for subject-specific glucose prediction, including an Android app interface. Its remaining challenges include reduced hypoglycaemia prediction performance at longer horizons and possible integration of physiological models.
- Application on resource-constrained mobile platforms: The Android app displays historic glucose, the current time, and the model’s predicted glucose curve.
- Limitations: Hypoglycaemia prediction performance degrades faster than hyperglycaemia prediction as the prediction horizon increases.The passage relates this to unaccounted fast-acting carbohydrates and aerobic exercise that can accelerate hypoglycaemia onset.
- Limitations: Physiological models and meal/bolus rules are identified as possible additions to create a hybrid method.The proposed hybrid approach is described as potentially combining conventional and deep learning methods.
- Application on resource-constrained mobile platforms: The CRNN trains a separate model for each diabetic subject and can be applied locally on portable devices.Trained networks can be converted into mobile-compatible files for app deployment.
VIII. APPENDIX
The appendix includes a table detailing the size and dimensions of the CRNN layers.
- VIII. APPENDIX: The appendix table details the size and dimensions of layers in the CRNN.