DIABETES TECHNOLOGY & THERAPEUTICS Volume 18, Number 4, 2016 ª Mary Ann Liebert, Inc. DOI: 10.1089/dia.2015.0250

ORIGINAL ARTICLE

Modeling Transient Disconnections and Compression Artifacts of Continuous Glucose Sensors Andrea Facchinetti, PhD, Simone Del Favero, PhD, Giovanni Sparacino, PhD, and Claudio Cobelli, PhD

Abstract

Background: Modeling the various error components affecting continuous glucose monitoring (CGM) sensors is very important (e.g., to generate realistic scenarios for developing and testing CGM-based applications in type 1 diabetes simulators). Recent work has focused on some error components (i.e., blood-to-interstitium delay, calibration, and random noise), but key events such as transient faults have not been investigated in depth. We propose two mathematical models that describe the disconnections and compression artifacts. Materials and Methods: A dataset of 72 subjects monitored with the Dexcom (San Diego, CA) G4 Platinum sensor is considered. Disconnections and compression artifacts have been isolated, and some basic statistical parameters (e.g., frequency and duration) have been extracted. A Markov chain model is proposed to describe the dynamics of a disconnection, and the effect of a compression artifact in the CGM profile is modeled as the output of a first-order linear dynamic system driven by a rectangular function. Results: The great majority of disconnections (approximately 90%) lasted less than 20 min. Compression artifact median (5th–95th percentiles) values were 45 (30–70) min for the duration and 24 (10–48) mg/dL for the amplitude. Both disconnections and compression artifacts happened with almost equal probability during the 7 days of monitoring. Disconnections were more frequent during the day and compression artifacts during the night. A three-state Markov model is shown to be effective to describe the single disconnection. The asymmetric shape of compression artifact is well fitted by the proposed model. Conclusions: The provided models are sufficiently accurate for simulation purposes (e.g., to create more challenging and realistic scenarios) to test real-time fault detection algorithms and artificial pancreas closedloop controllers. major error components of CGM sensors.6–10 For instance, in our recent work we proposed models to describe some key CGM sensor error components, such as lag introduced by the blood-to-interstitium kinetics, calibration, and random noise errors.8,9 However, CGM sensors can be also affected by occasional, transient faults for which, to the best of our knowledge, mathematical descriptions are still unavailable. In particular, in this article we consider two common faults of the CGM sensors. The first is disconnection, which consists of the loss of one or more consecutive samples, caused by the interruption of communication between the sensor transmitter and the receiver. An example of disconnection is reported in Figure 1 (left), in which the representative CGM time series presents two time windows of missing data: the first of 20 min, from 07:55 to 08:15 h, and the second of 30 min, from

Introduction

I

n terms of mean absolute relative difference, the accuracy of continuous glucose monitoring (CGM) sensors of the last generation has finally reached the single digits, and the gap between CGM and self-monitoring blood glucose meters is getting smaller and smaller.1 These improvements empowered the potential impact of several applications (e.g., sensor-augmented pumps, in which the modulation of basal insulin dosage is based on actual and predicted glucose levels measured by the CGM sensor,2,3 and artificial pancreas systems, where the insulin dosage is tuned by a closed-loop control algorithm on the basis of CGM readings4,5). As in any measurement device, the glucose values provided by CGM sensors are affected by errors. Great effort has been made in the last few years to describe and model the

Department of Information Engineering, University of Padova, Padova, Italy.

1

2

FIG. 1.

FACCHINETTI ET AL.

Examples of (left) disconnections and (right) compression artifact on continuous glucose monitoring (CGM) data.

