Abstract
Background:
An increasing number of individuals with type 1 diabetes (T1D) manage glycemia with insulin pumps containing short-acting insulin. If insulin delivery is interrupted for even a few hours due to pump or infusion site malfunction, the resulting insulin deficiency can rapidly initiate ketogenesis and diabetic ketoacidosis (DKA).
Methods:
To detect an event of accidental cessation of insulin delivery, we propose the design of ketone-based alert system (K-AS). This system relies on an extended Kalman filter based on plasma 3-beta-hydroxybutyrate (BOHB) measurements to estimate the disturbance acting on the insulin infusion/injection input. The alert system is based on a novel physiological model capable of simulating the ketone body turnover in response to a change in plasma insulin levels. Simulated plasma BOHB levels were compared with plasma BOHB levels available in the literature. We evaluated the performance of the K-AS on 10 in silico subjects using the S2014 UVA/Padova simulator for two different scenarios.
Results:
The K-AS achieves an average detection time of 84 and 55.5 minutes in fasting and postprandial conditions, respectively, which compares favorably and improves against a detection time of 193 and 120 minutes, respectively, based on the current guidelines.
Conclusions:
The K-AS leverages the rapid rate of increase of plasma BOHB to achieve short detection time in order to prevent BOHB levels from rising to dangerous levels, without any false-positive alarms. Moreover, the proposed novel insulin-BOHB model will allow us to understand the efficacy of treatment without compromising patient safety.
Introduction
Rapid advances in the development and implementation of automated insulin delivery (AID) systems for people with type 1 diabetes (T1D) have yielded marked improvements in glycemic outcomes. 1 Despite these advances, interruption of insulin delivery for even a few hours due to pump or infusion site malfunction can rapidly initiate ketogenesis, hyperketonemia, and diabetic ketoacidosis (DKA). An event of DKA can be dangerous or even fatal, thus continuing to be a challenge to the health and safety of those living with T1D.2-5
A common cause of unintentionally missed insulin in patients with T1D using an AID system is pump or infusion site malfunction, 6 which can be caused by mechanical defects 7 or kinking, occlusion, and displacement.8,9 This occurs frequently; for example, data from the T1D Exchange clinic registry demonstrated 17 device-related adverse events out of 124 subjects, including severe hyperglycemia with plasma 3-beta-hydroxybutyrate (BOHB) levels greater than 0.6 mmol/L or accompanied by symptoms of nausea, vomiting, or abdominal pain in only one year.10,11 Eleven of these events were attributable to infusion set issues. After such unintentional cessation of insulin delivery, ketosis can occur rapidly; for example, experimental cessation of delivery of lispro insulin resulted in ketosis as early as 180 minutes later, with BOHB levels rising above 0.4 mmol/L and to greater than 0.6 mmol/L at 240 minutes. 12
A continuous ketone monitor (CKM) can be integrated into an AID system with the aim of detecting an event of accidental cessation of insulin delivery during continuous subcutaneous insulin infusion (CSII) therapy. We propose the design of alert system relying on an extended Kalman filter (EKF) that uses noisy plasma BOHB measurements to estimate the disturbance acting on the insulin injection input. The EKF was chosen as the observer because it supports a real-time model for making estimates of the current plasma ketone state. The EKF design is based on a novel pharmacokinetic (PK) model capable of simulating the ketone dynamics in response to a change in the insulin state.
Although several compartmental models have been developed to account for ketone body kinetics in healthy humans based on clinical data,13,14 glucose and ketone body turnover in individuals with T1D remains open research questions.
Previous work to develop a simulation tool for a sample of people with diabetes involved creating a pediatric diabetes simulation incorporating both blood glucose (BG) and urine ketones as outputs. 15 We now use blood BOHB measurements as they change more rapidly in response to insulin deficiency and well as insulin repletion than urine ketone measurements, which detect acetoacetate that reflects an average of urine ketone concentration over hours since the last void. 16
Automatic methods for the detection of insulin pump malfunction have been reported in the literature using model-based fault detection techniques relying on BG values, meal announcements, and injected insulin information.17-23 To the best of our knowledge, no prior work has used blood ketone measurements directly in a strategy to detect insulin pump malfunction.
The parameters of the proposed PK model are obtained and validated by leveraging previous published works in which the time course of ketosis development has been assessed using sequential measurements of plasma ketones after discontinuation of insulin pump therapy,24,25 by computing root mean square error (RMSE) to determine the prediction errors.
The performance of the ketone-based alert system (K-AS) is demonstrated on 10 in silico subjects from the United States Food and Drug Administration-accepted University of Virginia (UVA)/Padova T1D Metabolic Simulator 26 using two real-life use-case scenarios, simulating the condition when the insulin is delivered by the pump but not received by the user.
Methods
We propose a physiological-based model to describe the ketone-insulin system. The model connects the ketone concentration in the plasma
with
Ketone production, utilization, and elimination terms are a sum of two components: a basal term, representing the constant rates when the plasma insulin concentration is at its basal value, and the alteration in the rates of change in the insulin signal.
The utilization rate
with
Endogenous ketone production
with
The inflow to the insulin plasma compartment is determined by the injected insulin
where
K-AS for Pump Failure
An EKF insulin observer was developed by combining Equation 1 with Equations 2 to 3. To obtain an estimate of
The continuous-time model was discretized using forward Euler integration, obtaining the associated discrete-time state-space equations. The model sampling time
where
where
Additional information comes from Rawlings and Risbeck 29 on the propagation and update of the state vectors at each time instant.
Since continuous plasma ketones cannot yet be measured in real time, the EKF design assumes that the unknown ketone measurements of the system are provided by a hypothetical ketone sensor that can perform continuous monitoring of ketone levels. The estimated disturbance

