**Blood Glucose Prediction for "Artificial Pancreas" System**

Nikolay A. Bazaev and Kirill V. Pozhar

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/67142

#### Abstract

The aim of modern science in diabetes therapy is to develop a closed-loop system to control blood glucose (BG) ("artificial pancreas"). Such a system includes glucose monitor, insulin pump and algorithms of their interaction and blood glucose (BG) dynamics analysis. Current work is devoted to mathematic modeling of BG dynamics, development of BG prediction algorithm and its approbation on clinical data Diabetes Research in Children Network (DirecNet). Prediction algorithm is based on sigma model of BG regulation and is supposed to be used for "artificial pancreas" system. The algorithm was tested under condition of possible errors in glucometer and/or insulin pump operation. Root-mean-square error of BG prediction is 15.7 mg/dl. Algorithm corrects 97.5% errors.

Keywords: artificial pancreas, mathematical model, blood glucose dynamics, prediction, noninvasive, glucose meter, glucometer, diabetes mellitus

#### 1. Introduction

Diabetes mellitus is one of the most widespread and serious diseases. Diabetes mellitus type 1 means that the pancreas loses its ability to produce insulin. The aim of modern science in diabetes therapy is to develop a closed-loop system («Artificial Pancreas»), which can compensate such an insufficiency. «Artificial Pancreas» is a system combining a glucose sensor, a control algorithm and an insulin infusion device [1]. In the case of diabetes mellitus (type 2), pump insulin therapy is not relevant due to metabolism disorder, whereas in the case of insulin-dependent one (type 1), it is the most effective method of diabetes compensation.

Modern systems for blood glucose (BG) monitoring concentration and insulin pumps for subcutaneous insulin injection have certain potential for raising the level of diabetes mellitus therapy. However, any errors in such a system can cause dangerous consequences for the patient's health: hypo- or hyperglycemia.

© 2017 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Some errors occur due to biomechanics of the sensor-tissue area (e.g., mechanical pressure in the sensor implantation zone) [2]. In clinical practice, there are two types of errors associated with glucose monitoring: abrupt fluctuations of BG and short-term decrease in the BG sensor sensitivity. Incorrect functioning of BG sensor can be associated with failure in insulin injection rate caused by tubing occlusion.

Moreover insulin and glucose have delays in absorption and action (about 30–100 min for insulin and 5–15 min for glucose) [1]. Thus, insulin should be injected in the way to prevent hyperglycemia.

### 2. Modeling of blood glucose dynamics

#### 2.1. Mathematic models of blood glucose and insulin dynamics

In the human body, glucose is the main and the most multifunctional energy source for metabolic processes. Due to utmost importance of stable blood glucose level, there is a complicated regulation system. The scheme of blood glucose and insulin regulation is represented in Figure 1.

Figure 1. Scheme of glucose and insulin regulation in the human body.

Most BG dynamics models tend to describe physiological processes of glucose and insulin regulation. The simplest model describing BG dynamics is the Bergman's minimal model [3]. It is a system of three ordinary differential equations (ODE) (Eq. (1)):

$$\begin{cases} \frac{d\mathbf{g}(t)}{dt} = -\left(b\_1 + \mathbf{x}(t)\right)\mathbf{g}(t) + b\_1\mathbf{g}\_b\\\\ \frac{d\mathbf{x}(t)}{dt} = -b\_2\mathbf{x}(t) + b\_3\left(\dot{\mathbf{i}}(t) - \dot{\mathbf{i}}\_b\right) \\\\ \frac{d\dot{\mathbf{i}}(t)}{dt} = b\_4\left(\mathbf{g}(t) - b\_5\right)^+ t - b\_6\left(\dot{\mathbf{i}}(t) - \dot{\mathbf{i}}\_b\right) \end{cases} \tag{1}$$

where g(t) is blood glucose level; i(t) is blood insulin level; x(t) is proportional to insulin in the remote compartment; g(b) is normal BG; i(b) is basal insulin level; b1, b2, b3, b<sup>4</sup> and b<sup>6</sup> are rate constants; and b<sup>5</sup> is glucose threshold level (b5).

Some errors occur due to biomechanics of the sensor-tissue area (e.g., mechanical pressure in the sensor implantation zone) [2]. In clinical practice, there are two types of errors associated with glucose monitoring: abrupt fluctuations of BG and short-term decrease in the BG sensor sensitivity. Incorrect functioning of BG sensor can be associated with failure in insulin injection

Moreover insulin and glucose have delays in absorption and action (about 30–100 min for insulin and 5–15 min for glucose) [1]. Thus, insulin should be injected in the way to prevent

In the human body, glucose is the main and the most multifunctional energy source for metabolic processes. Due to utmost importance of stable blood glucose level, there is a complicated regulation system. The scheme of blood glucose and insulin regulation is represented in

Most BG dynamics models tend to describe physiological processes of glucose and insulin regulation. The simplest model describing BG dynamics is the Bergman's minimal model [3]. It

is a system of three ordinary differential equations (ODE) (Eq. (1)):

Figure 1. Scheme of glucose and insulin regulation in the human body.

rate caused by tubing occlusion.

2. Modeling of blood glucose dynamics

2.1. Mathematic models of blood glucose and insulin dynamics

hyperglycemia.

56 Gluconeogenesis

Figure 1.

The advantage of the model (Eq. (1)) is in proper description of BG and insulin dynamics. However, under some circumstances, it behaves incorrectly. The model describes BG peak with returning to the initial BG level gb.

Many models are based on Bergman's minimal model but take into consideration some more parameters [4, 5].

Sturis' model [6] includes two negative feedbacks, describing glucose absorption due to insulin action and insulin secretion as a reaction to BG rising. The model is described by the following ODE system (Eq. (2)):

