GlyTwin: Digital Twin for Glucose Control in Type 1 Diabetes Through Optimal Behavioral Modifications Using Patient-Centric Counterfactuals
Pith reviewed 2026-05-25 08:45 UTC · model grok-4.3
The pith
GlyTwin generates patient-centric counterfactuals inside a digital twin to recommend behavioral changes that cut hyperglycemia in type 1 diabetes simulations.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
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. When evaluated on the AZT1D dataset of 50 type 1 diabetes patients monitored for 26 days each, the method produced 85.8 percent valid explanations and 87.3 percent effectiveness in preventing hyperglycemia relative to historical data, outperforming prior counterfactual methods.
What carries the argument
Patient-centric counterfactual explanations integrated into a digital twin that simulate alternative behavioral treatment scenarios for glucose trajectories.
If this is right
- Digital twins for diabetes can move from passive prediction to active generation of preferred behavioral alternatives.
- Stakeholder preferences can be directly encoded so that recommended changes remain acceptable to the individual patient.
- Hyperglycemia reduction of roughly 87 percent relative to historical traces becomes achievable inside simulation before any real-world change occurs.
- The same counterfactual machinery can be applied to other chronic conditions where daily behavioral choices drive long-term outcomes.
Where Pith is reading between the lines
- If the recommendations prove effective in practice, automated insulin delivery systems could embed GlyTwin-style modules that surface daily behavioral nudges rather than only adjusting insulin.
- Long-term complication rates could decline if repeated use of the tool steadily lowers cumulative hyperglycemic exposure.
- The approach could be tested by measuring whether patients who receive the counterfactual suggestions actually modify their recorded behavior in the expected direction.
Load-bearing premise
Counterfactuals judged valid and effective on past glucose and behavior records will produce the same improvements when patients actually adopt the recommended changes.
What would settle it
A prospective trial in which patients follow the specific carb-intake and insulin-dosing recommendations generated by GlyTwin for several weeks and their measured time-in-hyperglycemia is compared against their own baseline data.
Figures
read the original abstract
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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper introduces GlyTwin, a digital twin framework that augments glucose prediction models with counterfactual explanations to recommend patient-centric behavioral changes (primarily adjustments to carbohydrate intake and insulin dosing) aimed at reducing hyperglycemic events in type 1 diabetes. It constructs a new AZT1D dataset from 50 AID users monitored for 26 days each and reports that GlyTwin generates 85.8% valid counterfactuals while achieving 87.3% effectiveness in preventing hyperglycemia relative to historical traces, outperforming prior counterfactual methods.
Significance. If the retrospective performance numbers prove robust under prospective validation, the work would represent a meaningful step toward actionable, preference-aware digital twins that move beyond passive prediction to proactive behavioral guidance. The release of the AZT1D dataset is a concrete contribution that could support future reproducibility studies in the field.
major comments (2)
- [Evaluation] Evaluation section (and abstract): the 87.3% effectiveness figure is obtained solely by scoring counterfactual traces against the same historical glucose records used to generate them; no closed-loop simulation of the underlying glucose dynamics, no adherence model, and no prospective patient arm are described. This assumption is load-bearing for the central claim that the counterfactuals translate to improved real-world outcomes.
- [Methods] Methods section: the abstract and provided description supply no algorithmic details on how counterfactuals are generated, how validity is formally defined, how stakeholder preferences are encoded, or what statistical tests support the reported percentages. Without these, the 85.8% validity claim cannot be independently verified.
minor comments (2)
- [Evaluation] The paper should explicitly state the glucose dynamics model used to score counterfactual effectiveness and whether it was fitted on the same AZT1D traces.
- [Dataset] Clarify whether the 26-day windows are contiguous or selected, and report any patient-level variability in the validity and effectiveness metrics.
Simulated Author's Rebuttal
We thank the referee for the constructive feedback. We address each major comment below, indicating planned revisions where appropriate.
read point-by-point responses
-
Referee: [Evaluation] Evaluation section (and abstract): the 87.3% effectiveness figure is obtained solely by scoring counterfactual traces against the same historical glucose records used to generate them; no closed-loop simulation of the underlying glucose dynamics, no adherence model, and no prospective patient arm are described. This assumption is load-bearing for the central claim that the counterfactuals translate to improved real-world outcomes.
Authors: We agree that the evaluation is retrospective and relies on historical traces. The 87.3% effectiveness is computed by applying the generated counterfactual behavioral changes (carbohydrate and insulin adjustments) to the patient's observed data and comparing the resulting simulated glucose trajectory against the original historical record. This quantifies potential improvement under the observed conditions but does not model future adherence or closed-loop dynamics. In the revision we will add an explicit Limitations subsection acknowledging the absence of prospective validation or adherence modeling and outlining plans for future closed-loop simulation studies. The current results remain a necessary first step for demonstrating the framework on real patient data. revision: yes
-
Referee: [Methods] Methods section: the abstract and provided description supply no algorithmic details on how counterfactuals are generated, how validity is formally defined, how stakeholder preferences are encoded, or what statistical tests support the reported percentages. Without these, the 85.8% validity claim cannot be independently verified.
Authors: The full manuscript contains a Methods section that defines counterfactual generation via constrained optimization minimizing time-in-hyperglycemia subject to physiological and behavioral bounds, with validity defined as counterfactuals that reduce hyperglycemia duration by at least 20% while satisfying all constraints. Stakeholder preferences are encoded as additional soft constraints (e.g., bounds on daily carbohydrate intake derived from patient history). Percentages are supported by paired statistical tests across the 50-patient cohort. To address the concern, we will expand the Methods section with pseudocode, formal mathematical definitions, and explicit statistical test descriptions in the revision. revision: yes
Circularity Check
No significant circularity; evaluation is retrospective but independent of input definitions
full rationale
The paper introduces GlyTwin as a framework that generates patient-centric counterfactuals for carbohydrate/insulin adjustments and evaluates them on the newly collected AZT1D dataset (50 patients, 26 days each). The reported metrics (85.8% valid explanations, 87.3% effectiveness) are computed by comparing generated counterfactuals against observed historical glucose traces, not by re-using the same fitted parameters or self-referential definitions as the generation step. No equations or sections are shown that reduce the effectiveness score to a tautology (e.g., no case where the model used for scoring is identical to the model used for generation in a way that forces the result). Self-citations, if present, are not load-bearing for the central performance numbers. The derivation therefore remains self-contained against the external historical benchmark.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
Evan L. Reynolds, Kara R. Mizokami-Stout, Nathaniel Putnam, Mousumi Banerjee, Dana Albright, Lynn Ang, Joyce Lee, Rodica Pop-Busui, Eva L. Feldman, and Brian Christopher Callaghan. Cost and utilization of healthcare services for persons with diabetes. Diabetes research and clinical practice, page 110983, 2023
work page 2023
-
[2]
ElSayed, Grazia Aleppo, Vanita R
Nuha A. ElSayed, Grazia Aleppo, Vanita R. Aroda, Raveendhara R. Bannuru, Florence M. Brown, Dennis Bruemmer, Billy S. Collins, Marisa E. Hilliard, Diana M. Isaacs, Eric L. Johnson, Scott Kahan, Kamlesh K Khunti, Jose Leon, Sarah K. Lyons, Mary Lou Perry, Priya Pra- halad, Richard E. Pratley, J. Seley, Robert C. Stanton, GlyTwin: Digital Twin for Glucose C...
work page 2023
-
[3]
Jennifer L. Sherr, Lori M. Laffel, Jingwen Liu, Wendy A. Wolf, Jeoffrey A. Bispham, Katherine S Chapman, Daniel Finan, Lina Titievsky, Tina Liu, Kaitlin Hagan, Jason L. Gaglia, Keval Chandarana, Richard M. Bergenstal, and Jeremy H. Pettus. Severe hypoglycemia and impaired awareness of hypoglycemia persist in people with type 1 diabetes despite use of diab...
work page 2024
-
[4]
Paramesh Shamanna, Ravi Sankar Erukulapati, Ashutosh Shukla, Lisa Shah, Bree Willis, Mohamed Thajudeen, Ra- jiv Kovil, Rahul Baxi, Mohsin Wali, Suresh Damodharan, and Shashank R Joshi. One-year outcomes of a digi- tal twin intervention for type 2 diabetes: a retrospective real-world study. Scientific Reports, 14, 2024
work page 2024
-
[5]
Artifi- cial intelligence in diabetes management: Advancements, opportunities, and challenges
Zhouyu Guan, Huating Li, Ruhan Liu, Chun Cai, Yuex- ing Liu, Jiajia Li, Xiangning Wang, Shan Huang, Liang Wu, Dan Liu, Shujie Yu, Zheyuan Wang, Jia Shu, Xuhong Hou, Xiaokang Yang, Weiping Jia, and Bin Sheng. Artifi- cial intelligence in diabetes management: Advancements, opportunities, and challenges. Cell Reports Medicine, 4, 2023
work page 2023
-
[6]
Giacomo Cappon, Martina Vettoretti, Giovanni Spara- cino, Simone Del Favero, and Andrea Facchinetti. Re- playbg: A digital twin-based methodology to identify a personalized model from type 1 diabetes data and simu- late glucose concentrations to assess alternative therapies. IEEE Transactions on Biomedical Engineering, 70:3227– 3238, 2023
work page 2023
-
[7]
Giacomo Cappon, Elisa Pellizzari, Luca Cossu, Giovanni Sparacino, Annalisa Deodati, Riccardo Schiaffini, Ste- fano Cianfarani, and Andrea Facchinetti. System architec- ture of twin: A new digital twin-based clinical decision support system for type 1 diabetes management in chil- dren. 2023 IEEE 19th International Conference on Body Sensor Networks (BSN), ...
work page 2023
-
[8]
Naveenah Udaya Surian, Arsen Batagov, Andrew Wu, W. B. Lai, Yan Sun, Yong Mong Bee, and Rinkoo Dalan. A digital twin model incorporating generalized metabolic fluxes to identify and predict chronic kidney disease in type 2 diabetes mellitus. NPJ Digital Medicine, 7, 2024
work page 2024
-
[9]
Digital twin predicting diet response before and after long-term fasting
Oscar Silfvergren, Christian Simonsson, Mattias Ekstedt, Peter Lundberg, Peter Gennemark, and Gunnar Ceder- sund. Digital twin predicting diet response before and after long-term fasting. PLoS Computational Biology, 18, 2021
work page 2021
-
[10]
Glumarker: A novel predictive modeling of glycemic control through digital biomarkers
Ziyi Zhou, Ming Cheng, Xingjian Diao, Yanjun Cui, and Xiangling Li. Glumarker: A novel predictive modeling of glycemic control through digital biomarkers. 2024 46th Annual International Conference of the IEEE Engineer- ing in Medicine and Biology Society (EMBC), pages 1–7, 2024
work page 2024
-
[11]
Glysim: Mod- eling and simulating glycemic response for behavioral lifestyle interventions
Asiful Arefeen and Hassan Ghasemzadeh. Glysim: Mod- eling and simulating glycemic response for behavioral lifestyle interventions. 2023 IEEE EMBS International Conference on Biomedical and Health Informatics (BHI), pages 1–5, 2023
work page 2023
-
[12]
Syed Hasib Akhter Faruqui, Adel Alaeddini, Yan Du, Shiyu Li, Kumar Sharma, and Jing Wang. Nurse-in-the- loop artificial intelligence for precision management of type 2 diabetes in a clinical trial utilizing transfer-learned predictive digital twin. ArXiv, abs/2401.02661, 2024
-
[13]
Forewarning postprandial hyper- glycemia with interpretations using machine learning
Asiful Arefeen, Samantha N Fessler, Carol Johnston, and Hassan Ghasemzadeh. Forewarning postprandial hyper- glycemia with interpretations using machine learning. 2022 IEEE-EMBS International Conference on Wearable and Implantable Body Sensor Networks (BSN) , pages 1–4, 2022
work page 2022
-
[14]
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. “why should i trust you?”: Explaining the predictions of any classifier. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2016
work page 2016
- [15]
-
[16]
A Unified Approach to Interpreting Model Predictions
Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. ArXiv, abs/1705.07874, 2017
work page internal anchor Pith review Pith/arXiv arXiv 2017
-
[17]
Unbiased measurement of feature importance in tree-based methods
Zhengze Zhou and Giles Hooker. Unbiased measurement of feature importance in tree-based methods. ACM Trans- actions on Knowledge Discovery from Data (TKDD) , 15:1 – 21, 2019
work page 2019
-
[18]
Aaron Fisher, Cynthia Rudin, and Francesca Dominici. All models are wrong, but many are useful: Learning a variable’s importance by studying an entire class of prediction models simultaneously. Journal of machine learning research : JMLR, 20, 2018
work page 2018
-
[19]
Jo˜ao Bento, Pedro Saleiro, Andre Ferreira Cruz, M ´ario A. T. Figueiredo, and P. Bizarro. Timeshap: Explaining re- current models through sequence perturbations. Proceed- ings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, 2020
work page 2020
-
[20]
What went wrong and when? instance-wise feature im- portance for time-series black-box models
Sana Tonekaboni, Shalmali Joshi, Kieran Campbell, David Kristjanson Duvenaud, and Anna Goldenberg. What went wrong and when? instance-wise feature im- portance for time-series black-box models. In Neural Information Processing Systems, 2020
work page 2020
-
[21]
Saranya A. and Subhashini R. A systematic review of ex- plainable artificial intelligence models and applications: GlyTwin: Digital Twin for Glucose Control in Type 1 Diabetes Through Optimal Behavioral Modifications Using Patient-Centric Counterfactuals — 14/15 Recent developments and future trends. Decision Analyt- ics Journal, 2023
work page 2023
-
[22]
Entropy- based logic explanations of neural networks
Pietro Barbiero, Gabriele Ciravegna, Francesco Giannini, Pietro Li’o, Marco Gori, and Stefano Melacci. Entropy- based logic explanations of neural networks. ArXiv, abs/2106.06804, 2021
-
[23]
Rich Caruana, Yin Lou, Johannes Gehrke, Paul Koch, M. Sturm, and No´emie Elhadad. Intelligible models for healthcare: Predicting pneumonia risk and hospital 30- day readmission. Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2015
work page 2015
-
[24]
Nice: an algo- rithm for nearest instance counterfactual explanations
Dieter Brughmans and David Martens. Nice: an algo- rithm for nearest instance counterfactual explanations. Data Mining and Knowledge Discovery , pages 1–39, 2021
work page 2021
-
[25]
Use of What-if Scenarios to Help Explain Artificial Intelligence Models for Neonatal Health
Abdullah Mamun, Lawrence D. Devoe, Mark I. Evans, David W. Britt, Judith Klein-Seetharaman, and Hassan Ghasemzadeh. Use of what-if scenarios to help explain artificial intelligence models for neonatal health. ArXiv, abs/2410.09635, 2024
work page internal anchor Pith review Pith/arXiv arXiv 2024
-
[26]
Lisa Schut, Oscar Key, Rory McGrath, Luca Costabello, Bogdan Sacaleanu, Medb Corcoran, and Yarin Gal. Gen- erating interpretable counterfactual explanations by im- plicit minimisation of epistemic and aleatoric uncertain- ties. In International Conference on Artificial Intelligence and Statistics, 2021
work page 2021
-
[27]
Asiful Arefeen and Hassan Ghasemzadeh. Designing user-centric behavioral interventions to prevent dysg- lycemia with novel counterfactual explanations. ArXiv, abs/2310.01684, 2023
-
[28]
Glyman: Glycemic management using patient-centric counterfac- tuals
Asiful Arefeen, Saman Khamesian, Mar´ıa Adela Grando, Bithika Thompson, and Hassan Ghasemzadeh. Glyman: Glycemic management using patient-centric counterfac- tuals. 2024 IEEE EMBS International Conference on Biomedical and Health Informatics (BHI) , pages 1–5, 2024
work page 2024
-
[29]
Marta Lenatti, Alberto Carlevaro, Aziz Guergachi, Karim Keshavjee, Maurizio Mongelli, and Alessia Paglialonga. A novel method to derive personalized minimum viable recommendations for type 2 diabetes prevention based on counterfactual explanations. PLOS ONE, 17, 2022
work page 2022
-
[30]
Characterization of type 2 diabetes using counterfactuals and explainable ai
Marta Lenatti, Alberto Carlevaro, Karim Keshavjee, Aziz Guergachi, Alessia Paglialonga, and Maurizio Mongelli. Characterization of type 2 diabetes using counterfactuals and explainable ai. Studies in health technology and informatics, 294:98–103, 2022
work page 2022
-
[31]
Realistic coun- terfactual explanations by learned relations
Xintao Xiang and Artem Lenskiy. Realistic coun- terfactual explanations by learned relations. ArXiv, abs/2202.07356, 2022
-
[32]
Enhancing metabolic syndrome prediction with hybrid data balanc- ing and counterfactuals
Sanyam Paresh Shah, Abdullah Mamun, Shovito Barua Soumma, and Hassan Ghasemzadeh. Enhancing metabolic syndrome prediction with hybrid data balanc- ing and counterfactuals. volume abs/2504.06987, 2025
-
[33]
Aditya Bhattacharya, Jeroen Ooge, Gregor Stiglic, and Katrien Verbert. Directive explanations for monitoring the risk of diabetes onset: Introducing directive data- centric explanations and combinations to support what- if explorations. Proceedings of the 28th International Conference on Intelligent User Interfaces, 2023
work page 2023
-
[34]
Explaining machine learning classifiers through diverse counterfactual explanations
Ramaravind K Mothilal, Amit Sharma, and Chenhao Tan. Explaining machine learning classifiers through diverse counterfactual explanations. In Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, pages 607–617, 2020
work page 2020
-
[35]
Optimal Counterfac- tual Explanations for Scorecard modelling
Guillermo Navas-Palencia. Optimal Counterfac- tual Explanations for Scorecard modelling. ArXiv, abs/2104.08619, 2021
-
[36]
Raphael Mazzine Barbosa de Oliveira, Kenneth S¨orensen, and David Martens. A model-agnostic and data- independent tabu search algorithm to generate counterfac- tuals for tabular, image, and text data. European Journal of Operational Research, 2023
work page 2023
-
[37]
CounterNet: End-to-End Training of Prediction Aware Counterfactual Explanations
Hangzhi Guo, Thanh Hong Nguyen, and Amulya Yadav. CounterNet: End-to-End Training of Prediction Aware Counterfactual Explanations. Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2021
work page 2021
-
[38]
Fraser Cameron, G¨unter Niemeyer, and Bruce A. Buck- ingham. Probabilistic evolving meal detection and es- timation of meal total glucose appearance. Journal of Diabetes Science and Technology, 3:1022 – 1030, 2009
work page 2009
-
[39]
John P. Corbett, Marc D. Breton, and Stephen D. Patek. A multiple hypothesis approach to estimating meal times in individuals with type 1 diabetes. Journal of Diabetes Science and Technology, 15:141 – 146, 2019
work page 2019
-
[40]
Anne L. Peters, Michelle A Van Name, Brian Larsen Thorsted, Johanne Spanggaard Piltoft, and William V Tamborlane. Postprandial dosing of bolus insulin in pa- tients with type 1 diabetes: A cross-sectional study using data from the t1d exchange registry. Endocrine practice : official journal of the American College of Endocrinology and the American Associa...
work page 2017
-
[41]
S. Daenen, Agn `es Sola-Gazagnes, Jocelyne M’bemba, C Dorange-Breillard, F Defer, Fabienne Elgrably, Etienne Larger, and G´erard Slama. Peak-time determination of post-meal glucose excursions in insulin-treated diabetic patients. Diabetes & metabolism, 36 2:165–9, 2010
work page 2010
-
[42]
Explanation in Artificial Intelligence: In- sights from the Social Sciences
Tim Miller. Explanation in Artificial Intelligence: In- sights from the Social Sciences. Artif. Intell., 267:1–38, 2017
work page 2017
-
[43]
Sandra Wachter, Brent Daniel Mittelstadt, and Chris Rus- sell. Counterfactual Explanations Without Opening the GlyTwin: Digital Twin for Glucose Control in Type 1 Diabetes Through Optimal Behavioral Modifications Using Patient-Centric Counterfactuals — 15/15 Black Box: Automated Decisions and the GDPR. Cyber- security, 2017
work page 2017
-
[44]
Counterfactual Fairness through Transforming Data Orthogonal to Bias
Shuyi Chen and Shixiang Zhu. Counterfactual Fairness through Transforming Data Orthogonal to Bias. ArXiv, abs/2403.17852, 2024
-
[45]
Counterfactual explanations and how to find them: literature review and benchmarking
Riccardo Guidotti. Counterfactual explanations and how to find them: literature review and benchmarking. Data Mining and Knowledge Discovery, pages 1–55, 2022
work page 2022
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.