OBJECTIVE—The purpose of this study was to introduce a novel meal detection algorithm (MDA) to be used as part of an artificial β-cell that uses a continuous glucose monitor (CGM).

RESEARCH DESIGN AND METHODS—We developed our MDA on a dataset of 26 meal events using records from 19 children aged 1–6 years who used the MiniMed CGMS Gold. We then applied this algorithm to CGM records from a DirecNet pilot study of the FreeStyle Navigator continuous glucose sensor. During a research center admission, breakfast insulin was withheld for 1 h, and discrete glucose levels were obtained every 10 min after the meal.

RESULTS—Based on the Navigator readings, the MDA detected a meal at a mean time of 30 min from the onset of eating, at which time the mean serum glucose was 21 mg/dl above baseline (range 2–36 mg/dl), and >90% of meals were detected before the glucose had risen 40 mg/dl from baseline.

CONCLUSIONS—The MDA will enable automated insulin dosing in response to meals, facilitating the development of an artificial pancreas.

The development of an artificial β-cell is a challenging task that has drawn together different disciplines within engineering, science, and medicine for the past 30 years (1). In the most likely scenario, the subject is connected to both a continuous subcutaneous insulin infusion system and a continuous glucose monitor (CGM). The loop is “closed” inside a computer/personal data manager by software that regulates the glucose level by changing the insulin infusion rate of the pump. The success of such an artificial β-cell depends on the following: 1) predictive mathematical models of patients that can mimic glucose absorption secretion and insulin action (e.g., the pharmacokinetic/pharmacodynamic models in refs. 2 and 3); 2) reliable and accurate sensors that transmit real-time glucose measurements; 3) automated insulin pumps that can be controlled by software; and 4) a controller (algorithm) that can regulate glucose by changing the infusion rate based on sensor glucose measurements. A variety of controllers that are capable of regulating glucose can be found in the literature. Several are based on mathematical models and designed as proportional integral derivative or model predictive control (47); others are based on fuzzy logic (8). However, as was noted by Hovorka et al. (9), a number of challenges remain to be solved before the artificial β-cell is realized: one of the critical challenges is the regulation of glucose levels after a meal (10). The meal challenge can be met, in principle, by three different approaches. The first one is the feed-forward control approach in which the user of the artificial β-cell will inform the controller that a meal is occurring (or is about to occur) by clicking a button, thus initiating an insulin bolus. The second way is to rely strictly on feedback control, whereby the algorithm will respond only after a sufficiently large rise in glucose has occurred. This particular strategy has proven difficult in practice owing to the tradeoff between the need to respond quickly due to the delay in insulin absorption and the need to have a conservative scheme that does not deliver an overdose of insulin. The third approach is discrete meal detection; this will trigger an insulin bolus as part of an algorithm using continuous feedback from a CGM. One can envision that the first and third schemes could be combined, such that the discrete meal detection algorithm is a failsafe mode for a patient-initiated feed-forward scheme. This article details a reliable meal detection suite of solutions that was validated with historical CGM and can be implemented as part of an artificial β-cell controller.

Meal-related glucose excursions were initially assessed using the data from 26 meal events when subjects were wearing a MiniMed Gold CGM (Medtronic Diabetes, Northridge, CA) and had marked the onset of a meal. These records were obtained from 19 children aged 1–7 years (mean age 5 years) who were participating in an outpatient study (11). The data presented here were taken from a DirecNet pilot study (a complete list of the participating centers and investigators can be found in the appendix) of the FreeStyle Navigator real-time continuous subcutaneous glucose sensor (Abbott Diabetes Care, Alameda, CA) (12), which is currently an investigational device. This study of 30 children with type 1 diabetes treated with insulin infusion pump therapy included a clinical research center (CRC) admission. All subjects aged >8 signed an assent, and all parents signed a consent approved by the institutional review board at each participating DirecNet center. Twenty-one of the subjects had their breakfast dose of insulin withheld for 1 h to induce a rapid increase in blood glucose levels. Some children did not undergo this test because of their weight and the amount of previous blood sampling. For those participating in the meal challenge, blood samples were obtained every 10 min for 1 h after completion of breakfast. All subjects had been admitted to the CRC the previous day, and all were wearing a FreeStyle Navigator continuous glucose sensor that was recording interstitial blood glucose levels every minute. The average age of the subjects was 11 ± 4 years (range 4–17 years), and 40% were girls. Mean duration of diabetes was 6 ± 3 years. Mean A1C was 7.1 ± 0.6%.

