Pillar Post

From the ICU to the Marathon Course: What AI-Driven Glycemic Control Teaches Us About Athletic Performance

A physician-developer explores the powerful parallels between AI-driven glycemic control in the ICU and metabolic management for endurance athletes with Type 2 diabetes, introducing the Performance Glycemic Intelligence System (PGIS) as a real-world n-of-1 framework.

By Dr. Chukwuma Onyeije, MD, FACOG

Maternal-Fetal Medicine Specialist & Medical Director, Atlanta Perinatal Associates

Founder, Doctors Who Code · OpenMFM.org · CodeCraftMD ·

A split-screen image showing an ICU monitor with glucose waveforms and a marathon runner at dawn, bridged by a line of glowing data.

A systematic review published just days ago in Artificial Intelligence in Medicine stopped me mid-scroll on a Saturday morning.1 The paper — “Systematic review of Artificial Intelligence-based methods for glycemic control and risk prediction in intensive care units” — is a rigorous PRISMA-compliant survey of six years of research on how machine learning is reshaping glycemic management in the most demanding clinical environment we have: the ICU. But as I read it, I was not thinking about my patients in the hospital. I was thinking about my next long run.

That is the peculiar privilege of being a physician-developer who also happens to be a 60-year-old endurance athlete with Type 2 diabetes training for a half marathon. The science of the ICU and the science of the marathon course are, at their metabolic core, the same science. Both are exercises in managing a dynamic, nonlinear biological system under physiological stress, with imperfect data, and with consequences that are unforgiving if you get it wrong.


The ICU Glycemic Problem: A Masterclass in Metabolic Complexity

The central challenge of glycemic management in the ICU is not simply that patients have high blood sugar. It is that their physiology is a moving target. Stress hyperglycemia — the acute elevation of blood glucose in response to critical illness — occurs even in patients with no prior history of diabetes.2 The body’s catecholamine surge, glucocorticoid release, and cytokine storm conspire to drive glucose upward, while simultaneously inducing insulin resistance that makes correction unpredictable.3

The consequences of getting it wrong are severe in both directions. Hyperglycemia is associated with increased infection rates, prolonged ICU stays, and higher mortality.4 But the landmark NICE-SUGAR trial demonstrated that overly aggressive insulin therapy, targeting blood glucose of 81–108 mg/dL, actually increased mortality compared to a more permissive target of 144–180 mg/dL — largely because of iatrogenic hypoglycemia.5 The ICU glucose problem is therefore not a simple “lower is better” equation. It is a precision problem: the goal is Time-in-Range (TIR), the percentage of time a patient’s glucose remains within a defined therapeutic window.

This is precisely where AI enters the picture, and precisely where the parallel to athletic performance becomes so instructive.


What the Systematic Review Found

The Sarwar et al. review analyzed studies published between January 2019 and March 2025, drawing from PubMed, PubMed Central, and Google Scholar. The key findings are worth examining in detail, because they reveal both the promise and the honest limitations of the field.

FindingClinical Implication
Tree ensembles (XGBoost, Random Forest) and deep sequence models (LSTM) outperform traditional glucose prediction methodsShort-horizon glucose forecasting is now clinically viable
CGM combined with EHR physiologic streams yields the richest predictive signalMultimodal data integration is essential for accuracy
Several algorithms support closed-loop insulin titration strategiesAutomated glycemic management in the ICU is feasible
External validation is uncommon; calibration is inconsistently reportedCurrent models are not yet ready for uncritical deployment
Outcome endpoints vary widely (TIR, hypoglycemia burden, BGRI)Meta-analysis and cross-study comparison remain difficult

The review’s conclusion is measured and appropriately cautious: AI shows genuine promise for proactive alerts and individualized insulin dosing, but routine clinical adoption requires prospective multicenter trials, standardized endpoints, transparent calibration, and robust safety monitoring.1

This is the honest assessment of a field that is maturing rapidly but has not yet crossed the threshold from research tool to standard of care. It is a field that is, in the language of my own training system, still in the YELLOW zone: promising, active, but requiring careful monitoring before full deployment.


The Athlete’s Parallel: A Body Under Stress

Now consider the endurance athlete with Type 2 diabetes preparing for a marathon.

The physiological stressors are different in character but identical in their metabolic consequences. A long training run triggers a catecholamine surge that initially drives glucose upward, followed by a prolonged glucose-lowering effect from increased insulin sensitivity and muscle glucose uptake that can persist for 24 to 48 hours.6 The athlete must navigate this biphasic response — the acute hyperglycemia of exertion and the delayed hypoglycemia of recovery — across every training session, every week, for months.

