Multivariable artificial pancreas method and system
Methods and modules for using physiological (biometric) variables to advance the state of the artificial pancreas. The method and system includes one or more modules for recursive model identification, hypoglycemia early alert and alarm, adaptive control, hyperglycemia early alert and alarm, plasma insulin concentration estimation, assessment of physical activity (e.g., presence, type, duration, expected effects on insulin sensitivity and GC), detection of acute stress and assessment of its impact on insulin sensitivity, detection of sleep and its stages and assessment of sleep stages on GC, sensor fault detection and diagnosis, software and controller performance evaluation and adjustment and/or pump fault detection and diagnosis.
Latest ILLINOIS INSTITUTE OF TECHNOLOGY Patents:
 APPARATUS AND METHODS FOR MANUFACTURING HIGHDENSITY COIL WITH FORMED COOLING CHANNELS
 Alkane activation with single and bimetallic catalysts
 Apparatus and method for enhanced early photon detection in optical projection tomography
 TRANSITION METAL MXENE CATALYSTS FOR CONVERSION OF CARBON DIOXIDE TO HYDROCARBONS
 METHOD AND APPARATUS FOR STIMULATION OF CELLS FOR TISSUE REPAIR
This application claims the benefit of U.S. Provisional Application Ser. No. 62/169,947, filed on 2 Jun. 2015. The copending Provisional Application is hereby incorporated by reference herein in its entirety and is made a part hereof, including but not limited to those portions which specifically appear hereinafter.
GOVERNMENT SUPPORTThis invention was made with government support under 1DP3DK10107701 and 1DP3DK10107501 awarded by the National Institutes of Health. The government has certain rights in the invention.
FIELD OF THE INVENTIONThis invention relates generally to artificial pancreas (AP) that can regulate glucose concentrations (GC) without manual inputs from a patient with Type 1 diabetes (T1D). Major factors that cause variations in GC include meals, physical activity, acute stress and sleep.
BACKGROUND OF THE INVENTIONPatients with Type 1 diabetes (T1D) must receive insulin from external sources in order to regulate their blood glucose concentration (BGC). Excess glucose in the blood can damage the blood vessels. This leads to several complications such as cardiovascular disease, damage to kidneys, nerves, and eyes, and difficulty in wound healing. Diabetes is the fastest growing longterm disease that affects millions of people worldwide. Diabetes affects 25.8 million people in United States and about 5% of diabetes cases are T1D in adults. Diabetes is considered to be the seventh leading cause of death in the United States and the cost of diabetes to the nation has been estimated to be $174 billion in 2007.
Most patients with T1D either administer multiple (35) daily insulin injections (MDI) or use insulin pumps for continuous subcutaneous insulin infusion (CSII). In CSII, basal insulin is infused continuously and bolus insulin is administered before meals to maintain BGC in the target range (70180 mg/dl). T1D patients may experience hypoglycemia (BGC≤70 mg/dl) episodes that may be caused by insulin doses that are too large in relation to the BGC, reduced food intake, extensive physical activity, or slow absorption of currently available “fast acting” insulins. Hypoglycemia causes dizziness, unconsciousness, and seizures and if untreated diabetic coma or death. Fear of hypoglycemia is prevalent among patients with T1D and a concern in use of insulin pumps.
An artificial pancreas (AP) will automate insulin pumps by using a controller that receives information from sensors, computes the optimal insulin amount to be infused and manipulates the infusion rate of the pump. Fear of hypoglycemia is a major concern when the insulin infusion rate is under automatic control. An AP that can predict BGC accurately and compute infusion rates that will keep BGC in the target range without causing hypoglycemia would be very beneficial. Control systems that minimize the information to be entered by the user to the AP such as meal and exercise information would make life easier for patients with T1D.
Various control strategies such as proportionalintegral derivative (PID) control, model predictive control (MPC), fuzzy logic control, and generalised predictive control (GPC) have been proposed for the regulation of BGC in patients with T1D. Furthermore, a bihormonal system (insulin+glucagon) that uses PID, MPC, and GPC has also been investigated. Complexity of glucose homeostasis and the current level of technology prevents tight BGC regulation. BGC dynamics are subject specific and time varying. Since a single good model that describes BGC dynamics of individuals does not exist, models have to be developed based on measurements from individuals. A single model based on some training data is not sufficient for controller design since BGC dynamics are time varying for each individual. Also a model based on data from one person would not be suitable for representing the BGC dynamics of another person. Recursive timeseries models were shown to be a powerful tool for describing and predicting the dynamics of BGC, hypoglycemia alarm systems, and closedloop control. There is a continuing need for improved recursive model development, guaranteed stability of every model developed, and adaptive control based on these recursive models.
Meals, physical activity, and emotional state are some of the factors that affect BGC. Using information from such factors improves the performance of BGC regulation. Meal information is used by many researchers to compute the amount of insulin bolus to be infused. However, use of information manually entered by patients should be balanced with convenience and adherence. Patients may forget to enter meal information in a timely manner or make erroneous estimates about the carbohydrate content of the meal. The protein, fat, and carbohydrate ratios of the foods impact the glycemic value of the meal ingested. Thus there is a continuing need for improved method and systems for an artificial pancreas.
SUMMARY OF THE INVENTIONA general object of this invention is to provide additional methods and modules for rising physiological (i.e., biometric) variables to advance the state of the artificial pancreas in several ways including, without limitation: (1) determining the presence of major factors (e.g., meals, physical activity, acute stress and/or sleep) that affect GC without receiving any manual inputs from patients, and the assessment of the current state of the patient is used to modify the control policies to accommodate the effects of these factors; and/or (2) detecting errors in the components and operation of the AP system in order to achieve an AP that can function in presence of various equipment errors and limitations in control algorithms.
The general object of the invention can be attained, at least in part, through a method for monitoring and/or treating glucose levels of a patient with diabetes, and a device or system for implementing the method. In embodiments of this invention, the method includes: automatically monitoring a glucose concentration level in the patient with a continuous glucose monitor worn by the patient to obtain a measured glucose level; automatically monitoring physiological variables of the patient using at least one physiological sensor worn by the patient to obtain measured physiological variables; automatically determining a physiological state of the patient from the measured physiological variables; and automatically estimating a future glucose level of the patient as a function of the measured glucose level, at least one of the measured physiological variables, and the determined physiological state of the patient.
In one embodiment, automatically determining a physiological state of the patient includes automatically matching the measured physiological variables to one of a plurality of predetermined classified physiological states. An exemplary physiological state according to this invention is physical activity, and the invention can include automatically determining an intensity and/or duration of the exercise for the purpose of estimating future glucose needs. Another exemplary physiological state is stress, and especially periodic acute stress, which can impact glucose levels (as compared to chronic stress which has longterm effects). Yet another exemplary physiological state is sleep, and the method can include determining a stage of sleep for the patient. Knowing the patient's state, such as during exercise, a stressful, moment, or while sleeping, is useful to provide a context and understanding for interpreting measured glucose and biometrics.
Embodiments of the method of this invention include automatically predicting and alarming the patient of a predicted future low blood glucose concentration and or automatically determining and suggesting responsive measures including carbohydrate consumption to present low blood glucose concentration. The method can also include automated detection of food consumption and/or a rapid glucose level increase without manual input by the patient.
The invention further includes a device for monitoring and/or treating patient glucose levels. The device includes or incorporates a continuous glucose monitor adapted to measure a glucose level of a patient and a physiological status monitoring system worn by the patient and adapted to measure at least one physiological variable of the patient. The device is desirably further in communication with an insulin pump. An automatic controller is in communication with the glucose monitor and the physiological status monitoring system. The controller includes a processor and the necessary recordable medium to store and execute a prediction module adapted to automatically predict a future glucose level using data measured by the glucose monitor system and the physiological monitoring system, and a physiological classification module adapted to automatically determine a physiological state of the patient from the measured at least one physiological variable. Desirably, each of the prediction module and the physiological classification module include, or are based upon, a recursively updated stable multivariate timeseries model. The controller also desirably controls an insulin infusion from the insulin, pump as a function of predicted future glucose level.
In embodiments of this invention, the physiological classification module is adapted to detect and/or classify a physiological state selected from physical activity, stress, sleep, or combinations thereof. The physiological classification module can detect and classify a patient's physiological state as a junction of activity intensity and duration, body position, heart rate, respiration pattern, or a combination thereof.
Recent advances in wearable sensor technologies provide valuable biometric variables such as ECG information and respiration rate at high sampling rates in addition to accelerometer, galvanic skin response, temperature and heart rate data. These data and their specific patterns of change in response to various factors such as meals, physical activity, acute stress and sleep, enable automatic monitoring of the current biological/metabolic state of a patient with T1D, well before the effects of these factors influence GC values. Embodiments of the invention characterize the state of these factors in order to determine the most effective rates of insulin infusion to keep GC in the desired range. For example, when physical activity is detected, the nature of the physical activity (aerobic or resistance exercise or a blend), such as its intensity and duration, will also be determined in order to forecast if the patient will have hypo hyper or euglycemia as a result of this specific physical activity and the insulin doses will be adjusted accordingly. This proactive approach rather than the reactive approach based exclusively on GC measurements will improve GC control significantly. A critical component of this AP system is the ability to analyze many signals simultaneously, diagnose specific patterns and interpret the source causes of the potential changes in GC. For example, an increase in heart rate can be caused by exercise or acute stress, which affects insulin sensitivity in opposite ways. Correct diagnosis can only be made by determining the context of the change in heart rate through the collective interpretation of other variables such as accelerometer data and inspiration patterns.
The method and device of embodiments of this invention automatically monitor for and determine a faulty or missing measurement transmitted by the continuous glucose monitor or the physiological sensors. The device can include a fault detection and diagnosis module to monitor in real time sensors, the insulin, pump, and/or modules of the device for malfunctions, such as by using various sources of information and models, including the estimates of plasma glucose concentration and/or plasma insulin concentration.
Other objects and advantages will be apparent to those skilled in the art from the following detailed description taken m conjunction with the appended claims and drawings.
The present invention provides a method and device for monitoring and/or treating glucose levels of a patient with diabetes. The method is desirably implemented by a device including one or more individual modules discussed herein for providing a fully automated, closedloop artificial pancreas.
The device 20 includes a glucose sensor 30 for measuring a glucose level of the patient 22. The glucose sensor 30 desirably is embodied as a continuous blood glucose monitor (CGM) that determines blood glucose levels of interstitial fluids on a continuous basis, such as every few minutes. A typical CGM includes a disposable glucose sensor that is placed just under the skin, which is worn for a period of time until replacement, and a nonimplanted electronic receiver component worn by the user. In one embodiment of this invention, the receiver components can be integrally combined with other components of this invention, such as are discussed below. The glucose sensor 30 desirably includes a transmitter and a power source that is rechargeable without a wired connection, and computational capabilities, such as a data processor and recordable medium (e.g., flash memory) 10 implement the necessary modeling algorithms of this invention.
Glucose levels in interstitial fluid temporally lag behind blood glucose values, generally understood to be about five minutes behind. This lag can create issues during times of rapidly changing glucose levels. In the embodiment illustrated in
The device 20 also includes a physiological status monitoring system 36 for measuring at least one physical or metabolic variable of the patient 22 with more than one physiological sensor worn by the patient. Examples of physical or metabolic variables that can be monitored by the physiological status monitoring system 36 include, without limitation, movement (e.g., incorporating an accelerometer), skin temperature, dissipated heat from the body, galvanic skin response, heart rate, ECG, respiration rate, posture, or body position. The system 36 includes a software, module on a recordable medium for deriving at least one physiological state selected from sleep, total energy expenditure, stress, physical activity, or combinations thereof.
The physiological status monitoring system 36 can be implemented according to need. In one embodiment of this invention, the physiological status monitoring system 36 is implemented as an armband monitoring system worn by the patient 22. The armband desirably wirelessly communicates with other components of the device, such as using wireless local area network technologies or other radio frequencies. One exemplary armband, monitor that can be used and/or modified for use in the device 20 is available from Bodymedia, Inc., and sold under the name Sense Wear. Other embodiments may include chestbands, wristbands and sensors that can be pasted on skin.
The device 20 further includes an automatic controller 40 in communication with the glucose sensor 30 and the physiological status monitoring system 36. The controller includes a prediction module 42 for automatically predicting a future glucose level using data measured by the glucose sensor and the physiological sensor. The controller 40 includes a processor in combination with a recordable medium for implementing the control model according to this invention. The recordable medium stores the data, measured by the glucose sensor and the physiological, sensor, and the prediction module 42 predicts the future blood glucose level using at least a portion of the stored measured information by the glucose sensor and the physiological sensor.
In one embodiment, the prediction module includes an algorithm for predicting/future glucose concentration values at or between 5 to 60 minutes into the future, and preferably 530 minutes with high accuracy. The prediction module desirably includes a recursive model for predicting the future glucose level using data measured by the glucose sensor and the physiological sensor. The controller 40 also desirably includes an update module 44 for continuously updating the parameters of the recursive modeling, based upon the measurements of the sensors and the amount of insulin prescribed in response to the future glucose prediction.
The controller 40 includes a control module 46 that acts upon the predicted blood glucose levels by implementing an insulin pump 50. The controller 40 provides an insulin infusion rate to the insulin pump 50 as a function of the predicted future glucoselevel. The device 20 can also include an alarm 54 for alerting the patient of an unsafe current or future glucose level.
Any suitable insulin pump and alarm mechanism can be used in this invention. The insulin pump desirably includes an insulin reservoir that can be refilled without removing the entire pump device. As it can be desirable to limit the number of separate components, several of the components can be implemented in a single integrated device. In one embodiment of this invention, more than one, or all, of the glucose sensor, controller, pump, and alarm can be implemented in a single device housing. Integral components can communicate by wired connections, whereas separately housed components, such as any biometrics wearable sensor(s), can communicate wirelessly through known wireless technologies.
The glucose monitoring and/or treating device of this invention is preferably a closedloop system that does not requiring manual user inputs for either predicting patient glucose levels or, desirably, for operating the insulin pump. In one embodiment of this invention, the device implements a method of predicting glucose levels in a patient. The device periodically measures a glucose level in the patient to obtain actual glucose measurements, which can be modified as needed to account for any lags due to the type of sensor mechanism. The device further monitors for physiological signals of the patient to obtain measured physiological signals or derived physiological variables. The device models a glucose concentration of the patient as a function of the actual glucose measurements and the physiological signals. Using the patient model the device estimates a future glucose level for the patient from the model of the glucose metabolism of the patient, and can provide insulin according to the estimation.
As discussed above, the patient model cart be updated in view of new information from, the patient measurements. In one embodiment of this invention, the device determines changes in glucose metabolism model parameters and modifies the glucose metabolism modeling in view of the new parameters. In one embodiment, such as where the modeling includes multivariate recursive time series modeling, the model is automatically recursively updated with each of the actual glucose measurements. A determined difference between the estimated future glucose level for a timeframe and an actual glucose measurement, for that timeframe can be a trigger and used for modifying the model of the glucose metabolism. The glucose metabolism model can be established and updated by analysis of the stored actual measurements for a timeframe and the corresponding physiological data sampled during that timeframe.
The invention incorporates one or more recursive multivariate dynamic models that describes glucose homeostasis in the patient body and provides hypoglycemia warning systems and closedloop automatic adaptive controllers to regulate blood glucose levels by manipulating insulin infusion rates from an automatically controlled pump. Signals from the continuous glucose monitoring device and the multisensor body monitor (e.g., armband) are used for initial model development. The models developed are subjectspecific (they can handle inter and intrasubject variabilities of glucose metabolism) and desirably do not require any manual inputs from the subject (they function in fully automated form).
As shown in
Modules 13 are discussed in U.S. Pat. No. 8,690,820, herein incorporated by reference, and can be integrated with the master control system of this; invention. Module 4 can be implemented similar to Module such as using detection techniques for rapid increases in glucose. The modules will make use of the glucose sensor(s) and other physiological status sensor(s), as discussed herein, and have methods for change detection and interpretation, such as discussed herein.
In embodiments of this invention, the sensors and insulin pump can desirably communicate with a smartphone that can communicate with a server computer through wireless communication. At least several of the above modules can reside on the smartphone and will be executed there. Some modules with intensive computations, software for data storage and metasuper vision of the whole system, and communication software with care providers and emergency contacts can reside on the server.
In embodiments of this invention, the method includes: automatically monitoring a glucose concentration level in the patient with a continuous glucose monitor worn by the patient to obtain a measured glucose level, automatically monitoring physiological variables of the patient using at least one physiological sensor worn by the patient to obtain measured physiological variables. The measured physiological variables are automatically used for determining a physiological state of the patient, such as physical activity, stress, and/or sleep. The method further includes automatically estimating a future glucose level of the patient as a function of the measured glucose level, at least one of the measured physiological variables, and the determined physiological state of the patient. Embodiments of this invention further include automatically determining a change between at least two measured glucose levels that exceeds a predetermined value, and automatically comparing the change in the measured glucose level to any change in physiological state to determine a cause of the change in tire measured glucose level. For example, the determined response to a change in the glucose level will be different, if the person is determined to be sleeping or under stress or excreting. In one embodiment a physiological state of the patient can be determined b automatically matching the measured physiological variables to one of a plurality of predetermined classified physiological states. As an example, the invention can include automatically determining a stage of sleep for the patient.
Physical state has a wide range of effects on glucose concentrations in patients with type 1 diabetes depending on the type (e.g., aerobic, anaerobic, or mixed exercise) and the duration of the physical state. For example, the variability in glucose responses to physical activities makes the development of artificial pancreas (AP) systems challenging. To improve AP functioning, the invention further includes automatic detection of exercise intensity and its classification as aerobic or anaerobic, which is then used by the AP control algorithms. This can be achieved by using a multivariable AP approach where physiological (biometric) variables, such as described above, are measured and reported to the AP at high frequency. A classification system is provided that identifies, in real time, the exercise intensity and its reliance on aerobic or anaerobic metabolism. The classifier will be added as a new module to the integrated multivariable adaptive AP system to enable the detection of aerobic and anaerobic exercise for enhancing the accuracy of insulin infusion strategies during and after exercise.
Classification of Physical ActivityAs discussed above, physical activity can significantly affect blood glucose concentration (BGC) in persons with type 1 diabetes (T1D). Regular physical activity has several positive contributions on management of diabetes, such as improving insulin sensitivity, controlling body mass and lipid profiles and boosting selfesteem. Most AP control systems seek to regulate BGC in persons with T1D by using information from a continuous glucose monitor with little or no regard to physical activity levels. Physical activity challenges the AP system as a disturbance that can lead to unsafe conditions such as hypoglycemia or hyperglycemia.
Compared to resting conditions, aerobic exercise increases glucose uptake anywhere from 1.5 to 10fold, depending on the intensity of the activity. The dramatic increase in glucose needs of the working skeletal muscle is normally matched precisely by increased hepatic glucose production in nondiabetic individuals by a complex orchestration of feed forward and feedback mechanisms. In contrast, during intense aerobic exercise and during anaerobic work, hepatic glucose production can exceed muscle glucose utilization and glucose levels can rise dramatically. Thus, one of the key determinates of the glycemic response to exercise is the general classification of the exercise intensity (i.e., aerobic vs. anaerobic). The somewhat unpredictable effects on the BGC due to physical exercise cause fear in persons in T1D and this fear may be a barrier to exercise.
Exercise intensities that are dominantly reliant on by aerobic metabolism increase insulin sensitivity, which subsequently increases glucose uptake from the blood stream to tissue cells. This type of exercise is often of longer duration and with lower rates of muscular contractions compared to anaerobic exercise (see
On the other hand, exercise that becomes more reliant, on anaerobic metabolism may increase BGC that could lead to hyperglycemia due to the release of catecholamines which increase glucose production and limit glucose uptake into muscle. Typically, anaerobic exercise is commonly characterized by high rates of muscular contractions for short durations and subsequent relatively long periods of recovery, which may contribute to the significant increases in BGC.
In embodiments of this invention, an automated discrimination method is used for exercise intensity identification and classification of the reliance of the exercise on aerobic or anaerobic metabolism in real time as new information to be used in the integrated, multivariable adaptive AP (IMAAP) system. In one embodiment, the identification method is developed based on knearest neighbors (KNN) classification algorithm. The identified exercise intensity information can be exported to an AP, which enables the system to assess the potential impact of the exercise, forecast potential hypo or hyperglycemia, and provide preventive action to keep BGC in target range.
An experimental protocol was prepared with five participants (two males, three females). All participants were using insulin pump therapy and were classified as having a ‘moderatetohigh’ physical activity level based on a selfreported questionnaire. Participants were all in good to fair glycemic control (last HbA_{1c}<8.0%). Participants were all provided with an informed consent and the 2015 Physical Activity Readiness Questionnaire (2015 PARQ+ www.eparmed.com) to determine eligibility and risk stratify the study participants, which, would participate in a range of physical activity intensities from lighttomaximum, safely. Preexercise heart rate (HR) and blood pressure (BP) were measured using the BpTRU (Surge Surgical Supplies, Toronto, Ontario) automated blood pressure device to ensure participants were within an acceptable range prior to the initiation of the exercise protocols; BP<160/90 mmHg. The participants had their blood pressure and heart rate measured on the right and left arm while seated in a relaxed position, feet flat on the ground and legs uncrossed. Six measurements were taken consecutively with a 1minute rest interval in between, and averaged. The average values were obtained and used in the analysis.
Participants reported on four separate occasions. The first visit consisted of a graded (progressive) treadmill test of maximal aerobic power (VO_{2}max), lasting from 1012 minutes, while the next three visits involved 40minute exercise sessions; two vigoroustomaximum maximum intensity circuit based protocols and one continuous, lighttomoderate intensity steady state aerobic protocol. A further description of the visits and the types of exercise performed are found below. All four visits were completed with a minimum of 24hours between sessions in order to reduce the likelihood of blood glucose dysregulation due to exercise. All visits were conducted at the same time within each subject (either 11:00 AM or 4:00 PM), Baseline whole blood glucose concentrations were measured 10 minutes prior to the start of exercise (T minus 10 min) and every 10minutes during exercise and in recovery (10, 20 and 60minutes post exercise) using a Contour® Next Link or Contour® glucometer (Bayer Inc., Mississauga, ON). Lactate measurements were completed every 10minutes using a Lactate Scout+Analyzer (EKF Diagnostics, Germany). The rate of perceived exertion (RPE) was also measured throughout the exercise using the Borg Scale. Participants were asked to take their usual bolus of insulin with breakfast (7:00 AM) or lunch (12:00 PM) in order to begin the exercise protocol with minimal active or “onboard” bolus insulin. Exercise was immediately terminated if blood glucose concentrations were <3.5 mmol⋅L^{−1 }at any point during exercise. If necessary, participants were provided with a respective dose of dextrose to treat hypoglycemia (Dex4®, AMG Medical Inc.).
Anthropometric measurements were conducted on all participants during visit 1, including height (cm), body mass (k), body fat percentage, sum of five skinfolds, and waist circumference (WC) (cm). Standardized protocols were used to measure height, weight and WC. Height was measured without shoes using a stadiometer (Fitness Precision, Toronto Ontario). Body mass was measured using a digital scale (Seca Alpha, Germany) with no shoes and light clothing. WC was measured using the National Institute of Health (NIH) protocol; the measuring tape was placed on the skin at the level of the iliac crest. Body fat percentage was determined through bioelectrical impedance analysis instrument (Tanita Scale, model TBF612, Arlington Heights, Ill.), Skinfold measurements were taken using Harpenden fat calipers at standard sites: bicep, tricep, subscapula, iliac crest and medial calf, as per the Physical Activity & Lifestyle “R” Medicine (PALM): A HealthRelated Physical Activity and Lifestyle Approach.
Participants wore a physiological monitoring module (Bioharness3, Zephyr Technology, Annapolis Md.) to monitor various physiological variables including heart rate (HR), breathing rate, posture, activity level, peak acceleration, speed, and distance moved. Participants also wore a Polar chest HR monitor to obtain exercise and maximum HR (Polar Electro, Kemple, Finland). Participants were fitted with a Fitmate Pro Metabolic Unit (COSMED, Italy, Image Monitoring Mississauga, Ontario) for the determination of VO_{2 }during the continuous lighttomoderate intensity (LMI) plus vigoroustomaximum intensity (VMI) circuit exercise sessions and during the determination of VO_{2}. An incrementaltomaximum effort treadmill protocol was used to determine VO_{2}max and peak or maximum exercise HR. During the incremental to maximal test the protocol consisted of 2minute work stages that increased in intensity (treadmill speed and/or elevation) at every stage. The participants were instructed to remain on the treadmill until they reached volitional fatigue at which point they received a 2minute lowintensity active recovery. Following the recovery period, the participants continued the test for another stage, and then were given another 2minute recovery alter completing the workload. This discontinuous portion of the graded exercise test was used to ensure the attainment of VO_{2}max. The attainment of VO_{2}max was determined by applying the following criteria; a plateau in VO_{2 }with increasing workloads where VO_{2 }does not increase more than 1.5 mL of O_{2}⋅kg^{−1}min^{−1 }or 150 mL⋅min^{−1}, respirator exchangeratio (RER) value greater than 1.15, and no increase in HR with an increase in workload. Participants were fitted with a continuous glucose monitor (CGM) Enlite™ sensor (Medtronic Ltd., Minneapolis, Minn.) that was inserted into the interstitial space under the skin on the abdomen or upper buttocks. Participants were also instructed to use the laboratory issued glucometer for every selfmonitoring of blood glucose (SMBG).
Basal rate reductions were customized per subject for the VMI exercise sessions. Participants began by walking on a treadmill at 3.5 MPH and 2% incline for 4minutes followed by the circuit. The circuit begun with 45seconds of marching on the spot with high knees and swinging the arms with 58 lb. dumbbells in each hand (5 lb. for females, 8 lb. for males). Next, participants were asked to complete a squat with a front sweep and 4 kg medicine ball swinging between the legs and over the head for 60seconds. Four jumping jacks followed by a quadruped motion (palms flat on the floor, extending one arm and opposite leg simultaneously) for 30seconds and then two jumping jacks, four pushups, and a 20second forearm plank. The next exercise was marching on the spot with high knees for 30seconds, followed by squats with an 8 kg medicine ball placed on a high shelf each time for 60seconds. The circuit finished with four pushups and a 20second forearm plank. Participants were then asked to cycle on a cycle ergometer (Monark 874 E, Sweden) for 4minutes at 60 RPM with 2.5 kg of resistance and then completed the circuit two more times. In between the second and last circuit, participants walked on the treadmill again for 4minutes at 3.5 MPH and 2% incline. Participants completed the IHE protocol by cycling at 6070 RPM for 10 minutes until 40minutes of exercise were reached.
During one of the two circuit exercise sessions, basal rate adjustments were made every 10 minutes for all participants with T1D. The basal adjustment patients varied between some participants; however, the total percentage reduction was always the same during the 40minute exercise session (Table 1). Basal rates were at 100% for all participants 10minutes prior to exercise until the onset of exercise. Once the circuit exercise began, basal rates were adjusted in a random pattern. 1 able 1 summarizes the percent of basal rate (%) adjustment for each participant (15) with T1D from 10minutes prior to exercise to 40minutes of the circuit exercise session. Basal rates were adjusted every 10minutes in different patterns for all participants. The total combined percent reduction was the same between participants.
One visit involved continuous, steady state LMI aerobic exercise where basal insulin was set to zero for the entire exercise protocol, and resumed to 100% immediately following the cessation of exercise. During the treadmill protocol, participants were fitted with the same measurement equipment as the VMI protocol. Participants exercised at 3.5 MPH and 2% incline for 40minutes.
The identification of the intensity of exercise and its reliance on aerobic or anaerobic metabolism is made by KNN classification algorithm. KNN classification is one of the most popular classification methods used when there is little or no prior knowledge about the distribution of the data. In contrast to most concept learning systems, KNN classification docs not formulate a generalized conceptual model from the training instances at the training stage. Rather, a simple and intuitive rule is used to make decisions at the classification stage; instances close in the input space are likely to belong to the same class. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common among its knearest neighbors.
Defining x and y as the matrix of input features and vector of output labels of a training dataset, the standardized Euclidean distance vector D_{x,x}_{new}, between a new observation vector x_{new }and training data matrix x is defined as:
where t=1, . . . , N and N is the number of training data. W_{j }is the standard deviation of j^{th }column of x matrix for N observations. The KNN algorithm is:

 1. Compute the distance D_{x,x}_{new}(t) for every training data t=1, . . . , N.
 2. Select k lowest distance and corresponding y(t).
 3. Select y_{new }as the most frequent class from the previous step.
If there are outliers in training data, the KNN algorithm may have some wrong classification just like all other databased classification algorithms. Condensed nearest neighbors (CNN) rule was proposed to decrease the size of training data to a minimum such that the reduced size data is still able to describe all training data. The CNN algorithm is:  1. The first sample x(1) and y(1) is placed in x_{store }and y_{store}, respectively.
 2. The second sample x(2) is classified by the KNN algorithm using x_{store }and y_{store }
 a. If x(2) is classified correctly, x(2) and y(2) are placed in x_{discard }and y_{discard}, respectively.
 b. If x(2) is not classified correctly, x(2) and y(2) are placed in x_{store }and y_{store}, respectively.
 3. Repeat step2 for all N (t=1, . . . , N) observation in training data.
 4. Use x_{discard }and y_{discard }and repeat step 2 and step 3 until:
 a. All elements x_{discard }and y_{discard }are transferred to x_{store }and y_{store}, or
 b. No elements x_{discard }and y_{discard }are transferred to x_{store }and y_{store }during a complete loop (step2 and step3).
 5. The final contents of the x_{store }and y_{store }are used as optimized training data for the KNN to be used in realtune classification.
Data from 8 subjects were tested (5 with T1D, 3 without T1D). Demographic information of subjects is listed in Table III. The three volunteers without T1D wore the Bioharness3 chestband while they were performing the above exercise protocol. The HR, BR, and PA signals from the Bioharness3 chestband were defined to be features of the x matrix (statistical information is shown in Table II). The y vector was defined to have binary values such that 0 and 1 are used for aerobic and anaerobic exercise, respectively. One second sampling time was used.
For each subject 75% of data were randomly selected to be training data, and the rest of data is used as testing data. The CNN algorithm was performed for each training data to remove outliers and reduce the size of the training data. The k was selected to 1 in the KNN algorithm for real time exercise identification.
Table IV shows the performance analysis of the proposed algorithm. Overall 28324 seconds (aerobic: 14982 vs anaerobic: 13342) of exercise session were performed. The overall training data size was decreased from 17943 seconds to 1278 seconds after performing the CNN algorithm. Out of 7081 testing samples, 6997 seconds were truly classified (98.8%) with the KNN algorithm. The algorithm was not able to classify 1.2% of the testing data due to complexity in data at the time switching between aerobic and anaerobic.
Exercise sessions are one of the most challenging periods for an AP system to regulate BGC. People with T1D have adopted a range of precautions such as modifying their insulin intake or changing their food consumption before and during an exercise. For a fully automated AP system no information should be manually entered or manual interventions be made. The proposed algorithm is developed as a new module for the IMAAP system in order to enable the IMAAP system to distinguish between predominant aerobic and anaerobic exercise metabolism, since these two distinct forms of exercise can have divert effects on glucose concentrations.
The results show that the algorithm is able to distinguish aerobic and anaerobic exercise with high level of accuracy accuracy. With only 159 (±91) seconds of a carefully selected training data, the KNN algorithm is able develop a classifier to identify aerobic and anaerobic exercise, based on heart rate, breathing rate and peak acceleration information from the Bioharness3 chestband. The classifier was able to track very accurately the switching between aerobic and aerobic exercise during an exercise session for both groups of study participants as they alternate between sustained aerobic and circuit exercises.
The activity classification algorithm of this invention is able to differentiate and classify exercise intensities and the reliance of an exercise on aerobic or anaerobic metabolism with high accuracy. Use of biometric information and classification of exercise intensity and type in real time can provide valuable information where automatically integrated within an artificial pancreas for prevention of exerciseinduced hypoglycemia and hyperglycemia.
Detection of Acute Stress and Sleep PatternsThe methods discussed above for discriminating the types of exercise and detecting and diagnosing faults by multivariate statistical techniques such as principal components analysis, clustering, classification and discrimination, machine Seaming techniques, dynamic time warping also provide the foundation for detecting acute stress and sleep stages and patterns. The techniques of embodiments of this invention rely on the interpretation, of the collective behavior of various biometric variables. In one embodiment, respiration patterns, heart rate patterns, specific signatures of body movements and body position can be collected from wearable biometric sensors as streaming data to detect sleep stages and patterns, in another embodiment, the same variables can provide different combinations of patterns to indicate acute stress. Hence the modules of the multi variable AP system are able to use the same set of variables to determine physical activity, acute stress and sleep by using the developed methods discussed above.
In embodiments of this invention, an important element of these tools is synchronization of data for developing the baseline and for comparison of new data from current state of the patient with the baseline. Measured signals are synchronized such that similar trends or events are overlapped. Also the sequences with various different lengths are optimally shortened or extended in order to have same length of datasets over all subjects. A better statistical comparison can be done once data are synchronized, in embodiments of this invention, the method integrates dynamic time warning (DTW), SaviztkyGolay filter (SGF) and principal component analysis (PCA). DTW is extended to its higher derivative orders where the derivatives are obtained through an optimally designed SGF. PCA is used for determination of statistical weigh matrices for the case of multivariable synchronization.
DTW has its origins in speech recognition and is a flexible, deterministic, pattern matching scheme that works with pairs of patterns. It can locally translate, compress, and expand the patterns so that similar features in the patterns are matched, DTW nonlinearly warps two trajectories in such a way that similar events are aligned and a minimum distance between them is obtained. It is assumed that an appropriate scaling is performed prior to implementation of DTW; scaling is an important issue since DTW is a distancebased technique.
Assume that x_{R }and x_{T }are the reference batch trajectory (previously defined) and a batch to be synchronized with data lengths R and T, respectively. DTW defines the Euclidean distance between each point of the two trajectories as:
d(i(κ),j(κ))=[x_{R}(i(κ))−x_{T}(j(κ))]^{2} (2)
where κ is the number of grid points along a path between two trajectories. i, j are the sample points and goes up to R and T for the reference and new batch trajectories, respectively. The total distance between two batch trajectories is:
where max(R, T)≤L≤R+T. The optimal path and minimum total distance is found as the solution of the following optimization problem:
The computational load to solve the problem in Eq. (4) might be high since all possible paths must be defined and the one which gives minimum distance is selected. An elegant and effective solution to this problem is dynamic programming which guarantees to find the optimum path without basing to calculate the distance along all possible path:
with respect to some local and global constraints:
D_{F}(R,T)=d(R,T)
D_{F}(1,1)=d(1,1)
i(k+1)≥i(k)
j(k+1)≥j(k) (6)
When a feature (peak, valley, etc.) is slightly higher (or lower) from one trajectory to another, DTW may suggest aligning one single point on x_{R }to a large number of points on x_{T }or the opposite. To overcome this singularity problem, the point first order derivative (d1) can be used instead of Euclidian distance to measure the difference between two trajectories:
d^{1}(i(κ),j(κ))=[x_{R}^{1}(i(κ))−x_{T}^{1}(j(κ))]^{2} (7)
where
In mathematics, an object associated with a function that responds to its variability in time is the derivative of the function, the derivative of the function determines areas where the function is constant, increases or decreases, and the intensity of the changes, the derivative determines the general shape of the function rather than the value of the function at a specific point and shows what happens in the neighborhood of the point. In the case of time series, this means that the derivative of the function considers the behavior of a time series before and after some point in time. While the first derivative of a function gives some information about the shape of the function (increasing or decreasing), the second derivative adds additional information as to where the function is convex or concave.
Many datasets from real life applications usually do not follow a Normal distribution. Suppose that Z is a realvalued random variable measured from a reallife application. The mean of Z is a measure of the center of the distribution of Z. Furthermore, the variance of Z is the second moment (derivative) of Z about the mean, and measures the spread of the distribution of Z about the mean. The third and fourth moments of Z about the mean also measure interesting features of the distribution. The third moment measures skewness, the lack of symmetry or the degree of asymmetry of a distribution around its mean, while the fourth moment measures kurtosis, the degree to which the distribution is peaked or the relative peakedness or flatness of a distribution compared with the normal distribution.
A high order DDTW (HODDTW) can be used to capture more statistical information from a distribution as mentioned above. The distance for the HODDTW is defined as:
where d^{z }is the Euclidean distance between each point of the z^{th }derivatives of two trajectories, a_{z}'s are the coefficients to give different weights to different derivative orders and are defined as:
Note that, the DDTW algorithm may not be as robust as DTW due to the numerical, derivative estimation in Eq. (9) when it is applied to noisy trajectories. The SGF can be used to obtain the first derivative estimations. The SGF is a filter for smoothing without greatly distorting the signal by calculation of convolution coefficients, by fitting successive subsets of adjacent data points with a lowdegree polynomial by the method of linear least squares. When the data points are equally spaced an analytical solution to the leastsquares equations can be found, in the form of a single set of convolution coefficients that can be applied to all data subsets, to give estimates of the smoothed signal, (or derivatives of the smoothed signal) at the central point of each subset. A major drawback of the convolution weights for the centerpoint leastsquares evaluation of 2m+1 points is that the first and end points of the data sets are lost (2m points for a 2m+1 point filter). A technique based on Gram polynomials can be used for calculation of SGF convolution coefficients at all positions, for ail polynomial orders, all filter lengths, and any derivative without any loss of initial or end points.
Considering the uniformly sampled signal yl, we want to smooth and estimate its sth order derivative using a 2m+1 point filter and a polynomial of order n. The least squares polynomial has the form:
where l=−m, . . . , +m. The least squares criterion requires that the sum of the squares of the differences between the observed values, yl and the calculated, ƒ_{n}(l) be a minimum over the interval being considered:
This leads to n+1 simultaneous equations with, respect to the unknown coefficients bk at l=0 for smoothing (s=0) or differentiation (s≥1).
The least squares approximation of a function can also be obtained with a weighted expansion of discrete orthogonal polynomials, rather than, a simple powers series that is used in Eq. (11). Gram polynomials are well suited for this problem and Eq. (11) can be rewritten as:
where P_{k}^{m}(t) is the Gram polynomial with order k, over 2m+1 points, evaluated at point t and is defined as:
where (A)^{(B) }is a generalized factorial function: (A)(A−1) . . . (A−B+1) and (A)^{(O)}=1. After substituting Eq. (14) into Eq. (13) the generalized form for the convolution coefficients for data point i(−m≤i≤m) with polynomial order n and s^{th }derivative, evaluated at position t is:
with P_{0}^{m,s}(l)=0 and P_{1}^{m,s}(l)=0. Note that, in case of differential (s≥1), the original data points are separated by Δθ in Eq. (15) rather than Δθ^{s}=1 for s=0. Eq. (17) is the recursive version of the Eq. (14) which is more practical for computations.
PCA can be used to assign different weights to different variables according to their statistical importance. PCA involves the orthogonal decomposition of the set of process measurements along the directions that explain the maximum variation in the data, for a continuous process, the data can be represented by matrix X_{n×m }where n is the number of observation and m the number of variables. The directions extracted by the orthogonal decomposition of X are the eigenvectors p_{i }of X^{T}X also called principal components
(PC) Loadings:
X=t_{1}p_{1}^{T}+t_{2}p_{2}^{T}+ . . . +t_{a}p_{α}^{T}+E (18)
where E is the residuals matrix and superscript T denotes matrix transpose. The dimension α is chosen such that most of the significant process information is captured by the t_{i}p_{i}^{T }terms, and E contains mostly random error. The projection of the measurements onto the eigenvectors defines new points in the measurement space that constitute the score matrix {tilde over (T)} whose columns are t_{i }(Eq. (18)). The relationship between {tilde over (T)}, {tilde over (P)}, and X can also be expressed as:
X={tilde over (T)}{tilde over (P)}^{T}+E E=X−{tilde over (X)} (19)
where {tilde over (X)}={tilde over (T)}{tilde over (P)}^{T }and {tilde over (P)} is the m+α matrix of loadings and {tilde over (T)} is the n×α score matrix. PCA transforms the coordinate system of a data set for more efficient description of variability in data. The PCs can be computed by singular value decomposition (SVD) of the data matrix X:
X=USV^{T} (20)
where the columns of U are the normalised eigenvectors of XX^{T}, the columns of V are the normalized eigenvectors of X^{T}X, and S is a diagonal matrix having as its elements the singular values. The loadings and score matrices can be expressed as:
{tilde over (P)}=V_{m×α} and {tilde over (T)}=U_{n×α}S_{α×α} (21)
The multivariable version of the Eq. (2) is defined as:
d(i(κ),j(κ))=[{tilde over (T)}_{R}(i(κ))−{tilde over (T)}_{T}(i(κ))]A[{tilde over (T)}_{R}(i(κ))−{tilde over (T)}_{T}(i(κ))]^{T} (22)
where A is a diagonal weight matrix defined as:
The Eq. (22) is used in the Eq. (9) where the original multivariate signals X_{R }and X_{T }are changed with their score matrices {tilde over (T)}_{R }and {tilde over (T)}_{T}, respectively. In the Eq. (22), more weight is given to the score vectors that are aligned with the directions of maximum data variance.
To demonstrate this method of the invention, experiments were conducted over a 3day period. Subjects were provided a CGM device, a BodyMedia SenseWear armband, and a Zephyr chestband. Continuous data collection from 10 subjects (6 male, 4 female, 1927 years) with T1D (average A1C 7.7%) started on Day 1 and insulin delivery via AP algorithm continued for 60 hours. Data were collected and transmitted to a laptop computer, every 5 minutes. Day 1 subjects ate breakfast, then had an aerobic exercise (6080% heart rate reserve (HHR) used from their VO2Max), ate then had an anaerobic/resistance (AR) exercise (23 sets of 812 reps. 6080% rep 1 max). Day 2 they ate breakfast then had AR exercise, ate then had an interval exercise (3040 min; 5 min warm up, 3 min at 6070% HRR of VO2MAX, 4 minutes at 8590% HHR of VO2MAX x4, with 5 min cool down). On day 3 the order of exercise types was identical in day 1. Variations in meal and exercise times and intensities between subjects and from day to day provided a dataset that can illustrate the effects of trajectory synchronization.
Glucose measurements from the second day of subject 3 was used as the reference trajectory for the performance evaluation of the single variable version of the proposed algorithm.
Table V shows the performance evaluation of the proposed method for 45 days data from 15 subjects. All 45 days datasets are synchronized with the reference day (second day of subject 3) with highly statistically significant correlations. The correlation coefficient for subject 8 (Day 1) and subject first days of subjects 13 and 14 (Day 3) are relatively smaller than other days.
In contrast to studies conducted in the clinical research facility with carefully controlled conditions closed loop at home is exposed to considerably more varied meal and exercise patterns. Participants may over or underestimate carbohydrate content and may undertake unplanned activity and/or exercise. An AP system should be tested under completely freeliving conditions for prevention of any safety related issues that may not be observed in a wellcontrolled environment before it is commercially available. However, the statistical analysts of the results that are obtained under freeliving conditions may not be easily done due to large variation over the duration of experiments and between participants, this method is able to synchronize data that are collected under nonstandardized conditions. The synchronization aligns similar events over different patients and provides a better interpretation for the statistical analysis of the obtained results.
Fault DetectionError detection and diagnosis, and mitigation of risks of a faulty AP are important in the adoption of AP systems by patients. The success of these features will improve reliability and GC control. Embodiments of this invention rely on the use of both firstprinciples models to detect significant changes in model parameters to indicate abnormalities to system operation and datadriven models that can achieve detection and diagnosis by evaluating the statistics of current measurements with statistical limits established by using historical data with no abnormalities. In addition, algorithms axe developed to estimate plasma insulin and check the performance of pump operation and insulin delivery to the patient. The use of biometric signals provides significant advantages in the accuracy and reliability of the techniques developed with respect to algorithms that rely only on GC measurements.
Faults in subcutaneous glucose concentration readings can cause errors in the computation of insulin infusion rates, which can lead to hypoglycemia or hyperglycemia in artificial pancreas control systems for patients with type 1 diabetes. The invention includes automatically monitoring for and determining a faulty or missing measurement information transmitted by the continuous glucose monitor or the physiological sensors. The device of this invention further includes a fault detection and diagnosis module to monitor in real time sensors, the insulin pump, and/or the modules of the device for malfunctions, such as by using various sources of information and models, including the estimates of plasma glucose concentration and/or plasma insulin concentration. In embodiments of this invention, multivariable statistical monitoring methods are used for detection of faults in glucose concentration values reported by; a subcutaneous glucose sensor.
Embodiments of the invention include realtime modelbased fault detection methods that integrate datadriven and modelbased methods. The methods are able to detect CGM failures with a high rate of success. Embodiments of this invention include a nonlinear first principles glucose/insulin/meal dynamic model. Unscented Kalman filter can be used for state and parameter estimation of the nonlinear model. Principal component analysis models are used for detection of dynamic changes. A Knearest neighbors classification algorithm can be used for diagnosis of faults.
As an example, data from 51 subjects was used to assess the performance of a method according to this invention. The results indicate that the method works successfully with 84.2% sensitivity. The fault detection method can decrease the effects of faults on insulin infusion rates and reduce the potential for hypo or hyperglycemia for patients with T1D.
Continuous glucose monitoring (CGM) sensors are critical components of closedloop (CL) artificial pancreas (AP) control systems that aim to automatically regulate blood glucose concentration (BGC) of patients with type 1 diabetes (T1D). However, CGM sensors may not be able to follow actual BGC due to loss of sensor sensitivity, dislodging, interruption in signal transmission and pressure on sensor patcharea, CGM measurements provide glucose concentration (GC) information to AP systems for calculation of insulin amounts. Erroneous CGM measurements may cause wrong amounts of insulin to be infused which subsequently may cause hypo or hyperglycemia. Hence, detection of abnormalities and faults in CGM readings are important for proper operation of APs.
Fault detection algorithms can be divided into three main groups: qualitative modelbased methods, quantitative modelbased methods, and process historybased (datadriven) methods. Qualitative modelbased methods use knowledgebased (expert) systems and may not be appropriate by themselves for fault detection in complex biological systems. A knowledgebased system uses, ifthenelse rules that mimic the reasoning, of a human expert in solving problems. As the number of ifthenelse rules grows with the behavioral complexity of the system some rules may conflict with the new rules and the maintenance of the system and conflict resolution may become challenging. In contrast, the process history based methods require only the availability of large amounts of historical process data. Relations between variables, patterns that indicate various abnormalities, and/or statistical limits that indicate significant deviations are extracted fem the historical data and used for fault detection. However, the performance of these methods depends on the size and quality of historical data. A modelbased fault detection method can be developed by using first principles such as material and energy balances. But the cost of model development may be high as the model may become too complex and too large to run model computations on the computer within an acceptable amount of time as more details are added.
In the example, a method that is a combination of model and process historybased algorithms was developed for detection of CGM related faults. The modelbased component was based on the extension of Bergman's model. Bergman et al. developed the first threecompartment “minimal model” to analyze plasma glucose and insulin dynamics during an intravenous glucose tolerance test. Later, various modified versions of the minimal model were proposed in order to separate the effect of glucose production from utilization and to capture absorption, distribution and disposal glucose/insulin dynamics. The effects of free fatty acid (FFA) and exercise were also included in recent versions of the minimal model. Due to complexity of the human body, some states defined in firstprinciple models may not be measurable. The nonmeasurable states are usually estimated from available measurements. Model parameters are identified from available measurements as well. However, timeinvariant model parameters are not appropriate for the minimal model used in this work because of intra and intersubject variability over time. Therefore, the model states and parameters are estimated simultaneously. An Unseenfed Kalman Filter (UKF) is implemented for state estimation of nonlinear systems. Defining uncertain model parameters as augmented states, simultaneous state and parameter estimation can be performed.
The datadriven portion of the fault detection method is based on principal components analysis (PCA), To date, support vector machine wavelet Kalman filter, kernel density based stochastic, model, rates of changes threshold based model and PCA methods have been tested for detection of CGM failures. PCA involves the orthogonal decomposition of the set of process measurements along the directions that explain the maximum variation in the data. PCA was used to develop a model that describes the expected variation under normal conditions.
A modified version of the extended minimal model that was developed by Roy et al., “Dynamic modeling of free fatty acid, glucose, and insulin: An extended “minimal model”,” Diabetes technology & therapeutics, vol, 8, no, 6, pp. 617626, 2006, was used (
where I_{sc}, I_{p}, I_{eff }represent subcutaneous, plasma and effective insulin concentrations respectively, u_{ins }is also the amount of given Insulin. Plasma glucose concentration G is defined as a function of effective insulin, remote plasma FPA concentration (Z) and rate of appearance of carbohydrate (R_{c}):
where G_{b }and Z_{b }show basal values for plasma glucose and remote plasma FFA concentration, respectively. FFA dynamics are also represented by a threecompartments model;
where Y, F and F_{b }represent FFArelated insulin concentration and plasma FFA concentration, and basal plasma FFA concentration, respectively. Similar to plasma glucose, the plasma FFA concentration is a function of Y, F and rate of appearance of fat (R_{fat}). Rates of appearance of carbohydrate and fat are defined as twocompartments models denoted as R and R′ in
where the Eqs. (8) and (9) represent both compartments (R and R′) for carbohydrate and fat, respectively. Furthermore, and u_{fat }are u_{carb }are the amount of fat and carbohydrate consumed, respectively. Three additional parameters (s_{1}, s_{2}, s_{3}) are added to the extended model to describe the ratio of absorption of insulin, carbohydrate and fat, respectively. Also the rate of appearance of fat R_{fat }is defined in a similar way to rate of appearance of carbohydrate R_{carb}. All unknown parameters in Eqs. (1)(9) are defined to be timevarying.
Extended Kalman filter (EKF) is one of the most common techniques used for state estimation of nonlinear systems. Flowever, the linear approximation at operating point approach in EKF may cause errors when a timevarying model is used. Also, calculation of Jacobian matrices might be critical when a highorder model is used in realtime applications. The UKF is designed to overcome the drawbacks of EKF, and can easily be implemented to high order systems without calculation of Jacobian matrices.
To develop the UKF, the model in Eq. (24)(32) is discretized using first forward difference derivative approximation with a 5minutes sampling time. The notation for plasma glucose concentration G(t) in Eq. (28) is replaced with subcutaneous glucose concentration (CGM) G_{s}(k) in discrete from. The relation between two variables was shown to be a one compartment model with a delay parameter which was neglected in the study due to difficulties in validation. The nonlinear discrete model is written in nonlinear statespace form:
ξ(k+1)=f(ξ(k),u(k),θ(k))+w(k)
y(k)=g(ξ(k),u(k),θ(k))+v(k) (33)
where ξ(k), u(k), y(k), θ(k), w(k), v(k) are model states, inputs, outputs, uncertain model parameters, process noise and measurement noise, respectively. The nonlinearfunctions/(⋅) and g(⋅) are defined from Eq. (24)(33). In addition to u_{ins}, u_{carb }and u_{fat}, the basal values G_{b}, F_{b}, Z_{b }are defined as inputs.
The estimation of states and parameters is done simultaneously, by defining the following augmented state vector:
x(k)=[ξ(k)^{T }θ(k)^{T}]^{T} (34)
where the superscript T denotes matrix transpose. Defining L as the dimension of x vector, the sealer weights W_{i }are defined:
where i=1, . . . , 2L and μ=α^{2}(L+κ). The tuning parameters α, β and κ are selected to be 1, 2 and 0, respectively. The sigmapoints vectors χ_{i }are deterministically selected sets of sample points to more accurately map the probability distribution than the linearization of standard EKF and are defined as:
where η_{i }is the i^{th }column (i=1, . . . , L) of the square root of the augmented covariance matrix P(k−1) and the parameter γ=√{square root over (L+μ)}.
Prior sigmapoints estimations χ_{i}−(k) are calculated by propagating the sigmapoints χ_{i}(k−1) through the nonlinear function ƒ(⋅). The prior sigmapoints are trimmed with a nonlinear optimization to prevent nonrealistic estimations such as negative values in concentrations.
x_{i}^{−}(k)=min [Δx_{i}]^{T}[Δx_{i}]
Δx_{i}=x_{i}^{−}(k)−f(x_{i}(k−1))
x_{min}≤x_{i}^{−}(k)≤x_{max }
i=0, . . . ,2L (37)
The prior state estimations and covariance matrix are calculated as:
where Q_{p }is the covariance matrix of the process noise. The prior sigmapoints estimations are propagated through the nonlinear function g(⋅) for calculation of prior outputs sigmapoints ;
The measurement estimations are obtained from the output sigmapoints as:
The innovation covariance and crosscovariance matrices are calculated as:
where Q_{m }represent the covariance matrix for process measurement noise. Finally, the Kalman filter gain and the updated state vector estimation and covariance matrix are calculated:
The PCA model is built, from an appropriate (no faults) reference data. For a continuous process, the data can be represented by matrix {tilde over (X)}_{n×m }where n is the number of observations and m the number of variables. The directions extracted by the orthogonal decomposition of {tilde over (X)} the eigenvectors {tilde over (p)}_{i }of {tilde over (X)}^{T}{tilde over (X)} also called principal components (PC) loadings;
{tilde over (X)}={tilde over (t)}_{1}{tilde over (p)}_{1}^{T}+{tilde over (t)}_{2}{tilde over (p)}_{2}^{T}+ . . . +{tilde over (t)}_{α}{tilde over (p)}_{α}^{T}+{tilde over (E)} (47)
where {tilde over (E)} is the residuals matrix. The dimension a is chosen such that most of the significant process information is captured by the {tilde over (t)}_{i≅T }and {tilde over (E)} contains mostly random error. The relationship between {tilde over (X)}, loading and score matrices can be expressed as:
{tilde over (X)}={tilde over (T)}{tilde over (P)}^{T}+{tilde over (E)} {tilde over (E)}={tilde over (X)}−{tilde over (X)} (48)
where {tilde over (X)}={tilde over (T)}{tilde over (P)}^{T }and {tilde over (P)} is the m+α matrix of loadings and {tilde over (T)} is the n×α score matrix. PCA transforms the coordinate system of a data set for more efficient description of variability in data. The PCs can be computed by singular value decomposition (SVD) of the data matrix {tilde over (X)}=Ũ{tilde over (Σ)}{tilde over (V)}^{T}, where the columns of Ũ the columns of {tilde over (V)} are the normalized eigenvectors of {tilde over (X)}{tilde over (X)}^{T}, are the normalized eigenvectors of {tilde over (X)}^{T }{tilde over (X)}, and {tilde over (Σ)} is a diagonal matrix having as its elements the singular values and thus {tilde over (P)}={tilde over (V)} and {tilde over (T)}=Ũ{tilde over (Σ)}.
The UKF estimations are integrated with the PCA model as:
{tilde over (X)}_{n×m}=[{circumflex over (x)}(1) {circumflex over (x)}(2) . . . {circumflex over (x)}(n)]^{T} (49)
where {circumflex over (x)}(k) for k=1, . . . , n are obtained from Eq. 45.
Hotelling's T^{2 }chart detects the deviation of a new observation from the reference model. The statistical limits of the T^{2 }are defined as:
where F_{a,n−a,α }represents F distribution with a and n−a degrees of freedom and α is the confidence interval.
SPE charts (also called Q charts) show deviations from reference data that are not captured by the model. The statistical limits for SPE are defined as:
where z_{α }is the standard normal variable corresponding α confidence interval and λ_{i }represent the eigenvalues of {tilde over (X)}^{T }{tilde over (X)}/(m−1).
Once the control limits for T_{a}^{2 }and SPE_{a }are defined, for a new observation vector x_{new}(k), a fault is detected if any of the following conditions is satisfied:
T_{a}^{2}≤T^{2}(k)=[x_{new}(k){tilde over (P)}]A^{−1}[x_{new}(k){tilde over (P)}]^{T} (55)
SPE_{a}≤SPE(k)=[x_{new}(k)−x_{new}(k){tilde over (P)}{tilde over (P)}^{T}][x_{new}(k)−x_{new}(k){tilde over (P)}{tilde over (P)}^{T}]^{T} (55)
where Λ is a diagonal matrix consists of the eigenvalues λ_{i }for i=1, . . . , a. The selection of a is defined as:
The two conditions in Eqs. (54) and (55) may be satisfied not only when there is a faulty reading in CGM measurements but also for some dynamic changes that are not included in the reference data matrix {tilde over (X)}. These dynamic changes may not be considered as a fault, in order to minimize the number of erroneous fault detections, a twostep fault diagnosis algorithm is developed to distinguish CGM faults from regular dynamic changes. After a fault is detected by either the T^{2 }or SPE statistics as in Eqs. (54) and (55), the source of the fault must be determined. This is indicated by the variables responsible for inflating T^{2 }and SPE statistics. The variables that made the largest contributions to the fault detection charts are considered to indicate the faults. The contribution of each variable onto the T^{2 }and SPE charts is calculated as:
where x_{new,j }is the j^{th }(j=1, . . . , m) variable and {tilde over (P)}_{j }is the j^{th }row of the matrix {tilde over (P)}.
The knearest neighbors algorithm is a nonparametric classification method. An object is classified by a majority vote of its neighbors, with the object being assigned to the class, most common among its {hacek over (k)} nearest neighbors. The feature matrix {hacek over (x)} and the output vector {hacek over (y)} are defined as:
{hacek over (x)}(k)=[CONT^{T}^{2}(k) CONT^{SPE}(k)]
{hacek over (y)}(k)∈{0,1}={nonfaulty,faulty} (59)
where k=1, . . . , N and N is the number of training data. The standardized Euclidean distance vector Ď_{{hacek over (x)},{hacek over (x)}}_{new }between a new observation vector {hacek over (x)}_{new }and the training data {hacek over (x)} is defined as:
where {hacek over (W)}_{j }is the variance of j^{th }column of {hacek over (x)} matrix for N observation. The KNN algorithm is:

 1) Compute the distance Ď_{{hacek over (x)},{hacek over (x)}}_{new }for every training data k=1, . . . , N
 2) Select {hacek over (k)} lowest distances and corresponding {hacek over (y)}(k)
 3) Select {hacek over (y)}_{new }as the most frequent class from the previous step
