# GlyTwin: Digital Twin for Glucose Control in Type 1 Diabetes Through Optimal Behavioral Modifications Using Patient-Centric Counterfactuals

arXiv: https://arxiv.org/abs/2504.09846 · HTML: https://mlsanity.com/paper/2504.09846/

## Key facts

- Cited by 5 papers in the map (data through 14 Oct 2026).
- Builds on 27 of its 64 references that are in the map.
- First posted on arXiv 14 Apr 2025.

## Builds on (most cited first, 27 of 27)

- [A Unified Approach to Interpreting Model Predictions](https://mlsanity.com/paper/1705.07874/) (2017)
- ["Why Should I Trust You?": Explaining the Predictions of Any Classifier](https://mlsanity.com/paper/1602.04938/) (2016)
- [Explanation in Artificial Intelligence: Insights from the Social Sciences](https://mlsanity.com/paper/1706.07269/) (2017)
- [Counterfactual Explanations without Opening the Black Box: Automated Decisions and the GDPR](https://mlsanity.com/paper/1711.00399/) (2017)
- [Explaining Machine Learning Classifiers through Diverse Counterfactual Explanations](https://mlsanity.com/paper/1905.07697/) (2019)
- [All Models are Wrong, but Many are Useful: Learning a Variable's Importance by Studying an Entire Class of Prediction Models Simultaneously](https://mlsanity.com/paper/1801.01489/) (2018)
- [The Dangers of Post-hoc Interpretability: Unjustified Counterfactual Explanations](https://mlsanity.com/paper/1907.09294/) (2019)
- [TimeSHAP: Explaining Recurrent Models through Sequence Perturbations](https://mlsanity.com/paper/2012.00073/) (2020)
- [NICE: An Algorithm for Nearest Instance Counterfactual Explanations](https://mlsanity.com/paper/2104.07411/) (2021)
- [Entropy-based Logic Explanations of Neural Networks](https://mlsanity.com/paper/2106.06804/) (2021)
- [Generating Interpretable Counterfactual Explanations By Implicit Minimisation of Epistemic and Aleatoric Uncertainties](https://mlsanity.com/paper/2103.08951/) (2021)
- [Unbiased Measurement of Feature Importance in Tree-Based Methods](https://mlsanity.com/paper/1903.05179/) (2019)
- [Directive Explanations for Monitoring the Risk of Diabetes Onset: Introducing Directive Data-Centric Explanations and Combinations to Support What-If Explorations](https://mlsanity.com/paper/2302.10671/) (2023)
- [CounterNet: End-to-End Training of Prediction Aware Counterfactual Explanations](https://mlsanity.com/paper/2109.07557/) (2021)
- [AttenGluco: Multimodal Transformer-Based Blood Glucose Forecasting on AI-READI Dataset](https://mlsanity.com/paper/2502.09919/) (2025)
- [Feature Importance Explanations for Temporal Black-Box Models](https://mlsanity.com/paper/2102.11934/) (2021)
- [Optimal Counterfactual Explanations for Scorecard modelling](https://mlsanity.com/paper/2104.08619/) (2021)
- [Designing User-Centric Behavioral Interventions to Prevent Dysglycemia with Novel Counterfactual Explanations](https://mlsanity.com/paper/2310.01684/) (2023)
- [Use of What-if Scenarios to Help Explain Artificial Intelligence Models for Neonatal Health](https://mlsanity.com/paper/2410.09635/) (2024)
- [Glycemic-Aware and Architecture-Agnostic Training Framework for Blood Glucose Forecasting in Type 1 Diabetes](https://mlsanity.com/paper/2502.14183/) (2025)
- [Realistic Counterfactual Explanations with Learned Relations](https://mlsanity.com/paper/2202.07356/) (2022)
- [Meal-time Detection by Means of Long Periods Blood Glucose Level Monitoring via IoT Technology](https://mlsanity.com/paper/2303.00223/) (2023)
- [Counterfactual Fairness through Transforming Data Orthogonal to Bias](https://mlsanity.com/paper/2403.17852/) (2024)
- [GluMarker: A Novel Predictive Modeling of Glycemic Control Through Digital Biomarkers](https://mlsanity.com/paper/2404.12605/) (2024)
- [Enhancing Metabolic Syndrome Prediction with Hybrid Data Balancing and Counterfactuals](https://mlsanity.com/paper/2504.06987/) (2025)
- [Nurse-in-the-Loop Artificial Intelligence for Precision Management of Type 2 Diabetes in a Clinical Trial Utilizing Transfer-Learned Predictive Digital Twin](https://mlsanity.com/paper/2401.02661/) (2024)
- [Rethinking Distance Metrics for Counterfactual Explainability](https://mlsanity.com/paper/2410.14522/) (2024)

## Built on by (most cited first, 5 of 5)

- [GlyRAG: Context-Aware Retrieval-Augmented Framework for Blood Glucose Forecasting](https://mlsanity.com/paper/2601.05353/) (2026)
- [RealAC: A Domain-Agnostic Framework for Realistic and Actionable Counterfactual Explanations](https://mlsanity.com/paper/2508.10455/) (2025)
- [MetaPlate: Counterfactual-Guided RAG-LLM Tool for Personalized Food Recommendation and Hyperglycemia Prevention](https://mlsanity.com/paper/2606.10120/) (2026)
- [Trustworthy AI in Digital Health: A Comprehensive Review of Robustness and Explainability](https://mlsanity.com/paper/2608.02238/) (2026)
- [Peer-Grounded Counterfactual Path Planning for Chronic Health Management](https://mlsanity.com/paper/2609.30838/) (2026)

## Abstract (arXiv)

Frequent and long-term exposure to hyperglycemia increases the risk of chronic complications, including neuropathy, nephropathy, and cardiovascular disease. Existing continuous subcutaneous insulin infusion (CSII) and continuous glucose monitoring (CGM) technologies model only specific aspects of glycemic regulation, such as predicting hypoglycemia and administering small insulin boluses. Similarly, current digital twin approaches in diabetes management primarily focus on predicting glucose responses to human behavior and insulin therapy. As a result, these technologies lack the ability to provide alternative treatment scenarios that could guide proactive behavioral interventions for optimal diabetes management. To address this gap, we propose GlyTwin, a novel computational framework that enhances digital twin technologies by integrating counterfactual explanations to simulate optimal behavioral treatments for glucose control. GlyTwin generates counterfactual treatments by recommending adjustments to behavioral choices, such as carbohydrate intake and insulin dosing, to significantly reduce the occurrence and duration of hyperglycemic events. In addition, GlyTwin incorporates stakeholder preferences into its intervention-generation process, ensuring that the tool is personalized and user-centric. We evaluate GlyTwin on AZT1D, a new dataset constructed by collecting longitudinal data from 50 individuals living with type 1 diabetes (T1D) on automated insulin delivery (AID) systems, each monitored for 26 days. Results show that GlyTwin outperforms state-of-the-art methods for generating counterfactual explanations, with 85.8% valid explanations and 87.3% effectiveness in preventing hyperglycemia compared with historical data.
