# A Novel CGM Metric-Gradient and Combining Mean Sensor Glucose Enable to Improve the Prediction of Nocturnal Hypoglycemic Events in Patients with Diabetes

Authors: Jingzhen Li; Xiaojing Ma; Igbe Tobore; Yuhang Liu; Abhishek Kandwal; Lei Wang; Jingyi Lu; Wei Lu; Yuqian Bao; Jian Zhou; Zedong Nie
Journal: Journal of Diabetes Research
 (2020)

---

## Abstract

Nocturnal hypoglycemia is a serious complication of insulin-treated diabetes, and it is often asymptomatic. A novel CGM metric-gradient was proposed in this paper, and a method of combining mean sensor glucose (MSG) and gradient was presented for the prediction of nocturnal hypoglycemia. For this purpose, the data from continuous glucose monitoring (CGM) encompassing 1,921 patients with diabetes were analyzed, and a total of 302 nocturnal hypoglycemic events were recorded. The MSG and gradient values were calculated, respectively, and then combined as a new metric (i.e., MSG+gradient). In addition, the prediction was conducted by four algorithms, namely, logistic regression, support vector machine, random forest, and long short-term memory. The results revealed that the gradient of CGM showed a downward trend before hypoglycemic events happened. Additionally, the results indicated that the specificity and sensitivity based on the proposed method were better than the conventional metrics of low blood glucose index (LBGI), coefficient of variation (CV), mean absolute glucose (MAG), lability index (LI), etc., and the complex metrics of MSG+LBGI, MSG+CV, MSG+MAG, and MSG+LI, etc. Specifically, the specificity and sensitivity were greater than 96.07% and 96.03% at the prediction horizon of 15 minutes and greater than 87.79% and 90.07% at the prediction horizon of 30 minutes when the proposed method was adopted to predict nocturnal hypoglycemic events in the aforementioned four algorithms. Therefore, the proposed method of combining MSG and gradient may enable to improve the prediction of nocturnal hypoglycemic events. Future studies are warranted to confirm the validity of this metric.


---

## Body

## 1. Introduction

Diabetes mellitus is a metabolic disease resulting from defects in insulin secretion, insulin action, or both [1, 2]. Hypoglycemia is a common side effect of insulin therapy in diabetes, and it is one of the important limiting factors in the glycemic management of patients with diabetes [3]. It is estimated that 54.0% of patients with type 1 diabetes mellitus (T1DM) and 27.4% of patients with type 2 diabetes mellitus (T2DM) had nocturnal hypoglycemia and usually happened at around 1:00 am to 4:00 am [4, 5]. Furthermore, 75% of hypoglycemic events associated with coma or seizure occur at night because the autonomic symptoms are often not strong enough to awaken the patients [6]. Some studies reported that the “dead-in-bed” syndrome probably is the result of severe nocturnal hypoglycemia, which accounts for 5–6% of mortality cases in patients with T1DM [7, 8]. Therefore, the prediction of nocturnal hypoglycemia is urgent and important.Continuous glucose monitoring (CGM) is regarded as the roadmap for 21st-century diabetes therapy [9]. One of the important potential benefits of CGM is that it can provide maximal information about glucose levels throughout the day. Thus far, a limited number of studies have been published utilizing the raw data from the CGM device to achieve hypoglycemia prediction. In a previous study by Mhaskar et al. [10], a certain percentage of patients were set as the training data, and the remainder of the patients was set as the test data. Furthermore, a deep neural network with ReLU nonlinearities was suggested to predict hypoglycemia. Similarly, a new scheme of a kernel-based regularization learning algorithm was proposed for hypoglycemia prediction in a previous study by Naumova et al. [11]. In addition, a real-time method combines five individual algorithms presented for hypoglycemia prediction in studies by Buckingham et al. [12, 13]. Meanwhile, considering that the glycemic variability is associated with hypoglycemia [14], some metrics which could reflect the glycemic variability and hypoglycemia were also presented to achieve the prediction of nocturnal hypoglycemia [15]. The conventional metrics include mean sensor glucose (MSG), standard deviations of sensor glucose (SD), coefficient of variation (CV), mean absolute glucose (MAG), low blood glucose index (LBGI), and lability index (LI). However, it is noteworthy that the variation amplitude is considered, whereas the variation trend is neglected in the aforementioned metrics. As well known, hypoglycemia is more likely to occur when blood glucose shows a decreasing trend rather than an increasing trend. In this paper, a novel CGM metric, which is named as gradient, was proposed in this paper. In terms of the definition of gradient, it can reflect the variation trend of blood glucose. In addition, the MSG can reflect the overall blood glucose level, which is associated with hypoglycemia. Therefore, a new method which combines MSG and gradient of CGM was proposed to predict nocturnal hypoglycemia in this paper. Four algorithms were adopted to evaluate the prediction performance at different prediction horizons.


## 2. Methods

### 2.1. Procedure