09:15 to 09:45 h. The other failure is the so-called ‘‘compression artifact,’’11 also known as pressure-induced sensor attenuation12 or dropout,13 which is caused by a mechanical pressure made on the sensor by the patient (e.g., while sleeping prone) inducing a temporary loss of sensitivity with consequent distortion of the CGM trace. An example of compression artifact is displayed in Figure 1 (right): thanks to the availability of two CGM sensors working simultaneously, it is possible to identify a compression artifact of 45 min in length, from time 04:45 to 05:30 h. Quantitative analyses of the frequency and duration of these faults and models capable of describing them are key for developing and testing CGM-based applications. In particular, adding the capability of mimicking these transient faults to the University of Virginia/Padova type 1 diabetes (T1D) simulator14,15 would allow to generate more realistic in silico scenarios to develop and test, for example, artificial pancreas controllers16–18 or fault detection systems.11,12,19 In fact, disconnections and compression artifacts are events that, although present in almost all trials, can create risky situations. For instance, a compression artifact can generate a spurious hypoglycemic event by rapidly driving glucose concentration from the euglycemic to the hypoglycemic range, which can trigger, for example, an artificial pancreas system safety algorithm to stop the insulin administration. In such a scenario, it would be interesting to understand consequences of this interruption in terms of glucose control and then design or test countermeasures (e.g., fault detection systems). To the best of our knowledge, these transient faults have been scarcely investigated, so far, in the literature: no models of disconnections are available, whereas only one model of compression artifacts has been recently published by Emami et al.13 based on data of 15 subjects monitored for a period of 15 h with the Sof-sensor ( Medtronic, Northridge, CA).

The aim of our article is to develop models to describe disconnections and compression artifacts affecting CGM sensors by using a large dataset consisting of CGM time series measured in 72 T1D patients by the Dexcom (San Diego, CA) G4 Platinum sensor for periods of 7 days. The article is organized as follows: first we will present the data; next, we will analyze CGM disconnections and describe them by a Markov model; and then we will investigate CGM compression artifacts and model them as the output of a firstorder linear dynamic system driven by a rectangular function. Some conclusions end the article. Database

The considered database (courtesy of Dexcom) was taken from a larger pivotal study conducted in 2011 (see Christiansen et al.20 for more details on protocol, sensor accuracy, and cohort). It consisted of 72 subjects wearing Dexcom G4 Platinum sensors for 7 days. All subjects were admitted three times to the clinic for 12 h each on Days 1, 4, or 7, where blood glucose samples were also measured in parallel approximately every 15 – 5 min using the YSI (Yellow Springs, OH) glucose analyzer. Half of the subjects (n = 36) wore two sensors with needles placed on the two different sides of the abdominal region (left and right, respectively); thus in total 108 CGM time series were available. All 72 subject datasets were suitable for the analysis. With regard to the disconnections, because the Dexcom G4 Platinum has a sampling time of 5 min, we identified disconnections by looking for gaps between two consecutive samples of ‡10 min. With regard to compression artifacts, their identification is less straightforward. Compression artifacts have been identified by visual inspection either by comparing the two CGM sensor traces collected simultaneously on the same individual (when available) or by comparing the CGM

MODELING ARTIFACTS IN CGM

trace with the YSI references (available on Days 1, 4, and 7 for 12-h periods each). Then all CGM data belonging to compression artifacts were removed from the CGM trace (i.e., creating gaps in correspondence to each compression artifact). The gaps have been filled by resorting to a Bayesian smoothing technique,21,22 which estimates the glucose concentrations that should have been measured by the sensor without the effect of the compression artifact. Finally, for each compression artifact episode, a compression artifact profile has been obtained as the difference between the portion of original CGM data identified as a compression artifact (the one that was initially removed from the CGM trace) and the corresponding glucose profile estimated by the Bayesian smoothing technique. Model of CGM Sensor Disconnections Analysis of the events

As previously commented on for Figure 1 (left), disconnections are interruptions of the wireless communication between the transmitter and the receiver of the CGM device, usually generated when transmitter–receiver distance becomes greater than the maximum allowed by the manufacturer’s instruction (e.g., due to user forgetfulness to maintain the portable receiver close enough to the sensor/transmitter system). When a disconnection takes place, the transmitter is not able to send the measured glucose value to the receiver. In total, 1,014 disconnections over 108 CGM traces have been identified (1.3 – 1.1 per day). Figure 2 displays the analysis of disconnection events. Figure 2 (left) shows the normalized histogram (relative frequency) of the duration of the disconnections (each bar has height given by the number of occurrences divided by the total number of events). Most of the disconnections last a few samples: 71.4% of them consist of only one sample missing (10-min gap), and about 90% have length £20 min. Figure 2 (middle) shows the normalized histogram of the disconnection occurrences in the 7 days of sensor life: considering that by protocol during

3

