In Silico Diabetes Management and Prediction: A Personalized Hybrid Physics-ML System
CWSF · 2026 Digital Technology Silver Medal
Overview
Every 9 seconds, one person dies from diabetes, yet current technologies have significant limitations. I engineered a first-of-a-kind hybrid Physics-ML "glass-box" engine reconstructing each patient's unique metabolism. It uses Ordinary Differential Equations (ODEs) to model glucose flux (dG/dt), with gamma insulin pharmacokinetics curves, GI-weighted dual-wave absorption model, & circadian, exercise, stress & sleep modifiers. A Bayesian engine self-calibrates five parameters. Euler integration with 50 Monte Carlo simulations generates a 4-hour forecast with 80% confidence bands. Validated across four independent clinical datasets (N = 19,290; 2,858 patients), my system achieved mean bias = -0.15mg/dL, R² =0.896, AAE = 11.6mg/dL, MAPE = 7.0%, RMSE = 14.8mg/dL, paired t-test p = 0.15 > 𝛂, & Clarke A+B = 100% — confirming very strong retrospective clinical accuracy. My system also outperforms four recent peer-reviewed models — despite mine forecasting 4-8 times further ahead. It could prevent hypoglycemia/hyperglycemia before occurring — saving millions of lives.
Video
This video could not be played here. Watch it on the original project page.
Why?
Problem
1. Global Diabetes Statistics:
Major global crisis affecting over 830 million people
Leading cause of deaths: 3.4 million annual deaths; every 9 seconds, 1 person dies
Causing USD 1 trillion in healthcare costs
2. Personal Motivation:
Family/relatives history
3. Significant Product Gap:
There are three kinds of tools, but they have significant limitations (attached table):
Glucose Measurement Tools: Fingerstick meters, CGMs (Continuous Glucose Meters) – no forecasting & guidance
Decision Support Tools: Bolus/dose calculators – fixed static rules
Prediction Tools: Black-box AI – purely data-driven
Solution
(Attached table)
I created a novel hybrid physics-ML system that solves all these limitations and provides many more innovative features. Unlike other tools that remain reactive – they respond to glucose changes already underway rather than anticipating them, my system is the only tool that combines real-time physiological interpretability, patient-specific personalization, and "what-if" planning for proactive rather than reactive correction, in one accessible system.
My system will also be very useful in hospital settings, where inpatients with diabetes experience significant metabolic disruption relative to their usual baseline. These inpatients are on reactive sliding-scale insulin, but my proactive tool that predicts based on each patient's physiology, history, and current clinical state, will help nurses and doctors better manage inpatient hospitalizations.
Website:
(Attached figures)
Users just input basic data – food, exercise, medication, stress, and sleep – for a couple of days for calibration. Then my system delivers highly accurate, clinically safe predictions, and it also provides "what-if" scenarios for safe planning by simulating different combinations of food & exercise.
How?
Zone 1 – Signal Processing
(Figure-2)
Stage 1 (Sensor Noise Removal): A Savitzky-Golay filter smooths noise while preserving true glucose peaks
Stage 2 (Interstitial Lag): A first-order equation corrects the glucose delay
Stage 3 (Pre-Meal Slope): A linear regression over the last 6 readings computes the pre-meal slope, projected into each prediction
Zone 2 – Calibration Engine
(Table-1 & Figure-3)
It solves the inverse problem: given your meal history & glucose changes, what are your personal biological constants? Five parameters: CS, ISF, Alpha, Hepatic Output, & Bias, are stored as probability distributions.
Filter: Meal events are cleaned with a two-pass MAD outlier filter (2.5σ then 1.5σ).
Estimate: A regression finds CS & 𝛂 that best explain post-meal changes; fasting windows estimate liver output separately.
Update: Each estimate merges with the prior via a precision-weighted Bayesian update.
Zone 3 – Physics Engine
(More details: Figure 4-7 & Table-2)
This is my main equation (shown below) – an ODE modelling glucose flux across six biological processes. ISF is dynamically adjusted every step by four factors: circadian rhythm, sleep quality, post-exercise recovery, & stress cortisol. Five insulin types and six drug classes are modelled, each on a different ODE component.
Zone 4 – Solver & Prediction
(Figure-8)
The ODE is solved numerically using Euler's method (Δt = 5 min): dG/dt is computed every step from active boluses, meals, exercise, & medication effects, then projected forward 4 hours. 50 parameter sets are sampled from the Bayesian posteriors, yielding 80% confidence band. An independent 3-hour anchor cross-checks the Euler trajectory.
Validation Methodology
Validated against actual CGM data across four independent studies: three real-world clinical datasets (MetaboNet, CGMacros, GlucoBench) & an in-person patient dataset (NN)
Large sample size of 19,290 post-prandial meal events across 2,858 diverse patients (Type-1 & Type-2), varying HbA1c & CGMs
Per-patient split: initial meal events calibrate the system; & later events form the blind test set
What?
Overall Performance
(Table-1)
My system achieved clinically-safe, strong retrospective predictive accuracy.
My system's AAE of 11.6 mg/dL beats the ±15 mg/dL NIH clinical safety margin
My MAPE of 7.0% is less than half the gold standard threshold of <15%, for safe, actionable medical software
My RMSE of 14.8mg/dL falls under <15mg/dL threshold – a significant achievement because RMSE heavily penalizes large errors
Clarke Error Grid Analysis
(Figure-1)
It is the gold standard for assessing clinical safety of blood glucose prediction models. It divides predictions into five zones based on how an error would impact patient treatment:
Zone A is clinically accurate
Zone B is benign
Zones C, D, & E represent increasingly dangerous errors
The clinical threshold is ≥ 95% Zone A+B. All 19,290 of my predictions achieved Zone A (96.6%) & Zone B (3.4%), with 0 predictions in Zones C, D, or E. All my predictions are 100% clinically safe.
Parity Plot Analysis
(Figure-2)
It shows tight clustering along the perfect agreement line (y = x), yielding R² = 0.896, meaning 90% of the complex variance in human glucose in the measured CGM values is captured by my system
Pearson Correlation r = 0.9466 (p < 0.001) confirms a very strong positive linear relationship between my system's predictions & actual reality
Bland-Altman Plot Analysis
(Figure-3)
It confirms that the mean bias of -0.15mg/dL is negligibly small, proving my system is balanced – it does not systematically over-predict/under-predict
Scatter is evenly distributed across the horizontal axis within 95% limits of agreement, confirming consistent accuracy across all glucose ranges
Its performance does not degrade at extremes – an elite standard for clinical forecasting models
Residual Histogram Analysis
(Figure-4)
It shows a near-perfect bell curve centred near zero, proving errors are random, not systematic
My system does not suffer from algorithmic bias
Statistical Hypothesis Testing
(Table-2)
To prove the results were not due to chance, a t-Test: Paired Two Sample for Means was conducted on all 19,290 data points
We fail to reject the null hypothesis (H₀: μ₁ = μ₂) because the p-value = 0.15 > 0.05 (𝛂). This confirms no statistically significant difference between my system's predictions & actual glucose readings
For each of the four datasets, their p-value > 0.05, confirming no systematic bias across any population
Baseline Validation
(Table-3)
This confirms the physics components contribute meaningfully to accuracy.
Evaluated on MetaboNet held-out test set: 16,009 real CGM meal events, unseen during calibration
Full Digital Twin reduces MAE by 52% over no-model baseline
R² improved +0.882 (from -0.224 to +0.658)
Comparison with Published Models
(Table-4)
Benchmarked against four recent (2024-2026) peer-reviewed studies
All four models predict 30-60 minutes ahead; my system predicts 4 hours ahead
Despite 4-8 times longer prediction horizon, my system beats their accuracy (AAE, R², MAPE)
Only my model achieved perfect clinical safety score: 100% Clarke A+B, & covers both T1DM & T2DM
My system is glass-box with interpretable physics unlike black-box systems
Ablation Study
It confirms each component contributes meaningfully (details in poster).
So What?
Limitations: Accuracy depends on self-reported stress, exercise, & sleep inputs, which can be inconsistent. Future validation of these modifiers at scale remains difficult, as few existing datasets capture all these physiological parameters simultaneously.
Conclusion
Innovation: My novel hybrid Physics-ML system successfully converts noisy biological data into mathematically proven predictions – integrating Bayesian self-calibration and ODEs to isolate individual metabolic parameters like Insulin Sensitivity and Carb Ratios without human intervention.
Retrospective Clinical Validation: Testing across 19,290 real-world events, my system achieved a mean bias of only -0.15mg/dL, R² = 0.896, & paired t-test p = 0.15 > 𝛂. My system's AAE, MAPE, & RMSE also fall well below clinical safety margins. Against a no-model baseline, my system reduced MAE by 52%, & improved R² +0.882 (from -0.224 to +0.658). Benchmarked against four 2024-2026 published models, my system clearly outperformed on every metric despite forecasting 4 hours ahead versus their 30-60 minutes forecast; & only my model achieved 100% clinically safe Clarke A+B zones.
Empowering Patients & Clinicians: My innovation empowers patients with proactive, personalized "what-if" simulations, removing dangerous guesswork from daily diabetes management. It provides an accessible, highly reliable tool to prevent dangerously low/high glucose events before they occur. In hospitals, inpatients face significant metabolic disruption from baseline, & current sliding-scale protocols are purely reactive. My proactive tool – personalizing to each patient's physiology, history, & clinical state – enables nurses & physicians to make better dosing decisions.
Global Impact: My innovation has the potential to significantly transform the lives of hundreds of millions of people with diabetes.
What's Next?
Connect my system to a live CGM device and smartwatch so it receives readings automatically and updates its Bayesian parameters in real time without manual input.
Extend my system into a closed-loop controller where it forecasts glucose and communicates insulin doses to a connected pump – completing the feedback loop autonomously.
Incorporate additional physiological factors: illness, menstrual cycle, & pregnancy.
Extend the forecast horizon beyond 4 hours.
Conduct a direct benchmark comparison against black-box AI models – LSTMs, transformer-based predictors, & neural networks – on the same datasets.
Conduct a prospective clinical study across diverse patient populations, diabetes types, & age groups for real-world medical use.
Thanks
I would like to express my sincere gratitude to my teacher sponsor and my school for their invaluable support. I am also deeply thankful to all the organizers, judges, and volunteers of various science fairs for their dedication and time in making these events possible, and to GVRSF chair and delegate Charley Cai for his insightful feedback and suggestions on my ProjectBoard. Special thanks to my brother for his thoughtful feedback and for always being available to answer my questions; and to my family for their constant encouragement, motivation, and unconditional support.
References
References:
Bailey, C. J., & Turner, R. C. (1996). Metformin. New England Journal of Medicine, 334 (9), 574–579. https://doi.org/10.1056/NEJM199602293340906
Bergman, R. N., Ider, Y. Z., Bowden, C. R., & Cobelli, C. (1979). Quantitative estimation of insulin sensitivity. American Journal of Physiology, 236 (6), E667–E677. https://doi.org/10.1152/ajpendo.1979.236.6.E667
Bland, J. M., & Altman, D. G. (1986). Statistical methods for assessing agreement between two methods of clinical measurement. The Lancet, 327 (8476), 307–310. https://doi.org/10.1016/S0140-6736(86)90837-8
Burden, R. L., & Faires, J. D. (2011). Numerical analysis (9th ed.). Brooks/Cole.
Clarke, W. L., Cox, D., Gonder-Frederick, L. A., Carter, W., & Pohl, S. L. (1987). Evaluating clinical accuracy of systems for self-monitoring of blood glucose. Diabetes Care, 10 (5), 622–628. https://doi.org/10.2337/diacare.10.5.622
Colberg, S. R., Sigal, R. J., Yardley, J. E., Riddell, M. C., Dunstan, D. W., Dempsey, P. C., Hall, K. D., Dempsey, S., & Tate, D. F. (2016). Physical activity/exercise and diabetes: A position statement of the American Diabetes Association. Diabetes Care, 39 (11), 2065–2079. https://doi.org/10.2337/dc16-1728
Cryer, P. E., Davis, S. N., & Shamoon, H. (2003). Hypoglycemia in diabetes. Diabetes Care, 26 (6), 1902–1912. https://doi.org/10.2337/diacare.26.6.1902
Dalla Man, C., Raimondo, D. M., Rizza, R. A., & Cobelli, C. (2007). GIM, simulation software of meal glucose–insulin model. Journal of Diabetes Science and Technology, 1 (3), 323–330. https://doi.org/10.1177/193229680700100303
Davidson, P. C., Hebblewhite, H. R., Steed, R. D., & Bode, B. W. (2008). Analysis of guidelines for basal-bolus insulin dosing: Basal insulin, correction factor, and carbohydrate-to-insulin ratio. Endocrine Practice, 14 (9), 1095–1101. https://doi.org/10.4158/EP.14.9.1095
Deaths attributable to diabetes. (2025, May 5). Diabetes Atlas. https://diabetesatlas.org/data-by-indicator/mortality-attributable-to-diabetes-20-79-y/deaths-attributable-to-diabetes/
Diabetes-related health expenditure per person, USD. (2025, April 4). Diabetes Atlas. https://diabetesatlas.org/data-by-indicator/diabetes-related-health-expenditure/diabetes-related-health-expenditure-per-person-usd/
Dinneen, S., Alzaid, A., Miles, J., & Rizza, R. (1993). Metabolic effects of the nocturnal rise in cortisol on carbohydrate metabolism in normal humans. Journal of Clinical Investigation, 92 (5), 2283–2290. https://doi.org/10.1172/JCI116832
Donga, E., van Dijk, M., van Dijk, J. G., Biermasz, N. R., Lammers, G. J., van Kralingen, K. W., Corssmit, E. P. M., & Romijn, J. A. (2010). A single night of partial sleep deprivation induces insulin resistance in multiple metabolic pathways in healthy subjects. Journal of Clinical Endocrinology & Metabolism, 95 (6), 2963–2968. https://doi.org/10.1210/jc.2009-2430
Drucker, D. J. (2006). The biology of incretin hormones. Cell Metabolism, 3 (3), 153–165. https://doi.org/10.1016/j.cmet.2006.01.004
Eichenlaub, M., Waldenmaier, D., Wehrstedt, S., Pleus, S., Link, M., Jendrike, N., Öter, S., Haug, C., Schinz, M., Braunack-Mayer, V., Schneider, R., Brandt, D., & Freckmann, G. (2025). Performance of Three Continuous Glucose Monitoring Systems in Adults With Type 1 Diabetes. Journal of Diabetes Science and Technology. https://doi.org/10.1177/19322968251315459
Freckmann, G., Mende, J., Pleus, S., Waldenmaier, D., Baumstark, A., Jendrike, N., & Haug, C. (2021). Mean Absolute Relative Difference of Blood Glucose Monitoring Systems and Relationship to ISO 15197. Journal of Diabetes Science and Technology, 16(5), 193229682110014. https://doi.org/10.1177/19322968211001402
Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013). Bayesian data analysis (3rd ed.). CRC Press.
Hasan, K. S. (2025). Trustworthy Machine Learning for Interpretable Early Warning of Diabetes: Modern Ensembles and Tabular Deep Learning with Causal Inference, Counterfactuals, and Uncertainty. https://doi.org/10.20944/preprints202505.0292.v1
Hendawi, R., Li, J., & Roy, S. (2023). A Mobile App That Addresses Interpretability Challenges in Machine Learning–Based Diabetes Predictions: Survey-Based User Study. JMIR Formative Research, 7(1), e50328. https://doi.org/10.2196/50328
Jenkins, D. J. A., Wolever, T. M. S., Taylor, R. H., Barker, H., Fielden, H., Baldwin, J. M., Bowling, A. C., Newman, H. C., Jenkins, A. L., & Goff, D. V. (1981). Glycemic index of foods: A physiological basis for carbohydrate exchange. American Journal of Clinical Nutrition, 34 (3), 362–366. https://doi.org/10.1093/ajcn/34.3.362
Jeon, K., & Shin, M. (2016). Accuracy Evaluation of One Glucose Monitoring System Following ISO 15197:2013 Standards. Journal of Diabetes Science and Technology, 11(3), 637–638. https://doi.org/10.1177/1932296816676188
Karagoz, M. A., Breton, M. D., & Fathi, A. E. (2025, May 12). A Comparative Study of Transformer-Based Models for Multi-Horizon Blood Glucose Prediction. Arxiv.org. https://arxiv.org/html/2505.08821v1
Lehmann, E. D., & Deutsch, T. (1992). A physiological model of glucose-insulin interaction in type 1 diabetes mellitus. Journal of Biomedical Engineering, 14 (3), 235–242. https://doi.org/10.1016/0141-5425(92)90058-S
Luijf, Y. M., Mader, J. K., Doll, W., Pieber, T., Farret, A., Place, J., Renard, E., Bruttomesso, D., Filippi, A., Avogaro, A., Arnolds, S., Benesch, C., Heinemann, L., & DeVries, on behalf of the AP@home c, J. H. (2013). Accuracy and Reliability of Continuous Glucose Monitoring Systems: A Head-to-Head Comparison. Diabetes Technology & Therapeutics, 15(8), 721–726. https://doi.org/10.1089/dia.2013.0049
Maarbjerg, S. J., Sylow, L., & Richter, E. A. (2011). Current understanding of increased insulin sensitivity after exercise — emerging candidates. Acta Physiologica, 202 (3), 323–335. https://doi.org/10.1111/j.1748-1716.2011.02267.x
Murphy, K. P. (2012). Machine learning: A probabilistic perspective. MIT Press.
Pardo, S., & Simmons, D. A. (2016). The Quantitative Relationship Between ISO 15197 Accuracy Criteria and Mean Absolute Relative Difference (MARD) in the Evaluation of Analytical Performance of Self-Monitoring of Blood Glucose (SMBG) Systems. Journal of Diabetes Science and Technology, 10(5), 1182–1187. https://doi.org/10.1177/1932296816644468
Paterson, M. A., Smart, C. E. M., Lopez, P. E., McElduff, P., Attia, J., Morbey, C., & King, B. R. (2015). Influence of dietary protein on postprandial blood glucose levels in individuals with type 1 diabetes mellitus using intensive insulin therapy. Diabetic Medicine, 32 (9), 1193–1199. https://pmc.ncbi.nlm.nih.gov/articles/PMC5064639/
Perriello, G., De Feo, P., Torlone, E., Fanelli, C., Santeusanio, F., Brunetti, P., & Bolli, G. B. (1991). The dawn phenomenon in type 1 (insulin-dependent) diabetes mellitus: Magnitude, frequency, variability, and dependency on glucose counterregulation and insulin sensitivity. Diabetologia, 34 (1), 21–28. https://doi.org/10.1007/BF00404020
Rebrin, K., Steil, G. M., van Antwerp, W. P., & Mastrototaro, J. J. (1999). Subcutaneous glucose predicts plasma glucose independent of insulin: Implications for continuous monitoring. American Journal of Physiology — Endocrinology and Metabolism, 277 (3), E561–E571. https://doi.org/10.1152/ajpendo.1999.277.3.E561
Savitzky, A., & Golay, M. J. E. (1964). Smoothing and differentiation of data by simplified least squares procedures. Analytical Chemistry, 36 (8), 1627–1639. https://doi.org/10.1021/ac60214a047
Schmidt, M. I., Hadji-Georgopoulos, A., Rendell, M., Margolis, S., & Kowarski, A. (1981). The dawn phenomenon, an early morning glucose rise: Implications for diabetic intraday blood glucose variation. Diabetes Care, 4 (6), 579–585. https://doi.org/10.2337/diacare.4.6.579
Schwartz, F. L., & Marling, C. R. (2013). Use of Automated Bolus Calculators for Diabetes Management. European Endocrinology, 9(2), 92. https://pmc.ncbi.nlm.nih.gov/articles/PMC6003586/
Sengupta, S., Handoo, A., Haq, I., Dahiya, K., Mehta, S., & Kaushik, M. (2021). Clarke Error Grid Analysis for Performance Evaluation of Glucometers in a Tertiary Care Referral Hospital. Indian Journal of Clinical Biochemistry, 37(2), 199–205. https://doi.org/10.1007/s12291-021-00971-4
Student. (1908). The probable error of a mean. Biometrika, 6 (1), 1–25. https://doi.org/10.2307/2331554
World Health Organization. (2024, November 14). Diabetes. World Health Organization. https://www.who.int/news-room/fact-sheets/detail/diabetes
Datasets' Sources:
Gutierrez-Osuna, R., Kerr, D., Mortazavi, B., & Das, A. (2025). CGMacros: a scientific dataset for personalized nutrition and diet monitoring. Physionet.org. https://physionet.org/content/cgmacros/1.0.0/
NN Dataset: My in-person study of a real-world T2D patient (March 2026).
Sergazinov, R., Chun, E., Rogovchenko, V., Fernandes, N., Kasman, N., & Gaynanova, I (2024). GlucoBench: Curated List of Continuous Glucose Monitoring Datasets with Prediction Benchmarks. ArXiv.org. https://arxiv.org/abs/2410.05780
Wolff, M. K., Calhoun, P., Aiello, E. M., Qin, Y., & Royston, S. F. (2026). MetaboNet: The Largest Publicly Available Consolidated Dataset for Type 1 Diabetes Management. ArXiv.org. https://arxiv.org/abs/2601.11505
Compared Studies' Sources:
Alredaini, R., Abulkhair, M., & Almisbahi, H. (2026). Interpretable glucose forecasting for type 2 diabetes across traditional, deep, and large language models. Scientific Reports, 16, 2421. https://doi.org/10.1038/s41598-025-32373-4
Osman, M. H., Mahmoud, M., Zakzouk, S., Mohamed, S., Gomaa, I., Darweesh, M. S., Taha, S., & Soltan, A. (2026). Enhanced glucose forecasting using recurrent neural network and advanced feature engineering. Scientific Reports, 16, 12036. https://doi.org/10.1038/s41598-026-41066-5
Sun, X., Li, H., & Yu, X. (2026). Future-aware blood glucose forecasting using knowledge distillation with transformer-based sequence-to-sequence models. Scientific Reports, 16, 11404. https://doi.org/10.1038/s41598-026-41787-7
You, F., Zhao, G., Zhang, X., Zhang, Z., Cao, J., & Li, H. (2024). A new multivariate blood glucose prediction method with hybrid feature clustering and online transfer learning. Health Information Science and Systems, 12(1), 57. https://doi.org/10.1007/s13755-024-00313-7
Images (20)
Awards (2)
- Silver Medal
- Selected for CWSF 2026
Competition history
- CWSF 2026
Related projects
ISEF · 2023
Optimizing Glycemic Control in Type 1 Diabetic Patients Using a Deep Learning-Based Artificial Pancreas With a Secure Glucagon and Insulin Delivery System
ISEF · 2023
DiaVest II: A Non-Invasive Glucose Monitoring System for Diabetes Management
ISEF · 2025
Decoding Diabetes: Harnessing AI to Accurately Predict Real-Time and Future Blood Glucose Levels for Diabetes Management Using Diet, Exercise, Insulin Intake, and Heart Rate Variability
JSHS · 2023
GlucoseAssist: A Novel, Personalized System for Prediction of Blood Glucose Levels and Early Identification of Dysglycemic Events using Artificial Intelligence
JSHS · 2025
Decoding Diabetes: Harnessing AI to Accurately Predict Real-Time and Future Blood Glucose Levels for Diabetes Management Using Diet, Exercise, Insulin Intake, and Heart Rate Variability
ISEF · 2023
BioRx: An Integrative NLP Approach to Early Survival and Recurrence Prediction and Novel Biomarker Discovery in Unstructured Text-Based Clinical Narratives for Diabetes Patients
ISEF · 2022
Creating a Low-Cost Non-Invasive Blood Glucose Monitoring and Automatic Insulin Injection System With an Artificial Neural Network and Raspberry Pi
ISEF · 2022
A Low-Cost Artificial Pancreas System With Integrated Machine Inference
Closest projects by meaning, across every fair and year in the corpus.