A Logic-Based Learning Approach to Explore Diabetes Patient Behaviors

Josephine Lamp, Simone Silvetti, Marc D. Breton, Laura Nenzi, Lu Feng

Abstract

Managing Type 1 Diabetes (T1D) is a relentless cognitive challenge that requires balancing insulin doses, carbohydrate intake, and physical activity. While modern sensors like Continuous Glucose Monitors (CGMs) generate vast amounts of data, this information is often difficult for clinicians to interpret quickly due to its high variability. This paper introduces a logic-based machine learning framework that utilizes Signal Temporal Logic (STL) to automatically extract explainable behavior patterns from T1D patient data. By mining clinical datasets, the researchers identified personalized rules that correlate with glycemic control, providing a bridge between complex sensor data and actionable clinical insights.

The Challenge of T1D Management

For individuals with Type 1 Diabetes, maintaining blood glucose within a narrow "safe" range (70–180 mg/dL) is a 24/7 task. Deviations can lead to immediate dangers like hypoglycemia or long-term complications from chronic hyperglycemia. Modern technology, including CGMs and insulin pumps, has increased the volume of available data, but interpreting this data remains a significant hurdle.

Examples of daily behaviors and their impact on glycemic control.

Existing machine learning approaches often act as "black boxes," offering predictions without explaining the underlying reasoning. In a medical context, explainability is crucial. Patients and clinicians need to understand why a certain outcome occurred—for example, identifying that a specific exercise intensity without a corresponding snack leads to a glucose drop two hours later.

Methodology: Signal Temporal Logic Learning

To address the need for explainable AI, the authors propose a framework based on Signal Temporal Logic (STL). STL is a formal language used to describe properties of time-varying signals. Unlike traditional neural networks, STL formulas—such as "The glucose level is always between 70 and 180 for the next hour"—are inherently human-readable and trustworthy for clinical use.

The proposed framework for extracting explainable behavior patterns using Signal Temporal Logic (STL).

The core of the approach involves several distinct steps:

  1. Data Pre-processing: Disparate data streams from CGMs, insulin pumps, and wearables (like Fitbit) are aligned into 5-minute intervals and segmented into one-hour analysis windows.
  2. Labeling: The researchers used "Time in Range" (TIR)—the percentage of time glucose stays between 70–180 mg/dL—as the ground truth for evaluating glycemic control.
  3. STL Learning: An automated tool uses a genetic algorithm to find the optimal logical structure of a rule, while Gaussian Process algorithms fine-tune parameters such as specific glucose thresholds or time offsets.
  4. Clustering: To identify population-level trends, patients were grouped into four clusters based on their overall average glucose control.

Key Insights and Clinical Results

The study utilized a clinical dataset from the University of Virginia Center for Diabetes Technology, tracking 21 T1D patients over approximately two months. The analysis revealed several critical behavioral differences between patient groups.

Proactive vs. Reactive Management

A major finding was that patients with the best control (Cluster 1) were significantly more "engaged" with their data. They performed an average of 85 finger-prick checks (SMBG) over the study period, compared to only 50 checks in the worst-controlled group.

Furthermore, the data highlighted a "Correction Trap" among patients with poorer control. These individuals did not just take more correction boluses; they took significantly larger doses. The worst-controlled group used nearly double the amount of correction insulin per event (32.30 units) compared to the best-controlled group (17.14 units). This suggests a reactive "rollercoaster" style of management—waiting for a high blood sugar spike and then over-correcting—rather than proactively preventing the spike.

Personalized Behavioral Rules

The STL system successfully derived specific "safe zones" for individual patients. For example, for "Patient 21," the model identified that maintaining good control during high-intensity exercise required a basal insulin rate between 0.066 and 0.072 units. Such precise, logical formulas (e.g., Always[0,1](cgm > 120 AND activity > 3)) provide a common language for patients and doctors to refine treatment plans.

Conclusion and Future Directions

The learned rules achieved high accuracy, often exceeding 90% for many patients. While the current study focused on offline analysis of historical data with short time horizons, it demonstrates the potential for logic-based learning in chronic disease management.

Future work will focus on extending the analysis to longer time horizons to capture "long-tail" effects, such as meals affecting glucose levels 4–6 hours later. Ultimately, the authors aim to integrate this framework into real-time, closed-loop feedback systems, providing patients with explainable warnings before adverse glycemic events occur.

Summary updated

Abstract

Type I Diabetes (T1D) is a chronic disease in which the body’s ability to synthesize insulin is destroyed. It can be difficult for patients to manage their T1D, as they must control a variety of behavioral factors that affect glycemic control outcomes. In this paper, we explore T1D patient behaviors using a Signal Temporal Logic (STL) based learning approach. STL formulas learned from real patient data characterize behavior patterns that may result in varying glycemic control. Such logical characterizations can provide feedback to clinicians and their patients about behavioral changes that patients may implement to improve T1D control. We present both individual- and population-level behavior patterns learned from a clinical dataset of 21 T1D patients.
BibTeX
@inproceedings{lamp2019logic,
  author = {Josephine Lamp and Simone Silvetti and Marc D. Breton and Laura Nenzi and Lu Feng},
  title = {{A Logic-Based Learning Approach to Explore Diabetes Patient Behaviors}},
  booktitle = {CMSB},
  year = {2019},
  url = {https://openreview.net/forum?id=sGDxfHVB_-},
}
Figure