Days 1, 4, and 7 the subject was admitted to the clinic for a 12-h period and thus while in bed at rest the probability of forgetting the receiver decreases, we believe that choosing a distribution uniform over the 7 days of sensor life is reasonable. Figure 2 (right) depicts the normalized histogram of the clock hour of the day where disconnections occur: the probability of disconnection is significantly lower during the night than during the day. Moreover, the likelihood of disconnections increases in the afternoon and evening, possibly because of the decrease of focus/increased tiredness of the patient through the day. Also in Figure 2 (right), the black continuous line depicts the probability density function of occurrence of a disconnection during the 24 h of a day, estimated from the data using a kernel density estimator. The model

A simple candidate model to describe the dynamics of disconnections is the two-state Markov model displayed in Figure 3 (Model A). At a given sampling time, in state C (‘‘connected’’) the system is regularly functioning because sensor transmitter and receiver are properly connected, whereas in state D (‘‘disconnected’’) the measurement collected by the sensor is not transmitted to the receiver. As shown in the diagram, the probability to pass from state C to state D is a, while remaining in C (i.e., a regular sample followed by another regular sample) has probability 1 - a. If the current state is D, the probability of remaining in D (i.e., a missed sample followed by another missed sample) is b, whereas that of switching to C (i.e., a regular sample available thanks to communication restoration between transmitter and receiver) is 1 - b. Calling d the duration of a disconnection, the probability of having a disconnection of duration k sampling periods is as follows: P[d ¼ k] ¼ abk  1 (1  b)

(1)

being the result of a transition from state C to state C followed by k–1 consecutive D to D transitions and a D to C transition

FIG. 2. Analysis of disconnections: normalized histograms of (left) event duration, (middle) day of the event, and (right) clock-hour of event versus fitted probability density function (black line).

4

FACCHINETTI ET AL.

# of disconnections lasting more than two samples b2 ¼ # of disconnections lasting i ¼ 1, . . . , N two samples

(5)

Results

FIG. 3. Markov Models A and B for the description of the dynamics of a single disconnection event. For Model A, in state C (connected) the system is regularly functioning, whereas in state D (disconnected) the measurement collected by the sensor is not transmitted to the receiver. For Model B, C is the regularly working state, and D1 describes disconnections lasting one sample only (i.e., 10-min gap in the data), whereas D‡2 describes longer disconnections. Arches indicate the transition between two states, where the letter over the arch represents the transition probability. that terminates the disconnection event. The transition probability a can be estimated by maximum likelihood as: a¼

# of disconnection episodes # of regular samples

(2)

Analogously, the maximum likelihood estimate of the probability b to have disconnections longer than one sample is: b¼

# of missed samples preceded by a missed sample # of missed samples (3)

Figure 4 shows the probabilities of having a disconnection of duration k samples P[d = k] calculated from the data (gray bars). Note that Figure 4 differs from Figure 2 (left) because the bars are now probabilities instead of normalized frequencies (also note the log scale on the y-axis). The whiskers represent the –2 SE of the estimate, derived from a binomial distribution of parameters p = P[d = k] and N equal to the number of events. Moreover, Figure 4 reports the same probabilities P[d = k] computed according to Model A (black dashed line), whose parameters have been estimated from the data according to Eqs. 2 and 3 (i.e., a = 0.0049 and b = 0.5593). The log scale on the y-axis allows a better plot of P[d = k] calculated using Model A, which becomes a firstorder polynomial function in k with slope log (b). As shown in Figure 4, the two-state model does not fit the data well, and in most of the cases the model prediction does not lie within the SE bars. In particular, Model A underestimates the probability of having a disconnection of 10 min, overestimates the probability of having disconnections of duration of 10 and 15 min, and underestimates the probability of having a disconnection between 35 and 45 min. Therefore we have moved to the three-state Model B of Figure 3. The probability of entering a disconnection is the same of Model A (i.e., a = 0.0049), the probability to pass from state D1 to state D‡2 is b1 = 0.2738, and, finally, the probability of remaining in state D‡2 is b2 = 0.5852. The fit of Model B (Fig. 4, dark gray solid line) is good because

Model A is very simple, but it is based on the assumption that the probability b of the D to D transition is constant for the entire duration of the disconnection event. However, it is reasonable also to expect that this probability can change. In particular, observing in Figure 2 (left) that disconnections of one sample duration are more frequent than longer disconnections (i.e., the probability of D to C transition in case of a disconnection of one sample duration is greater than for disconnection of longer duration), we also consider the threestate Markov model of Figure 3 (Model B). In Model B, C is the regularly working state, and D1 describes the disconnections lasting one sample only (i.e., 10-min gap in the data), whereas D‡2 describes longer disconnections. The maximum likelihood estimate of the probability of getting a disconnection lasting more than one sample only b1 is as follows: b1 ¼