$$\begin{cases} \frac{d\dot{g}\_{i}(t)}{dt} = g\_{in} - f\_{2}(g(t)) - f\_{3}(g(t))f\_{4}(i\_{l}(t)) + f\_{5}(\mathbf{x}\_{3}(t)) \\\\ \frac{d\dot{p}\_{p}(t)}{dt} = f\_{1}(g(t)) - e\left(\frac{\dot{p}\_{p}(t)}{v\_{p}} - \frac{i\_{l}(t)}{v\_{l}}\right) - \frac{i\_{p}(t)}{t\_{p}} \\\\ \frac{di\_{l}(t)}{dt} = e\left(\frac{\dot{p}\_{p}(t)}{v\_{p}} - \frac{i\_{l}(t)}{v\_{l}}\right) - \frac{i\_{p}(t)}{t\_{l}} \\\\ \frac{dx\_{1}(t)}{dt} = \frac{3}{v\_{d}}\left(i\_{p}(t) - \mathbf{x}\_{1}(t)\right) \\\\ \frac{dx\_{2}(t)}{dt} = \frac{3}{v\_{d}}\left(\mathbf{x}\_{1}(t) - \mathbf{x}\_{2}(t)\right) \\\\ \frac{d\mathbf{x}\_{3}(t)}{dt} = \frac{3}{v\_{d}}\left(\mathbf{x}\_{2}(t) - \mathbf{x}\_{3}(t)\right), \end{cases} (2)$$

where gin is exogenous glucose infusion rate; ip(t) is plasma insulin; ii(t) is interstitial insulin; f1(z) is insulin secretion (function of glucose); f2(z) is insulin-independent glucose utilization (function of glucose); f3(z) is insulin-dependent glucose utilization (function of glucose); f4(z) is insulin-dependent glucose utilization (function of insulin); f5(z) is glucose production (function of insulin); x1, x<sup>2</sup> and x<sup>3</sup> are variables representing delay process between plasma insulin and glucose production; t<sup>1</sup> and t<sup>2</sup> are time constants of plasma and interstitial insulin degradation, respectively; t<sup>3</sup> is delay time between plasma insulin and glucose production; vp and vi are volumes of plasma and interstitial insulin, respectively; vd is volume of glucose space; and e is rate constant for exchange of insulin between the two compartments.