Advisory scheme for “pump occlusion” event detection (ie, insulin is delivered by the pump but not received by the user). An extended Kalman filter uses noise plasma ketone measurements to estimate the disturbance acting on the insulin injection input (d). The estimated disturbance
Performance Metrics
We evaluated the performance of the proposed K-AS through in silico studies using 10 in silico adult subjects in the UVA/Padova simulator.
26
Simulations were 24 hours in duration, starting at midnight with a 30-g carbohydrate meal at 8
Two different scenarios were designed to assess the performance of the proposed K-AS during overnight fasting and post-prandial conditions:
Scenario A: the insulin delivery is suspended starting from 3
Scenario B: the insulin delivery is suspended starting from 8
Scenario A represents a critical condition because individuals do not usually check glucose or ketone levels during the night; moreover, the overnight period is characterized by a natural increase in BOHB levels 3 during the fasted state, and generally reductions in insulin levels. Furthermore, with interruption of insulin delivery, due to fasting, BG levels may not rise sufficiently to generate an alarm and detection of the CSII malfunction may be delayed. Furthermore, the rate of rise in BOHB in response to an interruption in insulin delivery is faster than the rate of rise in glucose levels. 31 Scenario B aims to simulate a CSII interruption, which causes non-delivery of a meal bolus; in this setting, the occlusion can be hidden by the expected increase in BG in response to the meal intake.
When the occlusion is detected, an alert is raised and the nominal insulin correction bolus is administered at the time of the detection, with the assumption that CSII is resumed at the time of the detection. The nominal insulin correction bolus is computed as:
where G [mg/dL] is the BG concentration;
We proceeded to compare the results achieved by the proposed K-AS against the likely delayed responses obtained from an alert action based on the current guidelines32,33 (G-AS). According to general practice recommendations, individuals with T1D are advised to check their postprandial BG (or continuous glucose monitoring [CGM]) two to three hours after the start of a meal and then administer a correction insulin dosage aimed at reducing postprandial BG levels to <180 mg/dL.32,34 In fasting conditions, individuals with T1D are recommended to maintain their BG (CGM) levels below either 140 or 180 mg/dL, depending on the intensity of their management. 33 The higher threshold can be chosen to reduce the risk of hypoglycemic event in the overnight period.
Performance metrics include the time to detection
Results
We identified the parameters for the kinetic model of ketone production, utilization, and elimination using the data reported in Miles et al 24 and validated our model by comparing the model predictions with the available plasma BOHB levels reported in Orsini-Federici et al. 25 To validate our model, we replicated the protocols using the 10 adults from the UVA/Padova simulator. 26 The simulated protocols included a preliminary fasting period, followed by a period of insulin deprivation with the administration of a subcutaneous bolus at the end, followed by resumption of the usual basal insulin infusion.
For each participant reported in Orsini-Federici et al,
25
the median and interquartile range (IQR) of the estimated plasma ketone levels are presented in Figure 2. It is observed that the estimates of the