The stakes are not mortality, but they are real. Hypoglycemia during a long run is dangerous. Chronic hyperglycemia from poor training-related glycemic management accelerates the very complications the athlete is training to prevent. And suboptimal glucose control — even without frank hypo- or hyperglycemia — impairs performance, blunts recovery, and increases injury risk.

The athlete, like the ICU patient, needs a system that can:

  1. Monitor glucose continuously and in real time.
  2. Predict where glucose is trending, not just where it is now.
  3. Integrate multiple physiological data streams to contextualize the glucose signal.
  4. Prescribe individualized, adaptive responses rather than generic protocols.

This is not a metaphor. This is a clinical decision-support framework applied to a different population.


The Performance Glycemic Intelligence System: An N-of-1 Forerunner

Over the past year, I have been developing and living inside what I call the Performance Glycemic Intelligence System (PGIS) — my personal, AI-assisted framework for navigating the metabolic complexity of endurance training with Type 2 diabetes. The PGIS is, in every meaningful sense, a personal-scale implementation of the same principles that the ICU literature is working to standardize at the population level.

The PGIS integrates the following data streams into a daily readiness assessment:

PGIS Data StreamICU AnalogClinical Significance
Dexcom CGM (real-time glucose, trend arrows)Bedside glucose / ICU CGMPrimary metabolic signal; trend direction is as important as absolute value
Garmin HRV (Heart Rate Variability)Physiologic stream monitoringAutonomic nervous system readiness; flags occult stress or overtraining
Resting Heart RateVital signs trendingCardiovascular strain and recovery status
Sleep duration and quality (Body Battery)Sedation/arousal stateRecovery completeness; predicts next-day performance capacity
Training load (past 48 hours)Treatment effects and cumulative interventionsQuantifies physiological stress burden
DOMS (Delayed Onset Muscle Soreness)Inflammatory markersTissue recovery and injury risk

The system outputs a GREEN / YELLOW / RED readiness status each morning, which gates my training decisions for the day. This is not intuition dressed up as data. It is a structured, rule-based algorithm that applies my individual baselines — HRV ~30–31, resting HR in the high 50s, fasting glucose target below 100 mg/dL — to determine whether my physiology is prepared for aerobic stress, requires modification, or demands rest.

The PGIS also addresses one of the most clinically significant risks in my specific profile: nocturnal hypoglycemia following strength training sessions. This is a well-documented phenomenon in older adults with diabetes, and it is precisely the kind of individualized, time-sensitive risk that the ICU literature identifies as a target for AI-driven prediction. My system flags strength training days and automatically adjusts my bedtime fueling strategy and overnight CGM monitoring frequency in response.


The Deeper Lesson: Logs Before Intelligence

The ICU review makes a critical observation that every physician-developer should internalize: the quality of AI predictions is entirely dependent on the quality of the underlying data. The studies that performed best were those that combined continuous glucose monitoring with rich, multimodal physiologic data streams from electronic health records. The studies that struggled were those that relied on sparse, intermittent bedside glucose checks — data that captures snapshots rather than trajectories.

This is the principle I have come to call “Logs Before Intelligence.” You cannot build a meaningful predictive system on top of poor data infrastructure. The ICU’s move toward CGM integration, toward continuous physiologic streaming, toward structured EHR data — this is not primarily a technology story. It is a data discipline story.

For the athlete, the equivalent discipline is the daily practice of consistent, structured self-monitoring. The CGM is not optional. The HRV measurement upon waking is not optional. The training log is not optional. These are the raw materials from which intelligence is built. Without them, even the most sophisticated algorithm produces noise.

“Logs before intelligence” is not a technical constraint. It is a philosophical commitment to the idea that precision medicine — whether in the ICU or on the marathon course — begins with the discipline of observation.


What Physicians Who Code Should Build

The convergence of wearable technology, continuous biomonitoring, and accessible machine learning frameworks is creating an extraordinary opportunity for physician-developers. The ICU glycemic control literature is showing us what is possible when you apply rigorous AI methodology to a high-stakes physiological problem. The PGIS is my attempt to demonstrate that the same methodology can be applied at the individual level, by a clinician who understands both the biology and the code.

Here is what I believe physician-developers should be building at the intersection of these two worlds:

Personalized glycemic decision-support tools that go beyond the CGM app’s raw data to integrate training load, sleep, HRV, and nutritional context into actionable daily recommendations. The technology stack for this — Python, a CGM API, a wearable data API, and a simple rule engine or lightweight ML model — is accessible to any physician with basic programming literacy.