The study protocol was approved by the ethics committees of Shanghai Jiao Tong University Affiliated Sixth People’s Hospital in accordance with the principles of the Declaration of Helsinki. Written informed consent was obtained from each participant before the measurement. The glucose value was obtained by using a commercial CGM system (iPro2, Medtronic Inc., Northridge, CA). The measuring range of the CGM system was from 2.2 mmol/L to 22.2 mmol/L. The monitoring interval of the CGM system was 5 minutes. Each patient had three-day CGM records, generating a daily record of 288 continuous glucose values. Initially, a total of 5,763 days of CGM records were collected from 1,921 patients. Furthermore, there were at least four capillary blood glucose readings per day measured by using a SureStep blood glucose meter (LifeScan, Milpitas, CA) to calibrate the CGM system. In this paper, we mainly focused on the investigation on nocturnal hypoglycemia. The reasons why the prediction of nocturnal hypoglycemia is considered in this work are as follows. Firstly, as mentioned above, nocturnal hypoglycemia has important clinical significance. Secondly, the nocturnal blood glucose level is less affected by diet, exercise, and other intervention factors, which helps to evaluate the prediction performance of the proposed metric. According to the bedtime and awakening time in most of the patients with diabetes, the nocturnal period for outcome assessment each night was from 22:00 to 06:00 of the following morning in this paper [16]. Therefore, generally, a record of 97 continuous glucose values was acquired each night for the patient. However, some CGM records might be incomplete or missing. The missing CGM value was interpolated by using a straight line estimation if only one data was missing. The CGM records were excluded from further analysis if two or more data in the record were missing. In this paper, 809 CGM records were excluded, and the remaining 4,954 CGM records were used for our study.The nocturnal hypoglycemic event was defined as having at least 15 minutes of CGMvalues≤3.9mmol/L, and it occurred at night from 22:00 to 06:00 [17]. Hypoglycemic events were excluded from further analysis if they occurred <2 hours after a previous event. According to the aforementioned definition, 302 nocturnal hypoglycemic events from 4,954 CGM records were available for further study in this paper.


### 2.2. MSG and Gradient Calculation

In terms of the definition of gradient, it can represent the maximum along the direction derivative of a function at a point [18–20]. Assuming that the CGM data is expressed as a matrix of CGM=G1,G2,G3,⋯,Gi,⋯,GN, the MSG and gradient of CGM data can be obtained by equation (1) and equation (2), respectively.(1)MSG=∑i=1NGiN,(2)Gradienti=Gi+1−Gii=1Gi+1−Gi−122≤i≤N−1Gi−Gi−1i=N,where Gi represents the ith value of CGM, Gradienti is the ith gradient value of CGM, and N is the number of CGM data.The combination of MSG and gradient can be expressed as a matrix ofMSG,weight×gradient. It is noted that the weight between MSG and gradient was adaptive when combining MSG and gradient. The weight of MSG was set as 1, and the weight of the gradient depended on the value of MSG. For instance, if the MSG value was equal to 4.9, the weight of the gradient would be set as 4.9.


### 2.3. Hypoglycemia Prediction Algorithm

Four classical algorithms, namely, logistic regression (LR), support vector machine (SVM), random forest (RF), and long short-term memory (LSTM), were adopted to achieve the prediction of nocturnal hypoglycemia in our work. Those algorithms were conducted by Python 3.5 based on the Keras platform. The principle and parameter setup of algorithms were briefly introduced as follows. LR is a predictive analysis that uses a logistic function to model variables [21, 22]. LR has been widely used in data mining, automatic disease diagnosis, economic prediction, and so on. The LR parameters were set as the default value. SVM is a supervised learning model used for classification and prediction. The decision boundary of SVM is the maximum margin hyperplane for learning samples [23]. The kernel of SVM was set as “linear,” and the penalty parameter C of the error term was 1.0 in this paper. RF is a classical classifier which consists of a number of decision trees [24, 25]. It uses bootstrap aggregating and a random subspace method to build multiple decision trees and merges them together to get a more accurate and stable prediction. The RF parameters of n_estimators, max_features, criterion, and n_jobs were set as 200, “auto,” “entropy,” and 200, respectively. LSTM is an artificial recurrent neural network architecture used in the field of deep learning [26, 27]. The characteristic of LSTM is to use a memory module instead of ordinary hidden nodes, which is helpful to ensure that the gradient does not disappear or explode after passing over many time steps. In this paper, the model consisted of 3 LSTM layers, and the dimension of output was 10, 8, and 2. The return sequence of layer 1 and layer 2 was set as “true.”


### 2.4. Evaluation Method

In this paper, the specificity and sensitivity were adopted to evaluate the prediction performance of nocturnal hypoglycemia by different metrics and algorithms at different prediction horizons. In particular, sensitivity and specificity are the statistical measures of the performance of a binary classification test that is widely used in medicine. The calculations are as equation (3) and equation (4).(3)Sensitivity=TPTP+FN,(4)Specificity=TNTN+FP.As shown in equation (3), TP represents that the hypoglycemia was correctly identified as hypoglycemia, and FN represents that the hypoglycemia was incorrectly identified as nonhypoglycemia. Therefore, sensitivity can reflect the proportion of positives (i.e., hypoglycemia) that are correctly identified. Similarly, TN is that the nonhypoglycemia was correctly identified as nonhypoglycemia, and FP is that the nonhypoglycemia was incorrectly identified as hypoglycemia. Hence, specificity can reflect the proportion of negatives (i.e., nonhypoglycemia) that are correctly identified.


## 2.1. Procedure