Rate of change calculation

The glucose rate of change (ROC) is estimated by two different methods; both are based on real-time glucose measurements sampled at 1-min intervals. The first approach is a calculation of glucose ROC using a three-point (current and two previous samples) backward difference (13):


where G is the glucose measurement, t is time, Δt is the time difference between two sample intervals, and the subscripts i, i−1, and i−2 are the current and two previous samples, respectively.

The second approach is based on optimal estimation theory, using a Kalman filter (14,15), an established method that has been used as part of different algorithms in the context of glucose management such as the following: hypoglycemic/hyperglycemic prediction (16,17), improved glucose monitoring (18,19), and feedback control (7). This method assumes that the glucose sensor signal varies primarily through two contributions: 1) real changes to the underlying glucose value (gk) and 2) measurement noise (vk). Hence, the glucose can be expressed in terms of its ROC (dk):


such that the value at time k + 1 is the value at the previous time-step k plus the ROC. Similarly, the ROC can be expressed in terms of the rate in the previous time step plus the acceleration or the ROC of the ROC (fk):


where the acceleration term is a stochastic signal that is changed by a random amount that can be interpreted as process noise (wk):


where wk has a mean value of 0 and a covariance of Q. The glucose measurement is corrupted by random measurement noise with zero mean and covariance R:


Equations 25 can be written in matrix-vector form as

\[\ \left[\ \begin{array}{l}g\\d\\f\end{array}\ \right]_{k{+}1}{=}\ \left[\ \begin{array}{lll}1&1&0\\0&1&1\\0&0&1\end{array}\ \right]\ \left[\ \begin{array}{l}g\\d\\f\end{array}\ \right]_{k}{+}\ \left[\ \begin{array}{l}0\\0\\1\end{array}\ \right]w_{k}\]
\[G_{k}{=}{[}1\ 0\ 0{]}\ \left[\ \begin{array}{l}g\\d\\f\end{array}\ \right]_{k}{+}v_{k}\]

Equations 6 and 7 are commonly called discrete state space models, and the following notation is commonly used in the systems and control literature:


where x is a vector of states and y is the measured output. In this application, the matrices and vectors have the following values:

\[{\Phi}{=}\ \left[\ \begin{array}{lll}1&1&0\\0&1&1\\0&0&1\end{array}\ \right],\ {\Gamma}^{w}{=}\ \left[\ \begin{array}{l}0\\0\\1\end{array}\ \right],\ C{=}{[}1\ 0\ 0{]},\ x{=}\ \left[\ \begin{array}{l}g\\d\\f\end{array}\ \right],\ y{=}G\]

Because both the measurement and process noise are considered stochastic processes, their unknown covariances can be used as the tuning parameters. Hence, the tuning parameter used is related to the ratio of the expected process to sensor noise variance (Q/R = 5 × 10−6). The states are estimated using a predictor corrector equation of the form


where is the estimation of the states; the subscript k|k−1 indicates the estimation at time step k using the previous value; the process model is transformed using the standard notation (Φ, Γ, and C); and L is the Kalman gain. More details on the use of Kalman estimation in general and in the context of diabetes can be found in refs. 1416.

The best estimate, at the current sample time, of the states (glucose, ROC of glucose, and ROC of the ROC of glucose) is

\[\ \left[\ \begin{array}{l}{\hat{g}}\\{\circ{d}}\\{\circ{f}}\end{array}\ \right]_{k{\vert}k}{=}{\bigcirc}_{k{\vert}k}\]

In the discussion that follows, we will simply refer to these estimated states as G, G′, and G″; that is, at any sample time

\[\ \left[\ \begin{array}{l}G\\G{^\prime}\\G{^{\prime\prime}}\end{array}\ \right]{=}\ \left[\ \begin{array}{l}{\hat{g}}\\{\circ{d}}\\{\circ{f}}\end{array}\ \right]_{k{\vert}k}\]

