Blood Glucose Level Prediction of Diabetic Type 1 Patients Using Nonlinear Autoregressive Neural Networks

Diabetes type 1 is a chronic disease which is increasing at an alarming rate throughout the world. Studies reveal that the complications associated with diabetes can be reduced by proper management of the disease by continuously monitoring and forecasting the blood glucose level of patients. Objective. The prior prediction of blood glucose level is necessary to overcome the lag time for insulin absorption in diabetic type 1 patients. Method. In this research, we use continuous glucose monitoring (CGM) data to predict future blood glucose level using the previous data points. We compare two neural network techniques. We apply the optimal feedforward neural network and then propose optimal nonlinear autoregressive neural networks for blood glucose prediction 15–30 minutes earlier for diabetic type 1 patients. We validate the proposed model with 2 virtual subjects using their 24-hour blood glucose level data. These two case studies have been compiled from AIDA, i.e., the freeware mathematical diabetes simulator. Results. In the prediction horizon (PH) of 15 and 30 minutes, improved results have been shown for minimal inputs for blood glucose level of a particular subject. Root mean square error (RMSE) is used for performance calculation. For the optimal feedforward neural network, the RMSE is 0.9984 and 3.78 ml/dl, and for the optimal nonlinear autoregressive neural network, it reduces the RMSE to 0.60 and 1.12 ml/dl for 15 min and 30 min prediction horizons, respectively, for subject 1. Similarly, for subject 2 for the optimal feedforward neural network, RMSE is 1.43 and 3.51 ml/dl which is improved using the optimal autoregressive neural network to 0.7911 and 1.6756 ml/dl for 15 min and 30 min prediction horizons, respectively. Validation. We further validate our proposed model using UCI machine learning datasets (Abalone and Servo), and it shows improved results on that as well. Conclusion and Future Work. The proposed optimal nonlinear autoregressive neural network model performs better than the feedforward neural network model for these time series data. In the future, we intend to investigate a greater collection of AIDA scenarios and data that are real and influence other factors of BGLs.


Introduction
T1D is basically a chronic disease which is caused by insulin's deficiency. e reason for this deficiency is the destruction of pancreatic β-cells which can further result in affecting the capability of the pancreas to produce sufficient insulin. T1D can be very harmful to the health of a person, and nowadays, it is progressively increasing at the rate of 3% per year [1,2].
It usually takes 60-120 minutes to absorb the insulin to normalize the blood glucose level. erefore, prior prediction of blood glucose level is necessary to overcome the lag time for insulin absorption in diabetic type 1 patients. In this research, we used continuous glucose monitoring (CGM) data to predict future blood glucose using the previous inputs. First, we analyzed different feedforward neural techniques from the literature used for blood glucose level prediction using univariate and multivariate time series data of diabetic patients and then neural networks used for other applications. We discovered that nonlinear autoregressive (NAR) neural networks are powerful computational models for modeling and forecasting nonlinear time series data [3,4].We proposed optimal nonlinear autoregressive neural networks for blood glucose prediction in diabetic type 1 patients. We validated the proposed model with 2 virtual subjects for 24-hour blood glucose level data. ese two case studies have been compiled from AIDA, i.e., the freeware mathematical diabetes simulator. We compared the proposed technique with the optimal feedforward network [5] for BGL predictions in the prediction horizon (PH) of 15 and 30, minutes, and improved results have been shown for the proposed model with minimal inputs. For the optimal feedforward neural network, the RMSE is 0.9984 and 3.78 ml/dl, and for the optimal nonlinear autoregressive neural network, it reduces the RMSE to 0.60 and 1.12 ml/dl for 15 min and 30 min prediction horizons, respectively, for subject 1. Similarly, for subject 2, for the optimal feedforward neural network, RMSE is 1.43 and 3.51 ml/dl which is improved using the optimal autoregressive neural network to 0.7911and 1.6756 ml/dl for 15 min and 30 min prediction horizons, respectively. We further validated our proposed model using UCI machine learning datasets (Abalone and Servo), and it has shown improved results as well [1,6,7]. e organization of the paper is as follows: Section 2 contains related work, Section 3 describes the system architecture, Section 4 presents the model description and BGL performance prediction, and Section 5 shows results and analysis, whereas in Section 6, there is conclusion presenting the summary of the work done in this research and future work suggested.