# of disconnections lasting two samples i ¼ 1, . . . , N # of disconnections lasting one sample (4)

whereas the maximum likelihood estimate of the probability to remain disconnected for more than two samples is

FIG. 4. Histogram of probabilities of having a disconnection of duration k samples P[d = k] (divided by duration): the gray bars represent the value calculated from the dataset (the black whiskers represent the –2 SE on the estimate), and the black dashed and dark gray solid lines are the fit of Models A and B, respectively.

MODELING ARTIFACTS IN CGM

probabilities estimated using the model fit the data well and lie almost all within the SE bars. This confirms that the disconnection phenomenon can be reasonably described by a three-state model. We have also considered and investigated models with several states greater than three, but results (data not shown) indicate that adding other states does not significantly improve the fitting with respect to Model B. With regard to the transition probability a from a connected to a disconnected state, this probability can be modulated on the basis of the time of the day. In fact, as seen in Figure 2 (left), the distribution of the disconnections is smaller in the time interval 00:00–06:00 h and larger (almost uniform) over the rest of the day. Thus we can calculate two different a values for these two periods: anight = 0.0012 for time interval 00:00–05:59 h and aday = 0.0061 for time interval 06:00–23:59 h. Model of CGM Sensor Compression Artifacts Analysis of the events

As previously mentioned in commenting on Figure 1 (right), compression artifacts are transient faults caused by an external pressure applied on the sensor for a certain time (e.g., 30–40 min) and manifest as a rapid fall in glucose level (while the pressure is applied) and consequent recovery (when the pressure is released). In total, 143 compression artifacts over 108 CGM traces have been identified. Figure 5 shows some results on the identified compression artifacts. Figure 5 (left) shows the normalized histogram (relative frequency) of the duration, which indicates that the median (5th–95th percentiles) duration of a compression artifact is 45 min (30–70 min). Figure 5 (middle) shows the normalized histogram of the occurrence of a compression artifact in the 7 days of sensor life: the occurrence of compression artifacts seems very similar all over the 7 days except for Days 1 and 4, in which it is almost halved. This is not surprising because, as already noted in above in Model of CGM Sensor Disconnections, Analysis of the events, Days 1 and 4 are the days in which the subject was

5

admitted to the clinic for a 12-h period. Figure 5 (right) depicts the normalized histogram of the clock hour when compression artifacts occur: the probability of suffering for a compression artifact is significantly greater during the night than over the day, where the probability of compressing the sensor increases in the afternoon and evening. This result is expected because during the night, when the patient is asleep in bed, mechanical pressure episodes over the sensor (which is usually placed on the abdomen) are more likely. With regard to the amplitude of the compression artifacts, the median (5th–95th percentiles) amplitude is 24 mg/dL (10– 48 mg/dL). The model

Visual inspection of the data suggests that the pressureinduced modifications gradually affect the glucose profile, an effect that can be described by a low-pass dynamic filter. Hence, a candidate simple model for describing compression artifacts in CGM consists in considering the pressure mechanically applied on the sensor by the patient as a rectangle function with duration D and unitary amplitude. This produces a spurious additive component obtained as the output of a first-order linear system with transfer function G(s) = P/(1 + ss), where P is the amplitude (in mg/dL) of the event and s is the time constant of the system. A graphical representation of this model is shown in Figure 6. The model of Figure 6 can be parameterized as follows:  CGMca (t) ¼

