A physiologically-constrained neural network digital twin framework for replicating glucose dynamics in type 1 diabetes
Abstract: Simulating glucose dynamics in individuals with type 1 diabetes (T1D) is critical for developing personalized treatment strategies and supporting informed, data-driven clinical decisions. Current modeling approaches often fail to capture all physiological aspects influencing glucose dynamics and are difficult to adapt to individuals. In this work, we present physiologically-constrained neural network (NN) digital twins for simulating glucose dynamics in T1D. To ensure that the digital twins are interpretable and consistent with known physiology, we first develop a population-level NN state-space model designed to align with a set of ordinary differential equations (ODEs) describing the glucoregulatory system in T1D. This model is formally verified to conform to established glucose regulation dynamics. Individual-specific glucose dynamics (i.e., digital twins) are then achieved by combining the population-level model with individual-level models that enhance predictions through the integration of personal glucose management and contextual data, capturing both inter- and intra-individual variability. We validated our approach using participants from the T1D Exercise Initiative (T1DEXI) study by simulating the real-world scenarios observed during the study. Two weeks of data were segmented into 5-h sequences, and we compared the simulated versus actual glucose profiles. Similarity was assessed using clinically relevant glucose outcomes, and paired equivalence t-tests were conducted with predefined margins based on clinical significance. Across 394 digital twins, we observed equivalent glucose outcomes between the simulated and real-world scenarios. Time in range (70–180 mg/dL) 75.1(95% CI 69.0–80.9)% for simulations and 74.4(95% CI 69.9–78.6)% for real-world data (P-value = < 0.001); time below range (< 70 mg/dL) was 2.5(95% CI 1.2–4.1)% versus 3.0(95% CI 2.2–4.0)% (P-value = 0.022), and time above range (> 180 mg/dL) was 22.4(95% CI 16.6–28.8)% versus 22.6(95% CI 18.4–27.3)% (P-value = < 0.001). Our proposed framework can incorporate unmodeled features, such as sleep and physical activity, while preserving key physiological dynamics. Results show that including these additional inputs leads to more accurate simulations than omitting them entirely. This physiologically-informed framework enables personalized in-silico testing of T1D treatment strategies, supports model-based insulin optimization, and integrates physics-based constraints with data-driven learning. Code and models are publicly available at: https://github.com/mosqueralopez/T1DSim_AI.
Loading