Data were collected from closedloop studies conducted m multiple centers located in US, Israel, and Australia. A protocol with supervised freeliving conditions without meal or activity restrictions was performed. Frequent YSI measurements were obtained (30 minutes most of the time) throughout the length of the experiment to ensure patient safety.
Overall 11 states with 23 unknown parameters were estimated with the UKF algorithm. All of the estimations were constrained with lower and upper bounds to prevent physiologically nonrealistic cases such as negative values in concentrations. The initial values, upper and lower bounds for states and parameters are shown in Table VI. The consumed fat amounts were assumed to be 35% of the consumed carbohydrates. The basal values Gb, Fb and Zb were defined to be constant inputs with values of 100, 380 and 190, respectively. The diagonal Qp matrix was defined to be 10^{−6 }and 10^{−4 }of the maximum values of states and parameters, respectively, which are shown in Table VI. The Qm is selected to be 10^{−1}. The overall mean absolute relative difference (MARD) value (and standard deviation) for the Medtronic Paradigm Veo Enlite system (Medtronic, Northridge, Calif., USA) measured at the clinical research center, at home and in the hypoglycemic range to be 16.6 (13.5%, (20.5)% and 24.6 (18.8)%, respectively. In this example, every 30 minutes YSI measurements were interpolated and compared with CGM measurements. The time intervals where the difference between CGM and interpolated YSI values was more than 25% for three consecutive samples (15 minutes) were defined to be faulty CGM measurements.
PCA models were developed after removing the faulty intervals from each individual subject data. Half of the data was used for training of the PCA models. The confidence limit α in Eq. (60) was selected to be 0.9. In addition to 34 estimated variables from the UKF, the infused insulin (basal and bolus) and meal information was also used in the PCA models. The KNN classification algorithm was trained with randomly selected 50% of the faulty intervals for each subject. The rest of data was used for testing the proposed method. The {hacek over (k)} value was selected to be 1.
As the proposed method integrates modelbased and datadriven techniques with information about consumed meal and infused insulin amount, large delays in CGM readings are also detected even though YSI and CGM readings have similar trends as shown in
In
The proposed algorithm was tested on data from 51 subjects. The mean value for training data size out of all subjects was found to be 25 hours (±29.1, Max: 192 hours, Min: 1 hour). Table VII summarizes the results of all subjects. 184 faulty CGM intervals were determined where the difference between COM measurements and interpolated YSI was more than 25%. Overall, 155 (84%) of the CGM failures were detected successfully with a 2.8 minutes average detection time. The time between the first fault detection and the first point of the true fault was defined as detection time. The shortest and longest detection times were determined to be 0 and 20 minutes, respectively. Due to exclusion of nonfaulty subject data, Table VII shows at least one CGM fault for each subject. None of the subjects data have more than 1 missed fault. There were 12 cases where the algorithm detected faults but the difference between CGM and YSI was not larger than 25%. These cases are defined to be wrong alarms. The maximum number of wrong fault detection for one subject is found to be only 1.
The method of this embodiment of the invention integrates elements of modelbased and datadriven fault detection and diagnosis (FDD). By preserving the nonlinearity of the model, it has a better chance of representing the dynamic changes in the body with respect to FDD methods based on linearized models and Extended Kalman filters. By incorporating compartmental models in the method requires training data to be used for fault detection. The performance of the algorithm can be affected by the size of training data. The size should be large enough to contain different dynamical changes. Otherwise, some of new observed dynamic changes that are not captured in training data, might be considered as a fault which may increase the number of wrong detections (false positives). The quality of training data is also important. If the training data includes many faulty data, the proposed method may not be able to detect the faults with similar patterns in realtime and consider them as normal dynamical change which would increase the missed alarms and decrease the sensitivity of the algorithm. In some embodiments, 24 hours of training data that are known to have accurate COM measurements is sufficient. The training data can be updated or changed if another set of data is available.
By incorporating compartmental models in FDD, it enhances the data driven approach based on PCA and contribution plots. The computational cost of the algorithm can be addressed in two ways. As microprocessor power and memory of smartphones improve, the method can be handled in real time by a smartphone as each iteration of the proposed method is completed in less than a second. For extensive studies in the evaluation of the method, data can be sent to a cloud server that executes the method and provides the results to the smartphone for decision and action by the software, being run on the smartphone.
The results indicate that the method and module of this invention is able to detect most of the CGM failures with a high sensitivity. Such a fault detection, algorithm, can decrease the effects of faults on insulin infusion rates and reduce the potential for hypo or hyperglycemia for patients with T1D by warning patients about CGM failures in manual operation or integrated in an artificial pancreas control system for CGM data reconciliation.
In another embodiment of this invention, multiway principal component analysis (MPCA) is used for detection of CGM related faults. MPCA provides a model that describes the expected variation under normal conditions. The MPCA model is built from an appropriate (no faults) reference data. Measurements from batch process are used to construct a three dimensions
X=t_{1}p_{1}^{T}+t_{2}p_{2}^{T}+ . . . +t_{a}p_{a}^{T}+E (61)
where E is the residuals matrix and superscript T denotes matrix transpose. The dimension a is chosen such that most of the significant process information is captured by the t_{i}p_{i}^{T }terms, and E contains mostly random error. The projection of the measurements onto the eigenvectors defines new points in the measurement space that constitute the score matrix T whose columns are t_{j}. The relationship between T, P, and X can also be expressed as:
X=TP^{T}+E E=X−{tilde over (X)} (62)
where {tilde over (x)}=TP^{T }and P is the m×a matrix of loadings and T is the n×a score matrix. PCA transforms the coordinate system of a data set for more efficient description of variability in data. The PCs can be computed by singular value decomposition (SVD) of the data matrix X:
X−UΣV^{T} (63)
where the columns of U are the normalized eigenvectors of XX^{T}, the columns of V are the normalized eigenvectors of X^{T}X, and S is a diagonal matrix having as its elements the singular values. The loadings and score matrices can be expressed as:
P=V and T=UΣ (64)
Hotelling's T^{2 }chart detects the deviation of new observation from the reference model that is captured by model. The statistical limits of the T^{2 }are defined as:
where F_{a,n−a,a }represents F distribution with a and n−a degree of freedom and a confidenceinterval.
SPE (also known as Q statistic) charts show deviations reference data that are not captured by the model. The statistical limits for SPE are defined as:
where z_{a }is the standard normal variable corresponding to a confidence interval and li represent the eigenvalues of X^{T}X=(m−1).
Once the control limits for T_{a}^{2 }and SPE_{a }are defined, for a new observation vector x(k) a fault is detected if any of the following condition is satisfied:
where {circumflex over (x)}(k) is the estimation of the observed is vector x(k) and obtained from Eq. (62).
In this example, the selection of the number of principal components a is defined as an optimization problem subject to the percentage of variance of reference data:
Seven different threeday CL scenarios are generated with a fiveminute sampling time tested on a virtual patient using the UVa/Padova metabolic simulator. The controller of the simulator is used for insulin calculation. To simulate realistic ambulatory conditions, some settings are varied to accommodate variations in daily life, including different meal amounts at different times, late night snacks in some scenarios and different meal consumption times (Table VIII). For each scenario fifty simulations are run. Mean trajectory of every ten simulations are calculated and used as noisefree CGM signal, first six scenarios are used for development of MPCA model while the data from the seventh scenario is used for fault detection purpose. Each threeday scenario is defined to be a batch with the CGM measurements as the only variable. The reference PCA model matrix X includes 30 batches with 1 variable and 864 observations.
Due to variations in scenarios, glucose profile can be significantly different from each other (
Seven different idealized types of faults such as positive/negative step, positive/negative drift, random noise and positive/negative exponential changes are generated (
where k_{f }and k_{l }are the first and last samples of fault intervals and U([0, 1]) and var show a uniformly distributed randomnumber and variance amount respectively, τ in Eq. (75) defines the speed of the exponential function and is set to 5 minutes in this study.
A fault detection was considered true positive (TP) if it happens inside the 60minutes interval, of faults and continues at least for 3 samples (15 minutes). A false positive (FP) region was defined as the region where the faults are detected outside of the true positive region (earlier than or after 60minutes interval). A detection is considered false negative (FN) if it is not raised inside the true positive region (60minutes interval of fault). The detection time (DT) is defined as the time difference between the start of fault and the first TP detection. The sensitivity (S) and false detection ratio (FDR) are defined:
For the sensitivity analysis of the proposed method, more randomized cases were generated, for each of the 7 types of faults, 20 different fault/signal (%) ratio or variance (var) values were defined. For each % (or var) value 10 different faults were introduced. Testing datasets were randomly selected from fifty different threeday simulations of the seventh scenario. The times of fault introduction were also randomly selected for each % (or var) value and fault type.
Table IX shows the sensitivity analysis of the proposed method for positive and negative step faults that were defined based on various amplitudes. As expected for lower % values the S value was close to 0 which means that the faults were not detected. In fact, this is a desired behavior, since such small changes in CGM measurements are normal and were inside the acceptable range. The strength of the fault detection algorithm is seen when relatively higher % values are used. The sensitivity is above 90% while no false detection was observed. The detection time is between a range of 1015 minutes which was considered to be acceptable.
The % values are kept lower for the drift (Table X) and exponential (Table XI) types of changes since the faults themselves had an increasing (in both directions) amplitude. Compared to step changes, the drift and exponential changes had longer detection time (1020 minutes). There is no wrong fault detection for any of the cases. However there were some missed faults when smaller values for % are used.
The last fault type was defined to be random changes based on a variance (var) value. Time to detection is longer because the random variations may prevent three consecutive samples to exceed the limits. Thus even though the readings may be above the threshold for one or two samples, they were not considered as true positive detections.
Multiway principal component analysis is thus useful in embodiments of this invention for detection of CGM related faults using data generated from the UVa/Padova simulator. The proposed method and module are able to detect all types of faults with very high accuracy without need of any information from the system that is under surveillance.
Since an artificial pancreas (AP) system uses several components such as sensors, transmitters, receivers, control units and pumps, it is prone to equipment failures. A sudden increase in continuous glucose monitoring (CGM) value due to sensor error may cause an AP system to overdose which may cause hypoglycemia, and a blockage in the infusion set may cause hyperglycemia. There are no AP systems that have a fault (failure) detection and diagnosis module which can monitor the AP system for possible equipment failures.
Statistical, process monitoring (SPM) and quality control have been very important in manufacturing industries and several techniques ranging from Shewhart charts to advanced multivariate SPM methods have been used successfully. Multivariate SPM techniques have gained importance in recent years and powerful multivariate SPM techniques for continuous and batch processes have been developed. Multivariate SPM charts provide more accurate information, about the system state, give warnings earlier than the univariate charts.
In some embodiments of this invention, a fault detection and diagnosis method for an artificial pancreas systems frames the problem as a batch process monitoring problem where the period following a meals is defined as a batch. In embodiments of this invention the batch period is a predetermined time period, such as 24 hours. This period, starts with the consumption of a meal which is a major disturbance to glucose homeostasis. It causes a sharp rise in blood glucose concentration (BGC) that tapers off slowly to a steady value. Since meals may contain different amounts of carbohydrates, protein and fat, the maximum BGC and the time to reach a steady BGC will be different for various meals. Other confounding activities such as physical activity and stress (both affect the sensitivity to insulin) may also occur during this batch period. Consequently, it is necessary to align batches to be used for developing the reference that describes normal operation to capture how the body responds to food when she artificial pancreas is functioning without faults that cause significant deviations in BGC. A strength of the multivariate SPM approach is to leverage the information, collected from various sensors to compute statistics that indicate abnormal operation of an AP and to determine the variables that caused significantvariation in these statistics. Then, rules are used to relate these variables to the source causes of the abnormal operation and diagnose the faults. This multivariate SPM approach can also be used to detect the presence of physical activity or stress, and determine the type and intensity of physical activity.
Multivariate SPM relies on the statistical distance concept. When there is significant colinearity in data, multivariate SPM charts based on principal components (PC) or latent variables (LV) of partial least square (PLS) are used to compute statistical distances from the reference state to summarize the information about the status of the system by using two statistics, the Hotelling's T^{2 }(T^{2}) and the squared prediction error (SPE). The monitoring charts are the plots of T^{2 }and SPE values computed by using information collected at each sampling time on the time axis. The T^{2 }chart indicates the distance of the current operation from the desired state as captured by the PCs or LVs included in the development of the model. Since only the first few PCs or LVs that capture most of the variation in the data are used to build the model, the model is an accurate but incomplete description of the process. The SPE chart captures the magnitude of the error caused by deviations resulting from events that are not described by the model. The T^{2 }and SPE charts are desirably used as a pair and if either chart indicates a significant deviation from the reference state, the presence of an abnormal situation is declared.
Principal component analysis (PCA) involves the orthogonal decomposition of the set of process measurements along the directions that explain the maximum variation in the data, PCA method can be used either as a filtering tool, for efficient data analysis and visualisation or as a modelbuilding structure to describe the expected variation under normal operation (NO). For a particular process, a NO data set covers targeted operating conditions during satisfactory performance. The PCA model that is based on NO conditions can be used to detect outliers, unusual patterns and deviations from NO conditions.
For continuous process, the data can be represented by matrix X(n×m) where n is the number of measurements and m the number of variables. The directions extracted by the orthogonal decomposition of X are the eigenvectors p_{i}(m×1) of X^{T}X also called PC loadings:
X=t_{1}p_{1}^{T}+t_{2}p_{2}^{T}+ . . . +t_{r}p_{r}^{T}+E (78)
where E(n×m) is the residuals matrix and superscript T denotes mains transpose. The dimension r is chosen such that most of the significant process information is captured by the t_{i }p_{i}^{T }terms, and E contains mostly random error. The projection of the measurements onto the eigenvectors defines new points in the measurement space that constitute the score matrix T whose columns are t_{i}(n×1) (Eq. (62)). The relationship between T, P, and X can also be expressed as:
T=X P and X=TP^{T}+E (79)
where P is the m×r matrix of loadings and T is the n×r score matrix. PCA transforms the coordinate system of a data set for more efficient description of variability in data.
Even though the human body can be considered as a continuous batch, the changes in glucose profile occur in a batch format. In batch processes, the data from experimental studies takes the form of threeway matrix. A batch is run in which j−1, 2, . . . , J variables are measured at k=1, 2, . . . , K time intervals through the batch. Similar data exists on a number of i=1, 2, . . . , I repeated batches. Hence, the batch data composes a 3D matrix X(I×J×K) as illustrated in
Multiway principal component analysis (MPCA) has been applied to many application for fault detection purposes of batch processes where data compose threedimensions matrix. MPCA is equivalent to performing ordinary PCA on a large twodimensional matrix X constructed by unfolding the threedimensional matrix X. The very common two unfolding ways are shown in
The X matrix can be decomposed to summation of the product of score vectors t_{r }(I×1) and loadings matrix PR (J×K) and a residual E:
where denotes the Kronecker product such that X=, P=X(i, j, k)=t(i)P(j, k), and R is the number of PCs. Considering the first unfolding technique, the second equation in Eq. (64) can also be used, where t_{r}I×1) and p_{r}(KJ×1) are the score and loading vectors of the unfolded X(I×KJ) matrix (
The data matrix X is meancentered and usually scaled to unit variance if the variables are not already in the same scale before performing PCA in the preprocessing step. For doing that, the mean of each column in X is subtracted from each column and divide my standard deviation of the columns.
The PCs for PCA can be computed by spectral decomposition or singular value decomposition. The covariance matrix
can be decomposed by spectral decomposition as:
S=PΛP^{T} (81)
where P is a unitary matrix whose columns are the normalized eigenvectors of the S matrix and Λ is a diagonal matrix that contains the ordered eigenvalues λ_{i }of the S. The scores T is then calculated by T=X P.
Singular value decomposition of the X matrix is given as:
X=UΣV^{T} (82)
where the columns U are of the normalized eigenvectors of XX^{T}, the columns of V are the normalized eigenvectors of X^{T}X, and Σ is a diagonal matrix having as its elements the singular values, or the positive square roots of the magnitude ordered eigenvalues of X^{T}X. The loading and score matrices are obtained as:
P=V and T=UΣ (83)
In this example, the nonlinear iterative partial least square (NIPALS) method that was developed by Wold et al., “Principal component analysis,” Chemometrics and intelligent laboratory systems, vol. 2, no. 1, pp. 3752, 1987, was used for the calculation of PC's because the decomposition methods were inefficient for calculation of PCs when number of the PCs is largely smaller than the number of variables which is a very common condition when the X matrix is batch wise (first method) unfolded. The NIPALS algorithm for MPCA:

 1) Unfold X(I×J×K) into X(I×J K).
 2) Scale X.
 3) Choose a column of X as t.
 4) p=X T t.
 5) p=p/\p\.
 6) t=X p.
 7) If t has converged, then go to Step 8; otherwise go to Step 4.
 8) E=X−tpT.
 9) Go to Step 4 with X=E to extract the principal component.