Related Work
Numerous studies have already aimed to predict BGL by making use of different physiological, data-driven, and mathematical models. However, most of the models may not have delivered accurate representations because of oversimplifications and assumptions not suitable for making lifedependent predictions [8][9][10]. erefore, in this study, we aim to deliver solutions that are data-driven with minimal inputs. Ali et al. [5] proposed a novel artificial neural network for continuous blood glucose level prediction of type 1 diabetes mellitus patients. e data were collected from 13 patients for training and testing. Four different prediction horizons were considered: 15, 30, 45, and 60 minutes. is research work presented better results than any previous work done till now. In [11], virtual data from the free online diabetic simulator, AIDA, were used to predict future glucose level using artificial neural intelligence. In the study [1], the artificial neural network (ANN) is used for accurate blood glucose level prediction of type 1 diabetes (T1D). For validation, 12 real patients' data were used. Similarly, neural network models are created with variable predictive windows of 50-180 min. e neural network model was trained with 17 patients to validate the system [12]. On the other hand, nonlinear autoregressive (NAR) neural networks are powerful computational models for modeling and forecasting nonlinear time series [3,4,13,14]. In the paper [15], prediction models are developed using NAR and BP neural networks. e NAR neural network is used to predict the dynamic change of wheel diameter and therefore to predict the wheel wear high-speed trains. In this [16] study, the wind speed prediction model is created. Using the one-minute time series, the prediction of the next wind speed is performed with the NAR neural network model. Similarly, NAR networks were used for prediction of water level. In [17], NAR predicts a clearness index that is used to forecast global solar radiations. e NAR model is based on the feedforward multilayer perceptron model with two inputs and one output [18].
In this research, we compared two neural network techniques. We applied optimal feedforward neural network, and then we proposed optimal nonlinear autoregressive (NAR) neural networks for blood glucose prediction in diabetic type 1 patients. We used AIDA, diabetes simulator data, and UCI machine learning repository data for validation.

System Architecture
We used automatic insulin delivery advisor (AIDA), a free mathematical online simulator for diabetic patients for generating the required data. We used those data to train our proposed model. e network is trained on PHs, i.e., 15 and 30 minutes. e prediction BGL can be delivered to artificial pancreas (AP) for predicting and injecting the amount of required insulin dose to the diabetic type 1 patient shown in Figure 1 [3, 10, 12].

Blood Glucose Prediction
4.1. Dataset. In this paper, AIDA is used for the generation of diabetic subjects data. Nonlinear autoregressive neural networks (NARNNs) and optimal autoregressive artificial neural networks (OANNs) are trained on the basis of AIDA's BGL data. During the prediction period, the step of current time increments is 15 minutes. is helps OANNs and ONARNN in making BGL predictions by considering each time-step in the prediction period. For further illustration, consider a window having current time-step in its center, then this time-step has been preceded gradually through values of the input vector, with that, targeted BGL is also mentioned at the defined future interval [19,20].

Justification for Using AIDA.
ere are various reasons for adopting AIDA for the generation of patient's data: (i) it is hard to collect data of real patients as there are privacy and ethical concerns. (ii) Experimentation on real subjects is a time-consuming and really expensive task. (iii) e simulator has an ability to generate comparatively large datasets. Lastly, (iv) there is much more flexibility in simulation as compare to real subject experimentations. e British Diabetic Association (BDA) conducted an independent assessment based on the feedback from healthcare personnel and internal evaluators. When an accurate rating has been received from healthcare personnel, then the simulator has been listed in the healthcare brochure of BDA [19,20]. (ONARNN). We propose a model which creates optimal feedback delay (Optimal_feedD) and optimal hidden neuron (Optimal_Nhid) to give an optimal solution to the problem. As evident from Figure 2, first, we normalize the data. We  initialize the variable, min_RMSE to 10^-3 and Max_feedD and Max_Nhid to 10. e RMSE indicates root mean square error. e algorithm increments feedback delay and optimal neuron. Training is performed for each iteration, RMSE is calculated, and the optimal feedback delay and optimal neuron are assigned for each subject. e algorithm terminates on two conditions: first, if minimum RMSE is achieved, and second, if maximum iteration is completed. If maximum iterations are completed, then the minimum RMSE iteration is assigned as the optimal solution [5,7].

