A Telemedicine System for Modeling and Managing Blood Glucose David L. Duke October 26, 2009 Intelligent Diabetes Assistant
IDA Thesis ● Individual models, taking into account nutrition, medication, and exercise, with appropriate mathematical modeling, can learn accurate representations of specific patients suitable for providing therapy advice.
Proposed Outcomes ● Demonstrate the system that can collect, share, and analyze. ● Demonstrate improvement over previous methods of modeling and blood glucose prediction. ● Demonstrate methods for generating therapy advice from the models.
Background and Motivation ● Diabetes occurs when the control system for maintaining normal blood glucose ( mg/dl) fails. – Type 1 = pancreas failure. – Type 2 = insulin utilization failure. ● The primary therapy inputs are meals, medication, and exercise. ● There are over 300,000,000 diabetics in the world.
Modeling Task ● Two modeling tasks – Predicting postprandial blood glucose – Continuous dynamic modeling ● Key methods for model improvement – Start with better data – Include the controllable inputs – Model nonlinearities – Uncertainty propagation
Start with Better Data ● Three primary controllable components: – Meals, Medication, Exercise -> BG ● Collection system must be: – In situ: data that represents real life. – Accurate: best available measurement – Efficient: simple for patients to use – Complete: collects all primary inputs – Networked: shares data with the care team
IDA System ● Patient System – Cellphone, Bodymedia ● Health Care System – Time-line, Meal analysis – Messaging
Clinical Collection Protocol ● 16 patients collected data for two weeks. Subjects were to measure: – Pre-meal BG – Postprandial BG – Meal images/carbs – Exercise – All medications ● 9 male, 7 female ● 9 T2DM, 7 T1DM ● Diverse population
Descriptive Statistics ● Parameter Min Mean Max – Age (yrs) – BMI – Weight (lbs) – Mean BG (mg/dl) – Std BG (mg/dl) – Mean Carb (gm) – Std Carb (gm) – Mean Ex. (cal/m) – Std Ex. (cal/m) – Number BG
Postprandial Prediction Problems ● Determining the variable order ● Modeling method comparison – Linear vs. nonlinear – Joint vs. individual ● Model performance as a function of training set size ● Predicting performance for patient
Evaluation Methods ● R 2 coefficient ● Clarke Error grid – A - 20% – B – C – D – E A A B B B B C C C C C C D D D D E E E E
Model Input Parameters ● Pre-meal BG ● Time of Postmeal BG ● Exercise 2-1 hr before ● Exercise 1-0 hr before ● Exercise 0-1 hr after ● Exercise 1-2 hr after ● Time of day ● Carbs ● Fat ● Protein ● Calories ● Recent carbs ● Recent fat ● Recent protein ● Recent calories ● Rapid insulin ● Regular Insulin ● Recent Mixed Insulin ● Earlier Mixed Insulin ● Sulfonylureas ● Meglitinides ● Biguanides...
Modeling Methods ● Gaussian Process Regression – Linear kernel or Gaussian kernel – Individual, Weighted, or Joint data ● Reduced Rank Gaussian Process Regression with Generic Basis
Gaussian Process Regression ● GP Regression can be expressed as least squares minimization with a regularization parameter in the error function. ● This give the solution below for new test points.
GP Kernel Functions ● Linear kernel ● Gaussian kernel ● Patient similarity kernel (weighted mixture)
RRGP description ● Convert to a generic reduced rank basis and then apply patient specific coefficients. ● Solution found using ALS
Variable Order Experiment ● 10 times with randomly selected training and test sets ● GP regression with Gaussian and linear kernel ● Greedy algorithm to select the next variable based on either the R 2 or Clarke metric ● Results were combined using a voting algorithm
Variable Order Results
Model Performance Experiment ● 10 experiments with random training and test sets. ● Evaluated each model at each variable in previously selected order. ● Combined the results by calculating the mean value of the evaluation metric.
Model Performance Results
Comparison to Other Results ● IDA: 57% in region A ● Human predictions – 28.5 % – 41.5 % ● Other computational prediction systems – 34 % – 51 % ● Simulated theoretical bound – 43.6 %
Model Performance Results ● The Gaussian kernel is better than the linear kernel. ● There is no significant difference between the individual and weighted mixture of patients methods. ● For the interdependent variables like carbohydrates and insulin doses, the model only improves with both measurements are included.
Performance for a New Patient Patients with more than 30 valid meal events in their dataset. Converges after 3 days. Patients with more than 30 valid meal events in their dataset. Converges after 3 days.
Predicting modeling performance
Continuous Models ● Four model were evaluated – ARX – autoregressive with exogenous variables – AR – autoregressive – PM – published physiological model – PM+EX – physiological model with exercise ● Three use cases – Prediction: Model is updated with recent CGM – Real-time: Model is updated with recent BG – Retrospective: Model is update with both past and future BG measurements
Physiological Model Components
EKF Physiological Model ● The physiological model is implemented as an Extended Kalman Filter. ● The glucose regulatory system is a nonlinear system. ● The uncertainty in a blood glucose prediction or estimate is as important as the actual estimated value when generating therapy advice. ● The EKF propagates the uncertainty through the system.
Model Output
Optimizing Insulin Sensitivity
Results (15 minutes)
Comparison of Models AR X Physiological Models
Exercise vs Old: Prediction Time Old Model New Model with Exercise
Exercise vs Old: Real-time A B C D E Old Model New Model with Exercise
Exercise vs Old: Retrospective A B C D E Old Model New Model with Exercise
Therapy Advice ● There are two general types of therapy advice ● Real-time – Insulin dose adjustments – Hypoglycemia warnings – Closed-loop control ● Retrospective – Behavior advice – Parameter adjustment
Insulin Dose Adjustment ● Combine insulin dose calculated using a common equation with the optimal value estimated using GP regression to shift the suggested dose.
Providing Justification ● Justification can be given for a therapy suggestion by referencing similar data from the training set. Similar data can easily be selected using the Gaussian kernel.
Hypoglycemia Prediction: ARX
Closed-loop Control ● The most common form of closed-loop control being investigated for an artificial pancreas is model predictive control. ● Any improvement in modeling performance can help improve closed-loop control. ● The key limiting factor is the variability in the system, so accounting for exercise and the uncertainty propagation is a positive contribution.
Behavior Space Optimization
Meal Portion Estimation
Finding Similar Meals Similar Meal Images
Conclusions ● Demonstrate System: – Data collection. ● Demonstrate Improved Modeling: – Postprandial: performs better than other systems and humans. – Continuous: the method for including exercise improved the published physiological model. ● Demonstrate Advice: – The system can be used to generate many types of real-time and retrospective advice.
Acknowledgments ● Carnegie Mellon Qatar ● Hamad Medical Corporation – Mahmoud Zirie and Mazahir Mahmoud ● Qatar Diabetes Association – Katie Nahas and Nedaa El-Khatib ● Qatar National Science Fund
Questions?
Gaussian Process Regression Include similar patients to help extrapolate (red). Include similar patients to help extrapolate (red). Data from test subject (blue).
CGM Quality
Raw Patient Data
Sample Results
Extrapolation and Interpolation New Behavior Repeated Behavior Individual Data Mixture of Patients Moving Average
RRGP Error Convergence