{'fraction_non_alphanumeric': 0.026570739484118873, 'fraction_numerical': 0.007214977721456894, 'mean_word_length': 5.0381340244353945, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A Comparison of Different Models of Glycemia Dynamics for Improved Type 1 Diabetes Mellitus Management with Advanced Intelligent Analysis in an Internet of Things Context

The metabolic disease Type 1 Diabetes Mellitus (DM1) is caused by a reduction in the production of pancreatic insulin, which causes chronic hyperglycemia. Patients with DM1 are required to perform multiple blood glucose measurements on a daily basis to monitor their blood glucose dynamics through the use of capillary glucometers. In more recent times, technological developments have led to the development of cutting-edge biosensors and Continuous Glucose Monitoring (CGM) systems that can monitor patients’ blood glucose levels on a real-time basis. This offers medical providers access to glucose oscillations modeling interventions that can enhance DM1 treatment and management approaches through the use of novel disruptive technologies, such as Cloud Computing (CC), big data, Intelligent Data Analysis (IDA) and the Internet of Things (IoT). This work applies some advanced modeling techniques to a complete data set of glycemia-related biomedical features—obtained through an extensive, passive monitoring campaign undertaken with 25 DM1 patients under real-world conditions—in order to model glucose level dynamics through the proper identification of patterns. Hereby, four methods, which are run through CC due to the high volume of data collected, are applied and compared within an IoT context. The results show that Bayesian Regularized Neural Networks (BRNN) offer the best performance (0.83 R2) with a reduced Root Median Squared Error (RMSE) of 14.03 mg/dL.


Introduction
High blood sugar levels as a consequence of the body lacking the capability to make or to use insulin, or both, is the key feature of Type 1 Diabetes Mellitus (DM1) disease. In a healthy adult, glucose homeostasis signifies a closed-loop system with the ability to control levels of blood glucose. β cells are offered by the pancreas, which is affected by high glucose levels so that insulin is produced, and then works to decrease hyperglycemia by being a robust hormone [1].
Such control is not achievable with DM1, as this is an auto-immune disease that leads to the body extinguishing the vital insulin-producing cells in the pancreas. Viewed in this context, DM1 can be judged as the most aggressive type of diabetes. Individuals with DM1 are unable to produce insulin so they must either employ an insulin pump or inject exogenously so that glucose levels are controlled. Furthermore, those impacted by diabetes will have to monitor their glucose levels throughout the day, using capillary glucometers, allowing them to remain informed on how much insulin they need, which they will need to assess alongside their meals and exercise [2] in order to avoid hyperglycemia. Keeping levels healthy can be achieved via continuous infusion, permeating under the skin, or else with injections taken throughout the day.
To achieve such maintenance, innovative technology can enhance the ability of people diagnosed with diabetes to monitor their condition, with Intelligent Data Analysis (IDA) enabling the modeling of blood glucose levels. This breakthrough comes five decades after the first attempts at creating an artificial pancreas (AP) were made [3]. A computer-assisted system was proposed for this task in order to imitate the actions of a pancreas with the application of a control algorithm, but the pioneering breakthroughs currently predicted are likely to be hailed as something of a sea-change. Researchers consider these still under development APs to consist of a Continuous Glucose-Monitoring (CGM) device focused on monitoring an individual's glucose levels in real-time and injecting the required insulin, led by a mathematical model capable of simulating the ideal glycemia balance [4,5].
Alternatives to AP and CGM devices also look likely to be available, however, other biometrics researchers working on the potential for 24-h patient monitoring, meaning that vital health data can be obtained to inform an applicable glycemia solution. This is achieved by making the most of certain features that can be monitored consistently, including heart rate, temperature, sleep quality, and exercise, accordingly by the main biosensors included in commercial smart bands (a proper bio-monitoring process was proposed in [6]). There are problems with such advantages, however, in that handling such a depth of information demands robust Information and Communication Technologies (ICT), able to reliably obtain and process useful data that can then be applied. The prevalence of the Internet of Things (IoT) provides the technological foundation for this solution. With this, it is possible to collect a huge amount of data via several sensors attached to the diabetic patient, and then gather it to a smartphone using Bluetooth [7]. Unfortunately, smartphones are not powerful enough to build a glucose model and this computational task should be developed in a more capable computer.
Utilizing IoT offers extensive potential for intelligent and robust model systems for enhancing DM1 monitoring. Big data analytics presents the ability to leverage the extensive data hoards achieved by IoT networks to highlight factors that assist in the gaining of key information that can result in a more effective interpretation of glycemia disparities. Whereas Cloud Computing capabilities enable the utilization of time-consuming intelligent data methods in order to present the oscillation of glucose levels.
In this research, selected innovative modeling approaches have been utilized on a complete dataset of glycemia-related biomedical features. These have been gathered via a thorough, passive-monitoring operation carried out in real-world conditions with 25 patients diagnosed with DM1, as a means of modeling key aspects of glucose levels by effectively identifying patterns. Achieving this is applicable to enhancing the management of DM1. To this effect, four approaches have been carried out and analyzed within an IoT context-run through CC because of the extensive data involved. An assessment can be made once the chosen techniques have been trialed using the data obtained in order to train the models.
After this introduction, some relevant works regarding IoT platforms and IDA are indicated in Section 2, and then, in Section 3, the details of the monitoring campaign are presented. With the data collected, a preliminary study of the recorded features is carried out in Section 4, and then Section 5 states the methods that will be compared. With the results, a discussion is performed in Section 6, and some important conclusions close the paper in Section 7.

The Use of IDA in IoT Platforms for DM1 Management
Concerning the issue of handling the significant data quantity obtained via various biosensors and interpreting vital information from them, the literature puts forward a selection of methods to make the most of the IoT paradigm. One encouraging example for the management of diabetes came from Nachman at al. (2010) [8], which proposed making the most of smartphone technology to establish a healthcare platform for Type 2 conditions. This approach requires the gathering of various information, which includes heart rate, food intake, and physical activity. This combination of insightful data then allows for key information to be deduced regarding glycemia's progress, though with limited results.
An alternative approach is identified via the ADMAN platform [9], which is an alarm-based mobile control system for diabetes. The application of machine learning and remote monitoring methods can allow for enhancing diabetes regulation among older people. The main failing is that the majority of patient features are not included. The IoT is considered to offer the ideal criteria for diabetes control in [10], with smartphones put forward for the task of obtaining and managing data, allowing both patients and care professionals to gain valuable insights. The technique proposed in this work [10] looks to model the key dynamics of glucose, achieving accurate readings for the patients requiring insulin intake, although it needs to be made clear that, in the absence of round-the-clock readings, estimations cannot be made with total precision. CC innovations are put forward in [11] for diabetes management. Taking this approach highlights how useful the cloud is for information interchange, extending the capabilities of remote modeling-although complete monitoring remains absent. This notion is also applied in [12], which draws upon cloud capabilities to obtain patient data and then to achieve an insightful analysis. An earlier idea also needs to be considered, however, named "COntinuous Multi-parametric and Multi-layered analysis Of DIabetes TYpe 1 & 2" (COMMODITY12) [13], which was proposed to form a "personal-health system" that could aid diabetes sufferers. This is a strategy that makes the most of wearable and portable devices in order to obtain crucial body readings that then inform algorithms made applicable to expert knowledge. While this idea has some scope for combining heart rate and physical activity, biosensor technology could achieve the same conclusions. So, while expert knowledge can be applied to analyze data, the capabilities of alternative machine learning approaches might greatly exceed this method.
As discussed, while some proposed models offer the potential of applying intelligent analysis in everyday devices like smartphones [14], the implementation of complicated machine learning methods cannot be achieved without CC and, therefore, an appreciation for IoT factors. As a result, more current ideas, such as those offered in [7] suggest establishing a holistic platform that is ICT-driven to make the most of this paradigmatic transformation, which has led to a total monitoring of diabetes sufferers' conditions and IDA being integrated as a vital component. The notion of glycemia modeling, securing data on dosage levels, or enabling care professionals to manipulate DM1 requires the foundation of machine learning techniques. The capabilities of real-time data processing are assessed using the machine learning algorithms in [15] in order to establish a healthcare platform where DM1 management can proceed thanks to the performance of Bluetooth Low Energy (BLE) sensors.

Approaches to a Modeling Core
The vast quantity of new variables that can be measured within an IoT environment need to be turned into knowledge in what we call a modeling core, which is the last component of the system architecture proposed to reliably model glycemia dynamics. As long as this model is accurate, it is possible to adjust the insulin dosages properly. This way, capturing a complete and substantiated status of the patient (using the new devices described above) will result in a more precise representation of the blood glucose changes and, therefore, better management of diabetes.
An Artificial Neural Network (ANN) mimics the function of the brain's nerve system in, for example, distinguishing and recognizing a particular object from a set of objects. Since the interactions between the factors for glucose metabolism are complex, multidimensional, highly non-linear, chaotic, stochastically and time-variant time series, ANN models seem to be a suitable predictor. Different types of ANNs have been found in the scientific literature, and these will form part of the attempts in this paper to create the modeling core, where the prediction of glycemia will be performed.
A Multi-Layer Perceptron (MLP) is an ANN composed of multiple layers of nodes, whereby each internal node implements a logistic activation function that produces an output value by combining the weighted inputs from the nodes in the previous layer. The weights of the connections between the nodes on consecutive layers constitute the model's parameters and are learned efficiently using the widely used Back Propagation (BP) of error technique. This approach has been considered several times in the scientific literature on blood glucose prediction, as can be seen in [16], where the authors used an MLP with BP to prove the technique's ability to forecast glucose levels with a prediction horizon (PH) of up to 45 min. In [17,18], the researchers designed various neural network models with the Neuro Solutions software and BP-with the help of an electronic diary providing patient information-for the prediction of blood glucose in various PHs of up to 180 min. In [19], an MLP with BP was implemented for online glucose prediction from CGM data. The inputs of the neural network were the values provided by the CGM sensor using only the last 20 min and the output was a glucose prediction. The result was a vector of glucose values, not merely one measure, reaching up to 45 min with an RMSE of 27 mg/dL. MLP models are heavily parametrized-through selection of various hidden nodes, the model's complexity can be controlled. The universal approximation property was the development that gave credibility to the concept of a capable neural network [20]. When particularly mild conditions are applied to remote functions, any specific continuous function within a compact set may be approximated in a manner as close to arbitrary having a finite quantity of hidden nodes within the network. Although this result is reassuring, it is essential that overparameterization should be avoided, particularly with forecasting apps that generally have a limited amount of data that has a high quantity of noise.
BP is a learning algorithm widely used in the literature. However, in other areas, Bayesian Regularized Neural Networks (BRNN) have also been used in several instances, although not within a diabetes control context. BRNN [21] are more robust than standard backpropagation nets and can reduce or eliminate the need for lengthy cross-validation. Bayesian regularization is a mathematical process that converts a nonlinear regression into a well-known statistical problem in the manner of a ridge regression. They are difficult to over train since evidence procedures provide an objective Bayesian criterion for stopping training. They are also difficult to over-fit. In [22], this kind of regularization was successfully used to prevent hypoglycemia.
BRNN has a relationship with Bayesian parameter estimation, a classical statistical concept, and they also have a relationship with regularization concepts, e.g., ridge regression [23]. The concept of BRNN is that network parameters/weights should be treated as random variables that obey a theoretical distribution. The design of the distribution is such that less complex models are favored, i.e., models that produce a smooth fit. Having observed the data, evaluation of the posterior weight distribution takes place and this allows for the computation of the network prediction. These predictions will be reflective of both the smoothness aspect previously introduced and the fitness accuracy introduced through data observation.
Other similar techniques, such as Gaussian Processes (GPs) with Radial Basis Function Kernels (RBF) [24], which allow a general uniformity and a non-limited number of basic functions, are rarely used, although some approaches have exploited this technique with promising results [25]. GPs have also been considered in a recent work [26] exploring the possibility of automatic insulin delivery, resulting in a reduction of hypoglycemia events.
GPs represent a nonparametric methodology centered on modeling observable responses from various training data points (function values) as multivariate normal random variables [27]. An assumption is made of a priori distribution for such function values, which will guarantee the function's smoothness properties. To be specific, there will be a high correlation between the two function values when there is closeness (in the sense of Euclidean distance) between the corresponding input vectors and if they decay as they diverge. Posterior distribution of an as yet unpredicted function value may be derived from the employment of an assumed distribution through the application of simple probability manipulation. Support Vector Machines (SVM) are dual learning algorithms that process examples by solely computing their dot-products. These dot-products between feature vectors can be efficiently computed through a kernel function without iterating over all the corresponding features. Given the kernel function, the SVM learner tries to find a hyperplane that separates the positive from the negative examples and at the same time maximizes the separation (margin) between them. SVMs are known to be resilient to over-fitting and to have good generalization performance due to the max-margin criterion used during optimization. Furthermore, while the MLP solution may only be a local optimum, the SVM is guaranteed to converge to a global optimum due to the corresponding convex optimization formulation. A good attempt can be seen in [28], where the authors tried to predict hypoglycemia by considering electrocardiograms (ECG). By using a Fuzzy SVM method based on data collected from electroencephalogram (EEG), they found that almost 75% of low glucose levels were successfully predicted. Another SVM-based approach for hypoglycemia detection was shown in [29], which used a smart band, heart-rate monitoring, and a consideration of the galvanic skin response along with skin and air temperatures. Unfortunately, the results were limited by the size and nature of the dataset. SVM is centered on the employment of high-dimensional feature spaces (created through transformational original variables) and applying a penalty to the resulting complexity employing a penalty term inserted in the error function [30].
It is important to name some other approaches like deep learning. Although some deep learning models have recently demonstrated their capability to forecast glucose levels with an accuracy of RMSE = 9.38 ± 0.71 mg/dL over a 30-min horizon [31], in our approach, we are not dealing with a large enough amount of data to apply this technique, but it is indeed an important approach to bear in mind according to the possibilities that it offers [32].
Other recent techniques would need to be studied in the future in more detail, as no applications for modeling and forecasting glycemia have been developed yet. A dendritic neural network (DNN) [33] is based on the usual morphological neural networks. It is proposed for solving classification tasks and 3D object recognition problems. This type of model is demonstrated to be able to learn temporal features of spike input patterns. In addition, some DNNs only consider a single neuron rather than the network of a couple of neurons with a great data processing capacity. A DNN uses a pruning technique derived from a real biological phenomenon: at the early stages of neuron triggering, the selective removal of unnecessary dendrites and synapses does not cause neuron cell death. By the pruning function of the DNN, the dendritic morphology and structure are simplified.
Regarding the above, we can conclude that the previous methods would be good candidates to construct the modeling core of a system for estimating glycemia dynamics. However, to the best of the authors' knowledge, a proper comparison has yet to be carried out of their performance when using real data and a proper set of features in order to analyze which one would be the best option in terms of accuracy. Therefore, in this work, such a comparison is conducted by considering several features-related to glycemia-collected from an extensive monitoring campaign undertaken by the authors with DM1 patients. Specifically, the following techniques aimed at modeling glycemia dynamics are considered in the analysis: MLP, BRNN, GP-RBF, and SVM. On the other hand, it should be noted that all of these require substantial computational resources when being executed with several collected biosignals; therefore, they are run through CC within an IoT environment.

Monitoring Campaign
At present, it is not possible to think about a way to deal with an artificial pancreas without a CGM gadget. This instrument established an upheaval in diabetes care, since it can accommodate the magnitude, tendency, frequency, and duration of the dynamics of the glucose levels in diabetic patients. Contrary to customary glucose monitoring (fingerstick-capillary blood glucose checking), which gives between three to ten estimations of the glucose level every day, CGM can convey up to one estimation per minute (e.g., 1440 data points per day). Therefore, this sampling frequency is adequate to be the input of a control framework. In this way, in order to perform the global monitoring of a person with diabetes, the principal choice is to consider a CGM device.
In this sense, Abbott launched the Freestyle Libre by the end of 2014. The biosensor is on the patient's arm and the glucose data can then be transmitted, via NFC, through the so-called "flash system." It achieves a mean absolute relative difference (MARD) of 11.4% [34] and the sensors have a long life (14 days) but they cannot be restarted. One of its advantages is that it does not need to be calibrated.
As discussed above, to make an effective comparison for clarifying the most ideal glycemia modeling choice-as far as precision is concerned-utilizing the approaches discussed here, a monitoring campaign needs to be completed. In doing so, patient monitoring techniques were achieved using wearable Abbott Freestyle Libre (a CGM System), in partnership with smartphone technology so that a range of vital data could be obtained and communicated to a central processing server. The CGM sensor is equipped with a local memory with the capacity to collect and store readings for up to eight hours. In this manner, the software functioning on the individual's smartphone or tablet communicates with the CGM device periodically via a secure and short-range wireless connection, as per NFC standards, to obtain the most current readings. Nevertheless, certain devices act as transductors instead, such as NFC-Bluetooth ("miao-miao"; https://miaomiao.cool/?lang=en). This device is connected to the Libre sensor to ensure the smartphone receives a timely transfer of glucose readings. Such information is then passed on to a centralized and secure database where it becomes enhanced for additional processing by cloud prediction models. Further details regarding the ICT model applied to obtain data are offered in [7].
The CGM sensor is able to detect blood glucose readings (milligram/deciliter, mg/dL) each minute [35] thanks to drawing data from a sensitive filament implanted beneath the skin. The CGM sensor's value comes from an estimation of the glucose value within the bloodstream, taking a mean absolute relative difference (MARD) of 11.4% [36], as per the manufacturer's guidance. The sensor is equipped with a sensitivity range of 40 mg/dL to 500 mg/dL-beneath this range, a "low" reading is obtained by the sensor, and a "high" reading for anything above. It is, however, important that the readings can only be obtained after a several-minute delay. As a result, a lag time of somewhere between 5 and 10 min needs to be accounted for between the readings obtained by the CGM sensor and the actual bloodstream glucose levels [37]. The ability of mathematical techniques to account for precision issues as a consequence of this delay is significantly impressive [38], lessening the impact to just six minutes. With the CGM sensor in place, a self-calibration period of several hours only needs to pass [39], before the sensor itself will then expire within two weeks. So, overall, 8400 h of measurements were obtained from each patient during the monitoring process.
By applying the smart band Fitbit Charge HR© the dataset was completed. This is an advanced smart band that gives automatic tracking activity and a continuous heart rate throughout the day. It records heart beeps, distance traversed, number of steps, floors climbed, and sleep time. It stays connected via Bluetooth-low-energy and it is synchronized with a smartphone and a computer in order to monitor trends. The use of the Fitbit's devices has been widely presented in several previous studies related to health conditions [40]. Every contributor was equipped with a smartwatch that unceasingly monitored physical activity (number of steps) during the subsequent two weeks, together with sleep time and heart rate. While these devices are not exactly medical, their precision has been shown to be of sufficient quality for the data to be counted as representative. Plus, the energy consumption demands of the smart bands continue to decrease [41] and additional features are available via the manufacturer's website.
By adopting the approach discussed above, a monitoring project that incorporated 25 DM1 patients was carried out in 2018, supervised by the Endocrinology Departments of the Morales Meseguer and Virgen de la Arrixaca Hospitals, Murcia (Spain), and also conducted in association with the Helsinki Declaration. The research was supported by the Ethics Committee of Universidad de Murcia, Spain. The project adhered to the data storage requirements set out by the more extensive data protection rules that focus on personal details and anonymizing. The clinical features of the research participants are presented in Table 1. All patients had the focus of the study explained to them before written informed consent was requested, together with assent in line with national regulations. Plus, all individuals were kept up to date with any information obtained throughout the research and how it was stored. Local hospitals and diabetes associations were approached in order to recruit all the study's contributors, resulting in a group of 14 males and 11 females-as shown by Table 1-all of whom were receiving professional supervision as part of their healthcare package. The majority of participants were young adults, being students or office staff of the Universidad de Murcia, with an age range of between 18 to 56 years (average 24.51). Plus, the participants were selected based on more than five years of experience with diabetes, so they had personal expertise regarding all aspects of the disease and were also informed on the application of the Abbott Freestyle Libre CGM sensor. Every patient was provided with permanent access to CGM data so they could gain from any benefits of monitoring their glucose levels. In this respect, it can also be acknowledged that a regular downloading of the measurements offered by diabetes devices (CGM, blood glucose monitors, or pumps) tends to lead to more effective glycemic regulation.
Every participant claimed to follow healthy daily life routines, with a sporting activity indulged in three times a week as a minimum. Indeed, all individuals displayed a focus on their overall agendas, sticking to well-established timetables and habits and avoiding any harmful impacts on the routines they pursued. Typically, therefore, the participants were very self-disciplined, showing glycated hemoglobin (HbA1c) values between 6% and 7% as we started the research.
As the passive monitoring portion of the experiment progressed, the participants were encouraged to continue with their everyday habits, sticking to a healthy diet that matched the requirements of their caloric intake. In addition, all individuals were asked to try their best not to break the advice of health professionals as the monitoring period continued. However, all individuals pursued a basal-bolus regimen, incorporating slow insulins such as Levemir, Tresiba, or Lantus, ideal for supporting a flat-action curve, as well as fast insulin such as Humalog Lispro. The slow insulins offer a basal coverage that exceeds 24 h, whereas the fast insulin is to make up for rising glucose levels, caused by eating or hyperglycemia induced by other influencers.
In this paper, some of the methods aimed at modeling glycemia oscillations are compared and discussed.
At present, most of the previous literature on diabetes management systems have only taken into account glycemia and insulin levels, and sometimes an estimation of meals, but it seems reasonable to incorporate additional variables that could also influence glucose levels as far as it is possible to measure or estimate them. It seems that there is a general agreement in using glycemia, insulin, and meals as remarkable variables [42], and the studies with this set of variables are a majority. There have also been some works in the last years taking into account other variables, mainly exercise, both in silico and in vivo [43], and also consider heart rate and temperature. This way, and only in recent years has there been a general agreement in the need to include new variables, whose influence is out of doubt, that now can be measured [6].
Therefore, the following features collected in our experimental stage, which are variously related to the glucose level of the patient, are taken into account: • Glycemia: An array of past measures.

•
Insulin injections: Past values of fast insulin doses. This hormone, with an exogenous origin for a diabetic patient, is the feature that mainly governs how much the level of glucose in the blood will decrease. • Meal ingestion: Past values, in the same sense as for the insulin. It should be noted that the selected patients had proper experience in managing carbohydrate counting. The food that we all eat is conversed and absorbed as glucose, which is discharged into the bloodstream, increasing glycemia almost instantly. • Exercise: Influential historical data, measured in the number of steps taken. Physical activity raises the muscles' request for glucose. It also improves blood circulation, so insulin's effectiveness is increased as long as exercise makes the cellular barriers more permeable, letting glucose go inside the cells easily.

•
Heart rate: Current and previous values. An increment of this feature can be due to diverse causes. Obviously, it increases with physical activity. However, such a rise can also be generated by stressful situations or hypo/hyperglycemia situations. • Sleep: The data values collected indicated just "asleep" or "awake". Hence, it seems reasonable to express sleep as a series of the amount of time spent sleeping in the past. A low quality of sleep at night can lead to both unbalanced glucose dynamics and insulin resistance.

Preliminary Data Study
Occasionally, a key feature becomes completely reliant on one or more related features and, as a result, the details in the data series (of two or more) are considering as equal, because treating them separately might make any accurate assessment too complicated. To this effect, establishing a correlation matrix might assist in ascertaining if any information is present that can be considered insignificant.
Therefore, it is feasible to define the correlation factor between features, judged in pairs, by assuming that a positive relationship exists for any positive values. With this example, both the large and small values of a variable seem to be linked with the contrasting large or small values. So, a correlation factor with a negative value suggests a relationship that is negative or inverse.
When two variables are encountered with a high correlation factor, a summarization that both offer the same details (therefore are insignificant) becomes likely, so they can be dismissed and the data measurements become less weighty and monotonous. To this effect, we used the R software [44]. R is a free software environment for math computing. R is a GNU project and provides a wide variety of statistical (linear and nonlinear modeling, classical statistical tests, time-series analysis, classification, clustering, etc.) and graphical techniques while being highly extensible.
The corrplot routine [45], present in R software, is convenient for producing the correlation matrix that can illuminate the issue. As Figure 1 shows, relations can be expressed in pairs using this method, by utilizing the correlations between features. Using the data highlighted in Figure 1, establishing some deductions becomes possible. There is a strong connection between fast insulin and a meal because, more often than not, the two events happen at the same time. In any case, it could occur that in hyperglycemia there are exclusively insulin doses without food ingestion (in order to lower glucose levels) and, in hypoglycemia, the patient needs to ingest a light meal (for the most part, sugar) while insulin is never infused. With this, both fast insulin and a meal must be considered. However, be that as it may, with patients for the most part under good control, hypoglycemia and hyperglycemia ought to be something infrequent and less pronounced.
Moreover, the relationship between glycemia and both insulin and meals are close to zero. This makes sense because a proper insulin dose completely compensates for hyperglycemia caused by ingestion. There is a predicted negative correlation found between blood sugar levels and exercise, as well as for heart rate. Moving on with the assessment, both exercise steps and heart rate are revealed as highly correlated, as expected. This association, however, is not all-encompassing as with some scenarios both tachycardia and bradycardia become possible under stress or sharp glycemic oscillations [46]. Plus, a clear inverse correlation is apparent when assessing heart rate and sleep, caused by the bradycardia during sleep. Similarly, such an inverse relation is identified between exercise and sleep, as can easily be predicted. Therefore, because the inverse correlation between heart rate and sleep is more robust than that between exercise and sleep, exercise should be viewed as an aspect that affects heart rate measurements. Due to this, exercise has been left out of the subsequent research.
Notwithstanding, if an increase in heart rate is not correlated with physical activity, it could likewise be generated by stressful circumstances [47]. In addition, an increase in heart rate can be indicative of both hypoglycemia [48] and hyperglycemia [49] scenarios.

Methods
Previous studies presented by some of the authors of this work showed that a proper time window to model glucose dynamics involves the last six hours [50]. Therefore, the data on the chosen features taken within that past timeframe are used as inputs. After the above-mentioned preliminary considerations, and with the aim of building the proposed models, some parameters of the previously explained techniques need to be tuned. Thus, on the basis of the literature reviewed in Section 2.2. and after carrying out some preliminary estimations regarding the possible range of the tuning parameters, the following values for adjustment are considered, with the goal of finding the best fitting for each model.
Gaussian In order to generate the appropriate models, the following steps are followed: • Transformation: The above-mentioned parameters should be properly transformed to become appropriate inputs of the considered models so that they become representative features in techniques such as NN. Some features could be the regularity with which each parameter is updated, its historical values, etc. Selecting variables, deleting outliers, transforming numerical variables, and dividing the set of data into train and test sets. • Normalization: After the normalization process, all the values are in a [0,1] interval. With this, we also transform the features in order to have a mean of zero and unit standard deviation.

•
Evaluating metric: The RMSE gives us an idea about a mean of the error achieved, and the R-squared explains the standard deviation of the fitting. The RMSE has been widely used in previous literature [16][17][18][19][20][21][22][23][24][25] and it is, therefore, the preferred parameter for comparison purposes, being that it offers a single value that estimates the accuracy of the models under discussion. • PCA-Principal Components Analysis: With PCA, a new set of orthogonal coordinate axes is introduced, along which the sample data variance is maximized. This means that the other directions in which the variance is less than an assumed value are not important; these can, therefore, be removed from the training data set. By using PCA, it is (sometimes) possible to obtain lower values of RMSE, which, as previously mentioned, will be the evaluation metric. PCA is a very efficient way to approximate the data in a lower dimensionality and reveal some hidden and simplified structures/patterns that often underlie the data.

•
Validation method: 10-fold cross-validation and five repetitions over the training data set.
In order to generate the different models and compare the previously described approaches, a software specifically prepared for such a purpose is used, namely the CARET package (Classification And REgression Training) [51] for data modeling of the R software. This package is a set of functions that attempt to streamline the process of creating predictive models. All the computation is done on a server with the following characteristics: Microprocessor AMD Ryzen Threadripper 1920X (12 cores, 24 threads), 128 Gb RAM 2666MHz, 2xGPU GeForce RTX 2070 with 8 Gb RAM DDR6 per unit, and an SSD Samsung 860 4Tb.
In the next section, these attempts will be properly explained, and the chosen parameters will be indicated.

Results and Discussion
The four techniques described in the previous sections were used to train the glucose modeling to determine the optimal configuration of their hyperparameters. Using the above-mentioned R-package called CARET, the implementation of the four techniques enabled us to adjust their tuning values. Hereby, each technique model was trained by using the above-mentioned parameter values so that the one that achieved the best results-according to the chosen evaluation metric (that is, the RMSE)-was selected. The RMSE formulation appears in Equation (1). This metric shows the error expressing the quantity of glucose concentration (mg/dL) that deviated when predicting (withŷ i as predicted values and y i as real values, considering n elements).
The customary method of performing parameter-streamlining has been a grid search, which is just a comprehensive way of looking through a manually-determined subset of the parameter space of a learning technique. A grid search calculation must be guided by some presentation metric, ordinarily estimated by cross-validation on the training set.
With the aim of better examining the uncertainty of each model, their coefficient of variation (CV-RMSE) is also calculated. This coefficient is the named RMSE and is divided by the mean of the glycemia y (which is the output variable) related to the test set (see Equation (2)), resulting in a percentage of error and not just a number in general terms.
By considering the 5-times 10-fold cross-validation, the RMSE for the four techniques was obtained, and the results are depicted in Figure 2. As can be observed, for every situation, we find significant differences between each pair of algorithms. It is possible to appreciate the differences between the results for each technique, but in order to perform statistical analysis, a pairwise Wilcoxon post-hoc analysis for a Friedman test was performed (α = 0.99) to check if there were any differences in their outcomes. The test revealed that there is a significant difference between the groups (p-value always below 1 × 10 −5 ).
Specifically, a comparison of the accuracy obtained for the different techniques is present in Figure 3, and the best tuning option is indicated in Table 2.
As can be seen, BRNN yields the best result when compared to the other tested techniques, based on the named RMSE metric, for a configuration of two neurons (RMSE = 14.03 mg/dL and R-squared = 0.83). This technique goes beyond the limits of the neural networks in that it is more robust than usual BP nets. In addition, the number of neurons is usually considerably smaller than a BP neural net's weights [21].
Nevertheless, SVM could also be a good option as its outcome is only slightly worse than that obtained for BRNN (RMSE = 15.31 mg/dL and R-squared = 0.79). In any case, we can state that the results show that BRNN would be the best technique due to its accuracy and good performance.   On the other hand, the worst performance is that achieved with the GP technique, with an R-squared under 0.65 and an RMSE of the glycemia prediction of 21.64 mg/dL, which would be barely permissible; this reaffirms the idea that GP loses efficiency when the number of features increases [27]. In this sense, it is necessary to bear in mind that, for example, such an error would lead, in medical terms, to an estimated glucose level of 90 mg/dL (euglycemia) when the real value is around 70 mg/dL (hypoglycemia). However, as previously stated, with an R-squared of 0.83 and an RMSE of 14.03 mg/dL, BRNN exhibits an acceptable level of representativeness; therefore, we can conclude that this technique, with this configuration, would be the better option to build the modeling core of a system to reliably model glycemia dynamics.
Regarding computational complexity, BRNN is more time consuming on a single-user desktop computer when compared to GP and SVM, but these differences are not remarkable when using the cloud. On the other hand, there is not too much contrast in performance between the GP model and the MLP technique. In any case, all the computational efforts seem to be equated when being executed in a powerful cloud server. Comparing SVMs with ANNs, ANNs are considerably faster. The simple reason for this is that to train an SVM requires the solution of associated Lagrangian dual problems 30. This represents a quadratic optimization problem, which has an extremely large number of variables, equal to the number of training instances.
From the derived results, we can see that there are significant differences between various machine learning models, and they may be ranked unambiguously. The ranking may appear to be wide-ranging as it is not constrained by time series that have a number of features that could promote certain models. Nevertheless, it should be noted that the ranking is applicable to DM1-time time series. Certain other time series, e.g., in chemistry, physics, or other areas, will display significantly different features related to series size, noise levels, etc. Making comparisons of the tested models in these time series could be interesting, as would investigating whether the derived conclusions are applicable for a variety of time windows in the past. It should also be noted that the derived ranking represents a general ranking; with all forecasting problems, a number of models must be tested. Various types of time series have a variety of stylized facts, resulting in variations in performance ranking. Nevertheless, this general ranking remains an extremely useful tool for a modeler selecting models for testing.
The worst results are provided by the GP, but in no case are these excessively poor. This result is extremely interesting as machine learning communities have comparatively only become interested in GPs recently [27]. GP has been available for a considerable time but extensive study or application of it did not occur until very recently. We contend that there remains scope for making improvements to GPs in ways that could be a positive enhancement to its performance. The MLP model offered extremely good results partially (although not completely) due to the fact that it is able to reduce linear models [20]. Interestingly, GP is centered on the construction of locally centered weighted averages for target outputs in the training set, and while it is centered on solid probabilistic models [24], it came out lowest of the four methods tested. Although SVM ranks highly in the classification, for regression its results are not as good, but still acceptable. BRNN performs, on the whole, a little better than SVM.
It has been demonstrated that MLP is capable of providing an approximation of accuracy as long as it has enough hidden neurons [20]. Nevertheless, this capacity has a drawback in that these close approximations can become approximations to the noise. This means that the model's solutions are not easily generalizable with new data, a problem known as overfitting. The NN's complexity has to be matched with the problem under examination. In this area, Bayesian techniques can offer probabilistic interpretations of NN learning. There are significant advantages to BRNN modeling as compared to classical MLP learning processes. One of these advantages is that due to the method computing with greater accuracy than MLP, forecast unreliability is accounted for. BRNN has the capacity of dealing relatively efficiently with the complexity of the model and thus the overfitting problems [23].
With regards to SVM and MLP, it should be noted that in MLP, adjustments are made to the network weights in order to minimize the sum-of-square errors between the actual value (target) and network output. To train an SVM the decision boundaries must be explicitly determined directly from training data [30]. This is a necessary stage when dealing with the optimization problems inherent in the construction of SVM models, i.e., how to minimize the aggregate distance between the support vectors and the maximum-margin hyperplane. In practical terms, configuring the algorithm for training an SVM is more difficult.
So, we can conclude that in our case under study, BRNN performs better than the other methods. In any case, added to the RMSE parameter, it is important to take into account issues like overfitting, the complexity of the model, computational effort, and robustness, among others. We contend that comparison studies are useful for guiding practitioners to a choice of the best model for their purposes, and that they are also useful in guiding researchers so that research can be focused on the most practical and promising solutions.

Conclusions and Future Work
Due to innovative breakthroughs in technology, our global outlook continues to transform in many extraordinary ways. Consequently, life has become easier in many respects, thanks to many enhancements that can be considered ground-breaking. With the task of reaching an extensive and definitive means of regulating diabetes, certain breakthroughs have been achieved because of the new capabilities offered by CGM devices and insulin pumps, as two key examples. Even so, it might be that the real potential of new technologies has yet to be realized and that science will yet produce new methods. This research has offered an assessment of glycemia modeling structures to define the role that ICT can play.
A portion of these recommended platforms has been analyzed, highlighting the lack of overall patient monitoring for an applicable building and contrast of glucose oscillations methods. In this respect, both IoT and IDA have been explored by this research, confirming that these tactics offer the most effective solution for enhancing diabetes management by accurate glycemia estimation, which means that they need to be seen as the ideal approach for handling the extensive data stores required which, in turn, reveals how vital CC is and its likely ongoing impact.
A monitoring period of 14 days was carried out, including 25 DM1 participants and resulted in the gathering of a number of glycemia-related aspects. In this manner, it needs to be recognized that the obtained dataset incorporates not only CGM measurements from a wide range of individuals over a long timescale and in real-world scenarios, but also includes aspects such as insulin and mealtimes, and other related factors, such as heart rate, sleeping time, and exercise.
Using such data, and in order to explore the possibilities of glycemia modeling for improved diabetes management, the performance of four intelligent techniques have been tested and properly compared: MLP, SVM, GP, and BRNN. In view of the results obtained, it can be concluded that BRNN is the most powerful and suitable technique to model glucose bloodstream levels, showing the best values of both R-squared (0.83) and RMSE (14.03 mg/dL). Future lines of research will continue to collect data from more patients (also under real-world conditions), and also the authors will explore the capabilities of replicating the present work using deep learning, as a complex approach, and DNM as a very simple methodology, in order to perform a comparison between two different perspectives.