The study protocol was approved by the ethics committees of Shanghai Jiao Tong University Affiliated Sixth People’s Hospital in accordance with the principles of the Declaration of Helsinki. Written informed consent was obtained from each participant before the measurement. The glucose value was obtained by using a commercial CGM system (iPro2, Medtronic Inc., Northridge, CA). The measuring range of the CGM system was from 2.2 mmol/L to 22.2 mmol/L. The monitoring interval of the CGM system was 5 minutes. Each patient had three-day CGM records, generating a daily record of 288 continuous glucose values. Initially, a total of 5,763 days of CGM records were collected from 1,921 patients. Furthermore, there were at least four capillary blood glucose readings per day measured by using a SureStep blood glucose meter (LifeScan, Milpitas, CA) to calibrate the CGM system. In this paper, we mainly focused on the investigation on nocturnal hypoglycemia. The reasons why the prediction of nocturnal hypoglycemia is considered in this work are as follows. Firstly, as mentioned above, nocturnal hypoglycemia has important clinical significance. Secondly, the nocturnal blood glucose level is less affected by diet, exercise, and other intervention factors, which helps to evaluate the prediction performance of the proposed metric. According to the bedtime and awakening time in most of the patients with diabetes, the nocturnal period for outcome assessment each night was from 22:00 to 06:00 of the following morning in this paper [16]. Therefore, generally, a record of 97 continuous glucose values was acquired each night for the patient. However, some CGM records might be incomplete or missing. The missing CGM value was interpolated by using a straight line estimation if only one data was missing. The CGM records were excluded from further analysis if two or more data in the record were missing. In this paper, 809 CGM records were excluded, and the remaining 4,954 CGM records were used for our study.The nocturnal hypoglycemic event was defined as having at least 15 minutes of CGMvalues≤3.9mmol/L, and it occurred at night from 22:00 to 06:00 [17]. Hypoglycemic events were excluded from further analysis if they occurred <2 hours after a previous event. According to the aforementioned definition, 302 nocturnal hypoglycemic events from 4,954 CGM records were available for further study in this paper.


## 2.2. MSG and Gradient Calculation

In terms of the definition of gradient, it can represent the maximum along the direction derivative of a function at a point [18–20]. Assuming that the CGM data is expressed as a matrix of CGM=G1,G2,G3,⋯,Gi,⋯,GN, the MSG and gradient of CGM data can be obtained by equation (1) and equation (2), respectively.(1)MSG=∑i=1NGiN,(2)Gradienti=Gi+1−Gii=1Gi+1−Gi−122≤i≤N−1Gi−Gi−1i=N,where Gi represents the ith value of CGM, Gradienti is the ith gradient value of CGM, and N is the number of CGM data.The combination of MSG and gradient can be expressed as a matrix ofMSG,weight×gradient. It is noted that the weight between MSG and gradient was adaptive when combining MSG and gradient. The weight of MSG was set as 1, and the weight of the gradient depended on the value of MSG. For instance, if the MSG value was equal to 4.9, the weight of the gradient would be set as 4.9.


## 2.3. Hypoglycemia Prediction Algorithm

Four classical algorithms, namely, logistic regression (LR), support vector machine (SVM), random forest (RF), and long short-term memory (LSTM), were adopted to achieve the prediction of nocturnal hypoglycemia in our work. Those algorithms were conducted by Python 3.5 based on the Keras platform. The principle and parameter setup of algorithms were briefly introduced as follows. LR is a predictive analysis that uses a logistic function to model variables [21, 22]. LR has been widely used in data mining, automatic disease diagnosis, economic prediction, and so on. The LR parameters were set as the default value. SVM is a supervised learning model used for classification and prediction. The decision boundary of SVM is the maximum margin hyperplane for learning samples [23]. The kernel of SVM was set as “linear,” and the penalty parameter C of the error term was 1.0 in this paper. RF is a classical classifier which consists of a number of decision trees [24, 25]. It uses bootstrap aggregating and a random subspace method to build multiple decision trees and merges them together to get a more accurate and stable prediction. The RF parameters of n_estimators, max_features, criterion, and n_jobs were set as 200, “auto,” “entropy,” and 200, respectively. LSTM is an artificial recurrent neural network architecture used in the field of deep learning [26, 27]. The characteristic of LSTM is to use a memory module instead of ordinary hidden nodes, which is helpful to ensure that the gradient does not disappear or explode after passing over many time steps. In this paper, the model consisted of 3 LSTM layers, and the dimension of output was 10, 8, and 2. The return sequence of layer 1 and layer 2 was set as “true.”


## 2.4. Evaluation Method

In this paper, the specificity and sensitivity were adopted to evaluate the prediction performance of nocturnal hypoglycemia by different metrics and algorithms at different prediction horizons. In particular, sensitivity and specificity are the statistical measures of the performance of a binary classification test that is widely used in medicine. The calculations are as equation (3) and equation (4).(3)Sensitivity=TPTP+FN,(4)Specificity=TNTN+FP.As shown in equation (3), TP represents that the hypoglycemia was correctly identified as hypoglycemia, and FN represents that the hypoglycemia was incorrectly identified as nonhypoglycemia. Therefore, sensitivity can reflect the proportion of positives (i.e., hypoglycemia) that are correctly identified. Similarly, TN is that the nonhypoglycemia was correctly identified as nonhypoglycemia, and FP is that the nonhypoglycemia was incorrectly identified as hypoglycemia. Hence, specificity can reflect the proportion of negatives (i.e., nonhypoglycemia) that are correctly identified.