Prediction Model.
e purpose of training an ANN is to learn that how an input variable is related to the output BGL for making predictions. e ANN architecture which is developed in this research is shown in Figure 3. Nonlinear autoregressive networks can make predictions about time series with the help of feedback input. Input for ANN is CGM data (G (t), G (t−1),..., G (t−d), where d represents the times tapped delays occur in the input for making future predictions. e NARANN has been designed in such a way that it contains only one hidden layer consisting one ANN output and optimal neurons in the hidden layer. In this ANN model, previous inputs and outputs are considered for making future predictions about output value (G * (t + 1), G * (t + 2), . . .). e relationship between input and output has been represented below in equation (1) [15][16][17][18]21]: (1) Equation (1) is the prediction using past values.

Evaluating
Performance. e performance of the proposed model has been measured using RMSE. As depicted in Tables 1 and 2, the mean square error (MSE) for Case 001 is 0.6060, 1.127 ml/dl for 15 and 30 minutes, respectively. Similarly, for Case 002, the RMSEs are 0.7911 and 1.6756 ml/ dl for 15 and 30 minutes, respectively: Equation (2) is the root mean square error.

Results and Analysis
In this research work, two neural network techniques are compared. Firstly, the optimal feedforward neural network [5] acts as a window model for these time series data, and it optimally selects the input and hidden neuron. Tables 1 and 2 show RMSE for optimal autoregressive neural networks for PH (15 and 30 minutes). For Case 001, it is 0.60 and 1.12 ml/dl for 15 and 30 prediction horizons, respectively. Similarly, for Case 002, it is 0.7911  Actual data Predicted data  5 show the graphs of actual and predicted blood glucose concentration for different PHs (30 minutes) of optimal feedforward neural network and optimal nonlinear autoregressive neural network. Similarly, for Case 002 shown in Figures 6 and 7, it is evident from the results and the graphs that the optimal nonlinear autoregressive neural network is showing more accurate results compared to feedforward neural network. As it shows in Table 3 for the optimal feedforward neural network, RMSE is 0.9984 and 3.78 ml/dl which is improved using the optimal autoregressive neural network to 0.60 and 1.12 ml/dl for 15 min and 30 min prediction horizons, respectively, for patient 1.  Similarly, for patient 2 for the optimal feedforward neural network, RMSE is 1.43 and 3.51 ml/dl which is improved using the optimal autoregressive neural network to 0.7911 and 1.6756 ml/dl for 15 min and 30 min predication horizons, respectively. To validate the model, we used two UCI machine learning repository datasets (Abalone and Servo), and results are given in Tables 4 and 5. In Table 3, the comparison is presented to validate the improvement of our proposed system.

Conclusion and Future Work
In this study, we compare two neural network techniques for predicting future blood glucose level using the preceding data. For BGL predictions, improved results have been shown for minimal inputs in the prediction horizon (PH) of 15 and 30 minutes. For optimal feedforward neural network, RMSE is 0.9984 and 3.78 ml/dl which is improved using the optimal autoregressive neural network to 0.60 and 1.12 ml/dl for 15 min and 30 min prediction horizons, respectively, for patient 1. Furthermore, this study targets to make life easier for T1D patients by minimizing human input to the system. We further validate our proposed model using UCI machine learning datasets (Abalone and Servo), and it has shown improved results as well. e proposed optimal autoregressive neural network model performs better than the feedforward window model for time series data. In the future, we intend to investigate a greater collection of AIDA scenarios and multivariate data and using the nonlinear autoregressive neural network with exogenous inputs.
Data Availability e datasets used in this research are taken from http://www. 2aida.org and for validation. Two datasets are taken from the UCI machine learning repository.

Conflicts of Interest
e authors declare that they have no conflicts of interest.