Median of estimated plasma ketone levels from the model (blue) with the individual plasma ketone levels (orange) from Orsini-Federici et al. 25 Interquartile ranges of the model predictions of plasma ketone levels are reported in light blue.
K-AS for Pump Failure
Individual and population metrics are reported for Scenario A and B in Tables 1 and 2, respectively, as well as the obtained P-values using the non-parametric Wilcoxon rank-sum test. Figures 3 and 4 present the median and the IQR of the plasma BOHB and BG levels for Scenarios A and B, respectively.
Scenario A.
Individual values, medians, and P-values of performance metrics. Performance metrics include the time to detection for ketone-based alert system,
Abbreviations: IQR, interquartile range; BOHB, 3-beta-hydroxybutyrate.
Scenario B.
Individual values, medians (IQR), and P-values of performance metrics. Performance metrics include the time to detection for ketone-based alert system,
Abbreviation: IQR, interquartile range.

Scenario A. Median and interquartile ranges of (upper panel) ketone levels and (lower panel) blood glucose, in case of K-AS in blue, guideline-based alert with blood glucose threshold value of 140 mg/dL (G-AS140) in orange, and guideline-based alert with blood glucose threshold value of 180 mg/dL (G-AS180) in green.

Scenario B. Median and interquartile ranges of (upper panel) plasma ketone levels and (lower panel) blood glucose levels, in case of K-AS in blue, and guideline-based alert with alert two hours after meal intake if blood glucose value is higher than 180 mg/dL (G-AS) in orange.
As shown in Figure 3, following the basal insulin suspension at 3
The improvement in the performance is more evident when analyzing the simulation results of Scenario B, which aims to simulate an interruption of insulin delivery at 8
Discussion
Since CKM is now a demonstrated technology,16,30 although not yet clinically available, we aimed to show how CKM can be used in the future in protective systems to prevent episodes of hyperketonemia and DKA in people with T1D using CSII systems. Insulin pump occlusions are not necessarily noted immediately, as it takes time to build up sufficient back pressure until an occlusion is detected by internal checks followed by alerts to the user. 6 However, an early detection based on the metabolic consequences of interruption to insulin delivery might prevent subsequent hyperglycemia and potential development of DKA.
With an average basal rate of 1.0 U/h, pump systems detected the occlusion after approximately two to three hours. If a lower basal rate than 1.0 U/h is used, even longer times are to be expected. 37 Currently, the detection of malfunctioning events in CSII therapy has been investigated by leveraging CGM by several groups, such as detecting set failures with a glucose threshold. Rojas et al 38 used bivariate classification based on the last two hours’ mean glucose slope. Cescon et al 39 proposed a combination of both a rising trend in average daily CGM readings along with increasing daily doses of insulin. Facchinetti et al 19 used a linear observer to generate the residual signals, indicating the presence of faults.
A K-AS for occlusion detection can achieve shorter detection times without any or minimal false alarms, becoming an important feature of the next generation of AID systems. To achieve more accurate detection, it would be important to include the impact of additional external factors, such as counterregulatory hormones, insulin resistance, and medications, including SGLT2 inhibitors, which can alter ketone body kinetics. 40 Moreover, the proposed insulin-ketone model represents an opportunity for manual insulin correction bolusing in response to elevated ketone concentrations to achieve the shortest time to lower the BOHB levels while not causing hypoglycemia. Future work is needed to quantify the impact that the lag of the novel CKM technology has on the detection of an event of accidental cessation of insulin delivery. The proposed EKF algorithm is modular and can easily be expanded to include estimates for interstitial BOHB measurement by adding an additional compartment that can be used to represent the ketone diffusion process between the plasma BOHB and the interstitial BOHB concentration.41,42 Moreover, the EKF scheme can be used for real-time personalization of the population-level estimates of the production, utilization, and elimination rates of the ketone bodies, by using the EKF to estimate deviations from the population-level estimates. 28
Conclusion
We proposed a novel PK model that describes the alterations in the rates of production and utilization of plasma BOHB, the main ketone body predictive of progression to DKA. The simulation capabilities of the proposed model were validated by comparing the simulated traces with clinical data available in the literature. It is important to note that the proposed validation approach aims to verify that the model reproduces observed system behavior evidenced by available input-output experiments. To achieve a rigorous validation of the structure and parameter values, a future clinical protocol, including tracer administration, is needed to accurately estimate the ketone body flux in vivo.
Moreover, we propose a potential integration of a CKM into an AID system by designing an alert system able to detect events of accidental cessation of insulin delivery. Simulation scenarios were designed to mimic realistic and potentially critical situations. The K-AS leverages the faster rate of rise of plasma BOHB to achieve a shorter detection time than waiting for the development of clinically important hyperglycemia in response to insulin attenuation and prevents BOHB levels from rising to dangerous levels, without false-positive alarms.
Footnotes
Acknowledgements
Access to the academic version of the UVA/Padova Metabolic Simulator was provided by an agreement with Prof. C. Cobelli (University of Padova) and Prof. B. P. Kovatchev (University of Virginia) for research purposes.
Abbreviations
AID, automated insulin delivery; BG, blood glucose; BOHB, 3-beta-hydroxybutyrate; CGM, continuous glucose monitoring; CKM, continuous ketone monitoring; CSII, continuous subcutaneous insulin infusion; DKA, diabetic ketoacidosis; EKF, extended Kalman filter; G-AS, guideline-based alert system; IQR, interquartile; K-AS, ketone-based alert system; PK, pharmacokinetic; RMSE, root mean-square error; T1D, type 1 diabetes.
Author Contributions
E.M.A. and F.J.D. conceived and designed the pharmacokinetic model and the ketone-based alert system. E.M.A. performed the analysis and wrote the original draft of the manuscript. L.M.L. and M.-E.P. contributed to the design of the research, to the analysis of the results, and to revision of the manuscript. F.J.D. revised the manuscript, acquired funding, and administered the project.
Declaration of Conflicting Interests
The author(s) declared the following potential conflicts of interest with respect to the research, authorship, and/or publication of this article: F.J.D. reports licensed IP to Insulet, Roche, and Dexcom. L.M.L. reports grant support to her institution from NIH, JDRF, Helmsley Charitable Trust, Eli Lilly and Company, Insulet, Dexcom, and Boehringer Ingelheim; she receives consulting fees unrelated to the current report from NovoNordisk, Roche, Dexcom, Insulet, Boehringer Ingelheim, Medtronic, Laxmi, Vertex, and Provention. M.-E.P. reports receiving grant support, provided to her institution, from NIH, Helmsley Charitable Trust, Chan Zuckerberg Foundation, and Dexcom, patents related to hypoglycemia and pump therapy for hypoglycemia, and advisory board fees unrelated to the current report from Fractyl. E.M.A is currently with University of Trento, Italy, and this work was done when she was with Harvard University. F.J.D is currently with Brown University, USA, and this work was done when he was with Harvard University.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This study was funded by a grant from the Leona M. and Harry B. Helmsley Charitable Trust (grant no. 2018PG-TID06). L.M.L. and M.-E.P. were also supported in part by a grant from the National Institutes of Health (grant no. P30DK036836).