## 3. Results

### 3.1. Study Population

A total of 1,921 patients with diabetes (T1DM was 289, and T2DM was 1,632) were recruited from the Department of Endocrinology and Metabolism of the Shanghai Jiao Tong University Affiliated Sixth People’s Hospital between January 2018 and March 2019. The male percentage of the enrolled participants was 57.6%. Themean±standarddeviation age of the enrolled participants was 59±10years, and they had a mean±standarddeviation diabetes duration of 11.5±6.5years. The percentages of patients using insulin, biguanide, sulfonylureas, DPP-4i, and α-glycosidase inhibitor during therapy were 71.1%, 39.2%, 21.5%, 8.06%, and 33.4%, respectively.


### 3.2. Gradient Analyses

Figure1 demonstrates the raw glucose value and gradient value from t=−90minute to t=−5minute before the nocturnal hypoglycemic events occurred at t=0minute. The results in Figure 1 were presented as mean±standarddeviation. As shown in Figure 1, the raw glucose values showed a trend of approximately linearly declining before the hypoglycemic event occurred, whereas the raw glucose values remained almost unchanged with time for nonhypoglycemia. It could be observed that the gradient could reflect the variation direction of blood glucose. The gradient of hypoglycemic events showed a downward trend from -90 minutes to -5 minutes. For instance, the gradient value was -0.0611 mmol/L at -70 minutes, and it was less than -0.1099 mmol/L at -35 minutes. Furthermore, it was interesting to observe that the change of gradient value was more obvious in the time range -30 minutes to -5 minutes. The gradient value was about -0.2308 mmol/L at -5 minutes before the hypoglycemic events. However, the gradient value was almost the same from -90 minutes to -5 minutes for nonhypoglycemia, which was approximately -0.0015 mmol/L. In terms of the statistical analysis based on one-way ANOVA, the gradient value differed significantly across hypoglycemic events and nonhypoglycemia at different times (all P for trend <0.02).Figure 1
Raw data and gradient value fromt=−90minutes to t=−5minutes before the nocturnal hypoglycemic events occurred at t=0minutes. The results in Figure 1 were presented as mean±standard deviation.


### 3.3. Prediction Performance