Longitudinal performance audit systems that track not just glucose values but the relationship between training inputs and metabolic outputs over weeks and months. The ICU literature is hampered by the lack of standardized endpoints; the individual athlete has the luxury of defining their own endpoint (race performance, injury-free training weeks, HbA1c trajectory) and building toward it systematically.

Closed-loop fueling strategies that apply the same logic as closed-loop insulin delivery systems — real-time glucose sensing, predictive modeling, and automated adjustment — to the athlete’s nutrition and supplementation decisions. This is not science fiction. It is the logical extension of what CGM technology already enables.


The Marathon as a Clinical Trial

I am training for a half marathon at Thanksgiving 2026. I am 60 years old. I have had Type 2 diabetes for 24 years. I am vegan. I train in the early morning, often fasted, with a CGM on my arm and a Garmin on my wrist.

Every training session is a data point. Every morning readiness assessment is a clinical decision. Every race is an outcome measure. The PGIS is my protocol, and I am my own subject.

The ICU literature is right that AI-driven glycemic control requires prospective trials with standardized endpoints and rigorous safety monitoring. But it is also true that the most important trial in the history of any individual’s health is the one they run on themselves, every day, with whatever data and intelligence they can bring to bear.

The ICU and the marathon course are not as far apart as they seem. In both environments, the body is under stress, the data is imperfect, and the margin for metabolic error is real. In both environments, the future belongs to those who can integrate continuous monitoring, predictive intelligence, and individualized protocols into a coherent system of care.

I am building that system. And I am running toward the finish line.


References


Dr. Chukwuma Onyeije is a Maternal-Fetal Medicine specialist, physician-developer, and founder of DoctorsWhoCode.blog and CodeCraftMD. He writes at the intersection of clinical medicine, software development, and AI in healthcare. He is currently training for the 2026 Atlanta Thanksgiving Half Marathon.

Footnotes

  1. Sarwar, M. A., Damaševičius, R., Belousovienė, E., & Maskeliūnas, R. (2026). Systematic review of Artificial Intelligence-based methods for glycemic control and risk prediction in intensive care units. Artificial Intelligence in Medicine, 103409. https://doi.org/10.1016/j.artmed.2026.103409 2

  2. Dungan, K. M., Braithwaite, S. S., & Preiser, J. C. (2009). Stress hyperglycaemia. The Lancet, 373(9677), 1798–1807. https://doi.org/10.1016/S0140-6736(09)60553-5

  3. McCowen, K. C., Malhotra, A., & Bistrian, B. R. (2001). Stress-induced hyperglycemia. Critical Care Clinics, 17(1), 107–124. https://doi.org/10.1016/S0749-0704(05)70154-8

  4. Krinsley, J. S., Egi, M., Kiss, A., Devendra, A. N., Schuetz, P., Maurer, P. M., Schultz, M. J., van Hooijdonk, R. T., Kiyoshi, M., Mackenzie, I. M., Annane, D., Stow, P., Nasraway, S. A., Holewinski, S., Holzinger, U., Preiser, J. C., Vincent, J. L., & Bellomo, R. (2013). Diabetic status and the relation of the three domains of glycemic control to mortality in critically ill patients: an international multicenter cohort study. Critical Care, 17(2), R37. https://doi.org/10.1186/cc12547

  5. NICE-SUGAR Study Investigators. (2009). Intensive versus conventional glucose control in critically ill patients. New England Journal of Medicine, 360(13), 1283–1297. https://doi.org/10.1056/NEJMoa0810625

  6. van Dijk, J. W., Manders, R. J., Tummers, K., Bonomi, A. G., Stehouwer, C. D., Hartgens, F., & van Loon, L. J. (2012). Both resistance- and endurance-type exercise reduce the prevalence of hyperglycaemia in individuals with impaired glucose tolerance and in insulin-treated and non-insulin-treated type 2 diabetic patients. Diabetologia, 55(5), 1273–1282. https://doi.org/10.1007/s00125-011-2380-5

AI in Medicine Clinical Informatics Digital Health Endurance Sports Type 2 Diabetes PGIS Physician-Developer
Share X / Twitter LinkedIn
Chukwuma Onyeije, MD, FACOG

Chukwuma Onyeije, MD, FACOG

Maternal-Fetal Medicine Specialist

MFM specialist at Atlanta Perinatal Associates. Founder of CodeCraftMD and OpenMFM.org. I write about building physician-owned AI tools, clinical software, and the case for doctors who code.