Again, even though the human body can be considered as a continuous batch, the changes in glucose profile occur in a batch format. After a meal, glucose levels increase to a higher and comes does when insulin is infused. This is up and down curve shape is repeated for every meals. By defining each meal period as a batch, the batch wise unfolding technique is used herein.
Once the scores and loadings for the unfolded matrix X are obtained from the NIPALS algorithm, T^{2 }and SPE can be used for fault detection. The T^{2 }chart detects the small shifts and deviations of new observations from the NO conditions that are captured by the MPCA model. It includes contributions of ail variables which can be significantly faster than checking the deviation of individual variables. The T^{2 }for all variables in a batch at time k based on the reference data X is calculated:
where t_{i,j,k}(1×R) is the score vector of the batch i for variable j at time k and
where σ_{Tk }is the standard deviation of T_{k }matrix for I batches at time k.
SPE charts show deviations from the NO conditions that are not captured by the MFC A model. The SPE for all variables in a batch at time k based on the reference data X is calculated;
where x_{i,j,k }is a variable j from batch i at time k and {circumflex over (x)}_{i,j,k }is the predicted value of the same variable that is obtained from the Eq. (78). The control limit for SPE at time k is defined as:
=
where
In realtime, when a new set of data (J variables) from a new batch is measured at time k, the terms t_{i,j,k }and x_{i,j,k }in Eq. (68) and (69) are replaced with t_{new,j,k }and x_{new,j,k}, respectively. A fault is detected if any of the following condition is satisfied:
In Eq. (88) only, the positive side of limits is considered because both T^{2 }and SPE values are always positive due to squared calculation in Eq. (84) and (85).
It is a common situation in batch processes that the total, duration of the batches is not the same due to several factor. The unequal, batch data length causes problems for defining a 3D X for development of an MPCA model. Even though the batches have same length, due to dynamic variability, different event may occur at different times from batch to batch. This kind of mismatching in data may cause wrong and missed alarms in a MPCA based, fault detection algorithm. As mentioned before, the time interval between two meals is defined as a batch. Batch wise unfolded MPCA models require equal batch length. However, different types and/or amounts of meals may not have the same effect which may results various different lengths and shapes of glucose profile. Due to the human body complexity, the duration of two identical meals may not be the same.
Dynamic time warping (DTW) has its origins in speech recognition and is a flexible, deterministic, pattern matching scheme that works with pairs of patterns. It can locally translate, compress, and expand the patterns so that similar features in the patterns are matched. DTW nonlinearly warps two trajectories in such a way that similar events are aligned and a minimum distance between them is obtained. It is assumed that an appropriate scaling was performed prior to implementation of DTW; scaling is an important issue since DTW is a distancebased technique. One can calculate the mean and standard deviation for each variable in each batch trajectory set, take the average of those, and use the average to scale the set of trajectories to a common yaxis scale. The reference batch trajectory set is defined based on process knowledge, or it can be calculated based on an adaptive iteration technique. No scaling is performed in this thesis, since the batch synchronization is done only based on CGM measurements.
Assume that x_{r }and x_{t }are the reference batch trajectory (previously defined) and a batch to be synchronized with size r and t, respectively. DTW, discussed above, defines the Euclidean distance between each point of the two trajectories as:
d(i(κ))=[x_{r}(i(κ))−x_{t}(j(κ))][x_{r}(i(κ))−x_{t}(j(κ))]^{T} (89)
where κ is the number of grid points along the path between two trajectories, i, j are the sample points and goes up to r and t for the reference and new batch trajectories, respectively. The total distance between two batch trajectories is:
where max(t, r)≤L≤r+t. The optimal path and minimum total distance is found as the solution of the following optimization problem:
The Computational load to solve the problem, in Eq. (91) might, be too high, since all possible paths must be defined and the one which gives minimum distance is selected. A very elegant and effectively solution to this problem is dynamic programming. Dynamic programming is a mathematical technique which guarantees to find the optimum path without having to calculate the distance along all possible paths:
With respect to some local and global constraints:
D_{F}(r,t)≤d(r,t)
D_{F}(1,1)=d(1,1)
i(κ+1)≥i(κ)
j(κ+1)≥j(κ) (93)
After a fault is detected by either the T^{2 }or SPE charts as in the Eq. (88), the source of the fault most be defined. In this thesis, whenever a fault is detected, the contribution of all variables on the T^{2 }and SPE is calculated. The contributions are sorted in descending order. Based on reference data two threshold are defined. The sorted variables that have contributed more than the defined threshold are considered as the source of the detected fault. By checking the determined variables, a fault diagnosis is made based on process knowledge and if/then rules. The contribution of the variable j in a batch i at time k is calculated as:
Data was collected from 7 subjects using multiple devices. Each subject had a CGM sensor, a pump, a Sensewear armband and a BioHarness™ 3 chestband by Zephyr Technology. Overall 47 variables are defined including CGM measurements, insulin infusions, heart rate, breathing rate, three way accelerations, skin temperature, galvanic skin response, heat flux and more. An MPCA model was developed for each subject. The batches in the MPCA models were defined based on the meal detection algorithm where the time interval between two detected meals is defined as a batch. Dynamic time warping is used for realtime synchronization of unequal batch length. T^{2 }and SPE charts are used for the detection of system failures.
In
Another fault was detected at time 82 where both T^{2 }and SPE charts are above their thresholds (
A third fault was detected at time where only the SPE chart is above its threshold. The variables that contributed the most are defined to be the twoway mean absolute difference (MAD) acceleration signals from the armband (
The change in the galvanic skin response can be related to sweating during an exercise period. After the diagnosis step, the changes in the MAD accelerations are not defined as a fault but just an exercise period.
The last fault was detected at time 94 where both charts are above their thresholds. The variables that contributed the most are found to be step counter signal from the armband (
The invention includes a module for automatically detecting food consumption and/or a rapid glucose level increase without manual input by the patient. In embodiments of this invention, a modified version of the Herman's minimal model is used for meal detection. An unscented Kalman filter (UKF) can be used for simultaneous estimation of states and parameters of the minimal model. Also, meals can be detected based on rate of appearance of glucose estimations and some safety rules. An insulin bolus calculation algorithm, is also added for detected meals.
Bergman's minimal model, is a threecompartment “minimal model” to analyze plasma glucose and insulin dynamics during an intravenous glucose tolerance test. Modifications of the minimal model have been proposed to separate the effect of glucose production from utilization and to capture absorption, distribution, and disposal glucose insulin dynamics. The effects of free fatty acids and exercise are also incorporated into the minimal model. The dynamical equations for plasma glucose concentration G(t) and effective insulin concentration I_{eff }are given by:
where G_{b }and I_{p }represent basal plasma glucose concentration and plasma insulin concentration, respectively. The rate of appearance of glucose R_{a}(t) can be defined, as a twocompartment model:
where C(t), V, and τ are the amount of consumed carbohydrate, the distribution volume, and the peak time of meal absorption, respectively. In the original Bergman's model and its extensions, the unknown model parameters p_{1}, p_{2}, p_{3}, p_{4}, V, and τ are not timevarying. However, due to the complexity of the human body and intersubject variability, a constant set of parameters may not be able to describe all timevarying dynamics for a subject. Also, intrasubject variability may require different sets of parameters for different subjects. In embodiments of this invention, all unknown parameters and the basal plasma glucose concentration G_{b }are defined to be timevarying in order to overcome the inter and intrasubject variability. Using the first forward difference derivative approximation, (96)(98) are discretized as:
where
and h and w(k) represent sampling tune and noise term, respectively. l is the length of the window that is used for calculation of G_{b }and selected to be 30 min. The notation for plasma glucose concentration G(t) in (73) is replaced with subcutaneous glucose concentration (CGM) G_{3 }(k) in (76). The relation between two variables was shown to be a onecompartment model with a delay parameter, which was neglected in the example below due to validation reasons.
The Unsecured Kalman filter is a powerful tool for state estimation of nonlinear systems. The drawbacks of linear approximation at an operating point and calculation of Jacobian matrices in the extended Kalman filter are overcome by using a minimal set of carefully chosen sample (sigma) points.
A nonlinear statespace model is derived from (76)(80):
x(k+1)=f(x(k))+w(k)
y(k)=g(x(k))+v(k) (104)
where x(k) is the state vector, w(k) and v(k) are defined to the process and measurement noises, respectively. The nonlinear functions ƒ(⋅) and g(⋅) are defined from (99)(103). The statespace model in (81) has eight states since some parameters in (99)(103) are defined to be part of noise term w(k).
Defining L as the dimension of x vector, the scalar weights W_{i }are defined as:
W_{0}^{x}μ/(L+μ)
W_{0}^{y}=μ/(L+μ)+(1−α^{2}+β)
W_{i}^{x}=W_{i}^{y}=1/[2(L+μ)] (105)
where i=1, . . . , 2L and μ=α^{2}(L+κ). The tuning parameters α,β, and κ are selected to be 1, 2, and 0, respectively. The sigmapoint vectors χ_{i }are defined as:
χ_{0}(k−1)={circumflex over (x)}(k−1)
χ_{i}(k−1)={circumflex over (x)}(k−1)+γ×η_{i }
χ_{i+L}(k−1)={circumflex over (x)}(k−1)−γ×η_{i} (106)
where η_{i }is the ith column (i=1, . . . , L) of the squared roof of the augmented covariance matrix P(k−1) and the parameter γ=√{square root over (L+μ)}. Prior sigmapoint estimations χ_{i}^{− }are calculated by propagating the sigmapoints χ_{i}(k−1) through, the nonlinear function ƒ(⋅). The prior sigma points are trimmed with a nonlinear optimization to prevent nonrealistic estimations such as negative values in concentrations:
χ_{i}^{−}(k)=min[Δχ_{i}]^{T}[Δχ_{i}]
Δχ_{i}=χ_{i}^{−}(k)−ƒ(χ_{i}((k−1))
χ_{min}≤χ_{i}^{−}(k)≤χ_{max }
i=0, . . . ,2L. (107)
The prior state estimations and covariance matrix are calculated as:
where Q_{p }is the covariance matrix of the process noise. The prior sigmapoint estimations are propagated through the nonlinear function g(⋅) for calculation of prior output sigma points _{i}^{−}:
(k)=g((k))
i=0, . . . ,2L. (110)
The measurement estimations are obtained from the output sigma points as:
The innovationcovariance and crosscovariance matrices are calculated as:
where Q_{m }represents the covariance matrix for process measurement noise. Finally, the Kalman filter gain and the updated state vector estimation and covariance matrix are calculated as:
K(k)=P_{xy}(k)(P_{yy}(k))^{−1} (114)
{circumflex over (x)}(k)={circumflex over (x)}^{−}(k)+K(k)(y(k)−ŷ^{−}(k)) (115)
P(k)=P^{−}(k)−K(k)P_{yy}(k)(K(k))^{T}. (116)
To demonstrate meal detection according to this invention, example data were collected, from nine subjects undergoing multivariable AP control system experiments without any announcement (meal, or exercise). Closedloop control was performed for 32 h for each subject. Based on the study protocol, breakfast, lunch, dinner, and a late time snack were provided. Additional snacks were provided whenever requested by the subjects. The types of foods were selected based on a subject's personal requirements. No limitation on food or snack intake was imposed. The subject's own insulin type and pump were used during the experiments. Data were continuously collected from the subjects with a sampling time of 5 min. Every 10 min, insulin infusion rates were Computed by the controller and used to adjust the pump. Guardian REALtime CGMs (Medtronics, Northride, Calif., USA) were used to collect the glucose concentration information.
To minimise the effect of CGM measurement noise on the first forward difference derivative approximation, 1min sampled CGM data are obtained, from original data sampled every 5 min, using pchip interpolation. The initial conditions and tuning parameters are selected as:
where CGM(1) is the first measured glucose value and the initial, values for p_{1}, p_{2}, and p_{4 }were adapted from the literature.
The mealdetection algorithm was developed based on the state estimations {circumflex over (x)}(k) from the UKF algorithm. A meal is detected if the estimated rate of appearance of glucose R_{a}(k) is above the threshold of 2 [mg/dl/min]. Once the R_{a}(k) value goes below the threshold, a flag is lifted and another meal is detected when the value gets above 2 mg/dl/min. For safety from hypoglycemia, a meal detected is used for insulin bolus decision only when CGM values are above 100 [mg/dl].
Table XIII summarizes the results for nine subjects data. Overall, 51 main meal and 13 snack periods were tested. Out of 63 cases, only two meals were missed. As shown in
The rate of appearance of glucose R_{a}(k) estimations was used for calculation of meal boluses. A meal bolus was given when the estimated R_{a}(k) was above 2 [mg/dl/min] and measured CGM value is above 100 [mg/dl]. A second meal bolus can be given only after the R_{a }(k) values go below the 2 [mg/dl/min] threshold and 30 min passed over the last infused meal bolus. Once a meal bolus was infused, a flag was turned on to activate correction bolus (CB) infusion and the 2 [mg/dl/min] threshold was increased to 3 [mg/dl/min]. While the flag was ON, the R_{a }(k) value was checked every 15 min and a CB was given if the R_{a }(k) was above the new threshold. For each given CB, the threshold was increased by 1 [mg/dl/min] and the process was repeated every 15 min until the flag is turned OFF. The CBs are calculated based on measured CGM values G_{s }(k) and subject's body weight (BW) as a function of total daily dose (TDD) as follows:
where r_{0 }and μ are the desired set point, and the tuning parameter that affects the amount of CB infusions, respectively. The values μ were selected to be 0.55, 0.3, and 0.1 for sensitive, normal, and resistant adults or adolescents and 0.8, 0.7, and 0.45 for sensitive, normal, and resistant children, respectively. The set point r_{0 }is set to 100 mg/dl. The proposed meal bolus calculation strategy was performed on the academic version of UVa/Padova metabolic simulator, which had 30 subjects (ten adults, ten adolescents, and ten children). A threeday simulation scenario was generated and 300 simulations (ten for each subject) were performed. The same scenario was used for adults and adolescents. The amount of carbohydrates, in meals was reduced for children.
The 30 subjects of the UVa/Padova metabolic simulator were divided into three subgroups (sensitive, normal, resistant) based on a subject's insulin sensitivity. The amount of meal boluses were defined based on these three subgroups. The meal boluses were selected to be 4 [U], 3 [U], and 2 [U] for the resistant, normal, and sensitive adult and adolescent subjects and 1 [U], 0.85 [U], and 0.7 [U] for the resistant, normal, and sensitive child subjects, respectively.
The mealdetection algorithm developed was able to detect almost, all tested meals. Simulation results indicate that using such a highperformance mealdetection module in AP control systems can prevent most of hyperglycemia by providing bolus insulin for meals before large increases in BGC without any manual information from patients. The mealdetection method of this invention can be incorporated into a module for the artificial pancreas device of this invention. The mealdetection module is completely adaptive and does not require any subjectspecific initialization. It works based on only CGM measurements. The early detection of meals by the mealdetection module enables the device to provide a meal bolus (without any manual announcements) that would prevent most of postprandial hyperglycemia.
In a second study, seven subjects included in this analysis were young adults with fair glucose control (Table XIV) using continuous subcutaneous insulin infusion pump for their glucose regulation. The subjects met with the investigators for a total of 3 days; however, to best facilitate retention, some subjects opted split day(s) into 4 hour blocks of time totaling 24 hours. Based on some subjects' schedule, some of the experiments took 2 weeks to 8 weeks (total hours stay at facility was the still same). Subjects were provided meals and snacks during their stay. The meal numbers and amounts were defined based on subjects preferences. Additional snacks were provided whenever requested by subjects. Subjects used their own meal bolus and correction insulin calculation methods prescribed by their own diabetes provider.
The closed loop occurred over a 3day period. Subjects were provided two CGM devices, a BodyMedia SenseWear armband, and a Zephyr chestband. The subjects had a CGM placed prior to the study, and the study doctor had begun to remotely monitor subject BGs before the study began then continuously during the study. Continuous data collection from the subject started on Day 1 and insulin delivery via the algorithm continued for 60 hours. Data were collected and transmitted to a laptop computer, every 5 minutes. All three days subjects had exercises personalized to individual subjects, to include aerobic, resistance or interval exercises in the same sequence for all subjects according to the individuals' fitness level. Exercise intensity was calculated based on subjects' exercise stress tests from reference (OL) experiments. According to the Karvonen formula, the subjects' target heart rate training zone was calculated. The formula uses maximum and resting heart rate (HR) with the desired training intensity to get a target heart rate (((maximal HR−resting HR)×65 to 85% intensity)+resting HR). For interval training, moderate intensity is 6070% of heart rate reserve and high intensity is 8590% of heart rate reserve. Every 10 minutes insulin infusion rates were computed by the controller (CL) and overseen by a physician. Subjects were monitored, for hypo and hyperglycemia, during this time and discharged, from the facility approximately 2 hours following disconnection from the algorithm. Daily dietary needs (8 meals and snacks) and two nights sleeping accommodations were provided. Foods consumed (type and amount) and physical activity, were logged throughout the study period. The meal contents were not controlled and were defined based on subjects' preferences similar to the OL experiments.
Overall 14 experiments were performed on the 7 different subjects. Subjects made their own insulin decisions in the OL experiments while the device with the proposed meal bolus module is used during the CL experiments.
Two separate CL experiments were performed with Subject 1 where the meal bolusing method was tested during only the latter experiment.
People with Type 1 Diabetes (T1D) may experience hypoglycemic (blood glucose concentration ((BGC)<70 mg/dl) episodes that may be caused by insulin doses that are too large in relation to the BGC, reduced food intake, extensive physical activity, or slow absorption of currently available “fastacting” insulins. Fear of hypoglycemia is a major concern for many patients and affects patient decisions for use of an artificial pancreas (AP) system. Various strategies have been proposed for predicting BGC to be implemented in an AP system for prevention of hypoglycemia.
The indention further includes a method and hypoglycemia detection and or alarm module for prevention of hypoglycemia by issuing predictive hypoglycemia alarms and encouraging patients to consume carbohydrates in a timely manner. The method was tested on 6 subjects over threeday clinical experiments. Over 6 threeday clinical experiments, there were only 5 real hypoglycemic episodes of which only 1 episode of hypoglycemia occurred due to being missed by the proposed algorithm. The average glucose value at the time first alarms were triggered as recorded to be 117±30.6 mg/dl. The average carbohydrate consumption per alarm was 14±7.8 grams. The results show that most of low glucose concentrations can be predicted in advance and the glucose levels can be raised back to the desired levels by consuming an appropriate amount of carbohydrate. The method is thus able to prevent most hypoglycemic events by suggesting appropriate levels of carbohydrate consumption before the actual occurrence of hypoglycemia.
The experiments were performed over a 3day period. Six subjects (3 male and 3 female, age: 24.2±4.5, weight: 79.2±16.2 (kg), height: 172.7±9.4 (cm), HbA1C (%): 7.3±0.48, duration with diabetes (months): 209.2±87.9) participated in the study. Subjects were provided two CGM devices, a BodyMedia SenseWear armband, and a Zephyr chestband. The subjects had a CGM placed prior to the study, and the study MD had begun to remotely monitor subject blood glucose before the study began then continuously during the study. Continuous data collection from the subjects started on Day 1 and insulin delivery via AP methods continued for 60 hours. Data were collected and transmitted to a laptop computer, every 5 minutes. Plasma glucose concentration was measured every 30 minutes using the YSI 2300 STAT (Yellow Springs Instrument, Yellow Springs, Ohio). All three days subjects had exercises personalized to individual subjects, to include aerobic, resistance or interval exercises in the same sequence for all subjects according to the individual's fitness level Exercise intensity was calculated based on subjects' exercise stress tests. The subjects' target heart rate training zone was calculated according to the Karvonen formula. The formula uses maximum and resting heart rate (HR) with the desired training intensity to get a target heart rate (((maximal HR−resting HR)×65 to 85% intensity)+resting HR).
For interval training, moderate intensity is 6070% of heart rate reserve and high intensity is 8590% of heart rate reserve. Subjects were monitored for hypo and hyperglycemia during this time and discharged from the CRC approximately 2 hours following disconnection from the algorithm. Daily dietary needs (8 meals and 2 snacks) and two nights sleeping accommodations were provided. Participants received a 1dcycle rotating menu each day for 3 days customized to individual food preferences. Prior to admission for the study, participants were interviewed by phone to plan the study diet. Carbohydrate intake was kept very similar to their usual intake. Daily calories were divided among breakfast (25%), lunch (30%), dinner (35%) and evening snack (10%). The caloric content and macronutrient composition of consumed meals, snacks and beverages were calculated using Food Processor SQL (version 10.15.41, ESHA Research, Salem, Oreg.). Participants were not required to eat 100% of meals and were only allowed to eat food provided by the CRC Metabolic Kitchen. Any food that was not consumed was weighed back. Foods consumed (type and amount) and physical activity, were logged throughout the study period.
Glucose predictions were obtained by using a multivariable timeseries models where glucose concentration was expressed as a function of past glucose concentration and physical activity signal readings and infused insulin amounts by using an ARMAX model structure:
A(q^{−1})y(k)=B_{t}(q^{−1})u_{t}(k−1−d_{t})+C(q^{−1})∈(k) (121)
where q^{−1 }is the backward shift operator, y(k) is the observation (CGM readings), u(k−1) is the i^{th }input variable at k−1^{th }sampling time, ∈(k) is the white noise at k^{th }sampling time, d_{t }is the delay term for the corresponding input.
where n_{A}, n_{B}, n_{C }are model orders that are determined based on the properties system. The model in Eq. (121) has one output (glucose measurements) and three inputs (infused insulin, measured energy expenditure and galvanic skin response), respectively. With every new measurements, the model in Eq. (121) was used for 30 minutes prediction of glucose concentration, according to earlier work.
Based on measured glucose values five different phases were defined as shown in
where x=[0, 5, 10, 15, 20, 25] (based on 5 minutes sampling time) and y_{k }is measured glucose at time k. X and Y are mean values of x and y_{t}(t=k−N, . . . , k), respectively. The moving window length N is selected to be 5 (last 30 minutes).
With every new measurement, 30minutesahead glucose predictions were compared with 70 the mg/dl mild hypoglycemia threshold (80 mg/dl during exercise). If the predicted values were below the threshold, the last measured glucose value was used for determination of the phase interval. At the same time, the speed of glucose reduction was obtained using Eqs. (125) and (126). Once the phase and the speed of reduction, were calculated, specific amounts of CHO (
The method was tested on 6 subjects over threeday closed loop experiments. When hypoglycemia was detected, subjects were notified for the potential low glucose concentration and the module algorithm, suggested some amounts of warning CHO to be consumed according to the flowchart in
In the first experiments, hypoglycemia alarms were issued during six time periods throughout, the threeday experiment and warning CHO were suggested by the algorithm (
The second experiment had 4 potential hypoglycemic periods (
Overall, 18 times (19±5.2 gram, total 345 gram) warning CHO were taken during 12 different time instances for experiment 3 (
Experiment 4 had 12 different hypoglycemia warning alarm periods (
There, was no real hypoglycemia during experiment 5 (
Table XV summarizes the results where overall 5 real hypoglycemia instances were seen during all 6 experiments. Per experiment there was only 1 hypoglycemia. Out of 5 real hypoglycemia instances, only 1 is considered to be missed as by the algorithm as the rest are due to either patients' decision, or sensor inaccuracy.
The results show that most low glucose concentrations can be predicted in advance and the glucose levels can be raised back to the desired levels by consuming appropriate amount of OHO. There were only few cases where actual hypoglycemia occurred. However, some of these hypoglycemia episodes might be due to sensor accuracy or subject GEO consumption preferences. The method thus provides a simple and effective intervention based on 30minutesahead prediction of hypoglycemia. The method can be added to the developed system of this invention Including the other modules such as an adaptive controller, a hypoglycemia early alarm system, a meal detection and bolus calculator, a physical activity classifier, and a fault detection module.
AP control systems usually use continuous glucose measurements to calculate the optimum amount of insulin to be infused with an insulin pump in order to keep blood glucose concentration within a safe target range. Realtime estimation of plasma insulin concentrations would increase the accuracy of AP control algorithms. This information enables calculation of more realistic insulin infusion rates and prevention of hypoglycemia caused by overdosing of insulin.
The invention includes automated monitoring and/or determining plasma insulin concentration in real time from continuous glucose monitoring data by automatically implementing a mathematical model with the AP control system. Hovorka's compartmental model, developed to describe glucoseinsulin dynamic in different parts of the human body, has been incorporated into a continuousdiscrete extended Kalman filter (CDEKLF) to provide an estimate of plasma insulin concentration. The CDEKF is the generalization of the Kalman filter to nonlinear systems with continuoustime state equations and discretetime measurements. Furthermore, because of variability in system, dynamics, uncertain and subjectspecific model parameters have been considered as new states in Hovorka's model to be estimated by CDEKF. This method was evaluated by using clinical data from patients with Type 1 diabetes who underwent a closedloop AP experiment. Realtime insulin estimations were compared to plasma insulin measurements to evaluate performance and validity of the proposed methodology.
Simulation results indicated that the method is able to estimate the plasma insulin concentration accurately in real time. Furthermore, the results for estimated continuous glucose measurements were compared to their real values to assess the performance of the method. This method will be beneficial for an AP system for real time estimation of nonmeasurable variables such as plasma, insulin concentrations. The method can be implemented as a module within the integrated multivariable adaptive AP of this invention to estimate plasma insulin concentrations and for computing insulin infusion rates and making decisions on glucose concentration management strategies for an AP user.
Embodiments of this invention incorporate a continuousdiscrete extended Kalman filter (CDEKF). Hovorka's compartmental model (Hovorka et al., 2004) that describes glucoseinsulin dynamics is used to develop the state model that is augmented by additional state variables describing model parameters that have significant variations, CDEKF is developed by using the augmented model.
A common approach in literature to estimate plasma insulin concentration is to simulate the insulin intakes in an insulin model. In general this nonlinear model can be represented as:
{dot over (x)}=ƒ(x(t),u(t) (127)
where u(t) is the input of the model, x(t) is the system state vector, and ƒ(x(t), u(t)) defines the system's dynamics.
An exemplary insulin model is one developed by Hovorka et al. (Hovorka et al., 2004). The system state vector x(t) is given by:
x(t)=[S_{1 }S_{2 }I x_{1 }x_{2 }x_{3 }Z_{1 }Z_{2 }IG] (128)
All model equations, variables, parameters, units and nominal values used in this model are listed in Table XVI.
Systems with uncertainties in their dynamic and noise in measurements can be expressed by:
{dot over (x)}=ƒ(x(t),u(t))+G(t)ω,ω(t)˜N(0,Q) (129)
z(t)=h(x(t))+v(t),u(t)˜N(0,R)
where h(x(t)) denotes the measurement function and z(t) is the output of the model.
Furthermore, w(t) and v(t) represent uncertainties in the process model and the observation noises, while Q and R denote the variances of these noises, respectively. G(t) is also process noise matrix.
In most biological systems, only a few states are measurable (output variables z(t). In this case, only interstitial glucose concentration (GC) can be measured by subcutaneous glucose sensors. However, state observers such as the Kalman filters can estimate unmeasured states based on a limited set of measured variables. The linear Kalman filter is a stochastic filter that estimates the states of a system based on a linear statespace model in a twostep process: the prediction and the correction steps. In the prediction step, the Kalman filter estimates the current stale variables. Once new measurements (with noise) are collected, the state estimates are updated by using a correction factor based on the difference between the measured and estimated values multiplied by a gain term. The extended Kalman filter (EKF) uses local linearization to extend the Kalman filter to systems described by nonlinear ordinary differential equations.
In order to estimate plasma insulin concentration from CGM data, Hovorka's glucoseinsulin model is incorporated in an EKF. Moreover, an extra equation is added to the system to describe the relationship between blood glucose and interstitial glucose measured by continuous glucose monitors. The function f(x(t), u(t)) is described by the dynamical equations exposed into Table XVI, while h(x(t))=IG(t), as only interstitial glucose concentration can be measured by SC glucose monitors.
Because CGM data are reported every five minutes, a continuousdiscrete extended Kalman filter (CDEKF) is used. The CDEKF is the generalization of the Kalman filler to nonlinear systems with continuoustime state equations and discretetime measurements. These type of systems can be expressed by:
{dot over (x)}=ƒ(x(t),u(t))+G(t)ω,ω(t)˜N(0,Q) (130)
z(t_{k})=h(x(t_{k}))+v(t_{k}),v(t_{k})˜N(0,R)
Table XVII summarizes a CDEKF according to one embodiment of this invention,
In many state estimators good knowledge of systemdynamics and parameter values are assumed. This assumption is not realistic when the system has nonlinear dynamics and parameter values that are not accurate or constant. State observers can be used to estimate these uncertain parameters by building new extended models in which these parameters are considered as new states with no dynamics. The nonlinearities in glucoseinsulin dynamics and uncertainties in parameter values can be accommodated by defining extended Hovorka's models such that various parameters are considered as extended states of the model:
The parameters with the greatest impact on plasma Insulin concentration are k_{c }(plasma insulin elimination rate) and t_{max,t }(time to maximum insulin, absorption). Hence, both parameters have been selected as uncertain states in extended Hovorka's models.
In the following example, subjects were young adults aged 1835 years with T1D. All subjects used insulin pump therapy, were healthy and physically active. To analyze the performance of proposed method, the following clinical data were required for each experiment:

 CGM—available every five minute
 PIC—available every thirty minutes
 Insulin information—basal and bolus insulin based on adjustments made to insulin infusion rate of the pump
The CDEKF module was developed in MATLAB. Simulation results for one closedloop AP experiment was presented and the estimated values for COM and PIC were compared with clinical data. Based on simulation results and comparison with experimental data, as shown in
In another embodiment of this invention, the method for PIC estimation uses COM measurements by modifying Bergman's minimal model and integrating it to an unscented Kalman filter (UKF). UKF overcomes the drawbacks of linear approximation at an operating point and calculation of Jacobian matrices in the EKF by using a minimal set of carefully chosen sample points. Contrary to the original Bergman's model, the unknown model parameters are defined to be timevarying to deal with intra and intersubject dynamic variability. A partial least squares (PLS) model based on each patient's demographic information, such as body weight, height, BMI and total daily insulin dose is developed for prediction of initial values of the unknown model parameters. The method desirably uses only realtime CGM measurements. The method is likewise implemented as a module of the integrated multivariable adaptive artificial pancreas of this invention and no other manual information such as meal announcement or carbohydrate intake is used.
A modified version of the extended minimal model was developed and used, similar to that shown in
where I_{SC}, I_{p}, I_{eff}, G represent subcutaneous, plasma and effective insulin concentrations and glucose concentration, respectively. As shown in Eqs. (132136), all unknown model parameters were defined to be timevarying in order to accommodate inter and intrasubject dynamical variability. Equation (136) states that their variation over time is zero, however, their changes over time are defined to be functions of white noise later in the estimation step.
Consumed meals have significant effects, on the glucose compartment in Eq. (135). However, since the method is a part of the fully automated AP system of this invention, no manual information about meals was provided. Thus, the meal effect was considered as a disturbance to the system and was not modeled in the main model equations (132)(136). Instead, the tuning parameters of the estimators were defined in such a way that the nutrition effect was accommodated. The equations were discretized using first forward difference derivative approximation with a 5minutes sampling time and a nonlinear statespace model was written as:
ξ(k+1)=f(ξ(k),u(k))+w(k)
y(k)=g(ξ(k),u(k))+v(k) (137)
where ξ(k), u(k), y(k) are model states (I_{SC}(t), I_{P}(t), I_{eff}(t), G(t), τ_{1}(t), τ_{2}(t), p_{1}(t), p_{2}(t), p_{3}(t), p_{4}(t), V_{ins}(t)), input (infused insulin) and output (measured glucose), respectively, w(k) and v(k) represent model and measurement noises. The changes over time in the unknown timevarying model parameters listed in Eqs. (132136) and the nutrition effect (See
The two unknown model parameters τ_{1 }and τ_{2 }in Eqs. (132) and (133) have significant effect on PIC estimations and their initial values are critical for improving the accuracy of estimated PIC values. PLS models were developed for the initial guess of the two parameters. PLS is a multivariate regression method for modeling the relationship between two groups of data (explaining the variations in Y by using X) with many noisy, collinear variables and even incomplete data. PLS models summarize the repressor (input) variables matrix X to extract the most predictive information for the response variables Y and maximize the covariance between X and Y. The outer relations for X and Y are
X=TP^{T}+E=Σ_{t=1}^{a}t_{t}p_{t}^{T}+E (138)
Y=UQ^{T}+F=Σ_{t=1}^{a}u_{t}q_{t}^{T}+F (139)
where E and F represent the residuals matrices. Linear combinations of x vectors (single observation vector) are calculated from the latent variable scores t_{t}=w_{t}^{T}x and those for the y vectors (response variables, τ_{1 }and τ_{2 }in this case) from u_{t}=q_{t}^{T}y so that they maximize the covariance between X and Y explained at each dimension. w_{t }and q_{t }are the weight sectors and p_{t }are the loading sectors of X. The PLS model can be built by using the nonlinear iterative PLS algorithm (NIPALS). The X matrix consists of demographic information such as body weight, height, BMI, total daily insulin dose and the Y matrix is defined to be the two critical parameters τ_{1 }and τ_{2 }in Eqs. (129) and (133). Once the initial values for the parameters are determined from the PLS models that are developed by using training data, UKF can provide the estimates of PIC by using only CGM measurements.
Pearson's correlation coefficient, which is a measure of the strength of the linear relationship between two variables, is used to show the correlation between the estimated and measured PIC samples. Pearson's correlation coefficient R is calculated as:
where is the estimated PIC at time t. Pearson's R can range from −1 to 1. An R of −1 indicates a perfect negative linear relationship between variables, an R of 0 indicates no linear relationship between variables, and an R of 1 indicates a perfect positive linear relationship between variables.
The method was tested for two sets of data where the pharmacodynamics of insulin were different. The test indicated that the proposed method can estimate PIC accurately even under challenging and difficult conditions since the dynamics of insulin infusion to the subcutaneous tissue (and diffusion to the bloodstream) were different in the two clamp studies. Thus the proposed algorithm can estimate PIC with a high accuracy. The adaptive nature of the algorithm can deal with dynamic changes in the human body and provide good estimates of PIC.
Thus the invention provides an automated method and device for monitoring and/or treating glucose levels of a patient with diabetes. The various aspects of the method can implemented individually or collectively as modules in a new or existing artificial pancreas system to provide a fully automated, closedloop device.
While in the foregoing detailed description this invention has been described in relation to certain preferred embodiments thereof, and many details have been set forth for purposes of illustration, it will be apparent to those skilled in the art that the invention Is susceptible to additional embodiments and that certain of the details described herein can be varied considerably without departing from the basic principles of the invention.
Claims
1. A method for monitoring and/or treating glucose levels of a patient with diabetes, the method comprising:
 automatically monitoring a glucose concentration level in the patient with a continuous glucose monitor worn by the patient to obtain a measured glucose level;
 automatically monitoring physiological variables of the patient using at least one physiological sensor worn by the patient to obtain measured physiological variables;
 automatically receiving the glucose concentration level and the physiological variables at a controller in communication combination with the continuous glucose monitor and the at least one physiological sensor;
 the controller automatically determining a physiological state of the patient from the measured physiological variables by automatically matching the measured physiological variables to one of a plurality of predetermined classified physiological states stored in the controller;
 the controller automatically estimating a future glucose level of the patient as a function of the measured glucose level, at least one of the measured physiological variables, and the determined physiological state of the patient;
 the controller automatically computing the insulin dose to be infused and delivering instruction to an insulin pump to deliver the insulin dose to the patient; and
 automatically updating the controller using further glucose measurements from the continuous glucose monitor and further physiological variables from the at least one physiological sensor.
2. The method according to claim 1, further comprising:
 the controller automatically determining a change between at least two measured glucose levels that exceeds a predetermined value; and
 the controller automatically comparing the change in the measured glucose level to any change in physiological state to determine a cause of the change in the measured glucose level.
3. The method according to claim 1, wherein the physiological state is determined using real time streaming data from the at least one physiological sensor and is selected from sleep, physical activity, stress, or combinations thereof.
4. The method according to claim 3, wherein the at least one physiological sensor worn by the patient measures physiological variables selected from a combination of movement, skin temperature, dissipated heat from the body, galvanic skin response, heart rate, ECG, respiration rate, posture, or body position.
5. The method according to claim 1, further comprising automatically predicting and alarming the patient of a predicted future low blood glucose concentration and the controller automatically determining and suggesting responsive measures including carbohydrate consumption to prevent low blood glucose concentration.
6. The method according to claim 1, further comprising automatically detecting food consumption and/or a rapid glucose level increase without manual input by the patient.
7. The method according to claim 1, wherein the physiological state is exercise and further comprising automatically determining an intensity, type, and/or duration of the exercise, wherein the predetermined classified physiological states includes predetermined aerobic and anaerobic intensity exercise classifications.
8. The method according to claim 1, wherein the physiological state is acute stress.
9. The method according to claim 1, wherein the physiological state is sleep and further comprising automatically determining a sleep pattern and stage of sleep for the patient.
10. The method according to claim 1, further comprising the controller automatically monitoring for and determining a faulty or missing measurement information transmitted by the continuous glucose monitor or the physiological sensors and estimating measurements of any malfunctioning sensor for the predicting.
11. The method of claim 1, wherein the predetermined classified physiological states include a predetermined acute stress classification and predetermined sleep stage or sleep pattern classification.
12. A device for monitoring and/or treating patient glucose levels, the device comprising:
 a continuous glucose monitor adapted to measure a glucose level of a patient;
 a physiological status monitoring system worn by the patient and adapted to measure physiological variables of the patient; and
 an automatic controller in communication with the glucose monitor and the physiological status monitoring system, the controller including a recordable medium comprising a plurality of stored predetermined classified physiological states selected from physical activity states, stress states, and sleep states, wherein the controller is configured to compare the measured physiological variables to the stored predetermined classified physiological states to predict a future glucose measurement.
13. The device according to claim 12, wherein the controller comprises a recursively updated stable multivariate timeseries model.
14. The device according to claim 12, further comprising a hypoglycemia detection alarm.
15. The device according to claim 12, wherein the controller is configured to detect food consumption and to compute a bolus insulin amount without manual input by the patient.
16. The device according to claim 12, further comprising an estimator adapted to estimate a future plasma glucose concentration and/or a future plasma insulin concentration.
17. The device according to claim 12, wherein the controller detects and classifies the physiological state as a function of activity intensity and duration, body position, heart rate, respiration pattern, or a combination thereof.
18. The device according to claim 12, further comprising an insulin pump in combination with the controller, wherein the controller controls an insulin infusion as a function of the predicted future glucose level.
19. A method for monitoring and/or treating glucose levels of a patient with diabetes, the method comprising:
 automatically monitoring a glucose concentration level in the patient with a continuous glucose monitor worn by the patient to obtain a measured glucose level;
 automatically measuring physiological variables of the patient using at least one physiological sensor worn by the patient to obtain measured physiological variables;
 automatically receiving the glucose concentration level and the physiological variables at a controller in communication combination with the continuous glucose monitor and the at least one physiological sensor;
 the controller automatically interpreting the measured physiological variables to determine a physiological state of the patient, the physiological state selected from a group consisting of exercise, stress, sleep, or combinations thereof;
 the controller automatically estimating a future glucose level of the patient as a function of the measured glucose level and the determined physiological state of the patient;
 the controller automatically computing the insulin dose to be infused and delivering instruction to an insulin pump to deliver the insulin dose to the patient; and
 automatically updating the controller using further glucose measurements from the continuous glucose monitor and further physiological variables from the at least one physiological sensor.
20. The method of claim 19, wherein automatically interpreting the measured physiological variables comprises automatically matching the measured physiological variables to one of a plurality of predetermined classified exercise states, stress states, and sleep states stored in the controller.
21. The method of claim 20, wherein the predetermined classified exercise states include predetermined aerobic and anaerobic intensity classifications, the predetermined stress states include predetermined acute stress classifications, and the predetermined sleep states include predetermined sleep stage classification.
4475901  October 9, 1984  Kraegen et al. 
4498843  February 12, 1985  Schneider et al. 
6572542  June 3, 2003  Houben et al. 
6923763  August 2, 2005  Kovatchev 
7402153  July 22, 2008  Steil et al. 
8690820  April 8, 2014  Cinar et al. 
20030050621  March 13, 2003  Lebel et al. 
20030114836  June 19, 2003  Estes et al. 
20030208113  November 6, 2003  Mault et al. 
20040034295  February 19, 2004  Salganoff et al. 
20050080322  April 14, 2005  Korman 
20050119540  June 2, 2005  Potts et al. 
20060079809  April 13, 2006  Goldberger et al. 
20070060870  March 15, 2007  Tolle et al. 
20070173761  July 26, 2007  Kanderian, Jr. et al. 
20070270672  November 22, 2007  Hayter 
20080014601  January 17, 2008  Goldberger et al. 
20080188796  August 7, 2008  Steil et al. 
20080300572  December 4, 2008  Rankers et al. 
20080306434  December 11, 2008  Dobbles et al. 
20090069787  March 12, 2009  Estes et al. 
20090227855  September 10, 2009  Hill et al. 
20090312621  December 17, 2009  Lebel et al. 
20110040487  February 17, 2011  Hovorka 
20110046887  February 24, 2011  Veldhuise et al. 
20120059353  March 8, 2012  Kovatchev 
20160066894  March 10, 2016  BartonSweeney 
1 177 802  February 2002  EP 
1 759 726  March 2007  EP 
WO 96/37246  November 1996  WO 
WO 00/74753  December 2000  WO 
WO 2008/114254  September 2008  WO 
WO 2008/135329  November 2008  WO 
WO 2008/154312  December 2008  WO 
WO 2009/023407  February 2009  WO 
 Riddell et al. (Exercise and Glucose Metabolism in Persons with Diabetes Mellitus: Perspectives on the Role for Continuous Glucose Monitoring; Journal of Diabetes Science and Technology, Jul. 2009, vol. 3, Iss. 4, 914923);.
 Van Cauter et al. (Roles of Circadian Rhythmicity and Sleep in Human Glucose Regulation; Endocrine Reviews, Oct. 1997, 18(5):716738).
Type: Grant
Filed: Jun 2, 2016
Date of Patent: May 12, 2020
Patent Publication Number: 20160354543
Assignee: ILLINOIS INSTITUTE OF TECHNOLOGY (Chicago, IL)
Inventors: Ali Cinar (Wilmette, IL), Kamuran Turksoy (Chicago, IL), Iman Hajizadeh (Chicago, IL)
Primary Examiner: Jerry Lin
Application Number: 15/171,355
International Classification: A61M 5/172 (20060101); A61B 5/145 (20060101); A61M 5/142 (20060101); A61B 5/00 (20060101); G16H 40/63 (20180101); G06F 19/00 (20180101);