Taking into account that the number of nocturnal hypoglycemic events was much less than the nonhypoglycemia and the importance of the sample balance in the train model, half of the nocturnal hypoglycemic events (i.e., 151 events) and 151 data were randomly selected from the nonhypoglycemia and were used for training in four individual algorithms. The remaining data were used for verification.Table1 lists the specificity and sensitivity of different metrics and algorithms at different prediction horizons. The CGM length which was adopted for prediction was 30 minutes. The prediction horizons were 15 minutes, 30 minutes, 45 minutes, and 60 minutes. Both the single metric and complex metric were considered in our study. As illustrated in Table 1, it was interesting to observe that the prediction performance could be significantly improved when the proposed method of combining MSG and gradient (i.e., MSG+gradient) was utilized. Specifically, the specificity was up to 97.12%, and the sensitivity was up to 98.01% at the prediction horizon of 15 minutes in the LR algorithm. Additionally, the specificity values were 90.83%, 82.42%, and 77.87%, and the sensitivity values were 90.07%, 90.07%, 90.73% at the prediction horizons of 30 minutes, 45 minutes, and 60 minutes, respectively. Furthermore, the results indicated that the prediction performance of the proposed method was not only better than the raw data and single metrics but also better than the complex metrics, including MSG+SD, MSG+CV, MSG+LAGE, MSG+MAG, MSG+LBGI, and MSG+LI at different prediction horizons. In addition, as shown in Table 1, the specificity and sensitivity of the proposed method were also the largest at the prediction horizons of 15 minutes and 30 minutes when other algorithms such as SVM, RF, and LSTM were used to achieve hypoglycemia prediction.Table 1
The specificity and sensitivity of the prediction of nocturnal hypoglycemic events based on different metrics and algorithms (CGMlength=30minutes).
pHMethodLRSVMRFLSTMSPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)15 minRaw data95.7695.3696.3196.0394.8294.7093.5192.05MSG85.8990.0786.0690.0780.2190.0786.0690.07Gradient52.0090.7354.5189.4049.0290.0751.3289.40SD24.2491.3926.8389.4013.5389.4022.1791.39CV69.7576.8289.4254.9740.8490.0739.9492.72LAGE21.3791.3921.3791.3916.1590.7321.3791.39MAG32.8784.7732.7884.7715.5890.7332.7884.77LBGI89.1890.0789.0390.0786.0690.0789.2690.07LI32.5784.7732.5784.7716.0689.4032.5784.77MSG+gradient97.1298.0197.4098.0196.0796.0396.8897.35MSG+SD93.6194.7093.8294.0492.4292.7294.1394.04MSG+CV87.8190.0788.4390.0793.0293.3887.6190.73MSG+LAGE94.2694.7094.6794.7093.0094.0494.1895.36MSG+MAG93.8994.0494.9494.7093.4693.3893.3494.70MSG+LBGI88.5390.0789.0390.0790.0990.7389.0390.07MSG+LI95.2790.7394.0996.0393.4096.0394.3694.7030 minRaw data83.7090.0785.4390.0783.9990.0785.5090.07MSG75.9990.0776.1190.0761.5290.0776.1190.07Gradient30.9790.7331.3890.0727.4089.4028.3290.07SD21.4589.4023.2288.748.4888.7423.2288.74CV26.9594.701.2990.7326.6690.7343.8486.75LAGE20.8489.4020.8489.406.3090.7320.8489.40MAG31.7582.1231.7682.1217.1790.0743.9169.54LBGI82.9290.0783.1290.0781.3889.4083.3490.07LI42.7070.2016.8492.0510.0888.7431.4982.12MSG+gradient90.8390.0790.3090.7387.7990.0790.2090.07MSG+SD87.9490.7388.6190.0783.1190.7388.5790.07MSG+CV78.1190.0778.1190.0783.6890.0779.0790.07MSG+LAGE87.3690.7388.4790.0781.1590.0789.2790.07MSG+MAG86.0290.0788.1590.0779.7990.0787.5390.07MSG+LBGI79.2690.7377.0090.0781.2490.0781.3490.07MSG+LI87.9990.7388.4890.0778.9390.7379.5890.0745 minRaw data75.5690.0778.8490.7380.2490.0780.7290.07MSG65.6690.0765.4690.0754.5490.0765.1190.07Gradient12.0590.7311.0991.3921.3490.0711.4390.73SD20.5889.4022.4288.087.0390.0719.9189.40CV75.7557.6210.8260.9326.5690.7353.5678.81LAGE19.9589.4019.9489.407.7789.4019.9589.40MAG30.9386.0915.7290.0712.9189.4015.7290.07LBGI82.0182.7879.1587.4279.3585.4381.2982.78LI42.6271.5230.6186.0916.0686.0930.5286.09MSG+gradient82.4290.0781.1590.7379.7990.0782.8490.07MSG+SD81.7991.3982.1490.0774.8490.0782.1990.07MSG+CV65.8490.0766.9890.0773.3290.0767.0290.07MSG+LAGE81.5590.7381.9590.7372.2791.3981.3290.73MSG+MAG83.0190.0782.2390.0770.3490.7381.6890.07MSG+LBGI64.3890.0765.6590.0754.8790.0765.4190.07MSG+LI82.4890.0780.3990.7372.9590.0777.4390.0760 minRaw data71.6890.0770.6590.7364.4990.7370.1990.07MSG58.7390.0758.5690.0741.1690.0758.7390.07Gradient11.6690.0711.3690.0713.7790.0714.9386.75SD22.3988.7420.5290.737.9189.4030.9382.12CV77.3559.608.0568.2130.4390.0740.4787.42LAGE19.7390.7319.7390.7323.8786.0919.6590.73MAG30.6284.1130.6384.1121.8387.4230.6484.11LBGI81.4380.1382.3278.1579.4579.4780.7180.79LI49.7567.5530.3384.1118.2986.0941.6973.51MSG+gradient77.8790.7377.2590.0776.7990.0781.1090.07MSG+SD74.9591.3974.2090.0767.3290.7374.5590.07MSG+CV59.2890.7361.4690.0763.1590.0759.2590.07MSG+LAGE76.7590.7375.9790.0762.3090.0776.4190.07MSG+MAG77.7590.7378.8590.0769.7490.0776.8990.73MSG+LBGI57.4690.0758.7190.0745.1490.0758.1090.07MSG+LI76.5190.7376.6790.7370.8790.0778.9090.07PH: prediction horizon; SPE: specificity; SEN: sensitivity; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory; MSG: mean sensor glucose; SD: standard deviations of sensor glucose; CV: coefficient of variation; LAGE: largest amplitude of glycemic excursion; MAG: mean absolute glucose; LBGI: low blood glucose index; LI: lability index. The CGM length which was used for the prediction of nocturnal hypoglycemic events was 30 minutes in this table.In order to analyze the influence of CGM length on the prediction performance, three different CGM lengths were considered in our work. Table2 lists the prediction results at the prediction horizon of 15 minutes and 30 minutes when the CGM lengths were 30 minutes, 45 minutes, and 60 minutes, respectively. It could be observed that the CGM length had little impact on the specificity and sensitivity when the method of combining MSG and gradient was used for prediction. For instance, the specificity values based on the LR algorithm were 90.83%, 91.18%, and 90.73% when the CGM length was 30 minutes, 45 minutes, and 60 minutes, respectively. Additionally, the prediction performance based on SVM, RF, and LSTM algorithm also revealed the similar conclusions.Table 2
The influence of CGM length on the specificity and sensitivity of different algorithms when the metric of MSG+gradient was adopted.
pHAlgorithmCGMlength=30minCGMlength=45minCGMlength=60minSPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)15 minLR97.1298.0197.4797.7096.8597.35SVM97.4098.0197.4197.3596.2697.35RF96.0796.0395.9295.3695.3095.36LSTM96.8897.3597.1097.3596.4696.6930 minLR90.8390.0791.1890.0790.7391.39SVM90.3090.7390.0890.0790.0990.73RF87.7990.0787.5390.7386.9590.07LSTM90.2090.0790.8790.7389.3090.73PH: prediction horizon; SPE: specificity; SEN: sensitivity; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory.To further understand the prediction performance of the proposed metric, the periods of declining sensor glucose without a hypoglycemic event were taken into account in our work. As shown in Figure1, the average gradient from -90 minutes to -5 minutes was approximately -0.1119 mmol/L before the hypoglycemic events happened. Therefore, the data of nonhypoglycemia of which the average gradient was less than -0.1119 mmol/L was extracted for further analysis. A total of 1,438 data were obtained from nonhypoglycemia. Table 3 demonstrates the false positivity rate (FPR) and false-negative rate (FNR) at the prediction horizon of 30 minutes MSG+gradient was adopted. The FNR values were 7.95%, 6.62%, 9.27%, and 7.95%, and the FPR values were 9.32%, 12.20%, 7.15%, and 7.69%, respectively, by four different algorithms. Therefore, it indicated that the proposed metric showed better FNR and FPR.Table 3
The FPR and FNR in the periods of declining sensor glucose without a hypoglycemic event when the metric of MSG+gradient was adopted at the prediction horizon of 30 minutes.
AlgorithmLRSVMRFLSTMFPR (%)9.3212.207.157.69FNR (%)7.956.629.277.95FPR: false positivity rate; FNR: false-negative rate; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory.