t

 P(1  e  s for t < D tD t (1  e s )  P(1  e  s for tqD

(6)

which describes a compression artifact affecting CGM due to abnormal pressure placed on the sensor starting at time 0 and ending at time D. In Eq. 6, P, D, and s have to be estimated from the data, a different set for any event. The parameter s (i.e., the time constant of the system) can be approximately interpreted as one-third of the time needed by the artifact to vanish completely after the pressure ceasing.

FIG. 5. Analysis of compression artifacts: normalized histograms of (left) event duration, (middle) day of the event, and (right) clock-hour of event versus fitted probability density function (black line).

6

FACCHINETTI ET AL.

FIG. 6. The model proposed to describe the dynamics of a single compression artifact event. A mechanical pressure of unitary amplitude and duration D applied on the sensor is the input of a system having the transfer function G(s) = P/(1 + ss). The output of this first-order linear system is the spurious additive component affecting continuous glucose monitoring (CGM) data. The parameter A is the maximum amplitude reachable by the CGM signal deviation, P is the amplitude (in mg/dL) of the event, and s is the time constant of the system. The maximum amplitude A reachable by the spurious CGM signal component can be easily demonstrated to be equal to the following: D

A ¼ (1  e  s )P

(7)

Results

Figure 7 shows three examples of the model fit of Eq. 6 to portions of CGM data identified as compression artifacts.

Each panel in Figure 7 contains the compression artifact (gray line) that has been isolated from CGM data using the technique described in Model of CGM Sensor Compression Artifacts, The model, the confidence interval on the data (gray area) that represents the uncertainty associated to the CGM values (–2 SD), and the fit of the model (black line). Figure 7 (left) shows a high amplitude compression artifact, where the nadir is reached after 20 min (hard pressure applied for a short time, and slow recovery from -40 mg/dL to the normal condition. As is seen, the model is able to well

FIG. 7. Three examples of compression artifacts: (left) elevated amplitude and standard shape, (middle) low amplitude and standard shape, and (right) low amplitude and nonconventional shape. The black dots are the compression artifact values isolated from continuous glucose monitoring (CGM) data with the procedure described in Database. The gray line is a linear interpolation between compression artifact values to improve visualization. The gray area is the uncertainty associated to the CGM values (–2 SD) in correspondence with the compression artifact. The black line is the fit of the model of Eq. 6.

MODELING ARTIFACTS IN CGM

fit the typical patterns of compression artifacts in CGM data, by describing both the descending and recovery phases (all model values lie within the confidence interval). Figure 7 (middle) depicts a case in which the amplitude of the compression artifact is limited to -15 mg/dL, but the pressure lasts for about 40 min. Also in this case the model fit is very satisfactory. Figure 7 (right) presents, instead, an example of unsatisfactory fit. In this case, the compression artifact form is very similar to that of Figure 7 (middle), but the initial descending phase presents a convexity inversion, the plateau phase is very noisy, and the recovery phase is very rapid and almost linearly increasing in time. For identifiability reasons, the chosen model of the compression artifact is very simple and cannot take into account all these possible exceptions. However, the number of compression artifacts that are not properly described by the model (i.e., those having more than 50% of the model values not lying within the confidence interval) was limited to 21 over 143 (14.7%). This is a rather small percentage if compared with the number of compression artifacts that were perfectly fitted (i.e., having 100% of the model samples points of the fit within the confidence interval), which were 83 over 143 (58%). The goodness of the fit is supported also by standard metrics: for instance, the root mean square error (RMSE) was, on average, 0.8 mg/dL, which is a very small error (less than 5%) if compared with the average amplitude of the compression artifact (26 mg/dL). With regard to the model parameter estimates (i.e., the amplitude of the pressure P, the duration D, and the time constant of the system s), Figure 8 shows the normalized histograms (gray bars). Parameter P (Fig. 8, left) has a median (5th–95th percentiles) of 24.7 mg/dL (10.9–48.4 mg/dL), and

7

its normalized histogram is well fitted by a log-normal distribution (continuous thick line), with mean l = 3.17 and SD r = 0.57 (v2 goodness-of-fit test against log-normal distribution, P = 0.2117). Parameter D (Fig. 8, middle) has a median (5th–95th percentiles) value of 24.4 min (13.1–39.4 min), and its normalized histogram is also well fitted by a log-normal distribution (continuous thick line), with mean l = 3.19 and SD r = 0.42 (v2 goodness-of-fit test against log-normal distribution, P = 0.8396). Finally, the time constant of the system s (Fig. 8, right) has a median (5th–95th percentiles) value of 9.1 min (3.9–21.7 min), and its normalized histogram is well fitted by a b distribution (continuous thick line), with parameters a = 2.35 and b = 4.81 (v2 goodness-of-fit test against c distribution, P = 0.1276). The precision of the estimates of P, D, and s confirms the goodness of the model because more than 90% of the parameters are estimated with a coefficient of variation of

Modeling Transient Disconnections and Compression Artifacts of Continuous Glucose Sensors.

Modeling the various error components affecting continuous glucose monitoring (CGM) sensors is very important (e.g., to generate realistic scenarios f...
608KB Sizes 0 Downloads 8 Views