Abstract
Background Real-world 12-lead electrocardiograms (ECGs) often have missing or corrupted leads. A deep-learning classifier can be prepared for this by random lead masking during training, or by injecting clinical knowledge, for example by pulling its attention towards the leads that guidelines use for each diagnosis. Whether this knowledge adds robustness beyond masking is unknown.
Methods Pre-registered comparison of three arms sharing one network (per-lead 1D-ResNet encoder and per-diagnosis attention over the 12 leads): standard training (M0); random whole-lead masking (M1); masking plus a Kullback-Leibler penalty pulling attention towards a fixed guideline-derived key-lead map (M2, guideline-based attention guidance). Six diagnoses; five seeds per arm. Development on PTB-XL (21,799 ECGs); single sealed evaluation on PTB-XL fold 10 (2,198 ECGs) and on CODE-15% (233,204 exams, external validation). Primary endpoint: AUROC difference M2 − M1, averaged over first-degree AV block, right and left bundle branch block and atrial fibrillation and over 1 to 6 lost (zeroed) leads, with a patient-level paired BCa bootstrap 95% confidence interval.
Results The guidance did not change robustness: ΔAUROC −0.0010 (95% CI −0.0033 to +0.0006), an interval entirely within the pre-specified ±0.02 margin; the result was unchanged with another bootstrap seed, other interval methods and leave-one-diagnosis-out analyses. Masking improved AUROC: M1 − M0 = +0.0134 (95% CI +0.0102 to +0.0172) when one key lead was lost, and the number of lost leads tolerated before AUROC fell by more than 0.02 rose from 7 (M0) to 10 (M1). M2 attention matched the map and M2 was non-inferior on intact ECGs, but its calibration slope was lower for all six diagnoses in both datasets. M2 lost slightly more when all key leads were lost together (−0.0067) and gained only when one to three leads remained (exploratory; AUROC 0.9408 vs 0.9210 with 11 leads lost). CODE-15% reproduced every pattern (primary −0.0007, 95% CI −0.0011 to −0.0003).
Conclusions Random lead masking suffices to make an ECG classifier robust to missing leads; adding guideline knowledge aligns attention with clinical criteria but adds no robustness and worsens calibration. Guideline-aligned attention should not be taken as evidence of robustness.
Competing Interest Statement
The authors have declared no competing interest.
Clinical Protocols
https://doi.org/10.17605/OSF.IO/M9UR2
Author Declarations
I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.
Yes
The details of the IRB/oversight body that provided approval or exemption for the research described are given below:
The study used ONLY openly available human data that were publicly accessible before the initiation of the study (secondary analysis of two public, de-identified ECG datasets). No application, registration or access request was required. PTB-XL v1.0.3 (21,799 ECGs from 18,869 patients; Germany; CC BY 4.0), originally located at: https://physionet.org/content/ptb-xl/1.0.3/ (DOI: https://doi.org/10.13026/kfzx-aw45) CODE-15% (233,647 first exams from the CODE cohort; Brazil; CC BY 4.0), originally located at: https://zenodo.org/records/4916206 (DOI: https://doi.org/10.5281/zenodo.4916206) Both datasets were downloaded from these public pages without restriction. The study protocol was pre-registered on OSF (https://doi.org/10.17605/OSF.IO/M9UR2) on 16 October 2026, before any prediction on the test data.
I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.
Yes
I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).
Yes
I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.
Yes
Footnotes
Pre-registration: OSF, doi:10.17605/OSF.IO/M9UR2 (16 October 2026).
Reporting guideline: TRIPOD+AI.
Data Availability
All data analysed in this study are publicly available. PTB-XL v1.0.3 is available at https://physionet.org/content/ptb-xl/1.0.3/ and CODE-15% at https://zenodo.org/records/4916206. The study protocol was pre-registered on OSF (doi:10.17605/OSF.IO/M9UR2).
https://physionet.org/content/ptb-xl/1.0.3/