## 3.1. Study Population

A total of 1,921 patients with diabetes (T1DM was 289, and T2DM was 1,632) were recruited from the Department of Endocrinology and Metabolism of the Shanghai Jiao Tong University Affiliated Sixth People’s Hospital between January 2018 and March 2019. The male percentage of the enrolled participants was 57.6%. Themean±standarddeviation age of the enrolled participants was 59±10years, and they had a mean±standarddeviation diabetes duration of 11.5±6.5years. The percentages of patients using insulin, biguanide, sulfonylureas, DPP-4i, and α-glycosidase inhibitor during therapy were 71.1%, 39.2%, 21.5%, 8.06%, and 33.4%, respectively.


## 3.2. Gradient Analyses

Figure1 demonstrates the raw glucose value and gradient value from t=−90minute to t=−5minute before the nocturnal hypoglycemic events occurred at t=0minute. The results in Figure 1 were presented as mean±standarddeviation. As shown in Figure 1, the raw glucose values showed a trend of approximately linearly declining before the hypoglycemic event occurred, whereas the raw glucose values remained almost unchanged with time for nonhypoglycemia. It could be observed that the gradient could reflect the variation direction of blood glucose. The gradient of hypoglycemic events showed a downward trend from -90 minutes to -5 minutes. For instance, the gradient value was -0.0611 mmol/L at -70 minutes, and it was less than -0.1099 mmol/L at -35 minutes. Furthermore, it was interesting to observe that the change of gradient value was more obvious in the time range -30 minutes to -5 minutes. The gradient value was about -0.2308 mmol/L at -5 minutes before the hypoglycemic events. However, the gradient value was almost the same from -90 minutes to -5 minutes for nonhypoglycemia, which was approximately -0.0015 mmol/L. In terms of the statistical analysis based on one-way ANOVA, the gradient value differed significantly across hypoglycemic events and nonhypoglycemia at different times (all P for trend <0.02).Figure 1
Raw data and gradient value fromt=−90minutes to t=−5minutes before the nocturnal hypoglycemic events occurred at t=0minutes. The results in Figure 1 were presented as mean±standard deviation.


## 3.3. Prediction Performance

