Research Square
A Reproducible Ensemble Learning Framework for 12‑Lead ECG Classification of Myocardial Ischemia and Infarction
By Soltanzadeh L, Sangar AB, Majidzadeh K and 1 others.
Abstract
Abstract Background: Diabetes affects more than 537 million adults worldwide. Cardiovascular complications cause about half of all deaths in this population. Silent myocardial ischemia is common in diabetic patients. Autonomic neuropathy often hides the typical chest pain. As a result, ischemia often goes undetected until it becomes severe. Wearable ECG devices usually record only two or three leads. This reduces sensitivity for detecting ischemic events. Objective: We aimed to find an optimal teacher model for 12‑lead ECG classification of myocardial infarction (MI) and ischemia. Our goal was to provide a high‑capacity source for knowledge distillation. This source can train lightweight models for wearable devices. Methods : We performed a systematic hyperparameter search on the PTB‑XL dataset (21,837 records). We tested five architectures with different Transformer depths, hidden dimensions, dropout rates, and learning rates. We also trained two extended variants (V2 and V3) with higher positive‑class weights and longer schedules. We built ensembles by averaging the logits of the best models. Results : The wider transformer model (hidden dimension 1024, 3 layers, dropout 0.20) achieved 86.58% validation accuracy and 80.74% sensitivity. Extended training (V2: weight 3.0, 12 epochs) raised validation sensitivity to 88.82% with only a small accuracy drop (85.39%). The ensemble of V1 and V2 gave the best test performance: accuracy 87.40%, sensitivity 76.18%, specificity 92.65%, F1 79.41%, and AUC 93.97%. Adding V3 did not improve performance. Conclusions : The V1+V2 ensemble is a well‑calibrated teacher model for knowledge distillation. Its strong discriminative ability (AUC 93.97%) makes it suitable for training lightweight student networks. These networks can be used in reduced‑lead, resource‑limited settings. All code and data are publicly available.



