Precision Allocation of GLP1-RA and SGLT2i in Cardiac Rehabilitation
Overview
Every year nearly half of cardiac rehab patients quit before finishing recovery. With a specific cardiac rehab program helping over 550 patients with heart disease and diabetes restrengthen cardiovascular health, there is need of a system to prevent data entry errors. I built a computer program that checks medication records at entry to program, 12 week, and dropout. The program finds medication information from records and associates the data with a quality grade, so care providers know which information is trustworthy. Now researchers can use accurate data to prove that rehab saves lives. To solve the initial patient dropout problem, I created a system that reads three sources of patient data (wearable, ECG, medical history) and predicts which patients are most likely to drop out, flagging them before its too late. This system correctly identifies high risk patients and could prevent thousands of dropouts annually across Canada, saving lives everywhere.
Video
This video could not be played here. Watch it on the original project page.
Video
Precision allocation of GLP-1RA and SGLT2i in cardiac rehabilitation
Why?
Problem
Cardiovascular disease is a leading cause of death in Canada.
Cardiac rehabilitation reduces mortality by 26 percent in those who complete it (Taylor et al. 2004), however, 30 - 50 percent of patients never finish (Dalal et al. 2015). Figure 2 displays cardiac rehab truly guiding recovery.
Despite the proven benefits of the SGLT2i's and GLP-1RA's in reducing heart and kidney disease as displayed in Figure 1, utilization among patients needs to see improvement in uptake(McGuire et al., 2021).
Objectives
This project is in collaboration with a cardiac rehabilitation centre, and has two major objectives.
Develop an automated clinical tool to accurately determine which patients were receiving SGLT2i's or GLP-1RA's at program entry, 12 week, and program exit.
Develop a machine learning system using wearable signals, exercise ECG, and clinical heart disease variables to predict which patients are at the highest risk of dropping out beforehand, enabling coordinators time to intervene in time. The pipeline flow is displayed through Figure 3. Together these tools form a clinical decision support pathway that could help more patients complete a program that saves lives.
Validation letter (portion):
Modern day medicine is evolving towards personalized medication, pushing away from a one-size-fits-all treatment approach. This work represents that shift, a multimodal AI risk prediction tool integrating clinical, wearable and heart rate data to generate personalized risk scores in cardiac rehab. No comparable multimodal, personalized prediction tool currently exists in cardiac rehab, positioning this work at the leading edge of precision cardiovascular care (Beaudry, 2026).
How?
Methods
Part 1: Medication tracking
Using a database of patient records from a cardiac rehabilitation program, I identified 550 patients who had at least one recorded prescription for an SGLT2i or GLP1-RA at any point in their medication records.
For each patient, I created the capability to automatically search medication records and identify the closest prescription entry (within a a 7 day window) to the initial exercise stress test, the 12 week, and the date of a patients last recorded clinic attendance before a gap of 30 or more days without return. For patients who changed medication during the program, the record closest to each timepoints was used and flagged accordingly as displayed in Figure 3. A confidence score was assigned based on the number of days between the medication record and the clinical date.
I also built a patient lookup function enabling instant retrieval of any patients medication status and health vitals.
Part 2: Machine learning dropout prediction
I trained three separate machine learning models on three publicly available research datasets each providing the best available data for one physiological signal:
Wearable signals - 100 patients wearing an Empatica E4 wearable (blood volume pulse, electrodermal activity, accelerometer, temperature, features displayed in Figure 4) during lab stress and exercise tasks
Exercise ECG and gait signals - 98 post cardiac surgery patients during supervised rehabilitation sessions
Clinical heart disease variables - 303 patients from the Cleveland Clinic diagnostic cardiology database
Each model was validated using cross validation methods that prevent any patient from appearing in both training and testing sets. The three models' outputs were fused into one composite risk score and classified into four tiers as shown in Figure 5. A real time overexertion monitor was built using five published clinical thresholds to flag cardiac stress every 60 seconds during a session.
What?
Results
Part 1: Medication tracking results
Analysis of 550 cardiac rehabilitation patients revealed significant changes in cardiovascular medication use across the program.
SGLT2i usage increased from 21% at program entry to 73% at 12 week completion; a significant increase reflecting the programs effectiveness in optimizing evidence baed pharmacotherapy.
GLP-1RA usage increased from 5% to 18% over that same period. The trend of medication uptake is displayed in Figure 6.
Among patients who exited the program early, medication records were successfully matched at the time of exit for the majority of cases, providing a previously unavailable dataset linking medication status to program dropout.
Part 2: Machine Learning results
Model 1
The wearable stress and exercise classifier, which distinguishes stress physiology from appropriate aerobic and anaerobic exercise using E4 biosensor data, achieved 86% accuracy using cross validation, meaning the model was tested on subjects it had never seen during training (Figure 7). Random guessing on a 3 class problem would yield 33% accuracy, my result is more than 2.5 times this baseline.
Model 2
The most important biological finding came from the exercise ECG dataset, comparing 98 post surgical patients' first and last rehab sessions, RMSSD, a key marker of the parasympathetic nervous system activity, increased by 5%, while LF/HF ratio decreased by 5% (Figure 8). These changes confirm that the rehab program is producing measurable autonomic nervous system recovery, consistent with published exercise physiology literature (Kaikkonen et al., 2010).
Model 3
The clinical heart disease risk classifier achieved 85.1% accuracy and AUC of 0.91 on 303 patients using 10-fold stratified cross validation (Figure 9). An AUC of 0.91 means that if a sick patient and a healthy patient are randomly paired, the model correctly ranks the sick patient as a higher risk 91% of the time. This showed improved accuracy compared to Detrano et al. (1989), the original publication that established this benchmark dataset, by 8 percentage points confirmed statistically significant.
Fusion model
The triple fusion composite risk score stratified 41 patient profiles into risk tiers of Low, Moderate, High and Critical (Figure 10). Sensitivity analysis across five different weight configurations showed that 88-100% of patients remained in the same tier regardless of the weights.
The real time overexertion monitor detected physiological danger in demonstration scenarios. A progressive overexertion scenario triggered a HIGH alert as heart rate exceeded 85% heart rate reserve and RMSSD simultaneously dropped 47% below session baseline, an acute stress scenario triggered CRITICAL - STOP SESSION alert when Lf/HF exceeded 4.8 and electrodermal activity rose 3.6 standard deviations above session baseline (Figure 11). An actuarial model, using published estimates of cardiac rehab participation rates (Canadian Cardiovascular Society, 2021), dropout costs (CIHI, 2022), and intervention effectiveness (Clark et al., 2015), projected that this approach could prevent approximately 3600 program dropouts per year in Canada, potentially saving an estimated $11.6 million CAD annually in secondary cardiac event costs.
So What?
Results analysis
The medication tracking results reveal that cardiac rehab is a critical window for medication optimization. The tripling of SGLT2i usage during the program reflects active clinical decision making that this project can now track systematically and accurately. Researchers now have a tool to measure medication changes at scale, enabling future studies on whether medication status predicts cardiovascular outcomes after rehabilitation.
The pre/post HRV finding (RMSSD rising and LF/HF falling after rehabilitation) provides independent biological proof that supervised exercise therapy is achieving its intended physiological effect. The parasympathetic system is becoming stronger, while the sympathetic dominance is reducing. This validates the monitoring framework, the physiological signals this system measures are changing in the direction that published exercise physiology research predicts (Bernardi et al., 2012), confirming they reflect genuine cardiovascular adaptation.
The 85% cross subject accuracy and AUC 0.91 confirm that machine learning can identify high risk patients from routinely available physiological and clinical data. The ablation study proves that no single signal achieves this alone, and that fusion of all three is necessary.
This project has limitation considerations as well. The three machine learning datasets contain different populations requiring validation individually rather than a single shared cohort. The economic projections are estimates based on published assumptions and would require further analysis to confirm. The overexertion thresholds, have not been calibrated fully in a cardiac rehab population, thus require further external validation and testing.
https://drive.google.com/file/d/1_ndv8HcsCPQa2JyYf48QsAEg3mbR5Dmm/view?usp=sharing
What's Next?
The primary next step is further validation, collecting all three physiological streams from the same single cardiac rehab program simultaneously, with confirmed completion or dropout as the outcome variable. The medication tracking system could be integrated with the dropout prediction model to test whether SGLT2i and GLP-1RA prescription status at program entry predicts physiological risk scores. The overexertion detection thresholds, currently derived from published literature, should be calibrated against adverse events in a specific cardiac rehab cohort.
Thanks
I would like to thank TotalCardiology for providing access to the patient dataset and for their guidance on clinical interpretation of the medication variables.
I would also like to thank Dr. Rhys Beaudry for his invaluable guidance, validation and support in my project.
Thank you to my mom for her significant support throughout my project, and acting as second voice on every decision of mine along the way. Thank you Mom!
I would also like to thank the CYSF delegates who mentored team Calgary for CWSF.
Technical tools: VS code, Python, Jupyter notebooks.
References
Benowitz, N. L., Zevin, S., Carlsen, S., Wright, J., Schambelan, M., & Cheitlin, M. (1996). Orthostatic hypertension due to vascular adrenergic hypersensitivity. Hypertension (Dallas, Tex. : 1979), 28(1), 42–46. https://doi.org/10.1161/01.hyp.28.1.42
Bernardi, L., Porta, C., & Sleight, P. (2006). Cardiovascular, cerebrovascular, and respiratory changes induced by different types of music in musicians and non-musicians: the importance of silence. Heart (British Cardiac Society), 92(4), 445–452. https://doi.org/10.1136/hrt.2005.064600
Boucsein, W. (2012). Electrodermal activity (2nd ed.). Springer Science + Business Media. https://doi.org/10.1007/978-1-4614-1126-0
Camm, A. J., Malik, M., Bigger, J. T., et al. (1996). Heart rate variability: standards of measurement, physiological interpretation and clinical use. European Heart Journal, 17(3), 354-381.
Canadian Cardiovascular Society. (2021). Quality indicators for cardiac rehabilitation and secondary prevention. https://ccs.ca/ccs-data-definitions-quality-indicators/
Canadian Institute for Health Information. (2022). Cost of a standard hospital stay. https://www.cihi.ca/en/indicators/cost-of-a-standard-hospital-stay
Clark, A. M., Savard, L. A., & Thompson, D. R. (2009). What is the strength of evidence for heart failure disease-management programs?. Journal of the American College of Cardiology, 54(5), 397–401. https://doi.org/10.1016/j.jacc.2009.04.051
Continuous stress detection using a wrist device | proceedings of the 2016 ACM International Joint Conference on Pervasive and Ubiquitous Computing: Adjunct. (n.d.-c). https://dl.acm.org/doi/10.1145/2968219.2968306
Dalal, H. M., Doherty, P., & Taylor, R. S. (2015). Cardiac rehabilitation. BMJ (Clinical research ed.), 351, h5000. https://doi.org/10.1136/bmj.h5000
Detrano, R., Janosi, A., Steinbrunn, W., Pfisterer, M., Schmid, J. J., Sandhu, S., Guppy, K. H., Lee, S., & Froelicher, V. (1989). International application of a new probability algorithm for the diagnosis of coronary artery disease. The American journal of cardiology, 64(5), 304–310. https://doi.org/10.1016/0002-9149(89)90524-9
Fox, K. A., Dabbous, O. H., Goldberg, R. J., Pieper, K. S., Eagle, K. A., Van de Werf, F., Avezum, A., Goodman, S. G., Flather, M. D., Anderson, F. A., Jr, & Granger, C. B. (2006). Prediction of risk of death and myocardial infarction in the six months after presentation with acute coronary syndrome: prospective multinational observational study (GRACE). BMJ (Clinical research ed.), 333(7578), 1091. https://doi.org/10.1136/bmj.38985.646481.55
Fried, L. P., Tangen, C. M., Walston, J., Newman, A. B., Hirsch, C., Gottdiener, J., Seeman, T., Tracy, R., Kop, W. J., Burke, G., McBurnie, M. A., & Cardiovascular Health Study Collaborative Research Group (2001). Frailty in older adults: evidence for a phenotype. The journals of gerontology. Series A, Biological sciences and medical sciences, 56(3), M146–M156. https://doi.org/10.1093/gerona/56.3.m146
Introduction. Canadian Cardiovascular Society. (2024, April 12). https://ccs.ca/guideline/cardiorenal-2022/introduction/
JavaScript is not available. X (formerly Twitter). (n.d.). https://x.com/ZainKhalpey/status/2044451313459646657
Kaikkonen, P., Nummela, A., & Rusko, H. (2007). Heart rate variability dynamics during early recovery after different endurance exercises. European journal of applied physiology, 102(1), 79–86. https://doi.org/10.1007/s00421-007-0559-8
KARVONEN, M. J., KENTALA, E., & MUSTALA, O. (1957). The effects of training on heart rate; a longitudinal study. Annales medicinae experimentalis et biologiae Fenniae, 35(3), 307–315.
Kiviniemi, A. M., Hautala, A. J., Kinnunen, H., & Tulppo, M. P. (2007). Endurance training guided individually by daily heart rate variability measurements. European journal of applied physiology, 101(6), 743–751. https://doi.org/10.1007/s00421-007-0552-2
Koenig, J., Jarczok, M. N., Ellis, R. J., Hillecke, T. K., & Thayer, J. F. (2014). Heart rate variability and experimentally induced pain in healthy adults: a systematic review. European journal of pain (London, England), 18(3), 301–314. https://doi.org/10.1002/j.1532-2149.2013.00379.x
McGuire, D. K., Shih, W. J., Cosentino, F., Charbonnel, B., Cherney, D. Z. I., Dagogo-Jack, S., Pratley, R., Greenberg, M., Wang, S., Huyck, S., Gantz, I., Terra, S. G., Masiukiewicz, U., & Cannon, C. P. (2021). Association of SGLT2 Inhibitors With Cardiovascular and Kidney Outcomes in Patients With Type 2 Diabetes: A Meta-analysis. JAMA cardiology, 6(2), 148–158. https://doi.org/10.1001/jamacardio.2020.4511
Podsiadlo, D., & Richardson, S. (1991). The timed "Up & Go": a test of basic functional mobility for frail elderly persons. Journal of the American Geriatrics Society, 39(2), 142–148. https://doi.org/10.1111/j.1532-5415.1991.tb01616.x
Taylor, R. S., Brown, A., Ebrahim, S., Jolliffe, J., Noorani, H., Rees, K., Skidmore, B., Stone, J. A., Thompson, D. R., & Oldridge, N. (2004). Exercise-based rehabilitation for patients with coronary heart disease: systematic review and meta-analysis of randomized controlled trials. The American journal of medicine, 116(10), 682–692. https://doi.org/10.1016/j.amjmed.2004.01.009
Images (24)
Awards (1)
- Selected for CWSF 2026
Competition history
- CWSF 2026
Related projects
CYSF · 2026
Precision Allocation of GLP1-RA and SGLT2i in Cardiac Rehabilitation
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 · 2023
DiaVest II: A Non-Invasive Glucose Monitoring System for Diabetes Management
CWSF · 2026
In Silico Diabetes Management and Prediction: A Personalized Hybrid Physics-ML System
ISEF · 2019
Drugs to Defeat Diabetes: Comparing Diabetes Drug Treatment Efficacy after Metformin using Big Data
ISEF · 2019
Mobile Application to Facilitate the Transmission and Interpretation of Biometric Data to Enable the Early Detection of Cardiovascular Disease
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
CYSF · 2026
Mitigating Prediabetes: Building and Testing a Software-Enabled Recommendation Engine
Closest projects by meaning, across every fair and year in the corpus.