Engelborghs' model [7] is based on Sturis' model (Eq. (1)) and takes into account time delay of insulin secretion and of BG ascent. Insulin injections can be described in the following way (Eq. (3)) (with an assumption that it equals patient's pancreas insulin):

$$\begin{cases} \frac{dg(t)}{dt} = g\_{in} - f\_2\left(g(t)\right) - f\_3\left(g(t)\right)f\_4\left(i(t)\right) + f\_5\left(i(t-\tau\_2)\right) \\\frac{di(t)}{dt} = af\_1\left(g(t)\right) - \frac{i(t)}{t\_1} + (1-a)f\_1\left(g(t-\tau\_1)\right), \end{cases} \tag{3}$$

where αf <sup>1</sup> � gðtÞ � is the fraction of insulin delivered by the pancreas of a normal subject into the circulation to maintain blood sugar at its physiological level, τ<sup>1</sup> is pancreatic insulin production time delay and τ<sup>2</sup> is hepatic glucose production delay. In contrast with Sturis' model, Engelborghs' model is sustainable.

Bennett-Gourley's model (D.L. Bennett, S.A. Gourley) [8] for glucose and insulin dynamics uses the following differential equations (Eq. (4)):

$$\begin{cases} \frac{d\dot{v}\_p}{dt} = f\_1\left(\mathbf{g}(t)\right) - e\left(\frac{\dot{v}\_p(t)}{\upsilon\_p} - \frac{\dot{i}\_i(t)}{\upsilon\_i}\right) - \frac{\dot{i}\_p(t)}{t\_p} \\\\ \frac{d\dot{i}\_i(t)}{dt} = e\left(\frac{\dot{i}\_p(t)}{\upsilon\_p} - \frac{\dot{i}\_i(t)}{\upsilon\_i}\right) - \frac{\dot{i}\_i(t)}{t\_i} \\\\ \frac{d\mathbf{g}(t)}{dt} = \mathbf{g}\_{in} - f\_2\left(\mathbf{g}(t)\right) - q\mathbf{g}(t)f\_4\left(\dot{i}\_i(t)\right) + f\_5\left(\dot{i}\_p(t-\tau)\right), \end{cases} \tag{4}$$

where q > 0 is constant. The Bennett-Gourley's model has no sustained oscillations.

Despite significant international experience in modeling of blood glucose and insulin dynamics, there are a number of individual peculiarities of patient that effect BG like his/her physical activity, stresses, etc. Possible ways of taking into account such a variety of factors are in using of indistinct logic and neural networks. As input data for neural networks, information could be used that can have any influence on BG dynamics. The output data are blood glucose concentration or amount of insulin to infuse to normalize BG.

However, processing of neural network algorithms is even more consuming than systems of ordinary differential equations of high orders.

#### 2.2. Sigma model

Direct application of mathematic model for BG dynamics is in its predicting capabilities. On its basis, one can make an algorithm for BG prediction that can be used as a part of "artificial pancreas" system. Mathematic models on the basis of high-order differential equations are rather complicated to be used in a processing unit of a portable glucometer, especially when they are complexificated with additional data about numerous factors effecting blood glucose concentration. That is why simple empirical mathematic models [9] for such calculations are more preferable.

Let us consider independently BG ascent and descent processes. The main factor effecting BG increase is food intake. Food can be characterized by amount of carbohydrates and glycemic index. Thus, food intake can be described by three parameters: mf is food mass, υ is relative carbohydrate coefficient and GI is glycemic index. It should be noted that mentioned parameters have to be estimated for each product independently. Carbohydrate mass influences the amplitude of BG increase, whereas glycemic index defines the rate of glucose appearance in the blood stream.

For BG analysis precise track form during BG ascent is not important, only amplitude and assimilation time. The function of accumulating glucose in the blood can be expressed in the following way (Eq. (5)):

$$G(t) = G\_0 + \sum\_{i} \frac{m\_{f\_i} \nu\_i}{k m\_T} \cdot \left(\frac{1}{1 + \exp\left(-\alpha \left(t - t\_i - \tau\_{\rm glec} - \frac{\tau\_t}{\rm GI\_i}\right) / \frac{\tau\_t}{\rm GI\_i}\right)}\right),\tag{5}$$

where GðtÞ is BG value К, G<sup>0</sup> is initial BG value, GIi ¼ GIi=100 is normalized glycemic index, α is normalization coefficient, τ<sup>1</sup> is time of penetration of all glucose into the blood, ti is time of food intake and τgluc is time delay between food intake and glucose penetration into the blood.

Function of insulin effect on BG can be described as follows (Eq. (6)):

Engelborghs' model [7] is based on Sturis' model (Eq. (1)) and takes into account time delay of insulin secretion and of BG ascent. Insulin injections can be described in the following way

þ ð1 � αÞf <sup>1</sup>

circulation to maintain blood sugar at its physiological level, τ<sup>1</sup> is pancreatic insulin production time delay and τ<sup>2</sup> is hepatic glucose production delay. In contrast with Sturis' model,

Bennett-Gourley's model (D.L. Bennett, S.A. Gourley) [8] for glucose and insulin dynamics

� iiðt<sup>Þ</sup> vi

� iiðt<sup>Þ</sup> ti

� qgðtÞf <sup>4</sup>

Despite significant international experience in modeling of blood glucose and insulin dynamics, there are a number of individual peculiarities of patient that effect BG like his/her physical activity, stresses, etc. Possible ways of taking into account such a variety of factors are in using of indistinct logic and neural networks. As input data for neural networks, information could be used that can have any influence on BG dynamics. The output data are blood glucose

However, processing of neural network algorithms is even more consuming than systems of

Direct application of mathematic model for BG dynamics is in its predicting capabilities. On its basis, one can make an algorithm for BG prediction that can be used as a part of "artificial pancreas" system. Mathematic models on the basis of high-order differential equations are rather complicated to be used in a processing unit of a portable glucometer, especially when they are complexificated with additional data about numerous factors effecting blood glucose concentration. That is why simple empirical mathematic models [9] for such calculations are

� iiðtÞ � þ f <sup>5</sup> �

� �

ipðtÞ vp

� iiðt<sup>Þ</sup> vi

where q > 0 is constant. The Bennett-Gourley's model has no sustained oscillations.

� �

� gðtÞ � �

is the fraction of insulin delivered by the pancreas of a normal subject into the

� ipðt<sup>Þ</sup> tp

gðt � τ1Þ

� ,

iðt � τ2Þ

ipðt � τÞ

� , �

(3)

(4)

(Eq. (3)) (with an assumption that it equals patient's pancreas insulin):

� gðtÞ � � f <sup>3</sup> � gðtÞ � f 4 � iðtÞ � þ f <sup>5</sup> �

dgðtÞ

8 >>><

>>>:

Engelborghs' model is sustainable.

where αf <sup>1</sup>

58 Gluconeogenesis

� gðtÞ � diðtÞ dt <sup>¼</sup> <sup>α</sup><sup>f</sup> <sup>1</sup>

uses the following differential equations (Eq. (4)):

� gðtÞ � � e

dt <sup>¼</sup> gin � <sup>f</sup> <sup>2</sup>

concentration or amount of insulin to infuse to normalize BG.

ipðtÞ vp

dip dt <sup>¼</sup> <sup>f</sup> <sup>1</sup>

8

>>>>>>>><

>>>>>>>>:

diiðtÞ dt <sup>¼</sup> <sup>e</sup>

dgðtÞ

ordinary differential equations of high orders.

2.2. Sigma model

more preferable.

dt <sup>¼</sup> gin � <sup>f</sup> <sup>2</sup>

� gðtÞ � � <sup>i</sup>ðt<sup>Þ</sup> t1

$$\mathcal{G}(t) = \mathcal{G}\_0 - \sum\_{j} \frac{\mu \cdot n\_j}{km\_T} \cdot \left(\frac{1}{1 + \exp\left(-\beta(t - t\_j - \tau\_{\rm{ins}} - \tau\_2)/\tau\_2\right)}\right),\tag{6}$$

where β is normalization coefficient, τ<sup>2</sup> is time of insulin action spike, tj is time of insulin injection, τins is delay between insulin injection and its action, nj is the dose of injected insulin and μ is coefficient that refers to the glucose descent due to one unit of injected insulin.

The model is based on logistic function or sigma function. That is why it is call sigma model.

General equation of BG dynamics that takes into consideration food intake and insulin injection can be described as superposition of functions (Eqs. (5) and (6)):

$$\begin{split} \mathbf{G}(t) &= \mathbf{G}\_0 + \sum\_{i} \frac{m\_{f\_i \cdot n\_i}}{km\_T} \cdot \left( \frac{1}{1 + \exp\left( -a \left( t - t\_i - \tau\_{\rm glec} - \frac{\tau\_1}{\rm Gl\_i} \right) / \frac{\tau\_1}{\rm Gl\_i} \right)} \right) - \,, \\ &- \sum\_{j} \frac{\mu \cdot n\_j}{km\_T} \cdot \left( \frac{1}{1 + \exp\left( -\beta (t - t\_j - \tau\_{\rm ims} - \tau\_2) / \tau\_2 \right)} \right) \end{split} \tag{7}$$

Eq. (7) is the simplest variant of BG dynamics model. However, there are other independent factors affecting BG dynamics:


In current approach, we do not take into account glucose accumulation and glycogenolysis in the human body. These processes do not change BG rapidly and can be evaluated from blood glucose measurements.

As shown in Figure 2, the model (Eq. (7)) describes ascent and descent of BG track quite accurately. It should be noted that model provides better results in the diabetes mellitus type 1 case, because it is characterized by very little or even no insulin secretion. Sigma model appears to be applicable for BG prediction.

Figure 2. Modeling of blood glucose dynamics with sigma model.

#### 2.3. BG profile database

For experimental evaluation of developed mathematic model and the prediction algorithm, we need BG tracks with information about factors that affect BG dynamics. Protocols of Diabetes Research in Children Network (DirecNet) are used for that purpose. DirecNet investigates the potential use of glucose monitoring technologies and its impact on the compensation of type 1 diabetes in children [10]. Investigations with completed protocols were directed to estimate accuracy of constant glucose monitor system (CGMS) [11–14], especially of FreeStyle Navigator sensor [15–17] and evaluate physical activities on BG [18, 19] and basal insulin injection [20] influence on hypoglycemia in children with type 1 diabetes.

Experimental results are represented as a number of tables, reports about patient anamnesis and received data. Data protocols include detailed description of experiments. Tables contain the following information: BG measurements, insulin injections, initial patient data, calibrating BG tracks, anamnesis, meal, physical activity, dawn phenomenon, blood counts (CBC, hormones, biochemical, clinical BG), medicines, stress, etc. Database includes more than 4000 records about food intake, insulin injections and physical activity and more than 2000 glucose daily tracks. This available data can be used for approbation of mathematic models and prediction algorithm.

–Glucose elimination by kidneys

–Glycogenolysis driven by glucagon

appears to be applicable for BG prediction.

–Gluconeogenesis

60 Gluconeogenesis

glucose measurements.

2.3. BG profile database

–Glucose accumulation in the liver in the form of glycogen

In current approach, we do not take into account glucose accumulation and glycogenolysis in the human body. These processes do not change BG rapidly and can be evaluated from blood

As shown in Figure 2, the model (Eq. (7)) describes ascent and descent of BG track quite accurately. It should be noted that model provides better results in the diabetes mellitus type 1 case, because it is characterized by very little or even no insulin secretion. Sigma model

For experimental evaluation of developed mathematic model and the prediction algorithm, we need BG tracks with information about factors that affect BG dynamics. Protocols of Diabetes Research in Children Network (DirecNet) are used for that purpose. DirecNet investigates the potential use of glucose monitoring technologies and its impact on the compensation of type 1 diabetes in children [10]. Investigations with completed protocols were directed to estimate accuracy of constant glucose monitor system (CGMS) [11–14], especially of FreeStyle Navigator sensor [15–17] and evaluate physical activities on BG [18, 19] and basal insulin injection [20]

influence on hypoglycemia in children with type 1 diabetes.

Figure 2. Modeling of blood glucose dynamics with sigma model.

–Natural residual insulin secretion by pancreas β-cells

DirecNet data was structured, analyzed and filtered; daily BG tracks, provided by different glucose meters and clinical blood analysis, were synchronized (Figure 3).

Figure 3. Combined blood glucose track, provided by glucometers OneTouch Ultra, FreeStyleFlash and Medtronic CGMS.

In Figure 4, there is a BG track with information about food intake and insulin injection. BG growth and reduction accurately correlate with food and insulin intake time and amount.

Clinical analyses were taken as the most precise. Measurement results provided by noninvasive glucometers FreeStyle Flash and One Touch Ultra (measurements were performed once in a 30–60 minutes) match with each other and in the case of no clinical data, their arithmetic mean value was taken as a true one. Supporting track was formed according to these data. Medtronic CGMS and FreeStyle Navigator data (measurements were performed once in a 1–5 minutes) are less accurate and have noticeable value drift; however, due to higher digitalization, they make it possible to reconstruct precise BG track form. Tracks provided by glucose monitors were corrected in accordance with a supporting track. As a result, a set of BG tracks with higher digitalization (1–5 min step) and accuracy was obtained (Figure 5).

Obtained data were used for approbation mathematic models and prediction algorithm.

Figure 4. BG track with food intake and insulin injection data.

Figure 5. Averaged blood glucose concentration track.

#### 2.4. Mathematic model approbation

DirecNet databases give enough information for sigma model approbation. However, it is necessary to define a wide range of parameters for other models of BG dynamics.

In particular, Sturis', Engelborghs' and Bennett-Gourley's models require such parameters as quantities of plasma insulin, interstitial insulin and glucose, pancreatic insulin production, insulin-independent glucose utilization, insulin-dependent glucose utilization, the influence of insulin on hepatic glucose production, distribution volumes for insulin in plasma and interstitial fluid.

These parameters were obtained from BG tracks using a neural network. Bennett-Gourley's model has broader set of parameters in comparison with Sturis' and Engelborghs' models. The purpose of the neural network was to reconstruct Bennett-Gourley's model parameters by an input track. Neural network was trained in the following way. Randomly generated set of parameters for Bennett-Gourley's model (from physiological range of values) was used to reconstruct BG track. This track was included in training sample as a stimuli vector and model parameters as a response vector. After training the neural network, it was used to define necessary parameters for models by analyzing track from DirecNet. Neural network processing was implemented by Matlab Neural Net Toolbox using FeedForwardNet, Elman Recurrent Neural Network and embedded neural network. The best efficiency was demonstrated by training algorithm "trainbr" with 14 neurons in the hidden layer and activation functions "logsig" and "purelin" combination. Average error of model parameter determination was 14%. Elman Recurrent Neural Net provided the best accuracy; RMSE was equaled to 27 mg/dl.

It should be noted that track representation by all models appeared to be more precise when neural network was trained by Bennett-Gourley's model. The model parameters are presented in Table 1 and its description is represented in the work of Tolic et al. [21].

We compared results of track modeling by Engelborghs', Bennett-Gourley's and sigma model parameters with BG tracks for T1DM patients from DirecNet databases. Missing parameters of first three models were defined by neural network; sigma model was built according to parameters specified in experiment protocols. Results are represented in Figure 6. Moments of food intake and insulin injections with corresponding doses are also marked on the plot.

As it turned out, Sturis' model is highly oscillating and has significant dips on the track after food intake. Engelborghs', Bennett-Gourley's and sigma models describe BG track form rather accurately; nevertheless, due to the fact that these models show better results in the case of healthy subjects, it can be noticed that BG tends to return to initial value. Moreover, sigma model is more accurate in describing BG track. Model error in the physiological blood glucose concentration range was equal to 15.7 mg/dl. It makes the model applicable for BG prediction algorithm development on its bases. It should be noted that presented RMSE is average for the whole day. The accuracy is higher for short-term prediction (30 min) and model iterative correction.

The disadvantage of the model is its ability to predict only growth or reduction of BG induced by food intake or insulin injection, respectively. As there are a lot of other BG-affecting factors [22], sigma model can be extended and improved but is applicable for prediction algorithm development as is.

2.4. Mathematic model approbation

Figure 5. Averaged blood glucose concentration track.

Figure 4. BG track with food intake and insulin injection data.

62 Gluconeogenesis

DirecNet databases give enough information for sigma model approbation. However, it is

necessary to define a wide range of parameters for other models of BG dynamics.



Table 1. Model parameters for neural net training.

Figure 6. Comparison between BGC tracks based on experimental data and model.

#### 3. Predictive algorithm

Symbol Value Dimension

Rm 210 mmol/min a<sup>1</sup> 300 mg/l C<sup>1</sup> 2000 mg/l Ub 72 mg/min C<sup>2</sup> 144 mg/l C<sup>3</sup> 1000 mg/l Vp 3 l Vi 11 l E 0.2 l/min U<sup>0</sup> 40 mg/min Um 940 mg/min β 1.77 – C<sup>4</sup> 80 mol/l Rg 180 mg/min α 0.29 l/mol C<sup>5</sup> 26 l/mol ti 100 min tp 6 min td 36 min

Vg 10 l

Table 1. Model parameters for neural net training.

64 Gluconeogenesis

Figure 6. Comparison between BGC tracks based on experimental data and model.

BG prediction algorithm is needed for adjusting the rate of insulin injection and detection of insulin pump or glucometer failure.

Algorithm is based on sigma model [23] and calculates BG dynamics for 2 hours in advance. Initial BG level is measured by invasive glucose meter in the fasting state. On receiving new data (from glucose monitor or from patient), a new prediction is made and previous predictions are erased. After each measurement made by BG monitor, the model analyses received data. Incorrect system operation cases and algorithm response on that are described below. If there are no errors in measurement process, new BG dynamic prediction is performed on the base of received data. Linear shift of predicted track toward measured value is calculated as follows (Eq. (8)):

$$
\Delta \mathbf{G} = |\mathbf{G}\_{\text{gluc}} - \mathbf{G}| \cdot \frac{\delta\_m}{\delta\_m + \delta\_{\text{gluc}}},\tag{8}
$$

where δgluc is glucose monitor value error and δ<sup>m</sup> is averaged error of mathematic model for the period between two measurements.

In order to evaluate measured BG adequacy, we consider two types of prediction: short-term and long-term predictions, to detect local errors and systematic ones, respectively.

#### 3.1. Error detecting and correction

The first type of errors is related to possible spikes due to BG monitor software or hardware failure during BG measurements. Such kind of errors is revealed to single value of glucometer data that differ significantly from predicted one. Threshold for taking measured value as falling can be expressed as (Eq. (9))

$$
\delta\_{\Sigma} = \frac{\mathbf{2} \cdot \delta\_m + \delta\_{\text{gluc}}}{2} + \delta\_{\text{tol}} \tag{9}
$$

where δΣ is the total tolerance and δtol is the theoretical tolerance of BG data deviation from values obtained by the model when accurate measurement and modeling occur.

When such an error takes place, algorithm ignores the data from glucose monitor and considers predicted data as true. Error signalization is not obligatory in this case. During the period of seven measurements, only three falling out values are allowed. If incorrect values appear, too often algorithm makes a report about possible system failure. Algorithm operation example with such type of errors is represented in Figure 7.

The second error type is connected to damage (split or disconnection) or cross clamping of insulin pump infusion set. Because of undelivered insulin, BG systematically increases. If longterm prognosis differs from glucometer data with insulin being infused, the algorithm sends a signal about possible error and suggests patient to check an infusion set (Figure 8).

It also may happen that a patient for some reason did not enter meal data. In this case, as well as in the previous one, significant deviation of glucometer measurements from long-term prediction occurs. If insulin was not infused, algorithm sends a signal about the error (Figure 9) and suggests patient to confirm that he/she didn't have a meal during last 60 minutes.

Figure 7. Example of BG track spikes elimination by predictive algorithm.

Figure 8. Algorithm operation in the case of infusion system failure.

In the case of sharp reduction of sensor sensibility, insulin pump breakdown, or other system operation failure, systematical deviations occur and there is no possibility to eliminate them by prior mentioned methods. Then algorithm reports about system failure, turns off automatic insulin infusion and suggests a patient to consult his/her doctor.

Figure 9. Algorithm operation when patient didn't enter meal data.

#### 3.2. Insulin dosage calculation

prediction occurs. If insulin was not infused, algorithm sends a signal about the error (Figure 9)

In the case of sharp reduction of sensor sensibility, insulin pump breakdown, or other system operation failure, systematical deviations occur and there is no possibility to eliminate them by prior mentioned methods. Then algorithm reports about system failure, turns off automatic

insulin infusion and suggests a patient to consult his/her doctor.

Figure 8. Algorithm operation in the case of infusion system failure.

Figure 7. Example of BG track spikes elimination by predictive algorithm.

66 Gluconeogenesis

and suggests patient to confirm that he/she didn't have a meal during last 60 minutes.

The aim of insulin pump is automatic insulin infusion in two regimes: basal and bolus. The pancreas produces insulin in advance so that BG would be in certain range of values. There are several schemes for individual insulin injections and in most cases, it should be injected before BG meal. Rapid-acting insulin should be infused straight after the meal but before blood glucose increase. Moreover, patients often need basal insulin infusion twice a day, but with insulin pump, it is infused continuously [24]. Bolus insulin dose is calculated in accordance to meal composition and product glycemic index.

Using such data and sigma model, one can calculate BG dynamics and evaluate dose and time of insulin injection to make BG normal after food assimilation. As a rule a standard value is used, for instance, 80 mg/dl. As sigma model is sensible only to food intake and insulin injection, BG with t ! ∞ tends to a constant (Eq. (10)):

$$\left. \left( \frac{m\_{f\_i \cdot r\_i}}{km\_T} \cdot \left( \frac{1}{1 + \exp\left( -\alpha \left( t - t\_i - \tau\_{\text{gluc}} - \frac{\tau\_1}{\text{Gl}\_i} \right) / \frac{\tau\_1}{\text{Gl}\_i} \right) \right)} \right) \right|\_{\text{i-m}} = \frac{m\_{f\_i \cdot r\_i}}{km\_T} \cdot \left( \frac{1}{1 + \exp(-\alpha \epsilon)} \right) = \frac{m\_{f\_i \cdot r\_i}}{km\_T} \tag{10}$$

In order to reach desired BG value Gnorm (Eq. (11)), it is necessary to infuse the following insulin volume nnorm (Eq. (12)):

$$\mathbf{G}\_{norm} = \left( \mathbf{G}\_0 + \sum\_{i} \frac{m\_{f\_i \cdot v\_i}}{km\_T} - \sum\_{j} \frac{\mu \cdot n\_j}{km\_T} \right) - \frac{\mu \cdot n\_{norm}}{km\_T},\tag{11}$$

$$n\_{norm} = \frac{km\_T}{\mu} \left( \left( G\_0 + \sum\_i \frac{m\_{f\_i \cdot v\_i}}{km\_T} - \sum\_j \frac{\mu \cdot n\_j}{km\_T} \right) - G\_{norm} \right) \tag{12}$$

Insulin infusion time depends on type of insulin used in the insulin pump. Selection of insulin infusion pattern is performed according to definite kind of insulin. The pattern is selected to minimize BG deviation from normal range of values. It is important to prevent hypoglycemic values of BG, because lack of insulin can be compensated by additional bolus, but extra BG reduction caused by insulin over-infusion cannot be balanced automatically.

Predicting track is shifted depending on measured BG values. As a result, it may happen that real BG value after some time will be lower than it was initially predicted. Meanwhile a new prediction will contain a zone where predicting value will appear in hypoglycemia area. Insulin and food have assimilation delays. If insulin of extra value is infused, it will be impossible to register and correct appropriate BG changes and a patient will have hypoglycemia after a while. In order to avoid hypoglycemia, it was offered to infuse only 75% of bolus value at once and the rest after increase of BG.

#### 3.3. Concept of predictive algorithm work principles

General concept of predictive algorithm operation is represented by the flowchart (Figure 10).

#### 3.4. Experimental tests

Algorithm was approbated using BG tracks from DirecNet database.

Algorithm successfully detected cases of meal data absence. In the case further data input and algorithm operation were impossible to perform. As all tests were performed under the medical supervision, DirecNet protocols have no data about possible insulin infusion system failure.

However, measured BG tracks had many spikes. Results of such kind of error elimination are represented in Table 2.

Algorithm corrected 97.5% of BG monitor errors. Meanwhile only 3.7% of correct BG monitor data was detected as errors. Generally, measurements were taken as errors in the ranges of BG sharp ascent and descent due to food intake or insulin infusion, respectively. That is explained by high track differential. Having that, little variations of delays in food uptake and in insulin infusion lead to significant difference of predicted and real BG values. Uncorrected errors of BG appeared, when spikes had deviated toward the predicted track and then had fallen into algorithm's correct values zone. Along with real errors of BG monitor, the synthetic errors were included in tracks. Approbation of the

Blood Glucose Prediction for "Artificial Pancreas" System http://dx.doi.org/10.5772/67142 69

Figure 10. Prediction algorithm operation flowchart.

Gnorm <sup>¼</sup> <sup>G</sup><sup>0</sup> <sup>þ</sup><sup>X</sup>

nnorm <sup>¼</sup> kmT μ

value at once and the rest after increase of BG.

3.4. Experimental tests

represented in Table 2.

failure.

68 Gluconeogenesis

3.3. Concept of predictive algorithm work principles

Algorithm was approbated using BG tracks from DirecNet database.

0 @

i

0 @

0 @

<sup>G</sup><sup>0</sup> <sup>þ</sup><sup>X</sup> i

reduction caused by insulin over-infusion cannot be balanced automatically.

mf i �νi kmT

�<sup>X</sup> j

mf i �νi kmT

Insulin infusion time depends on type of insulin used in the insulin pump. Selection of insulin infusion pattern is performed according to definite kind of insulin. The pattern is selected to minimize BG deviation from normal range of values. It is important to prevent hypoglycemic values of BG, because lack of insulin can be compensated by additional bolus, but extra BG

Predicting track is shifted depending on measured BG values. As a result, it may happen that real BG value after some time will be lower than it was initially predicted. Meanwhile a new prediction will contain a zone where predicting value will appear in hypoglycemia area. Insulin and food have assimilation delays. If insulin of extra value is infused, it will be impossible to register and correct appropriate BG changes and a patient will have hypoglycemia after a while. In order to avoid hypoglycemia, it was offered to infuse only 75% of bolus

General concept of predictive algorithm operation is represented by the flowchart (Figure 10).

Algorithm successfully detected cases of meal data absence. In the case further data input and algorithm operation were impossible to perform. As all tests were performed under the medical supervision, DirecNet protocols have no data about possible insulin infusion system

However, measured BG tracks had many spikes. Results of such kind of error elimination are

Algorithm corrected 97.5% of BG monitor errors. Meanwhile only 3.7% of correct BG monitor data was detected as errors. Generally, measurements were taken as errors in the ranges of BG sharp ascent and descent due to food intake or insulin infusion, respectively. That is explained by high track differential. Having that, little variations of delays in food uptake and in insulin infusion lead to significant difference of predicted and real BG values. Uncorrected errors of BG appeared, when spikes had deviated toward the predicted track and then had fallen into algorithm's correct values zone. Along with real errors of BG monitor, the synthetic errors were included in tracks. Approbation of the

μ � nj kmT

�<sup>X</sup> j

1

μ � nj kmT

<sup>A</sup> � <sup>μ</sup> � nnorm kmT

1

A � Gnorm

1

, (11)

A (12)

algorithm confirmed its sensibility to mentioned situations; however, they rarely happen in practice.


Table 2. Algorithm test results.

#### 4. Results and discussion

Sigma model rather accurately describes BG dynamics in patients with diabetes mellitus. For initial model approbation, only food intake and insulin injection data were taken into account. Other factors affecting BG dynamics can be included in the model after additional research. In this case, more precise clinical data will be needed for mathematic model approbation. Nevertheless, the advantage of sigma model is that it does not require a lot of physiological parameters of patient and can be used for BG prediction as is.

Described model approbation shows that RMSE of Bennett-Gourley model is 18.21 mg/dl. In spite of its simplicity, sigma model has the lowest RMSE among all tested models—15.7 mg/dl. This model contains no differential equations and requires minimal computing power in "artificial pancreas" technical embodiment.

Developed predictive algorithm is based on the sigma model. The algorithm estimates the difference between theoretical and experimental tracks with possibility of further correction. BG prediction algorithm is needed for detection of incorrect measurements and correction spikes on BG track. That allows patient to avoid incorrect insulin infusion or glucose intake and reduce possible risks.

Moreover, the algorithm alerts about closed-loop BG control system failures. It allows patient to detect damage or cross clamping of insulin pump infusion set and actualize meal data. Meanwhile patient at his own risk can continue system operation.

The algorithm allows making glucometer-insulin pump system automatic and its work more physiological. Due to insulin doses and injection time calculation, it is infused in advance (before patient BG ascent). Automatic system avoids errors when patient calculates insulin doses and injects it himself.

The algorithm was tested using 52 tracks with full information about the patient's schedule of food intake, insulin injections, etc. Thus, the algorithm suggested in this work makes it possible to avoid 97.5% cases of incorrect operation of the BG monitor. In this case, the RMSE of the calculated blood glucose concentration values was 11.06 mg/dl.

#### Acknowledgements

algorithm confirmed its sensibility to mentioned situations; however, they rarely happen

Correct 1102 (96.3%) 42 (3.7%) Error 4 (2.5%) 152 (97.5%)

Correct Error

Sigma model rather accurately describes BG dynamics in patients with diabetes mellitus. For initial model approbation, only food intake and insulin injection data were taken into account. Other factors affecting BG dynamics can be included in the model after additional research. In this case, more precise clinical data will be needed for mathematic model approbation. Nevertheless, the advantage of sigma model is that it does not require a lot of physiological param-

Described model approbation shows that RMSE of Bennett-Gourley model is 18.21 mg/dl. In spite of its simplicity, sigma model has the lowest RMSE among all tested models—15.7 mg/dl. This model contains no differential equations and requires minimal computing power in

Developed predictive algorithm is based on the sigma model. The algorithm estimates the difference between theoretical and experimental tracks with possibility of further correction. BG prediction algorithm is needed for detection of incorrect measurements and correction spikes on BG track. That allows patient to avoid incorrect insulin infusion or glucose intake

Moreover, the algorithm alerts about closed-loop BG control system failures. It allows patient to detect damage or cross clamping of insulin pump infusion set and actualize meal data.

The algorithm allows making glucometer-insulin pump system automatic and its work more physiological. Due to insulin doses and injection time calculation, it is infused in advance (before patient BG ascent). Automatic system avoids errors when patient calculates insulin

The algorithm was tested using 52 tracks with full information about the patient's schedule of food intake, insulin injections, etc. Thus, the algorithm suggested in this work makes it possible to avoid 97.5% cases of incorrect operation of the BG monitor. In this case, the RMSE of the

in practice.

70 Gluconeogenesis

4. Results and discussion

Table 2. Algorithm test results.

eters of patient and can be used for BG prediction as is.

Measured Algorithm

Meanwhile patient at his own risk can continue system operation.

calculated blood glucose concentration values was 11.06 mg/dl.

"artificial pancreas" technical embodiment.

and reduce possible risks.

doses and injects it himself.

This work was supported by the Russian Ministry of Education and Science. Project number 14.578.21.0186. Identifier of the project RFMEFI57816X0186.

#### Author details

Nikolay A. Bazaev and Kirill V. Pozhar\*

\*Address all correspondence to: kir-p@rambler.ru

National Research University of Electronic Technology, Zelenograd, Moscow, Russian Federation

#### References


[20] Diabetes Research in Children Network (DirecNet) Study Group. Prevention of Hypoglycemia During Exercise in Children with Type 1 Diabetes by Suspending Basal Insulin. Diabetes Care. 2006; 29(10):2200–2204. DOI: 10.2337/dc06-0495

[9] Bazaev N.A., Pozhar K.V., Rudenko P.A. Mathematical Modeling of Blood Glucose Concentration Dynamics. Biomedical Engineering. 2015; 48(6):292–296. DOI: 10.1007/s10527-

[10] Ruedy K.J., Beck R.W., Xing D., Kollman C. Diabetes Research in Children Network: Availability of Protocol Data Sets. Journal of Diabetes Science and Technology. 2007; 1

[11] Diabetes Research in Children Network (DirecNet) Study Group. The Accuracy of the CGMS™ in Children with Type 1 Diabetes: Results of the Diabetes Research in Children Network (DirecNet) Accuracy Study. Diabetes Technology & Therapeutics. 2003; 5

[12] Diabetes Research in Children Network (DirecNet) Study Group. The Accuracy of the GlucoWatch® G2™ Biographer in Children with Type 1 Diabetes: Results of the Diabetes Research in Children Network (DirecNet) Accuracy Study. Diabetes Technology & Ther-

[13] Diabetes Research in Children Network (DirecNet) Study Group. A Multicenter Study of the Accuracy of the One Touch Ultra Home Glucose Meter in Children with Type 1 Diabetes. Diabetes Technology & Therapeutics. 2003; 5(6):933–941. DOI: 10.1089/

[14] Diabetes Research in Children Network (DirecNet) Study Group. The Effects of Aerobic Exercise on Glucose and Counterregulatory Hormone Concentrations in Children with Type 1 Diabetes. Diabetes Care. 2006;29(1):20–25. DOI: 10.2337/diacare.29.01.06.dc05-1192

[15] Diabetes Research in Children Network (DirecNet) Study Group. Continuous Glucose Monitoring in Children with Type 1 Diabetes. The Journal of Pediatrics. 2007; 151(4):388–

[16] Diabetes Research in Children Network (DirecNet) Study Group. FreeStyle Navigator Continuous Glucose Monitoring System Use in Children with Type 1 Diabetes Using Glargine-Based Multiple Daily Dose Regimens: Results of a Pilot Tria. Diabetes Care.

[17] Diabetes Research in Children Network (DirecNet) Study Group. Relationship of A1C to Glucose Concentrations in Children with Type 1 Diabetes: Assessments by High-Frequency Glucose Determinations by Sensors. Diabetes Care. 2008; 31(3):381–385. DOI:

[18] Diabetes Research in Children Network (DirecNet) Study Group. Accuracy of Newer-Generation Home Blood Glucose Meters in a Diabetes Research in Children Network (DirecNet) Inpatient Exercise Study. Diabetes Technology & Therapeutics. 2005; 7(5):675–

[19] Diabetes Research in Children Network (DirecNet) Study Group. Impact of Exercise on Overnight Glycemic Control in Children with Type 1 Diabetes Mellitus. The Journal of

Pediatrics. 2005; 147(4):528–534. DOI: 10.1016/j.jpeds.2005.04.065

015-9472-3

72 Gluconeogenesis

152091503322640971

2008; 31(3):525–527.

10.2337/dc07-1835

680. DOI: 10.1089/dia.2005.7.675

393. DOI: 10.1016/j.jpeds.2007.03.047

(5):38–745. DOI: 10.1177/193229680700100519

(5):781–789. DOI: 10.1089/152091503322526987

apeutics. 2003; 5(5):791–800. DOI: 10.1089/152091503322526996


### *Edited by Weizhen Zhang*

Gluconeogenesis, the metabolic process through which glucose or glycogen is synthesized from noncarbohydrate substrates, is critical for maintaining the plasma glucose level within a narrow range either in the fed or fasting (nutritional deprivation) state. Dysregulation of this pathway usually causes severe or even fatal outcomes. This book discusses a series of up-to-date topics about this critical process, including the fundamental biochemical reactions of glucose metabolism, the glucogenesis process in eukaryotic cells using the Dictyostelium discoideum as a model, the role of "gut-brain-liver axis" in the control of glucose homeostasis, and the new mathematic model for the monitoring and prediction of blood glucose. This book is written by international scientists with expertise in the study of gluconeogenesis. By presenting a clear and succinct review of the fundamentals of gluconeogenesis, it is expected to draw more attentions and stimulate more scientists to dedicate their researches in revealing the mechanism and its application of gluconeogenesis.

Photo by amatevosyan1982 / iStock

Gluconeogenesis

Gluconeogenesis

*Edited by Weizhen Zhang*