Taking into account that the number of nocturnal hypoglycemic events was much less than the nonhypoglycemia and the importance of the sample balance in the train model, half of the nocturnal hypoglycemic events (i.e., 151 events) and 151 data were randomly selected from the nonhypoglycemia and were used for training in four individual algorithms. The remaining data were used for verification.Table1 lists the specificity and sensitivity of different metrics and algorithms at different prediction horizons. The CGM length which was adopted for prediction was 30 minutes. The prediction horizons were 15 minutes, 30 minutes, 45 minutes, and 60 minutes. Both the single metric and complex metric were considered in our study. As illustrated in Table 1, it was interesting to observe that the prediction performance could be significantly improved when the proposed method of combining MSG and gradient (i.e., MSG+gradient) was utilized. Specifically, the specificity was up to 97.12%, and the sensitivity was up to 98.01% at the prediction horizon of 15 minutes in the LR algorithm. Additionally, the specificity values were 90.83%, 82.42%, and 77.87%, and the sensitivity values were 90.07%, 90.07%, 90.73% at the prediction horizons of 30 minutes, 45 minutes, and 60 minutes, respectively. Furthermore, the results indicated that the prediction performance of the proposed method was not only better than the raw data and single metrics but also better than the complex metrics, including MSG+SD, MSG+CV, MSG+LAGE, MSG+MAG, MSG+LBGI, and MSG+LI at different prediction horizons. In addition, as shown in Table 1, the specificity and sensitivity of the proposed method were also the largest at the prediction horizons of 15 minutes and 30 minutes when other algorithms such as SVM, RF, and LSTM were used to achieve hypoglycemia prediction.Table 1
The specificity and sensitivity of the prediction of nocturnal hypoglycemic events based on different metrics and algorithms (CGMlength=30minutes).
pHMethodLRSVMRFLSTMSPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)15 minRaw data95.7695.3696.3196.0394.8294.7093.5192.05MSG85.8990.0786.0690.0780.2190.0786.0690.07Gradient52.0090.7354.5189.4049.0290.0751.3289.40SD24.2491.3926.8389.4013.5389.4022.1791.39CV69.7576.8289.4254.9740.8490.0739.9492.72LAGE21.3791.3921.3791.3916.1590.7321.3791.39MAG32.8784.7732.7884.7715.5890.7332.7884.77LBGI89.1890.0789.0390.0786.0690.0789.2690.07LI32.5784.7732.5784.7716.0689.4032.5784.77MSG+gradient97.1298.0197.4098.0196.0796.0396.8897.35MSG+SD93.6194.7093.8294.0492.4292.7294.1394.04MSG+CV87.8190.0788.4390.0793.0293.3887.6190.73MSG+LAGE94.2694.7094.6794.7093.0094.0494.1895.36MSG+MAG93.8994.0494.9494.7093.4693.3893.3494.70MSG+LBGI88.5390.0789.0390.0790.0990.7389.0390.07MSG+LI95.2790.7394.0996.0393.4096.0394.3694.7030 minRaw data83.7090.0785.4390.0783.9990.0785.5090.07MSG75.9990.0776.1190.0761.5290.0776.1190.07Gradient30.9790.7331.3890.0727.4089.4028.3290.07SD21.4589.4023.2288.748.4888.7423.2288.74CV26.9594.701.2990.7326.6690.7343.8486.75LAGE20.8489.4020.8489.406.3090.7320.8489.40MAG31.7582.1231.7682.1217.1790.0743.9169.54LBGI82.9290.0783.1290.0781.3889.4083.3490.07LI42.7070.2016.8492.0510.0888.7431.4982.12MSG+gradient90.8390.0790.3090.7387.7990.0790.2090.07MSG+SD87.9490.7388.6190.0783.1190.7388.5790.07MSG+CV78.1190.0778.1190.0783.6890.0779.0790.07MSG+LAGE87.3690.7388.4790.0781.1590.0789.2790.07MSG+MAG86.0290.0788.1590.0779.7990.0787.5390.07MSG+LBGI79.2690.7377.0090.0781.2490.0781.3490.07MSG+LI87.9990.7388.4890.0778.9390.7379.5890.0745 minRaw data75.5690.0778.8490.7380.2490.0780.7290.07MSG65.6690.0765.4690.0754.5490.0765.1190.07Gradient12.0590.7311.0991.3921.3490.0711.4390.73SD20.5889.4022.4288.087.0390.0719.9189.40CV75.7557.6210.8260.9326.5690.7353.5678.81LAGE19.9589.4019.9489.407.7789.4019.9589.40MAG30.9386.0915.7290.0712.9189.4015.7290.07LBGI82.0182.7879.1587.4279.3585.4381.2982.78LI42.6271.5230.6186.0916.0686.0930.5286.09MSG+gradient82.4290.0781.1590.7379.7990.0782.8490.07MSG+SD81.7991.3982.1490.0774.8490.0782.1990.07MSG+CV65.8490.0766.9890.0773.3290.0767.0290.07MSG+LAGE81.5590.7381.9590.7372.2791.3981.3290.73MSG+MAG83.0190.0782.2390.0770.3490.7381.6890.07MSG+LBGI64.3890.0765.6590.0754.8790.0765.4190.07MSG+LI82.4890.0780.3990.7372.9590.0777.4390.0760 minRaw data71.6890.0770.6590.7364.4990.7370.1990.07MSG58.7390.0758.5690.0741.1690.0758.7390.07Gradient11.6690.0711.3690.0713.7790.0714.9386.75SD22.3988.7420.5290.737.9189.4030.9382.12CV77.3559.608.0568.2130.4390.0740.4787.42LAGE19.7390.7319.7390.7323.8786.0919.6590.73MAG30.6284.1130.6384.1121.8387.4230.6484.11LBGI81.4380.1382.3278.1579.4579.4780.7180.79LI49.7567.5530.3384.1118.2986.0941.6973.51MSG+gradient77.8790.7377.2590.0776.7990.0781.1090.07MSG+SD74.9591.3974.2090.0767.3290.7374.5590.07MSG+CV59.2890.7361.4690.0763.1590.0759.2590.07MSG+LAGE76.7590.7375.9790.0762.3090.0776.4190.07MSG+MAG77.7590.7378.8590.0769.7490.0776.8990.73MSG+LBGI57.4690.0758.7190.0745.1490.0758.1090.07MSG+LI76.5190.7376.6790.7370.8790.0778.9090.07PH: prediction horizon; SPE: specificity; SEN: sensitivity; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory; MSG: mean sensor glucose; SD: standard deviations of sensor glucose; CV: coefficient of variation; LAGE: largest amplitude of glycemic excursion; MAG: mean absolute glucose; LBGI: low blood glucose index; LI: lability index. The CGM length which was used for the prediction of nocturnal hypoglycemic events was 30 minutes in this table.In order to analyze the influence of CGM length on the prediction performance, three different CGM lengths were considered in our work. Table2 lists the prediction results at the prediction horizon of 15 minutes and 30 minutes when the CGM lengths were 30 minutes, 45 minutes, and 60 minutes, respectively. It could be observed that the CGM length had little impact on the specificity and sensitivity when the method of combining MSG and gradient was used for prediction. For instance, the specificity values based on the LR algorithm were 90.83%, 91.18%, and 90.73% when the CGM length was 30 minutes, 45 minutes, and 60 minutes, respectively. Additionally, the prediction performance based on SVM, RF, and LSTM algorithm also revealed the similar conclusions.Table 2
The influence of CGM length on the specificity and sensitivity of different algorithms when the metric of MSG+gradient was adopted.
pHAlgorithmCGMlength=30minCGMlength=45minCGMlength=60minSPE (%)SEN (%)SPE (%)SEN (%)SPE (%)SEN (%)15 minLR97.1298.0197.4797.7096.8597.35SVM97.4098.0197.4197.3596.2697.35RF96.0796.0395.9295.3695.3095.36LSTM96.8897.3597.1097.3596.4696.6930 minLR90.8390.0791.1890.0790.7391.39SVM90.3090.7390.0890.0790.0990.73RF87.7990.0787.5390.7386.9590.07LSTM90.2090.0790.8790.7389.3090.73PH: prediction horizon; SPE: specificity; SEN: sensitivity; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory.To further understand the prediction performance of the proposed metric, the periods of declining sensor glucose without a hypoglycemic event were taken into account in our work. As shown in Figure1, the average gradient from -90 minutes to -5 minutes was approximately -0.1119 mmol/L before the hypoglycemic events happened. Therefore, the data of nonhypoglycemia of which the average gradient was less than -0.1119 mmol/L was extracted for further analysis. A total of 1,438 data were obtained from nonhypoglycemia. Table 3 demonstrates the false positivity rate (FPR) and false-negative rate (FNR) at the prediction horizon of 30 minutes MSG+gradient was adopted. The FNR values were 7.95%, 6.62%, 9.27%, and 7.95%, and the FPR values were 9.32%, 12.20%, 7.15%, and 7.69%, respectively, by four different algorithms. Therefore, it indicated that the proposed metric showed better FNR and FPR.Table 3
The FPR and FNR in the periods of declining sensor glucose without a hypoglycemic event when the metric of MSG+gradient was adopted at the prediction horizon of 30 minutes.
AlgorithmLRSVMRFLSTMFPR (%)9.3212.207.157.69FNR (%)7.956.629.277.95FPR: false positivity rate; FNR: false-negative rate; LR: logistic regression; SVM: support vector machine; RF: random forest; LSTM: long short-term memory.