Detection algorithm

The proposed algorithm for meal detection is divided into five stages as illustrated in the flowchart in Fig. 1 and detailed below (20):

  1. The first stage is data acquisition, in which the last 5-min reading from the CGM is conveyed to the algorithm. These data are processed in parallel by a ROC component and a Kalman filter estimation algorithm.

  2. In the second stage, the ROC estimation can be broken down into 1) backward difference ROC calculation based on the raw data, 2) backward difference estimation based on the glucose estimation from the Kalman filter (backward difference and Kalman), 3) Kalman filter estimation of glucose (G) and the ROC (G′) (Kalman), and 4) the Kalman estimate of the ROC of the ROC (G″). Thus, four separate inferences of the actual ROC are generated.

  3. The estimated ROC is compared with a threshold value that corresponds to a meal-related rise in glucose and is screened using multiple heuristics to minimize false-positive detections. We have identified four design variables that can be tuned according to individual subjects: 1) a glucose ROC threshold (1.8–3 mg/dl-min); 2) a maximum glucose ROC (2–5 mg/dl-min); 3) a glucose threshold (150–220 mg/dl); and 4) an acceleration threshold (0.4–0.8 mg/dl per min2). A secondary screening condition to minimize noise artifacts is the requirement that the glucose values will increase monotonically. As a safety interlock measure, a meal declaration will not be issued if such a declaration is issued 15–20 min earlier, and a night safety condition prevents any meal announcement during the night. This condition can be adjusted for the lifestyle of an individual patient. These safety layers can minimize false detections and lead to a more reliable automated system.

  4. A voting algorithm is implemented to minimize the risk of an unnecessary insulin bolus. A meal flag will be sent only if two of three methods or three of four methods consistently detect a meal in the same 5-min time window.

  5. Finally, the controller will receive a meal flag and/or the algorithm will reset for the next data point.


Kruskal-Wallis one-way ANOVA on ranks was used to assess significance of the mean time from onset of the meal and the mean increase in glucose values from baseline when a meal was recognized by the four proposed algorithms (SigmaStat, SYSTAT, San Jose, CA).

The results from the 17 subjects admitted to the CRC as part of the DirecNet study (21) are summarized in Table 1. Subjects consumed an average of 56 g of carbohydrate for breakfast (range 22–105 g). The table details, for each meal detection method, the time it took to detect the meal (ΔT) and how much the glucose had increased from baseline when the meal was detected (ΔG). An example of meal detection is provided in Fig. 2. In this example, the four different methods succeeded in detecting the breakfast meal within <20 min of the onset of that meal, and there was a <22 mg/dl increase of the glucose from the preprandial value. In this figure a false-positive meal detection is seen, where G″ detected a meal before breakfast. The voting scheme, however, would have prevented this from being a false-positive event. In Table 1 the meal detection time for each of the voting schemes (three-out-of-four and two-out-of-three methods) is denoted for each of the 17 breakfast meals. Using a voting scheme of three-out-of-four, the overall mean detection time from all datasets was 32 min with a mean increase in the serum glucose of 21 ± 9 mg/dl from the onset of eating. Using a voting scheme of two-out-of-three, the mean detection time was 30 min with a mean increase in the serum glucose of 15 ± 10 mg/dl from the onset of eating.

A summary of the results showing how well the “challenge” breakfast meal was detected in all 17 cases by the four different methods is presented in Table 1 and Fig. 3. The average detection time from the onset of the challenge meal was 29, 35, 31, and 30 min, respectively (Table 1), for the backward difference, Kalman, backward difference and Kalman, and G″ algorithms, and the average detection time from the end of the meal was 11, 18, 13, and 12 min, respectively. The glucose only increased by a mean of 2 mg/dl from the onset of the meal to the completion of the meal, despite a mean of 17 min to complete a meal. One can infer from Fig. 3 that the Kalman estimation is more conservative than the other methods. This is a result of how the Kalman filter was tuned and, in our opinion, is beneficial in improving the robustness of the voting scheme and providing an additional layer of safety. A second critical factor is the increase in glucose by the time of meal detection. This information is presented in Fig. 3, which shows that 100, 94, 100, and 94% of meals were detected before a 40 mg/dl increase in the glucose using the backward difference, Kalman, backward difference and Kalman, and G′ methods, respectively, and 94, 59, 100, and 94% of meals were detected before a 30 mg/dl increase in the glucose using the respective methods.

