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

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.


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 realtime 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.
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 CGM values ≤ 3:9 mmol/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.

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][19][20]. Assuming that the CGM data is expressed as a matrix of CGM = fG 1 , G 2 , G 3 , ⋯, G i , ⋯, G N g, the MSG and gradient of CGM data can be obtained by equation (1) and equation (2), respectively.
where G i represents the ith value of CGM, GradientðiÞ 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 of fMSG, weight × gradientg. 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.

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).
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.

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%. The mean ± standard deviation age of the enrolled participants was 59 ± 10 years, and they had a mean ± standard deviation diabetes duration of 11:5 ± 6:5 years. 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. Figure 1 demonstrates the raw glucose value and gradient value from t = −90 minute to t = −5 minute before the nocturnal hypoglycemic events occurred at t = 0 minute. The results in Figure 1 were presented as mean ± standard deviation. 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  Figure 1 were presented as mean ± standard deviation.

Gradient Analyses.
3 Journal of Diabetes Research 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).

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. Table 1 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.
In order to analyze the influence of CGM length on the prediction performance, three different CGM lengths were considered in our work. Table 2 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 perfor-mance based on SVM, RF, and LSTM algorithm also revealed the similar conclusions.
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 Figure 1, 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 falsenegative 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.

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. 4 Journal of Diabetes Research 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    Journal of Diabetes Research 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.

Data Availability
Requests for access to these data should be made to zd.nie@siat.ac.cn or zhoujian@sjtu.edu.cn.

Conflicts of Interest
The author(s) declare(s) that they have no conflicts of interest.