## 4. Discussion

This study revealed that the proposed method of combining MSG and gradient enabled to improve the prediction of nocturnal hypoglycemic events at different prediction horizons. The specificity was greater than 87.79%, and the sensitivity was greater than 90.07% at the prediction horizon of 30 minutes in four different algorithms in this paper. On the other hand, in the previous studies, the accuracy of hypoglycemic event prediction was 67.21% at the prediction horizon of 30 minutes and 81.75% at the prediction horizon of 20 minutes, respectively [10, 11]. In [12], using algorithms to shut off the insulin pump when hypoglycemia was predicted at the prediction horizon of 35 minutes, hypoglycemia was possibly prevented for 84%. In [28], a hypoglycemia prevention rate of nearly 80% after exercise was achieved by using the MiniMed 670G system. In [29], hypoglycemia was prevented in 76.8% of instances of predictive suspend. Compared with previous studies, the reason why the proposed method showed better prediction performance might be explained as follows. Firstly, the MSG value of CGM could reflect the overall blood glucose level over a period of time. As known to all, the lower the blood glucose value, the higher the probability of hypoglycemia. In addition, the occurrence of hypoglycemia was related to the change in blood glucose. A hypoglycemic event was more likely to occur when the blood glucose level showed a downward trend rather than an upward trend. The gradient value of CGM could reflect the direction of blood glucose variability. Therefore, the method of combining MSG and gradient was helpful to improve the prediction of hypoglycemia. It could be observed that the specificity and sensitivity based on the method of combining MSG and gradient were higher than the other metrics at different prediction horizons, especially in short prediction horizons of 15 minutes or 30 minutes. The reason might be associated with the change of gradient value. As shown in Figure 1, the closer the hypoglycemic event occurred, the greater the change of gradient value was. Thus, it indicated that the proposed method would show more obvious advantages in the short prediction horizon.Our study is only a first step toward MSG and gradient and its application on nocturnal hypoglycemia. Three limitations of this study should be noted. Firstly, there were too few nocturnal hypoglycemic events to analyze, which requires a larger study of longer duration and participants. Secondly, the participants enrolled in this study were mainly patients with T2DM. However, compared with T2DM, patients with T1DM show a higher degree of glycemic variability, and the hypoglycemia predication may be more difficult. Since most of the enrolled subjects were T2DM, the results of our study might not be generalizable to all patients with diabetes, especially for T1DM. Therefore, a further study of the new metric by using a larger sample of patients with T1DM is necessary. Thirdly, the prediction of nocturnal hypoglycemia was static analysis in this work. The feasibility still needs to be evaluated when the proposed metric is used for real-time prediction of nocturnal hypoglycemia in patients with diabetes. A potential approach is that the metric can be integrated into wearable devices or CGM systems to verify the feasibility of the real-time hypoglycemia prediction. In the near future, we will try to incorporate the proposed metric and other factors including insulin dosage, carbohydrates intake, and daily activities to improve the specificity and sensitivity of hypoglycemia prediction. In addition, the feasibility of whether the proposed metric can be used in insulin pump to achieve the insulin suspension before hypoglycemia at different prediction horizons needs to be further investigated.



---

*Source: 8830774-2020-11-03.xml*