Meal detection is a critical and enabling component of a control algorithm for an artificial β-cell. Independent of whether one uses a proportional integral derivative, model predictive control, or another control algorithm, the ability to have an automated meal announcement that does not require patient input is an important factor. In reviewing the literature, we were unable to find another article in the medical or engineering literature that specifically addressed the issue of meal detection by using a continuous glucose sensor. We therefore evaluated meal detection algorithms using a FreeStyle Navigator that measures interstitial glucose. In addition, the insulin bolus for breakfast was delayed by 1 hour, allowing us to evaluate the ROC of glucose values following a meal without the confounding effects of an insulin bolus at the time of the meal. The content of the breakfast meals was decided by the study subject, and these meals varied significantly in their composition and grams of carbohydrate, as would occur in their home environment. These conditions therefore mimic the expected conditions for recognizing a meal in a fully closed-loop artificial β-cell.

A critical element of a meal detection algorithm is minimization of the time between the actual meal and the detection flag. This depends on a variety of factors including the meal composition, the time it took to consume the meal, insulin on board, and the amount of noise in the data. Using our algorithm that employed a voting scheme of two-out-of-three methods to detect a meal, the mean detection time from the onset of the meal was 30 min and the mean increase in the serum glucose was only 15 mg/dl. It is our impression that this algorithm combined with a rapid-acting insulin will provide the means to prevent significant postprandial hyper- and hypoglycemia in a closed-loop system, but this theory remains to be tested.

The DirecNet Study Group clinical centers (listed in alphabetical order with clinical center name, city, and state. Personnel are listed as principal investigator [PI], coinvestigator [I], and coordinators [C]). 1) Barbara Davis Center for Childhood Diabetes, University of Colorado, Denver, CO: Peter Chase (PI), Rosanna Fiallo-Scharer (I), Laurel Messer (C), and Barbara Tallant (C); 2) Department of Pediatrics, University of Iowa Carver College of Medicine, Iowa City, IA: Eva Tsalikian (PI), Michael J. Tansey (I), Linda F. Larson (C), Julie Coffey (C), and Joanne Cabbage (C); 3) Nemours Children's Clinic, Jacksonville, FL: Tim Wysocki (PI), Nelly Mauras (I), Larry A. Fox (I), Keisha Bird (C), and Kim Englert (C); 4) Division of Pediatric Endocrinology and Diabetes, Stanford University, Stanford, CA: Bruce A. Buckingham (PI), Darrel M. Wilson (I), Jennifer M. Block (C), Paula Clinton (C), and Kimberly Caswell; 5) Department of Pediatrics, Yale University School of Medicine, New Haven, CT: Stuart A. Weinzimer (PI), William V.Tamborlane (I), Elizabeth A. Doyle (C), Heather Mokotoff (C), and Amy Steffen (C). Coordinating center: Jaeb Center for Health Research, Tampa, FL: Roy W. Beck, Katrina J. Ruedy, Craig Kollman, Dongyuan Xing, Andrea Kalajian, and Cynthia R. Stockdale. University of Minnesota Central Laboratory: Michael W. Steffes, Jean M. Bucksa, Maren L. Nowicki, Carol A. Van Hale, and Vicky Makky. National Institutes of Health: Gilman D. Grave, Barbara Linder, and Karen K. Winer. Data and Safety Monitoring Board: Dorothy M. Becker, Christopher Cox, Christopher M. Ryan, Neil H. White, and Perrin C. White.

This work was supported by the Juvenile Diabetes Research Foundation through the artificial pancreas project (grant 22-2006-1108) and by the National Institutes of Health (grant R21-DK69833).

