Professional Documents
Culture Documents
Enhanced Accuracy of Continuous Glucose Monitoring by Online Extended Kalman Filtering
Enhanced Accuracy of Continuous Glucose Monitoring by Online Extended Kalman Filtering
Enhanced Accuracy of Continuous Glucose Monitoring by Online Extended Kalman Filtering
Andrea Facchinetti, Ph.D., Giovanni Sparacino, Ph.D., and Claudio Cobelli, Ph.D.
Abstract
Background: Most continuous glucose monitoring (CGM) devices measure a current, proportional to the in-
terstitial glucose (IG) concentration, which is converted into a glucose level by a standard device calibration step
that exploits some blood glucose (BG) references. However, data show that deterioration of sensor gain may
occur, which can affect CGM output by a systematic and possibly large (e.g., up to 15=20 mg=dL) error. En-
hanced calibration algorithms for improving the accuracy of CGM are thus of critical importance, especially in
real-time applications.
Methods: In this work we present an enhanced Bayesian calibration method that can be implemented online by
using the Extended Kalman Filter. The method takes into account the existence of BG-to-IG kinetics by incor-
porating a population convolution model and exploits only four BG reference samples per day.
Results: The new method is successfully applied on 10 simulated virtual patients. Its performance in improving
the accuracy of CGM profiles is significantly better than that of other current calibration procedures. Further-
more, the new method is shown to be robust to changes in its parameters. Improvement in the accuracy of CGM
is also shown on a representative subject.
Conclusions: Realistic simulations show that the new enhanced calibration method significantly improves the
accuracy of CGM signals, suggesting potential benefits by its inclusion in real-time applications of CGM devices.
Introduction lyzer [YSI, Inc., Yellow Springs, OH]), and a CGM pro-
file (line), collected using a subcutaneous sensor (FreeStyle
353
354 FACCHINETTI ET AL.
400
BG references
350 CGM data
300
250
mg/dL
200
150
100
50
0 5 10 15 20 25
Time (hours)
FIG. 1. Representative real data taken from Kovatchev et al.9: BG reference samples (stars) versus CGM data (line) profiles.
applications, e.g., artificial pancreas methods relying on CGM Study Group,14 which retrospectively analyzed the im-
output.12,13 Improving the accuracy of CGM data is therefore provement in CGMS sensor accuracy by modifying the
an important task to deal with in real-time. In this work we number and timing of the calibration points. Results showed
present a new enhanced calibration method that can poten- that the timing of the calibration points is even more impor-
tially work in cascade to standard calibration of any CGM tant than the number. In particular, performing calibrations
device. The aim of this enhanced calibration is to process the during periods of relative glucose stability, i.e., where the
sensor outcome in order to improve the quality of the CGM point-to-point difference due to the BG-to-IG kinetics is min-
readings. The method is based on the Extended Kalman Filter imized, significantly improves the accuracy.
(EKF), which, by taking into account the BG-to-IG kinetics, The most adopted calibration strategy15,16 is the one pre-
four SMBG samples per day, and a model of the time– sented by King et al.,17 which is based on the linear regression
behavior of sensor accuracy, significantly enhances the qual- model of Eq. 2:
ity of CGM data in real-time applications. The new method is
successfully validated on a simulated dataset reproducing y ¼ ax þ b (2)
10 virtual patients. In particular, the method is shown supe-
rior in terms of both root mean square error (RMSE) and ro- where a and b are calibration parameters that are determined
bustness with respect to other current calibration procedures by fitting them against a couple of BG (y) and CGM (x) pairs
proposed in the literature. In addition, a representative subject collected at the same time.17,18 The procedure works retro-
dataset is also used show the practical usability of the method. spectively and exploits all available BG references. This
method suffers by several limitations. First, it can be applied
CGM Calibration: State of the Art only retrospectively. Second, it does not take into account the
distortion introduced by the BG-to-IG kinetics. For instance, it
Different calibration procedures have been presented in the does not consider that, when glucose is changing rapidly, e.g.,
literature. A preliminary and important work that considered after a meal, BG and IG are significantly different (e.g., BG can
the efficiency of calibration was performed by the DirecNet be 20 mg=dL higher than IG). Finally, it cannot deal with a
possible time-varying behavior of sensor performance (i.e.,
the parameters of Eq. 2 are estimated only once for the entire
monitoring).
Another approach is presented in the work of Kuure-
Kinsey et al.,19 where a dual-rate Kalman filter is presented to
improve the accuracy of CGM data. The procedure exploits
sparse SMBG measurements and estimates in real-time the
sensor gain. However, this algorithm also does not account
for BG-to-IG kinetics.
A comprehensive description of the CGM measurement
process is due to Knobbe and Buckingham.11 In their work,
the BG-to-IG kinetics model was explicitly taken into ac-
FIG. 2. Two-compartment model describing the BG-to-IG count in order to reconstruct BG levels at continuous time
kinetics. In order to obtain the formulation of Eq. 1, the fol- from CGM measurements. In such an attempt, a state-space
lowing reparameterization has been used: g ¼ (k21V1=V2)t Bayesian framework exploiting a priori knowledge of the un-
and t ¼ 1=(k02 þ k12). known variables was adopted (for details see The state space
ENHANCED ACCURACY OF CGM 355
model), and an EKF was implemented to perform state esti- number 3) in a representative day (Day 6). SMBG samples
mation. However, in the article of Knobbe and Buckingham11 were simulated by taking four BG samples per day and
the EKF was tested on four subjects principally to estimate the adding a measurement error with coefficient of variation (CV)
BG concentration. The calibration of CGM was only a by- of 2% (gray circles in Fig. 3), as follows:
product of the method. Even if results were insightful, the
robustness of the method was not fully assessed because SMBG(k) ¼ u(k)BG(k) þ v2 (k) (3)
validation on simulated data was missing.
Below we start from the work of Knobbe and Bucking- where j(k) is a flag that is equal to 1 only when the SMBG
ham11 and further develop the approach in order to tackle sample is collected.
calibration issues. In particular, our method aims to improve Then, by applying Eq. 1 with time-invariant parameters
the accuracy of CGM data by performing an enhanced cali- (i.e., g ¼ 1 and t ¼ 12 min), IG concentrations are obtained
bration, which works in cascade to the standard device cali- (gray thick line in Fig. 3). Finally, the measured CGM profile
bration. Also, we design and implement a simulation strategy (black thin line in Fig. 3) is obtained as:
that is able to precisely define the domain of validity of the
method. CGM(k) ¼ (1 þ a(k))IG(k) þ v1 (k) (4)
220 BG
IG
200 CGM
SMBG
glucose (mg/dL)
180
160
140
120
100
0 6 12 18 24
Time (hours)
FIG. 3. Representative simulated virtual patient number 3, Day 6: actual BG (black thick line) and IG (gray thick line),
measured CGM (black line), affected by random multiplicative calibration error (Eq. 5) and by random additive error (Eq. 4),
and measured SMBG (gray circles), affected by additive noise (Eq. 3).
356 FACCHINETTI ET AL.
True IG
220 CGM (enhanced)
200
glucose (mg/dL)
180
160
140
120
Day 2 Day 3 Day 4 Day 5 Day 6 Day 7
6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24
True BG
220 Estimated BG
200
glucose (mg/dL)
180
160
140
6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24
0.2
0.15
Day 2 Day 3 Day 4 Day 5 Day 6 Day 7
0.1
0.05
α
−0.05
Simulated
−0.1
Estimated
6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24 6 12 18 24
Time (hours)
FIG. 4. Representative subject number 3. (Top) True IG (gray dashed) versus enhanced CGM (black) time series. (Middle)
True (gray dashed) versus estimated (black) BG concentrations. (Bottom) Simulated (gray dashed) versus estimated (black) a
profiles.
and Buckingham,11 this assumption can be taken without any the following, the acronym BCM will be used. As detailed
loss of generality because the introduction of a bias term below, the inputs of BCM are the noisy CGM time series
would not introduce any change in the performance of the (black thin line in Fig. 3) and the four SMBG samples per day
method. (gray circles in Fig. 3). The outputs are the enhanced CGM
time series, i.e., an estimation of the IG profile, an estimation
of the BG concentration, and, as a by-product, an estimation of
Enhanced Bayesian Calibration Method (BCM)
the gain deviation a(k).
The new online calibration method exploits a stochastic BCM exploits a state space model representation of all un-
framework and Bayesian estimator. For sake of simplicity, in known signals (see The state space model below), and it is
ENHANCED ACCURACY OF CGM 357
implemented by using EKF (see The EKF implementation time process governed by a nonlinear stochastic differential
below). equation:
while Wk and Vk are two identity matrices of size 66 and Table 1. Estimated k22 Values for Each
22, respectively. It is important to evidence that Hk change of the 10 Simulated Subjects
with k.
Note that the method of Eqs. 8 and 9 and the EKF im- Subject k22
plementation described above represent an improvement of 1 3.7
the approach proposed by Knobbe and Buckingham.11 In fact, 2 2.7
the aim is now focused on improving the accuracy of CGM 3 2.3
data, rather than on estimation of BG and physiological 4 3.7
parameters (e.g., t as in Knobbe and Buckingham11), by per- 5 3.8
forming an enhanced calibration in cascade to the standard 6 4.7
device calibration. Also, the model is different and, for some 7 2.9
aspects, simpler. The original model of Knobbe and Buck- 8 3.1
ingham11 has five state variables (i.e., BG, rate of change of 9 5.9
10 2.7
BG, IG, t, and the scale factor), each one with its own variance
(which has to be known a priori). Even if the new model has
apparently six states, the true unknown variables are only
three, i.e., BG, IG, and a. A further simplification is that, now,
only two variances (i.e., k21 and k22 ) have to be set (compared
to the five variances that had to be trained in Knobbe and
Focusing on the middle panel, we can see that BCM allows us
Buckingham11). Finally, a different description of the vari-
to correctly identify an underestimation in Days 4 and 5 and
ables (i.e., BG is an integrated random walk process, and a is
an overestimation in Day 7.
the triple-integration of a random white noise) has also been
In order to better understand the quality of BCM outputs,
used in order to improve the method performance.
in Figure 5 a 1-day detail (Day 6) has been reported. The top
row shows the true IG (gray dashed line), the measured CGM
Results
(black thin line), and its enhanced version (black thick line),
BCM on simulated data whereas the middle row displays the true BG (gray dashed)
and the reconstructed BG (black) profiles. Looking at the
BCM has been tested on the 10 simulated virtual patients
top row, it is possible to see that the enhanced calibration
created in Simulated Database. Data of Day 1 are used as the
completely eliminates the amplitude distortion present in the
burn-in interval. Matrices Rk and Qk in Eqs. 13 and 14 are
measured CGM signal. As a by-product of the procedure,
considered available. Concerning Rk, the variances of v1(k)
the CGM profile has also been significantly denoised. In the
and v2(k) in Eq. 9 have been set to r21 (k) ¼ 4 mg2 =dL2 and
bottom row, a zoom of 10–14 h is highlighted (IG, CGM, and
r22 (k) ¼ (0:02 · y2 (k))2 mg2 =dL2 , respectively. Concerning Qk,
enhanced CGM on the left side, BG and estimated BG on the
the variance of w1(k) has been estimated for each subject in the
right side).
burn-in interval by resorting to a stochastically based
smoothing criterion based on maximum likelihood,24,25 and
Comparison with other methods
the variance of v1(k) was set at k21 ¼ 10 19 (the same value
used to generate a profiles in Simulated Database). For each In order to better assess the potential usefulness of the
subject, k22 estimated values are reported in Table 1. The four method, below we make a comparison with both the model of
SMBG samples per day were ‘‘optimally’’ drawn at breakfast Knobbe and Buckingham11 and a recently proposed calibra-
and dinner and at the correspondent glycemic peaks, ac- tion procedure based on the linear regression model of Eq. 2.17
cording to the accepted notion that using reference values Because the procedure of King et al.,17 in its original formu-
collected at very different glycemic levels (e.g., one at val- lation, works only retrospectively, we have modified it using
ley and one at peak) improves calibration.17 This particular a two-point strategy for the update of the parameters of Eq.
scheduling suits real life because type 1 diabetes subjects 218 (with this modification, the method performs better than
likely measure their glycemic level before a meal to calculate the other calibration procedures previously proposed in the
the dosage of the insulin bolus and 1 h after to check if an literature).15,17
additional bolus correction is necessary.
Figure 4 shows the results for a representative subject Optimal SMBG scheduling. To compare the three cali-
(number 3). The top panel displays the true IG (gray dashed) bration methodologies, the RMSE between true IG and en-
and the enhanced CGM (black) profiles. The middle panel hanced CGM profiles is performed. Columns 1, 2, and 3 of
shows the true BG (gray dashed) and the reconstructed BG Table 2 show the RMSE for BCM, the model of Knobbe and
(black) profiles. The bottom panel displays the true a (gray Buckingham,11 and the two-point calibration procedure, re-
dashed), used to simulate this dataset, and its estimate (black) spectively, in the 10 simulated virtual patients, together with
obtained by BCM. Even if the procedure is based only on four mean and SD values. BCM performs better than the other
SMBG samples, IG is correctly reconstructed. A good estimate approaches. In particular, the RMSE mean value has been
of BG is obtained thanks to the incorporation of the BG-to-IG significantly reduced (82%, P < 0.001 for the model of Knobbe
dynamics into the state space model. The trend of a is nicely and Buckingham11; 33%, P ¼ 0.01 for two-point calibration,
reconstructed thanks to the inclusion of the description of Wilcoxon rank sum test). Furthermore, by looking at the SD
sensor gain by Eq. 5. Notably, a reflects the systematic under- values, BCM performs similarly and satisfactory for all sub-
or overestimation of the glucose level made by the CGM de- jects, whereas the algorithm of Knobbe and Buckingham11
vice, and therefore it is a sort of indicator of its accuracy. performs unsatisfactorily in all subjects except for number 6,
ENHANCED ACCURACY OF CGM 359
True IG
220
CGM
CGM (enhanced)
200
glucose (mg/dL)
180
160
140
120
100
0 6 12 18 24
True BG
220 Estimated BG
200
glucose (mg/dL)
180
160
140
120
100
0 6 12 18 24
220 220
True IG True BG
CGM Estimated BG
200 CGM (enhanced) 200
glucose (mg/dL)
180 180
160 160
140 140
120 120
10 11 12 13 14 10 11 12 13 14
Time (hours) Time (hours)
FIG. 5. Subject number 3, detail of Day 6. (Top) True IG (gray dashed), noisy CGM (black thin) with lack of calibration, and
enhanced CGM (black thick) time series. (Middle) True (gray dashed) versus estimated (black) BG profiles. (Bottom) Zoom of
the time window 10–14 h, true IG (gray dashed), noisy CGM (black thin) with lack of calibration, and enhanced CGM (black
thick) time series (left panel) and true (gray dashed) versus estimated (black) BG profiles (right panel).
360 FACCHINETTI ET AL.
Table 2. RMSE (in mg=dL) for Optimal (i.e., Valleys and Peaks) and Suboptimal
(i.e., Close to Valleys and Peaks) SMBG Scheduling
Optimal scheduling Suboptimal scheduling (30-min window) Suboptimal scheduling (2-h window)
Two SMBGs,
Subject BCM Knobbe 2-point BCM 2-point BCM 2-point BCM
and the two-point procedure presents unsatisfactory results SMBG scheduling has been drawn in which only two mea-
for some of them, in particular for subject number 7. Because surements per day are provided. The two samples have been
the two-point procedure performs better than the EKF of collected one at breakfast and one at the postprandial dinner
Knobbe and Buckingham11 (73%, P < 0.001), hereafter only peak, respectively, and both with suboptimal timing (ran-
the two-point calibration will be used as reference. domly taken in the 2-h window around each point). For each
Figure 6 shows a graphical comparison on Day 6 of the subject RMSE values are reported in the last column of
representative dataset. The true IG (gray dashed), the mea- Table 2. By looking at the results it is evident that even if
sured CGM (black thin), the two-point calibrated (black dot- resorting only to two SMBG samples per day, BCM mean
ted), and the BCM calibrated (black thick) signals are plotted. RMSE increases by only 33% if compared to results of four
As apparent even by graphical inspection, BCM is able to SMBG samples with optimal scheduling. This confirms that
perform a satisfactory CGM data enhancement, producing BCM is able to perform satisfactorily also in suboptimal
better results than the two-point method. In addition, BCM conditions concerning both number and scheduling of SMBG
also returns a smoothed profile with a significant reduction in samples.
the noise component. Finally, we also tested the performance of BCM by apply-
ing higher CV values to SMBG measurements and obtained
Robustness to suboptimal SMBG scheduling. In this results comparable to the ones presented above (data not
subsection we investigate the situation in which a suboptimal shown).
scheduling of the four SMBG measurements per day is pro-
vided. In particular, each of the four SMBG samples per day is Robustness to errors in t. We also investigated the in-
collected randomly in a time interval of 30 min centered at the fluence of the value of t in Eq. 7. The value of t can signifi-
‘‘optimal’’ sampling times used in the previous simulations. cantly vary from subject to subject,15 and its individual
Columns 4 and 5 of Table 2 report the RMSE for this first identification is impossible in practice because it would re-
simulation. Also in this case, BCM performs much better than quire abundant BG references per day.
the two-point method, with a significant reduction of the The first simulation is aimed to test BCM if, inside the
RMSE of 43% (P < 0.01). Notably, BCM performance is almost model, a wrong t value is used. In particular, we choose
insensitive to the suboptimality of SMBG sampling (þ3%, t values from 6 to 18 min, i.e., we consider the worst case in
comparing average results of columns 1 and 4), whereas the which the BG-to-IG model has 50% of error. Figure 7 shows
two-point procedure has a significant decrease in perfor- the BCM average RMSE values (black profile) obtained
mance (þ21%, comparing average results of columns 3 and 5). comparing true IG and enhanced CGM time series. Even in
In order to stress the performance of BCM, a second test the worst case, i.e., by using t ¼ 6 min, BCM performance in
has been performed by increasing the time interval to 2 h. terms of RMSE is better than for the two-point method (3.9 vs.
RMSE values are reported in columns 6 and 7 for BCM and the 5.2, respectively). If compared with the result of the optimal
two-point procedure, respectively. The BCM mean RMSE SMBG scheduling of section (see BCM on simulated data)
increases of only 5.4% if compared to results of optimal (average RMSE ¼ 3.5), the average RMSE increases only by
scheduling (3.7 vs. 3.5, respectively) and, not surprisingly, is 12%. This means that, even if we use inside BCM a t value that
significantly better than the two-point calibration in terms of is lower=greater than 50% of the real one, BCM still performs
RMSE (71%, P < 0.001). In addition, by looking at SD values, better than the calibration procedure of King et al.17
RMSE variability from subject to subject is similar to the ideal In the second simulation, we compared the performance of
situation only for BCM. individualized versus ‘‘population’’ BCM. The dataset created
in Simulated Database has been modified in order to take into
Robustness to reduction of SMBG measurements. It is account the interindividual variability of t. Ten new simu-
of interest to test the performance of BCM by reducing the lated subjects have been created, each one with a different t
number of SMBG samples exploited. In particular, a new drawn from a Gaussian distribution (18 4 min [see Facchi-
ENHANCED ACCURACY OF CGM 361
True IG
220 CGM
2−point
200 BCM
glucose (mg/dL)
180
160
140
120
100
0 6 12 18 24
Time (hours)
FIG. 6. Subject number 3, detail of Day 6: true IG profile (gray dashed), CGM data (black thin), two-point calibrated (black
dotted), and BCM enhanced (black thick) CGM profiles.
netti et al.15]). The mean and SD values of the RMSE were been correctly identified by estimating a negative value of a in
3.6 1.1 and 4.1 1.4 mg=dL, by using the individualized correspondence to the time window 15–21 h (bottom panel),
and the ‘‘population’’ BCM, respectively. This result evidences but also it has been satisfactorily recovered. In fact, the en-
that BCM, even with ‘‘population’’ parameters, performs hanced CGM profile (black series in the top panel) presents
satisfactorily. increased CGM values exactly in that window if compared to
the original one. Quantitatively, the RMSE calculated in 18–
BCM on a representative subject 26 h, i.e., after the two SMBG samples have been exploited,
between BG references (we remember not used by BCM) and
BCM was also tested on the same subject of Figure 1. As one
CGM profile has been reduced from 32.0 to 25.5 mg=dL
can see by comparing the two time series, the CGM profile is
thanks to the enhanced calibration.
characterized by an evident underestimation of the glycemic
level in the time interval 17–21 h. Two of the BG references
Conclusions
have been selected to simulate two SMBG measurements (see
the gray circles plotted in the top panel of Fig. 8). Then, BCM In this work we have proposed a new online enhanced
has been applied as data were received in real time. By calibration method that can be applied in cascade to the
looking at the results, a zoom of which is shown in Figure 8, standard CGM device calibration in order to improve
not only has the underestimation of the original CGM data the accuracy of CGM output. This method, which is an
3.9
3.8
mg/dL
3.7
3.6
3.5
6 8 10 12 14 16 18
τ (min)
FIG. 7. The average BCM RMSE obtained comparing true IG versus enhanced CGM time series by using a wrong t value in
the BG-to-IG kinetics model (50% of the true value, i.e., 12 min).
362 FACCHINETTI ET AL.
400
CGM
CGM (enhanced)
350
SMBG
300
glucose (mg/dL)
250
200
150
100
12 14 16 18 20 22 24 26
0.1
Estimated α
0.05
α
−0.05
−0.1
12 14 16 18 20 22 24 26
Time (hours)
FIG. 8. Representative real subject. (Top) Measured (gray) versus enhanced (black) CGM time series as well as SMBG
samples (gray circles). (Bottom) Estimated a profile.
improvement of the algorithm of Knobbe and Buckingham,11 the need of a burn-in interval. Here, 1 day was exploited in
is embedded within a stochastic framework and implemented order to estimate the covariance matrix of the state vector in
by EKF. By taking into account BG-to-IG kinetics, few SMBG the transient phase.
samples per day, and a model describing the sensor gain In conclusion, the enhanced calibration algorithm signifi-
variability, the enhanced calibration method significantly cantly improves the accuracy of CGM signals, suggesting that
improves the accuracy of CGM data in real-time. Further- it could be profitably included in real-time applications of
more, the method intrinsically denoises the CGM signal and, CGM devices, e.g., algorithms for open=closed-loop diabetes
as a by-product, also provides a continuous-time estimate of control. The model here used for the description of the sensor
both BG and sensor gain. gain deviation a is rather general and could be used in cascade
Compared to state of art literature calibration strategy, the to make an enhanced calibration for any CGM device. In
new method performs significantly better, when both optimal addition, the method could be also used retrospectively to
and suboptimal scheduling of the four SMBG measurements efficiently improve the accuracy of CGM profiles before ap-
is done and when the number of the SMBG per day is reduced. plying to those data any type of post-processing.
Also, the method exhibits small sensitivity to variations of the
BG-to-IG time constant t. In addition, when applied to a real Acknowledgments
dataset, BCM is shown to correctly identify under- and
We thank Dr. Chiara Dalla Man (University of Padova,
overestimations of original CGM profile and to improve
Padova, Italy) for having provided the software13,20,21 and for
sensor outcome.
her helpful support in its use in the simulations reported in the
Finally, we note that the application of the BCM to real data
present work.
requires the knowledge of the variances of both state and
measurement processes, which in real-life conditions are
Author Disclosure Statement
usually unknown. Therefore, a real-time method for this es-
timation should be considered. Another aspect is related to The authors have no conflicts of interest.
ENHANCED ACCURACY OF CGM 363