Hovorka R: Continuous glucose monitoring and closed-loop systems.
Diabet Med
Dalla Man C, Camilleri M, Cobelli C: A system model of oral glucose absorption: validation on gold standard data.
IEEE Trans Biomed Eng
Man CD, Toffolo G, Basu R, Rizza RA, Cobelli C: A model of glucose production during a meal. In
Conference Proceedings: Annual International Conference of the IEEE Engineering in Medicine and Biology Society.
Piscataway, NJ, IEEE Engineering in Medicine and Biology Society,
, p.
Marchetti G, Barolo M, Jovanovič L, Zisser H, Seborg DE: An improved PID switching control strategy for type 1 diabetes. In
Conference Proceedings: Annual International Conference of the IEEE Engineering in Medicine and Biology Society.
Piscataway, NJ, IEEE Engineering in Medicine and Biology Society,
, p.
Palerm CC, Zisser H, Bevier WC, Jovanovič L, Doyle FJ III: Prandial insulin dosing using run-to-run control: application of clinical data and medical expertise to define a suitable performance metric.
Diabetes Care
Steil GM, Rebrin K, Darwin C, Hariri F, Saad MF: Feasibility of automating insulin delivery for the treatment of type 1 diabetes.
Parker RS, Doyle FJ III, Peppas NA: A model-based algorithm for blood glucose control in type I diabetic patients.
IEEE Trans Biomed Eng
Grant P: A new approach to diabetic control: fuzzy logic and insulin pump technology.
Med Eng Phys
Hovorka R, Wilinska ME, Chassin LJ, Dunger DB: Roadmap to the artificial pancreas.
Diabetes Res Clin Pract
Bequette BW: A critical assessment of algorithms and challenges in the development of a closed-loop artificial pancreas.
Diabetes Technol Ther
Gandrud LM, Xing D, Kollman C, Block JM, Kunselman B, Wilson DM, Buckingham BA: The Medtronic MiniMed Gold continuous glucose monitoring system: an effective means to discover hypo- and hyperglycemia in children under 7 years of age.
Diabetes Technol Ther
Wilson DM, Beck RW, Tamborlane WV, Dontchev MJ, Kollman C, Chase P, Fox LA, Ruedy KJ, Tsalikian E, Weinzimer SA, the DirecNet Study Group: The accuracy of the FreeStyle Navigator continuous glucose monitoring system in children with type 1 diabetes.
Diabetes Care
Riggs. JB:
An Introduction to Numerical Methods for Chemical Engineers.
Lubbock, Texas Tech University Press,
Stengel RF:
Optimal Control and Estimation.
New York, Dover Publications,
Bequette BW: Optimal estimation applications to continuous glucose monitoring. In
Proceedings of the American Control Conference.
Vol. 1. Boston, MA, IEEE,
, p.
Palerm CC, Willis JP, Desemone J, Bequette BW: Hypoglycemia prediction and detection using optimal estimation.
Diabetes Technol Ther
Sparacino G, Zanderigo F, Corazza S, Maran A, Facchinetti A, Cobelli C: Glucose concentration can be predicted ahead in time from continuous glucose monitoring sensor time-series.
IEEE Trans Biomed Eng
Kuure-Kinsey, Cutright R, Bequette BW: Computationally efficient neural predictive control based on a feedforward architecture. In
Proceedings of the American Control Conference
, Minneapolis, MN, IEEE,
, p.
Knobbe EJ, Buckingham B: The extended Kalman filter for continuous glucose monitoring.
Diabetes Technol Ther
Dassau E, Bequette BW, Palerm CC, Buckingham BA, Gandrud LM, Doyle FJ III: Detection of a meal using continuous glucose monitoring (CGM), implications for model predictive control using a real-time CGM.
56 (Suppl. 1)
The Diabetes Research in Children Network (DirecNet) Study Group: Impact of exercise on overnight glycemic control in children with type 1 diabetes mellitus.
J Pediatr

Published ahead of print at http://care.diabetesjournals.org on 31 October 2007. DOI: 10.2337/dc07-1293.

B.W.B. serves on the Scientific Advisory Board of Ultradian Diagnostics. B.A.B. has received honoraria as a speaker for Abbott Diabetes Care.

The costs of publication of this article were defrayed in part by the payment of page charges. This article must therefore be hereby marked “advertisement” in accordance with 18 U.S.C. Section 1734 solely to indicate this fact.