Accurate and Auditable ECG Classification via Visibility Graph Neural Networks
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
arXiv:2610.41795v1 [cs.LG] 30 Oct 2026
Accurate and Auditable ECG Classification via Visibility Graph Neural Networks Artur Xavier1*, Guilherme Henrique Gomes Evangelista1 , Aitazaz Khan2 , Antonio Luiz Pinho Ribeiro3 , Mohammed J. Zaki2 , Srinivasan Parthasarathy4*, Wagner Meira Jr.1* 1
Department of Computer Science, Universidade Federal de Minas Gerais, Belo Horizonte, Minas Gerais, Brazil. 2 Department of Computer Science, Rensselaer Polytechnic Institute, Troy, New York, USA. 3 Department of Internal Medicine, School of Medicine, Universidade Federal de Minas Gerais, Belo Horizonte, Minas Gerais, Brazil. 4 Department of Computer Science and Engineering, The Ohio State University, Columbus, Ohio, USA.
*Corresponding author(s). E-mail(s): arturxavier@dcc.ufmg.br; srini@cse.ohio-state.edu; meira@dcc.ufmg.br; Abstract Physicians read electrocardiograms (ECGs) from waveform shape and timing, yet accurate deep-learning classifiers rarely show which waveform regions drive their predictions. We introduce LYNX-ECG, a graph neural network that represents each heartbeat as a sparse visibility graph of timestamped turning points. On CODE-Test, LYNX-ECG reaches a macro F1 score of 0.889, outperforming five baselines including the ECGFounder foundation model, while its graphs need about 14% of the storage of graphs built from every sample. Because each node maps to a specific ECG time, we can delete clinically defined waveform regions and alter beat timing to audit predictions. For conduction disorders, the clinically expected region was the strongest evidence in more than 90% of correct predictions. Bradycardia and tachycardia calls follow heart rate with conduction intervals held fixed, and atrial fibrillation calls vanish when beat-to-beat variation is removed. Sparse visibility graphs thus pair accurate ECG classification with clinically grounded, testable explanations.
1
Keywords: electrocardiography, graph neural networks, visibility graphs, explanation auditing, sparse representation
The 12-lead electrocardiogram (ECG) is a gold-standard, non-invasive test used to detect cardiac rhythm and conduction disorders [1, 2]. Each lead captures the heart’s electrical activity over time from a unique perspective. Physicians interpret these waveforms by analyzing their shape, duration, and sequence across beats and leads. A machine learning model designed to assist in this analysis should be explainable, providing evidence linked to identifiable regions that physicians want to investigate. Recent machine learning models have demonstrated strong performance in classification tasks by analyzing raw ECG measurements over time [1, 3–6]. ECGFounder, pretrained on more than 10 million ECGs, itself identifies black-box opacity as an open limitation [4]. These models represent clinical structures, such as beat boundaries and waveform landmarks, only implicitly, through raw sample positions and amplitudes. As a result, standard attribution methods often highlight isolated points instead of meaningful waveform regions. Additionally, it remains challenging to establish the model’s true dependence on these highlighted areas. Attribution methods, like Integrated Gradients (IG) [7], are highly sensitive to the choice of reference input [8, 9]. Explanation methods for graph neural networks (GNNs) can disagree with one another [10–13], attention can fail faithfulness tests [14], and redundant predictors can yield seed-dependent explanations [15], so explanations need localization, perturbation, and replication checks [16, 17]. Graph-based representations of ECGs provide a potential solution. However, such an approach (e.g., based on visibility graphs [18, 19]) must represent waveform regions while keeping graph construction manageable. Such a graph should preserve the predictive signal and the timestamps needed for regional interventions without assigning a node to every sample. Existing sparse and relational ECG methods choose other units: learned subsequences [20], relations between channels [21], three hand-designed P/QRS/T segment nodes per beat [22], or lead-level graphs for myocardial-infarction localization [23]. Prior ECG visibility graphs operate on raw samples [19]. Their naive adaptation, which we call all-points, makes every sample a node and connects pairs that are geometrically visible, and it exemplifies the scale constraint: on the full CODE training dataset (CODE100), it exceeds one trillion edges and requires more than one terabyte of storage. We explore turning-point visibility graphs, an alternative that locally sparsifies the naive graph representation [24] by selecting samples before graph construction. This selection uses local extrema to capture waveform shape and clinical landmarks, such as R peaks and points associated with ventricular activation, to help define individual beats. Unlike P/QRS/T segment nodes [22], the retained nodes carry no clinical wave labels. For each beat, the selected samples form the graph nodes, and the natural visibility criterion determines their connections. We encode each beat graph with a GNN, then combine the resulting representations first within each lead and then across leads to make exam-level predictions. We call the resulting model LYNX-ECG (Lead-level visibilitY Networks for eXplainable ECG). Because each node retains its 2
LYNX-ECG a
12-Lead ECG
Turning Points
Visibility Graph
I
II
V1
⋮
⋮
V6
b
Beat
Lead
Exam attention pool
GATv2
I II
…
III
… h2
h3
hB
… attention pool
h2
h3
RBBB
aVL
h1
h1
1dAVb
aVR
GINE
hB
LBBB
aVF
MLP V1
SB
V2
AF
V3
ST
V4 V5
zℓ
V6
Fig. 1 The LYNX-ECG pipeline. (a) LYNX-ECG keeps the timestamped turning points of each ECG beat and connects them with the natural visibility criterion. (b) A hierarchical GNN encodes each beat graph with an edge-aware Graph Isomorphism Network (GINE), combines the beats of each lead with a graph attention network (GATv2) and attention pooling, and pools the 12 lead embeddings into one exam embedding. A multilayer perceptron (MLP) head produces the six logits.
original timestamp, we can map attribution and deletion results back to predefined ECG landmarks and regions, such as the R peak and other waveform segments. Fig. 1 summarizes these steps. Our contributions are as follows. First, LYNX-ECG adapts visibility graphs to ECG classification and is competitive with ECG foundation models such as ECGFounder. Second, turning-point selection reduces the node count by more than 86% while keeping this performance. Third, by combining IG with structural deletion, timing interventions, and an exact lead decomposition, we audit which regions, timing, and leads drive each diagnosis, an audit that raw-signal models can approximate only by masking samples. Fourth, we evaluate how node selection, topology, edge attributes, and message direction on two real-world datasets affect classification tasks.
Results We evaluated turning-point visibility graphs for six-label ECG classification on heldout CODE-Test and on PTB-XL as an external dataset [2], whose diagnostic labels we mapped to the same six targets (Methods; Supplementary Table 1). We report macro F1, the area under the receiver operating characteristic curve (AUROC), and the area under the precision–recall curve (AUPRC). F1, precision, and recall use a fixed threshold of 0.5, and every result covers three training seeds.
3
Table 1 Six-label classification on CODE-Test and external PTB-XL. Macro F1 and AUROC average the six labels; F1 uses the fixed 0.5 threshold. PTB-XL labels come from exact SCP-ECG statement codes (strict-SCP; Methods). Values are mean ± sample SD across three training runs. Boldface marks the highest mean and underline marks the second-highest (ties within 0.001). CODE-Test (n = 827) Model LYNX-ECG DNN [1] ViT [25] EfficientNet [26] ECGFounder-Scratch [4] ECGFounder-Finetuned [4]
PTB-XL strict-SCP (n = 21 799)
Macro F1 ↑
AUROC ↑
Macro F1 ↑
AUROC ↑
0.889 ± 0.004 0.849 ± 0.023 0.683 ± 0.018 0.582 ± 0.089 0.863 ± 0.004 0.858 ± 0.035
0.9984 ± 0.0001 0.9976 ± 0.0002 0.9814 ± 0.0130 0.9744 ± 0.0044 0.9979 ± 0.0003 0.9961 ± 0.0016
0.730 ± 0.001 0.718 ± 0.003 0.715 ± 0.010 0.728 ± 0.003 0.730 ± 0.013 0.734 ± 0.003
0.9815 ± 0.0005 0.9809 ± 0.0008 0.9791 ± 0.0018 0.9790 ± 0.0013 0.9818 ± 0.0007 0.9730 ± 0.0010
Competitive classification with smaller graphs We compared LYNX-ECG with five baseline configurations (Table 1; Methods): a deep neural network (DNN) [1], a Vision Transformer (ViT) [25], EfficientNet [26], and the ECG foundation model ECGFounder [4], trained from random initialization (ECGFounder-Scratch) or fine-tuned from pretrained weights (ECGFounderFinetuned). Our turning-point model was trained from random initialization. On CODE-Test, it achieved the highest mean macro F1, 0.889, and the highest mean AUROC among the evaluated models. Paired exam-level comparisons also support higher macro F1 than all five baselines (Supplementary Table 2). On PTB-XL, our model reached a macro F1 of 0.730, close to both ECGFounder variants. Paired comparisons support higher F1 than DNN and ViT, but do not establish a difference from EfficientNet or either ECGFounder variant. These external results were not uniform across diagnoses (Extended Data Table 1). The largest decline at the fixed threshold occurred for first-degree atrioventricular block (1dAVb). Sinus bradycardia (SB) also declined because PTB-XL assigns SB below 60 beats/min, whereas the CODE labels require 50 beats/min or less (Supplementary Note 12 and Supplementary Table 3). Complete class-wise results are reported in Supplementary Notes 3 and 11, Supplementary Tables 4 and 5, and Supplementary Fig. 1. This performance does not require the dense all-points representation. Turningpoint selection removed more than 86% of the post-resampling samples on both datasets. On CODE100, this reduction translated into graphs that required only about 14% of the storage used by the all-points graphs (Table 2).
Node selection changes predictive and storage trade-offs This storage reduction depends on which samples are retained. To examine how sample selection affects the balance between classification and storage, we compared turning points with two alternatives under a matched protocol (Table 2; Methods). Uniform sampling retains k = 30 nodes per beat without explicitly selecting local extrema, whereas all-points graphs keep every sample.
4
Table 2 Node selection, predictive performance, and graph size. Predictive values are CODETest means ± sample SD across three seeds. Graph counts and Hierarchical Data Format 5 (HDF5) storage cover the complete CODE100 dataset; B denotes billions, and all-points nodes are the resampled signal samples. LYNX-ECG uses turning points. All representations use the same model and effective batch size. Their node counts are not identical.
Representation
Nodes Nodes /beat (B)
Edges (B)
HDF5 (GB)
Turning points Uniform k = 30
34.46 30.00
9.83 8.56
29.27 28.47
164.6 0.889 ± 0.004 0.9984 ± 0.0001 0.914 ± 0.016 121.7 0.878 ± 0.009 0.9987 ± 0.0002 0.887 ± 0.004
All points
257.97
73.58 1180.74 1175.6
Macro F1
0.870 ± 0.011
AUROC
0.9985 ± 0.0002
Recall
0.884 ± 0.025
Compared with uniform sampling, turning points achieved higher mean recall and higher macro F1 in every CODE-Test seed. Uniform sampling instead achieved higher precision, AUROC, and AUPRC. For 1dAVb, this contrast was particularly clear: uniform sampling achieved higher AUPRC but missed more positive exams at the chosen threshold (class-wise results in Supplementary Note 4 and Supplementary Table 6). We next asked whether keeping every sample helps. On CODE-Test, turning-point graphs achieved higher macro F1 and recall than all-points graphs, while on PTB-XL the all-points representation yielded slightly higher F1 (Supplementary Note 5 and Supplementary Table 7). Beyond requiring less storage, turning-point graphs were faster to build and used less memory in a construction benchmark (Supplementary Note 7 and Supplementary Table 8).
Graph topology and edge attributes interact Having examined which samples should be retained, we next asked how those samples should be connected. Using the same turning-point nodes, we compared natural visibility with a forward temporal chain, which connects each node only to the next one in time. For each topology, we trained one model with the time and amplitude differences between connected nodes, (∆t, ∆a), and another with these edge attributes set to zero (Methods). This 2 × 2 design separates connectivity, edge attributes, and their interaction. With the derived time and amplitude attributes, visibility achieved higher macro F1 than the temporal chain in every CODE-Test seed. Removing these attributes changed the pattern: the temporal chain then achieved higher F1 in every seed (Extended Data Table 2). As a result, the effect of visibility cannot be attributed to connectivity alone. Instead, the results indicate an interaction between the visibility topology and the information carried by its edges.
Effect of message direction on classification We next examined whether allowing edge information to flow in both temporal directions improves classification, by adding the reverse of every forward edge and retraining the model (Methods). This additional information flow did not yield a clear classification benefit. Paired comparisons did not establish a difference in macro F1 or AUPRC on either dataset 5
a
Node Attribution Integrated Gradients
b
PR
integrated gradients PR
QRS
c
Structural Deletion exact Shapley over PR, QRS, T QRS
Timing Tests
delete PR / QRS / T PR
QRS
d
Lead Shapley
beats rebuilt, model unchanged
exact over 2¹² lead subsets
T
I
II
III
aVR
aVL
aVF
V1
V2
V3
V4
V5
V6
rebuild beats
keep a subset
T template shuffled
I
II
III
aVR
aVL
aVF
equalized
V1
V2
V3
V4
V5
V6
new rate
score each node, sum the scores per region
delete all 8 combinations of PR, QRS, T, bridge, rescore
change shape, order or rate of the beats, rescore
score every subset of leads, split the credit exactly
Fig. 2 Four audits test the evidence behind each prediction. All audits keep the trained model unchanged. (a) Node attribution: Integrated Gradients (IG) scores each node, and the scores are summed within each region. (b) Structural deletion: PR, QRS, and T are removed in every combination, the gap is bridged, and the exam is rescored; exact Shapley values over the three regions give each region’s contribution. (c) Timing tests: the beats are replaced by a template, shuffled, equalized, or rebuilt at a new heart rate, and the exam is rescored. (d) Lead Shapley: every subset of the 12 leads is scored, and exact Shapley values split the credit among the leads.
(Supplementary Note 6 and Supplementary Table 9). AUROC favored forward-only propagation on PTB-XL, with no supported difference on CODE-Test.
Takeaway Turning-point sparsification trades storage for higher CODE-Test recall than uniform sampling, the benefit of visibility depends on its time and amplitude edge attributes, and reverse messaging gives no established gain.
Each diagnosis is audited with the evidence that defines it The six labels differ in the evidence that defines them. First-degree atrioventricular block and right and left bundle-branch block (RBBB, LBBB) are conduction disorders, defined by the duration or shape of regions within each beat. Sinus bradycardia, sinus tachycardia (ST), and atrial fibrillation (AF) are rhythm disorders, defined by rate and regularity across beats. Because nodes keep their timestamps, we delete delineated regions to test conduction labels and change the timing between beats to test rhythm labels. An exact decomposition over the 12 leads then shows which leads carry the evidence for every label. Fig. 2 summarizes these tests and the node attribution. For the conduction labels, we used the PR interval as the expected region for 1dAVb and the QRS complex for both bundle-branch blocks, following the diagnostic criteria for these labels [1, 27]. The PR interval spans atrial activation and the conduction delay to the ventricles, which 1dAVb prolongs. A complete bundle-branch block forces one ventricle to activate through a slower path, which widens and distorts the QRS complex. The T wave reflects ventricular recovery. The regional analysis included all 85 CODE-Test exams with at least one of these labels. We evaluated each positive exam–class pair under all three seeds and refer to each exam–class–seed combination as a verdict. The rhythm labels have no expected region; we test them 6
(a) IG lift by baseline 2.5
(b) Deletion verdicts: leading region, every exam and seed
1dAVb: expected PR, comparison QRS
1dAVb (28 exams, expected PR)
RBBB (34 exams, expected QRS)
LBBB (30 exams, expected QRS)
|IG| lift
2.0 1.5 1.0 0.5 0.0
2.5
RBBB: expected QRS, comparison PR
|IG| lift
2.0 1.5 1.0 0.5 0.0
2.5
LBBB: expected QRS, comparison PR
|IG| lift
2.0 1.5 1.0 0.5 0.0
zero
feature median
seed A
seed B
seed C
PR leads in 47/59 correct verdicts PR leads in all seeds for 16/28 exams PR QRS T
seed A
seed B
seed C
QRS leads in 95/96 correct verdicts QRS leads in all seeds for 32/34 exams dimmed: misclassified
seed A
seed B
seed C
QRS leads in 78/83 correct verdicts QRS leads in all seeds for 26/30 exams
Fig. 3 Regional attribution and structural-deletion results. (a) Integrated Gradients (IG) lift of the expected region and of the comparison region under the zero and feature-median baselines. PR is the expected region for 1dAVb, and QRS is the expected region for RBBB and LBBB. Each point is the median over the label-positive CODE-Test exams for one trained seed, and a line joins the two baselines of the same seed. A lift of 1 (dashed line) means that a region receives attribution in proportion to its number of nodes. (b) Region with the largest Shapley contribution after structural deletion, for every label-positive exam (row) and trained seed (column). Dimmed cells are misclassified verdicts. The models classify 59 of 84 1dAVb, 96 of 102 RBBB, and 83 of 90 LBBB verdicts correctly. Across the three labels, the expected region leads in 220 of 238 correct verdicts (92.4%) and in all seeds for 74 of 92 exam–class pairs, which come from 85 distinct exams.
with timing interventions (structural-deletion results in Supplementary Note 15 and Supplementary Table 10).
Regional attribution depends on its baseline We first examined whether IG attribution, summarized within fixed windows anchored on each beat’s R peak (Methods), was concentrated in the region expected for each diagnosis. IG evaluates the contribution of each node feature relative to a baseline input. We compared two baseline choices, an input with features set to zero and an input using the training-set median of each feature. To compare regions of different sizes, we used the lift, a region’s fraction of the total absolute attribution divided by its fraction of all nodes (Methods). A lift of 1 indicates attribution proportional to the node count. We compared the expected region with another waveform region: PR against QRS for 1dAVb, and QRS against PR for RBBB and LBBB. Extended Data Table 3 and Fig. 3a report the regional lifts under both reference inputs. For RBBB and LBBB, attribution remained concentrated in the expected QRS region across all three seeds and under both baselines. The pattern was less stable for 1dAVb. With the zero baseline, PR lift remained below 1, whereas with the feature-median baseline it rose above 1. In both cases, however, QRS received greater 7
attribution than PR. This shift suggests that the regional interpretation for 1dAVb depends on the choice of IG baseline, consistent with the known sensitivity of attribution methods to their reference input [8, 9]. Structural deletion tests these regions directly.
Structural deletion tests regional contributions We tested these regional contributions by removing waveform regions and recomputing the class score. For each exam and target class, we removed the nodes within a selected region and all edges connected to them, and linked the last remaining node before the region to the first remaining node after it, so that each beat graph stayed connected. We did this in every beat where PR, QRS, and T were delineated (Methods) and evaluated all eight combinations of PR, QRS, and T removal. We used exact Shapley values [28] to divide the total score drop among the three regions (Methods). The region with the largest contribution was considered the leading region. Among correctly classified verdicts, the expected region had the largest contribution in more than 90% of cases (Fig. 3b). This alignment was strongest for RBBB, where QRS led in all but one correct verdict, and remained high for LBBB. For 1dAVb, PR led less often, but the alternative was consistently QRS among correct predictions. Across all 1dAVb verdicts, including misclassified cases, only one placed T first. To examine whether this ranking was consistent across training runs, we counted the exam–class pairs in which the expected region had the largest contribution under all seeds. This agreement was weaker for 1dAVb than for the bundle-branch blocks (Fig. 3b). Some 1dAVb exams consistently favored QRS, others changed ranking across seeds with closer PR and QRS contributions, and both regions far exceeded T (Supplementary Fig. 2). These findings support contributions from both PR and QRS, rather than reliance on PR alone. The clinical diagnosis of 1dAVb does not depend on QRS morphology or duration, so the QRS contribution is a property of the model rather than of the diagnostic criterion. Two factors may explain it: the boundary node that ends PR belongs to the QRS segment, and 21% of 1dAVb exams in the CODE annotations also carry an RBBB or LBBB label, against 4% of the other exams. Concurrent labels in the test exams do not explain it, because all 12 QRS-led correct verdicts come from exams without a bundle-branch block label (Supplementary Table 11). To complement the analysis of label-positive exams, we examined the same regions in target-negative exams. In this setting, the expected region had a negative median Shapley contribution for each class. Removing it therefore raised the class score on average. This pattern matches clinical rule-out reasoning, in which a normal PR interval argues against 1dAVb and a narrow QRS complex argues against a bundle-branch block. The contribution of a region thus depends on the diagnostic context in which it appears.
Region boundaries affect deletion verdicts Structural deletion also depends on how each region is bounded. We repeated the analysis on the same available beats using two fixed-window definitions anchored on the R peak (Extended Data Table 4). Compared with per-beat delineation, both fixedwindow approaches reduced the number of correct verdicts led by the expected region. 8
Fraction of verdicts called positive
a
b
1.0
0.8
0.6
0.4
0.2
0.0 40
50
60
70
80
90
100
110
120
130
40
50
Imposed heart rate (beats/min) no target label: SB call
SB positive: SB call
60
70
80
90
100
110
120
130
Imposed heart rate (beats/min) ST positive: ST call
interval-preserving (only diastole changes)
1dAVb positive
RBBB positive
LBBB positive
uniform time scaling
Fig. 4 Rhythm calls follow heart rate, and conduction calls follow interval duration. Fraction of CODE-Test verdicts called positive as the imposed heart rate changes. Dashed lines scale the whole time axis of every beat, which also changes the PR, QRS, and QT durations. Solid lines change only the time before P onset and after T offset. They are drawn where at least a quarter of the cohort remains feasible, because faster rates exhaust the diastole. (a) Exams without any target label called SB, SB-positive exams called SB, and ST-positive exams called ST. (b) Conductionpositive exams called positive. Cohorts are the CODE-Test exams without any target label and the label-positive exams (SB n = 16, ST n = 37, 1dAVb n = 28, RBBB n = 34, LBBB n = 30). Lines are means over three seeds, and bands span the seeds.
The largest differences occurred for RBBB and LBBB. In LBBB, the R-wave peak time in V5–V6 exceeds 60 ms [27], so a window that starts 60 ms before the R peak can omit the QRS onset in the leads that define the diagnosis. For 1dAVb, fixed windows increased the number of T-leading verdicts from one under per-beat delineation to five under either fixed-window protocol.
Conduction evidence lies within each beat We next asked whether the conduction calls also depend on the beat sequence. For each label-positive verdict, we shuffled the beats within each lead, replaced them with one template beat, or equalized their durations (Methods). The conduction calls barely changed (Supplementary Table 12). With a single template beat, for example, 0.89 of RBBB verdicts and 0.94 of LBBB verdicts stayed positive, against 0.94 and 0.92 intact. The evidence for these labels therefore lies within each beat. Heart rate is harder to isolate, because stretching or compressing the whole time axis also changes the PR, QRS, and QT durations. Under such a uniformly applied change, the conduction calls fell at faster imposed rates, to 0.49 for RBBB and 0.47 for LBBB at 100 beats/min (Fig. 4b, dashed). We then changed only the pause between the end of one T wave and the next P wave, keeping PR, QRS, and QT durations constant. Under this interval-preserving change, at least 0.92 of RBBB verdicts stayed positive between 60 and 100 beats/min (Fig. 4b, solid; Supplementary Table 13). This shows that the bundle-branch calls follow interval duration, as the QRS criterion requires, and not heart rate. 1dAVb calls declined only moderately between 60 and 80 beats/min, and all conduction calls fell at 40 beats/min.
9
Rhythm evidence lies across beats The same interventions test the rhythm labels. With the conduction intervals held fixed, half of the exams without any target label were called SB once the imposed rate fell below about 45 beats/min, close to the 50 beats/min criterion of the CODE labels, and ST-positive exams lost the ST call below about 102 beats/min (Fig. 4a; Supplementary Table 13 and Supplementary Fig. 3). No SB-positive verdict kept its call at an imposed 60 beats/min. Rate alone thus creates and removes both sinus-rate calls. The observed errors agree with this reading. On CODE-Test, false SB calls and missed ST exams had median measured rates at the 50 and 100 beats/min thresholds (Supplementary Fig. 4). Atrial fibrillation behaved differently. Replacing every beat with one template removed every AF call on CODE-Test and 99% of AF calls on PTB-XL, whereas shuffling the beats left the calls unchanged (Supplementary Table 12). The AF calls therefore depend on the differences between beats rather than on their order, and a record in which every cycle is identical is no longer called AF.
Lead evidence Exact lead Shapley values (Methods; Supplementary Note 14, Supplementary Table 14, and Supplementary Fig. 5) showed that, for the rhythm labels, the evidence was redundant across leads. Several single leads kept the call alone, and removing one lead changed the call in at most 4% of correct SB, ST, and AF verdicts on CODETest and 7% on PTB-XL. For the conduction labels, the evidence was concentrated in a few leads. Lead II alone kept 0.97 of correct 1dAVb calls, and V2 alone kept 0.96 of correct LBBB calls. Although the classic criterion for RBBB is the rsR′ pattern in V1 and V2, LYNX-ECG relies on I and V6, where the wide terminal S wave is a supporting criterion. Each of these leads alone kept 0.95 of correct RBBB calls, whereas V1 or V2 alone kept none. Similarly, although fibrillatory waves are usually clearest in V1, V1 alone kept almost no AF calls (0.00 on CODE-Test and 0.03 on PTB-XL).
Takeaway Explanation audits reveal that attribution leaves the 1dAVb evidence baselinedependent, whereas direct deletion of measured regions yields stable verdicts: the clinical region leads in more than 90% of correct verdicts and in all but one correct RBBB verdict, and the 1dAVb evidence stays inside the PR interval and the QRS complex under every seed and both region protocols. Timing interventions complete the audit for the rhythm labels. SB and ST follow heart rate with the conduction intervals held fixed, the bundle-branch calls follow interval duration rather than rate, and AF calls depend on the differences between beats. All three findings agree with the clinical definitions.
10
Discussion Turning-point visibility graphs bring predictive performance, efficiency, and regional auditability into the same ECG representation. LYNX-ECG had the highest CODETest macro F1 with a fraction of the all-points storage. This reduction does more than make graph construction practical: because the retained nodes preserve their original timestamps, the same representation supports direct interventions on clinically defined waveform regions. On PTB-XL, all-points graphs achieved a slightly higher F1, but turning-point graphs remained competitive while retaining their substantial advantage in graph size. The value of these regional tests lies in complementing attribution with an explicit intervention. Structural deletion avoids choosing the feature baseline required by IG, while delineation defines region boundaries without consulting the classifier’s outputs. Deletion still depends on the region definition. Fixed windows lowered expected-region leadership, mostly for the bundle-branch blocks, possibly because they miss parts of wider QRS complexes (Extended Data Table 4). The intervention therefore needs both an explicit deletion rule and a clearly specified region definition. The same timestamps also allow time-based interventions, which show that the model reads interval duration for the bundle-branch blocks and rate for the sinus rhythm labels, as the clinical definitions require. The model also does not treat beats in isolation. Replacing every beat with one template removes the atrial fibrillation calls and leaves the conduction calls intact. These audits also show where the model’s evidence differs from the clinical criteria, as for RBBB, which the model reads in leads I and V6 rather than V1 and V2. The model has no cross-lead edges, and none of the six labels is a territorial diagnosis, so these audits cannot test lead-territory patterns such as inferior infarction in leads II, III, and aVF. External evaluation shows which parts of the representation transfer. Node times are absolute, so the rate rules carry over to PTB-XL: SB recall was 0.97 below 50 beats/min, and ST recall was 0.92 at 100–105 beats/min (Supplementary Table 3). Ranking also transferred, with per-class AUROC between 0.94 and 0.997 on PTB-XL. The F1 losses came mainly from the label protocols and the fixed operating point. For example, 1dAVb kept an AUROC of 0.94 while its F1 fell to 0.44. We did not recalibrate the threshold or adapt the model to PTB-XL, so these results measure the transfer of a fixed CODE model. Other devices, populations, and labeling standards remain untested. Transfer-calibrated prediction-powered inference [29] could address this gap. Cardiologists interpret an ECG through a standard nomenclature of waves, intervals, rates, and leads, and an explanation helps them when it uses the same terms, as these audits do: the PR interval and the QRS complex for conduction disorders, heart rate and beat-to-beat variation for rhythm disorders, and the individual leads for all six labels. Together, these results show that turning-point visibility graphs combine competitive ECG classification, a compact representation, and explanation audits that test which waveform regions, timing, and leads drive a prediction.
11
Methods We describe the construction from individual beats to exam-level predictions, followed by the training protocol and the regional explanation audits. Fig. 1 and Extended Data Fig. 1 summarize the complete pipeline and the beat-level graph construction, and Fig. 2 summarizes the explanation audits.
Datasets and labels Models were trained on CODE100 and evaluated on held-out CODE-Test [1] and, as an external dataset, on PTB-XL [2]. For PTB-XL, we mapped the diagnostic labels to the same six targets using strict SCP-ECG code presence. A domain specialist reviewed this mapping and the corresponding clinical definitions. The exact codes and class prevalence appear in Supplementary Note 1 and Supplementary Table 1.
Turning points retain morphology and temporal coverage Graph construction begins by preprocessing each 10 s 12-lead record. We apply a fourth-order zero-phase Butterworth band-pass filter (0.5 Hz to 40 Hz), resample to 300 Hz when needed, and normalize amplitude using the median across leads of their 95th-percentile amplitudes. A polarity-aware NeuroKit2 detector [30] identifies R peaks independently in each lead. Consecutive R peaks define beat boundaries at their temporal midpoints, while the first and last beats extend to the signal boundaries. The quality-control criteria are reported in Supplementary Note 2; only 0.218% of exams are removed during validation of the full CODE graph build. Within each beat, we use a low-pass signal to locate local extrema. These extrema, together with the detected R peak and the two beat endpoints, form the initial set of samples. We then limit the temporal gap between consecutive nodes to 80 ms. If two selected points are more than 80 ms apart, we insert support nodes at uniformly spaced samples until no gap exceeds this limit. Every node, including each support node, takes its amplitude from the preprocessed signal at its own sample, without interpolation, and retains its normalized within-beat time. Natural visibility defines the connections between the retained nodes [18]. We number the retained nodes of a beat in time order, so node i has amplitude ai and time ti , in seconds. For nodes i < j , an edge is added when every intermediate retained node lies below the line joining them:
ak < ai +
aj − ai (k − i), j−i
i < k < j.
(1)
Here i, j , and k are node positions, not times: the topology depends on the order of the retained nodes but not on their spacing in time. Each visible pair is oriented forward in time and stored as i → j . Each node stores amplitude and normalized within-beat time, [a, tnorm ], while each edge stores [∆t, ∆a], with ∆t = tj −ti > 0 and ∆a = aj −ai . Node times are in seconds, so ∆t keeps absolute durations, whereas tnorm is relative to the beat. Because each beat spans the two half R–R intervals around its R peak,
12
its duration also encodes heart rate. The topology captures geometric visibility, while the node and edge features preserve amplitude and timing information.
A hierarchical GNN follows ECG structure LYNX-ECG follows the beat → lead → exam hierarchy. At the beat level, a threelayer edge-aware Graph Isomorphism Network (GINE) encoder [31, 32], with hidden width 128 and multilayer perceptron (MLP) width 256, maps each directed beat graph to one embedding. Because within-beat edges point forward in time, later nodes can aggregate information from earlier nodes before global mean pooling. The resulting beat embeddings provide the inputs to the lead-level graph. The beat representations from each lead form the next level of the hierarchy. A two-layer, four-head Graph Attention Network v2 (GATv2) [33] exchanges information between temporally adjacent beats. Adjacent beats are connected in both directions, and learned direction embeddings distinguish forward from backward links. Learned lead embeddings encode lead identity. Gated attention [34] then combines the beat representations into one embedding for each lead. At the exam level, softmax attention pools the available lead representations while masking absent leads. The primary model contains no explicit cross-lead graph edges, so information from different leads combines only during this final pooling step. A two-layer MLP head maps the resulting exam representation to logits for first-degree atrioventricular block (1dAVb), right and left bundle-branch block (RBBB/LBBB), sinus bradycardia (SB), atrial fibrillation (AF), and sinus tachycardia (ST).
Dynamic sampling controls training composition Most CODE exams are negative for all six targets and would dominate batches drawn from the full training distribution. Let Dpos contain every exam positive for at least one target and Dneg contain all-negative exams. At each epoch, we minimize binary cross-entropy over Dpos ∪ Sample(Dneg , nneg ), where nneg is the number of negative exams per epoch. We selected nneg = 220 514 together with the other training hyperparameters by maximizing macro F1 on the CODE100 validation split (Supplementary Table 15). We draw the negative exams without replacement and select a new sample at the start of each epoch. This procedure controls training composition while exposing the model to different negative exams across epochs. Validation and test retain their original distributions. We select checkpoints by validation macro F1 on a 2% patient-hash split disjoint from CODETest. Every class and dataset uses a fixed decision threshold of 0.5. Supplementary Note 2 gives the full protocol.
Baselines The deep neural network (DNN) baseline is the residual convolutional network of Ribeiro et al., which processes the ECG time series [1]. ECGFounder is an ECG foundation model developed through large-scale pretraining [4]. We evaluated its
13
architecture from random initialization (ECGFounder-Scratch) and by fine-tuning pretrained weights (ECGFounder-Finetuned). Vision Transformer (ViT) uses attention over input patches [25], whereas EfficientNet uses a convolutional architecture developed for efficient image classification [26]. Both models take images, so we rendered each ECG as a 12-lead plot. We removed baseline wander with a zero-phase elliptic high-pass filter (0.8 Hz cutoff) and cropped a 5 s window aligned to a detected QRS complex. Each plot shows the limb and precordial leads in two columns on a standard ECG grid, as a 1000 × 720-pixel image. We resized the images to the input size of each model (384×384 for ViT-B/16 and 300×300 for EfficientNet-B3) and fine-tuned both models from ImageNet-pretrained weights. Supplementary Note 2 gives the remaining settings, and Supplementary Note 10 gives the paired comparisons.
Representation and graph-design comparisons The node-selection comparison changes only the node selector. We kept the graphconstruction rule, model, and training protocol unchanged. Beat boundaries and effective batch size were also matched. The two sparse selectors often covered similar temporal neighborhoods, although turning points retained more nodes per beat on average. This comparison therefore evaluates the selection strategies without imposing an identical node budget. The topology comparison keeps the turning-point nodes. For retained nodes ordered in time as v1 , . . . , vn , the temporal chain contains only consecutive edges, (vi , vi+1 ). Natural visibility can instead connect nonconsecutive nodes vi and vj when every intermediate node lies below the straight line joining their amplitudes (equation (1)). The chain therefore preserves only immediate temporal adjacency, whereas visibility can introduce longer-range connections according to waveform geometry. All four conditions of the 2 × 2 design used the same architecture and training protocol. In the forward-only graph, an edge vi → vj , with ti < tj , carries information from an earlier sample to a later one within the same beat. The bidirectional variant adds the reverse edge, vj → vi , so the later sample can also send information back to the earlier one. We kept the turning-point nodes, visibility criterion, and edge-attribute definition fixed. Both variants were retrained with the same architecture and training protocol to isolate the effect of these additional reverse messages. We retained forwardonly propagation because the reverse messages increased message passing without an established improvement in these comparisons.
Regional explanation protocol Each graph node retains its original timestamp, allowing node-level explanations and graph interventions to be mapped to ECG regions. We evaluate regional evidence with Integrated Gradients (IG) [7] and structural deletion. For IG, we attribute the selected class logit to node features using a 64-step path from a reference input to the observed graph. We evaluate two references: an allzero input and per-feature medians estimated from one million training-graph nodes.
14
This reference provides the starting feature values for the attribution calculation. Feature attributions are summed within each node and converted to absolute nodelevel attribution, which measures attribution regardless of whether the contributions were positive or negative. Regional attribution is then aggregated relative to the R peak using PR (−0.35 to −0.07 s) for 1dAVb and QRS (−0.06 to +0.12 s) for RBBB and LBBB. For each region, the lift divides its fraction of the total absolute attribution by its fraction of all nodes. It equals 1 when attribution is proportional to the node count, and values above 1 indicate more attribution per node than the overall average. Structural deletion instead uses PR, QRS, and T regions delineated separately for each beat. A NeuroKit2 prominence delineator [30] identifies P onset, QRS onset and offset, and T onset and offset from the stored R anchors. Its parameters are selected without using model outputs (Supplementary Note 8). The primary analysis includes lead–beat units for which all five landmarks are present and ordered, covering 89.1% of units. Deleting a region removes its nodes and incident edges and then links the last remaining node before the region to the first remaining node after it, so that each beat graph stays connected. Like every other edge, this edge carries the time and amplitude differences between its two nodes. The exam is then rescored. The three regions define 23 = 8 deletion states, including the graph without deletions, which measures each region’s effect both alone and after other regions have been removed. Exact Shapley values decompose the intact-minus-all-regions-deleted logit difference among PR, QRS, and T; each value averages a region’s effect across all possible removal orders, and the region with the largest contribution is the leading region. The analysis is repeated across all three seeds. Fixed-window regions and a per-region availability rule provide sensitivity analyses; the latter is detailed in Supplementary Note 9. The primary analysis uses only lead–beat units in which PR, QRS, and T are all identified. In LBBB, excluded units had a longer median QRS duration (173 ms versus 163 ms for included units). To test the effect of this exclusion, we repeated the audit with each available region analyzed independently. Among correct LBBB verdicts, the fraction in which QRS had the largest contribution increased from 94% to 99%. RBBB gained one verdict, and 1dAVb changed only slightly (Supplementary Note 9). The audit depends both on the intervention and on the regions that can be reliably delineated.
Timing and lead interventions The timing tests change a trained model’s input, not the model. We edit the beat graphs of an exam, reassemble the exam, and classify it again with the same weights. An exam’s heart rate is 60 divided by the median R–R interval, computed per lead and then taken as the median across leads. The sequence tests edit beats in three ways. Shuffled randomly reorders the beats within each lead. Template replaces every beat of a lead with copies of its median-duration beat, so all beats become identical. Equalized stretches or compresses each interior beat to the lead’s median beat duration. Stretching a beat multiplies the time between its nodes (∆t) and keeps each node’s relative position in the beat (tnorm ).
15
The uniform rate change stretches or compresses every beat by the ratio of the measured to the imposed heart rate, so the PR, QRS, and QT durations change with it. The interval-preserving change keeps each beat’s segment from P onset to T offset intact and stretches or compresses only the time outside it. Each changed beat is rebuilt with the dataset rules. A beat that would keep less than 20 ms outside this segment keeps its original shape. An imposed rate counts as infeasible when more than 10% of interior beats keep their shape, which is why fast imposed rates are often infeasible. Since each lead embedding is computed independently, removing a lead removes only its embedding from the final pooling. We can therefore score all 212 subsets of leads from embeddings computed once per exam, with the empty subset giving a zero exam embedding. Shapley values then split the difference between the full-exam and empty-exam logits exactly among the 12 leads. The subset logits match the logits obtained by deleting the lead graphs from the input. For the timing and lead tests, we report the fraction of verdicts that keep or change a call. A verdict is the call of one trained model on one exam and label, and we pool verdicts over exams and the three seeds. The 95% intervals of the timing tests (Supplementary Note 13 and Supplementary Tables 12 and 13) come from 2000 bootstrap resamples of exams, each resample keeping all three seeds of an exam.
Use of LLMs We used large language models (LLMs) for generating initial prototype code, suggesting code optimizations, and proofreading and editing, always under full human supervision. The authors take full responsibility for the content of this article.
Ethics statement This study complies with all relevant ethical regulations. Use of the CODE data was approved by the Research Ethics Committee of the Universidade Federal de Minas Gerais (protocol 49368496317.7.0000.5149) [1]. The study is a secondary analysis of anonymized ECG exams stored by the Telehealth Network of Minas Gerais, so the committee waived informed consent. Researchers with access to CODE signed terms of confidentiality and data use. PTB-XL is an openly available, anonymized dataset whose publication was approved by the institutional ethics committee of the Physikalisch-Technische Bundesanstalt (PTB-2020-1) [2].
Data availability. PTB-XL [2, 35] and CODE-Test [1, 36] are openly available. CODE100 is the training portion of the CODE dataset [37], which contains 12lead ECG exams recorded by the Telehealth Network of Minas Gerais and is under restricted access to protect patient privacy. Researchers affiliated with educational or research institutions can request access through the dataset’s SciLifeLab Data Repository record [37] by providing the name of the principal investigator and host organization, contact details, and the scientific purpose of the request. The Telehealth Network of Minas Gerais evaluates each request individually, data use is restricted to non-commercial research, and access is granted after a data use agreement is signed [1]. A subset with 15% of the patients, CODE-15%, is openly available [38].
16
Code availability. Our code is released at https://github.com/aaaxn/LYNX-ECG under the MIT License. Acknowledgements. SP acknowledges support from NSF grant #2112471 (AIEDGE) and a fellowship from the Translational Data Analytics Institute (TDAI) at Ohio State University. SP and WM also acknowledge the Translational Data Analytics Institute’s Joint Human AI Systems (JHAS) theme for partially sponsoring WM’s visit to Ohio State University where this collaboration was initiated. WM acknowledges support from the Brazilian agencies CNPq, CAPES and FAPEMIG, and projects CIIA-Saúde, IAIA-INCT on AI, INCT TILD-IAR, NIAR-Saúde, and the Brazilian Center on Algorithm Transparency and AI Safety. ALPR is supported in part by Brazilian agencies CNPq, FAPEMIG and FAPESP, projects CIIA-Saúde and IATSCARE, and SEIDIGI – Brazilian Ministry of Health. This work represents the authors’ views and findings and does not necessarily reflect those of their funding agencies or their institutions. Author contributions. Conceptualization of initial ideas and method design: AX, WM, and SP during a collaboration visit. Refinement of ideas and methodology: all authors. Implementation: AX. Experimental design: all authors. Analysis of experimental results: all authors. Clinical interpretation and discussion of results: ALPR with all authors. Initial draft: AX. Draft refinement: all authors. Funding for the study: WM, SP, and MZ. Competing interests. The authors declare no competing interests. Supplementary information. The Supplementary Information contains Supplementary Notes 1–15, Supplementary Figs. 1–5, and Supplementary Tables 1–15.
References [1] Ribeiro, A. H. et al. Automatic diagnosis of the short-duration 12-lead ECG using a deep neural network. Nature Communications 11, 1760 (2020). [2] Wagner, P. et al. PTB-XL, a large publicly available electrocardiography dataset. Scientific Data 7, 154 (2020). [3] Strodthoff, N., Wagner, P., Schaeffter, T. & Samek, W. Deep learning for ECG analysis: Benchmarks and insights from PTB-XL. IEEE Journal of Biomedical and Health Informatics 25, 1519–1528 (2021). [4] Li, J. et al. An electrocardiogram foundation model built on over 10 million recordings with external evaluation across multiple domains. arXiv preprint arXiv:2410.04133 (2024). [5] Wang, F., Xu, J. & Yu, L. From token to rhythm: A multi-scale approach for ECG-language pretraining. In Proceedings of the 42nd International Conference on Machine Learning, Vol. 267 of Proceedings of Machine Learning Research, 65059–65074 (2025). URL https://proceedings.mlr.press/v267/wang25du.html.
17
[6] Zhou, R., Zhang, Y. & Dong, Y. H-Tuning: Toward low-cost and efficient ECGbased cardiovascular disease detection with pre-trained models. In Proceedings of the 42nd International Conference on Machine Learning, Vol. 267 of Proceedings of Machine Learning Research, 79548–79569 (2025). URL https://proceedings. mlr.press/v267/zhou25aj.html. [7] Sundararajan, M., Taly, A. & Yan, Q. Axiomatic attribution for deep networks. In International Conference on Machine Learning (ICML) (2017). [8] Sturmfels, P., Lundberg, S. & Lee, S.-I. Visualizing the impact of feature attribution baselines. Distill (2020). https://distill.pub/2020/attribution-baselines/. [9] Ancona, M., Ceolini, E., Öztireli, C. & Gross, M. Towards better understanding of gradient-based attribution methods for deep neural networks. In International Conference on Learning Representations (ICLR) (2018). [10] Yuan, H., Yu, H., Gui, S. & Ji, S. Explainability in graph neural networks: A taxonomic survey. IEEE Transactions on Pattern Analysis and Machine Intelligence 45, 5782–5799 (2022). [11] Ying, Z., Bourgeois, D., You, J., Zitnik, M. & Leskovec, J. GNNExplainer: Generating explanations for graph neural networks. In Advances in Neural Information Processing Systems (NeurIPS) (2019). [12] Luo, D. et al. Parameterized explainer for graph neural network. In Advances in Neural Information Processing Systems (NeurIPS) (2020). [13] Yuan, H., Yu, H., Wang, J., Li, K. & Ji, S. On explainability of graph neural networks via subgraph explorations. In International Conference on Machine Learning (ICML) (2021). [14] Azzolin, S., Malhotra, S., Passerini, A. & Teso, S. Beyond topological selfexplainable GNNs: A formal explainability perspective. In Proceedings of the 42nd International Conference on Machine Learning, Vol. 267 of Proceedings of Machine Learning Research, 2045–2080 (2025). URL https://proceedings.mlr. press/v267/azzolin25a.html. [15] Tai, W., Zhong, T., Trajcevski, G. & Zhou, F. Redundancy undermines the trustworthiness of self-interpretable GNNs. In Proceedings of the 42nd International Conference on Machine Learning, Vol. 267 of Proceedings of Machine Learning Research, 58169–58188 (2025). URL https://proceedings.mlr.press/v267/tai25a. html. [16] Yang, J. et al. From GNNs to trees: Multi-granular interpretability for graph neural networks. In International Conference on Learning Representations (ICLR) (2025).
18
[17] Zhang, J., Liu, X., Luo, D. & Wei, H. Is your explanation reliable: Confidenceaware explanation on graph neural networks. In Proceedings of the ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD) (2025). [18] Lacasa, L., Luque, B., Ballesteros, F., Luque, J. & Nuño, J. C. From time series to complex networks: The visibility graph. Proceedings of the National Academy of Sciences 105, 4972–4975 (2008). [19] Oliveira, R. F., Moreira, G. J. P., Freitas, V. L. S. & Luz, E. J. S. Leveraging visibility graphs for enhanced arrhythmia classification with graph convolutional networks. arXiv preprint arXiv:2404.15367 (2024). [20] Liu, Z. et al. Learning soft sparse shapes for efficient time-series classification. In Proceedings of the 42nd International Conference on Machine Learning, Vol. 267 of Proceedings of Machine Learning Research, 39032–39059 (2025). URL https://proceedings.mlr.press/v267/liu25ar.html. [21] Zhang, D. et al. MedMamba: Multi-view state space models with adaptive graph learning for medical time series classification. In Proceedings of the 43rd International Conference on Machine Learning (2026). URL https://icml.cc/virtual/ 2026/poster/61414. [22] Lee, M., Lim, J. & Kim, J. ECG-GraphNet: Advanced arrhythmia classification based on graph convolutional networks. Heart Rhythm O2 6, 1199–1211 (2025). [23] Maurer, M. C. et al. xGNN4MI: Explainability of graph neural networks in 12-lead electrocardiography for cardiovascular disease classification. npj Digital Medicine 9, 256 (2026). [24] Satuluri, V., Parthasarathy, S. & Ruan, Y. Local graph sparsification for scalable clustering. In Proceedings of the 2011 ACM SIGMOD International Conference on Management of data, 721–732 (2011). [25] Dosovitskiy, A. et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR) (2021). URL https://openreview.net/forum?id=YicbFdNTTy. [26] Tan, M. & Le, Q. EfficientNet: Rethinking model scaling for convolutional neural networks. In Proceedings of the 36th International Conference on Machine Learning, Vol. 97 of Proceedings of Machine Learning Research, 6105–6114 (PMLR, 2019). URL https://proceedings.mlr.press/v97/tan19a.html. [27] Surawicz, B., Childers, R., Deal, B. J., Gettes, L. S. et al. AHA/ACCF/HRS recommendations for the standardization and interpretation of the electrocardiogram: Part III: Intraventricular conduction disturbances. Circulation 119, e235–e240 (2009).
19
[28] Shapley, L. S. A value for n-person games. In Contributions to the Theory of Games II (eds Kuhn, H. W. & Tucker, A. W.), no. 28 in Annals of Mathematics Studies, 307–317 (Princeton University Press, 1953). [29] Vadlamani, A. T., Chang, J. H., Parthasarathy, S. & Paul, S. Transfer calibrated prediction powered inference. arXiv preprint arXiv:2609.34156 (2026). [30] Makowski, D. et al. NeuroKit2: A python toolbox for neurophysiological signal processing. Behavior Research Methods 53, 1689–1696 (2021). [31] Xu, K., Hu, W., Leskovec, J. & Jegelka, S. How powerful are graph neural networks? In International Conference on Learning Representations (ICLR) (2019). [32] Hu, W. et al. Strategies for pre-training graph neural networks. In International Conference on Learning Representations (ICLR) (2020). [33] Brody, S., Alon, U. & Yahav, E. How attentive are graph attention networks? In International Conference on Learning Representations (ICLR) (2022). [34] Li, Y., Tarlow, D., Brockschmidt, M. & Zemel, R. Gated graph sequence neural networks. In International Conference on Learning Representations (ICLR) (2016). [35] Wagner, P., Strodthoff, N., Bousseljot, R.-D., Samek, W. & Schaeffter, T. PTB-XL, a large publicly available electrocardiography dataset (version 1.0.3). PhysioNet (2022). URL https://doi.org/10.13026/kfzx-aw45. [36] Ribeiro, A. H. et al. CODE-test: An annotated 12-lead ECG dataset (version 1.0.3). Zenodo (2020). URL https://doi.org/10.5281/zenodo.3625006. [37] Ribeiro, A. H. et al. CODE dataset. SciLifeLab Data Repository (2021). URL https://doi.org/10.17044/scilifelab.15169716. [38] Ribeiro, A. H. et al. CODE-15%: a large scale annotated dataset of 12-lead ECGs (version 1.0.0). Zenodo (2021). URL https://doi.org/10.5281/zenodo.4916206.
20
21
0.783 ± 0.076 0.717 ± 0.104 0.398 ± 0.054 0.451 ± 0.106 0.743 ± 0.043 0.756 ± 0.059 0.441 ± 0.018 0.458 ± 0.022 0.459 ± 0.013 0.458 ± 0.025 0.482 ± 0.033 0.480 ± 0.005
PTB-XL (n = 21 799) LYNX-ECG DNN [1] ViT [25] EfficientNet [26] ECGFounder-Scratch [4] ECGFounder-Finetuned [4]
1dAVb
CODE-Test (n = 827) LYNX-ECG DNN [1] ViT [25] EfficientNet [26] ECGFounder-Scratch [4] ECGFounder-Finetuned [4]
Model
0.773 ± 0.029 0.801 ± 0.003 0.745 ± 0.015 0.761 ± 0.018 0.751 ± 0.027 0.739 ± 0.003
0.920 ± 0.037 0.913 ± 0.020 0.695 ± 0.077 0.494 ± 0.295 0.901 ± 0.052 0.923 ± 0.010
RBBB
0.734 ± 0.036 0.749 ± 0.022 0.712 ± 0.045 0.777 ± 0.014 0.725 ± 0.041 0.761 ± 0.016
0.959 ± 0.010 0.966 ± 0.000 0.955 ± 0.011 0.228 ± 0.293 0.960 ± 0.009 0.897 ± 0.058
LBBB
0.697 ± 0.009 0.604 ± 0.009 0.657 ± 0.011 0.647 ± 0.013 0.672 ± 0.009 0.684 ± 0.008
0.843 ± 0.037 0.804 ± 0.025 0.647 ± 0.018 0.725 ± 0.047 0.811 ± 0.031 0.796 ± 0.043
SB
0.920 ± 0.002 0.884 ± 0.019 0.909 ± 0.003 0.916 ± 0.007 0.924 ± 0.006 0.915 ± 0.005
0.918 ± 0.018 0.773 ± 0.040 0.559 ± 0.140 0.762 ± 0.048 0.867 ± 0.029 0.852 ± 0.071
AF
0.815 ± 0.021 0.814 ± 0.011 0.808 ± 0.008 0.806 ± 0.021 0.828 ± 0.022 0.827 ± 0.005
0.911 ± 0.014 0.922 ± 0.013 0.846 ± 0.015 0.833 ± 0.063 0.898 ± 0.013 0.921 ± 0.012
ST
0.730 ± 0.001 0.718 ± 0.003 0.715 ± 0.010 0.728 ± 0.003 0.730 ± 0.013 0.734 ± 0.003
0.889 ± 0.004 0.849 ± 0.023 0.683 ± 0.018 0.582 ± 0.089 0.863 ± 0.004 0.858 ± 0.035
Macro
Extended Data Table 1 Per-class F1. Values are mean ± sample SD across three seeds. Boldface marks the highest mean and underline marks the second-highest mean (ties within 0.001). The macro column repeats Table 1. Supplementary Table 5 gives the per-class AUROC.
Extended Data Table 2 Graph topology and edge attributes on CODE-Test. Derived edge attributes encode the time and amplitude differences between connected nodes, (∆t, ∆a). Values are mean ± SD across three matched seeds; contrast rows report paired within-seed differences in percentage points. The interaction row is the visibility–chain contrast with the derived edge attributes minus the same contrast without them. Lower expected calibration error (ECE) is better. Configuration or contrast
Macro F1@0.5
Macro AUROC
Macro ECE
Visibility + edge attributes (LYNX-ECG) Visibility + no edge attributes Temporal chain + edge attributes Temporal chain + no edge attributes
0.889 ± 0.004 0.799 ± 0.061 0.863 ± 0.010 0.845 ± 0.024
0.99842 ± 0.00005 0.99530 ± 0.00199 0.99818 ± 0.00013 0.99721 ± 0.00025
0.00799 ± 0.00102 0.00983 ± 0.00173 0.00882 ± 0.00085 0.00912 ± 0.00064
Visibility–chain contrast, with attributes Interaction
+2.640 ± 1.105 +7.281 ± 2.740
+0.023 ± 0.016 +0.214 ± 0.163
−0.083 ± 0.116 −0.154 ± 0.211
22
Extended Data Table 3 Regional IG attribution under two reference inputs. The analysis includes 85 label-positive CODE-Test exams, comprising 92 positive exam–class pairs. Ranges span the minimum and maximum of the three per-seed median lifts. A lift of 1 indicates attribution proportional to the region’s node count. The comparison region is QRS for 1dAVb and PR for RBBB and LBBB. The feature-median baseline uses training-set feature medians.
Zero baseline
Feature-median baseline
Class
Expected region
Expected
Comparison
Expected
Comparison
1dAVb RBBB LBBB
PR QRS QRS
0.753–0.780 2.156–2.208 2.048–2.113
1.980–2.109 0.499–0.592 0.682–0.742
1.096–1.257 1.469–1.764 1.335–1.514
1.239–1.312 0.928–1.053 0.996–1.072
Extended Data Table 4 Effect of region definition on structural-deletion verdicts. All three definitions are evaluated on the same available beats. Cells report how often the expected region leads among correctly classified verdicts. “T leads” counts 1dAVb verdicts in which the T region has the largest Shapley contribution. Both fixed-window definitions use PR from −0.35 to −0.07 s and QRS from −0.06 to +0.12 s relative to the R peak and differ only in the T window: the class-specific variant sets a different T window for each class, and the standardized window spans +0.15 to +0.45 s for every class (Supplementary Note 8).
Region definition
1dAVb
RBBB
LBBB
All
T leads
Per-beat delineation Fixed, class-specific Fixed, standardized
47/59 48/59 49/59
95/96 89/96 89/96
78/83 68/83 67/83
220/238 (92%) 205/238 (86%) 205/238 (86%)
1 5 5
23
240 samples → 31 nodes
95 visibility edges
I II III aVR aVL aVF V1 V2 V3 V4 V5 V6 R peak
turning point
gap-support node
beat endpoint
edge to R peak
Extended Data Fig. 1 Each beat becomes a sparse graph that keeps its morphology. One V1 beat of a CODE-Test exam keeps 31 of its 240 samples (87% fewer). Natural visibility connects these nodes with 95 edges; R-peak edges are highlighted.
24
Supplementary Information for Accurate and Auditable ECG Classification via Visibility Graph Neural Networks Artur Xavier, Guilherme Henrique Gomes Evangelista, Aitazaz Khan, Antonio Luiz Pinho Ribeiro, Mohammed J. Zaki, Srinivasan Parthasarathy, and Wagner Meira Jr. Correspondence: arturxavier@dcc.ufmg.br; srini@cse.ohio-state.edu; meira@dcc.ufmg.br
Contents 1 Datasets and label protocol
2
2 Matched preprocessing, model, and training protocol
2
3 Per-class performance across datasets
3
4 Turning-point selection changes class trade-offs
3
5 All-points comparison
3
6 Directed and bidirectional propagation
4
7 Computational efficiency
4
8 Delineated regional Shapley audit
4
9 Delineation availability sensitivity
5
10 Paired baseline comparisons
5
11 External 1dAVb fixed-threshold limitation
5
12 External SB label protocol
6
13 Timing interventions
6
14 Lead Shapley values
6
15 Regional deletion for the rhythm labels
6
1
Supplementary Note 1: Datasets and label protocol We train on the full CODE100 dataset [1], accessed with authorization from the Telehealth Network of Minas Gerais, and evaluate on the openly released CODE-Test cohort. PTB-XL v1.0.3 [2, 3, 4] provides 21 799 ECGs from 18 869 patients under CC BY 4.0. The model reads CODE records at 300 Hz; the public CODE files contain 400 Hz signals. PTB-XL provides original 500 Hz records and 100 Hz downsampled records. Every graph artifact uses the same preprocessing described below and in Methods. After graph quality control, Supplementary Table 1 reports the number of exams and the per-class positive counts in each cohort. Because the task is multilabel, its class counts need not sum to the number of exams. The six targets are first-degree atrioventricular block (1dAVb), complete right and left bundle-branch block (RBBB and LBBB), sinus bradycardia (SB), atrial fibrillation (AF), and sinus tachycardia (ST). CODE training labels combine cardiologist reports with interval and rhythm checks, including PR ≥ 190 ms for 1dAVb, QRS ≥ 115 ms for bundle-branch block, heart rate ≤ 50 bpm for SB, and heart rate ≥ 100 bpm for ST [1]. Two certified cardiologists independently read CODE-Test, with senior adjudication of disagreements. PTB-XL uses SCP-ECG ontology codes rather than the CODE interval and rhythm rules. We map exact SCP-code presence to the six targets in the last row of Supplementary Table 1. A domain specialist reviewed the class definitions and mapping. The mapping includes first-degree atrioventricular block, complete bundle-branch blocks, SB, ST, and AF, while excluding atrial flutter. Thus, PTB-XL is an external evaluation under a strict ontology-to-task mapping, not a relabeling under the CODE annotation protocol.
Supplementary Note 2: Matched preprocessing, model, and training protocol Preprocessing and graph quality control. We apply a fourth-order zero-phase Butterworth band-pass filter (0.5 Hz to 40 Hz), resample to 300 Hz, and normalize by the median across leads of each lead’s 95th-percentile absolute amplitude. A polarity-aware NeuroKit2 0.2.13 detector [5] locates R peaks in each lead. Midpoints between adjacent R peaks delimit beats, with the first and last beats extended to the signal boundaries. A 40 Hz smoothing pass supplies local extrema. The retained nodes are these extrema, the R peak, both beat endpoints, and fixed-gap support nodes that enforce a maximum 80 ms gap. Node amplitudes come from the preprocessed, unsmoothed beat. Each lead must have at least three ordered, in-range R peaks and a median heart rate between 30 and 240 beats/min. Nonboundary beats must contain finite values, last 0.25 s to 4.0 s, contain at least three samples, and have amplitude range greater than 10−4 . Boundary beats bypass the duration check. A valid lead contains at least three valid beats, and a valid exam contains at least one valid lead. Shared architecture. Runs initialized with different seeds use hidden width 128, a three-layer GINE encoder with MLP width 256, and a two-layer, four-head GATv2 encoder. Node features are [a, tnorm ], edge features are [∆t, ∆a], and learned signed step embeddings distinguish forward and backward links between adjacent beats. Attentional intra-lead pooling, softmax inter-lead pooling, and a two-layer MLP six-logit head complete the hierarchy. LYNX-ECG contains 327 371 trainable parameters. 6 denote the multilabel target for exam n. Training and model selection. Let yn ∈ {0, 1}P P We partition the training data into Dpos = {n : i yn,i > 0} and Dneg = {n : i yn,i = 0}, with 233 959 and 2 003 166 exams in CODE100 training (Supplementary Table 1). Every epoch contains all exams in Dpos and a without-replacement sample of nneg exams from Dneg ; the negative sample is redrawn each epoch. We selected nneg = 220 514 by hyperparameter
2
search together with the other training hyperparameters (Supplementary Table 15). Each epoch therefore holds 454 473 exams, close to one negative per positive, and covers about 11% of Dneg . Validation and test distributions are unchanged. Checkpoints are selected by validation macro F1 on the disjoint 2% patient-hash split. Unless stated otherwise, all threshold-dependent results use a fixed 0.5 threshold and three independently initialized runs. Supplementary Table 15 gives the declared hyperparameter ranges and the selected configuration shared by these runs. All representation comparisons retain the CODE100 patient-hash split, CODE-Test artifact, architecture, optimizer, checkpoint rule, three seed identifiers, and fixed threshold. The 2 × 2 topology ablation crosses stored visibility or a directed chain over consecutive turning points with derived or zero edge attributes. The matched baselines use two RTX 5090 GPUs, while the original baseline study used eight RTX A6000 GPUs. The baselines runs preserve the per-GPU batch size and therefore use a smaller total batch. ECGFounder-Scratch uses fp32 because its normalization-free Net1D overflows fp16 when trained from random initialization. Versioned scripts produce the reported metrics and bind them to the dataset and checkpoint artifacts. The CODE data-use agreement prevents redistribution of the restricted waveforms.
Supplementary Note 3: Per-class performance across datasets Supplementary Table 4 consolidates the per-class results on CODE-Test (panel A) and strictSCP PTB-XL (panel B). The per-class AUROC, F1, precision, and recall entries are ranges across the three runs. Per-class AUPRC and every macro metric are means ± sample SD across runs. Threshold-dependent metrics in this table use the fixed 0.5 operating point. Supplementary Fig. 1 shows the per-class ROC curves for one run and marks that operating point, while Supplementary Table 4 provides the three-run summaries. Supplementary Table 5 compares the per-class AUROC of every model on both datasets, and Extended Data Table 1 of the main text compares their per-class F1. The largest external fixed-threshold degradation occurs for 1dAVb, discussed in Supplementary Note 11.
3.1
CODE-Test confusion counts
Panel C of Supplementary Table 4 gives the true-positive, false-positive, false-negative, and true-negative count ranges across the three runs. The endpoints within a row can come from different seeds, so the ranges do not define a single confusion matrix.
Supplementary Note 4: Turning-point selection changes class trade-offs Supplementary Table 6 reports the matched class means for turning-point and uniform k = 30 node selection. Turning-minus-uniform macro-F1 differences are +0.0028, +0.0202, and +0.0106 in the three paired seeds. The largest class-level F1 increase is for 1dAVb, where mean recall rises from 0.583 to 0.702 even though AUPRC is lower. AF recall rises from 0.949 to 1.000 and its AUPRC also rises. Uniform sampling has its largest F1 advantage for SB. Both selectors attain recall 1.000 for SB, while uniform sampling raises mean precision from 0.730 to 0.787. These results describe a fixed-threshold trade-off rather than uniform improvement across metrics.
Supplementary Note 5: All-points comparison All-points runs use the same seeds and effective batch size as the turning-point runs. Because a physical batch of 128 all-points graphs exceeds GPU memory, they use physical batches of eight with 16-step gradient accumulation. Supplementary Table 7 reports the three-run means, sample SDs, and paired within-seed differences.
3
At the fixed threshold, all points have lower macro F1 in every CODE-Test seed and higher macro F1 in every PTB-XL seed. Their recall is lower in every paired seed on both datasets. Higher PTB-XL precision accompanies the external F1 increase, while turning points have the in-domain F1 increase. The ranking metric differences are smaller; among AUPRC and AUROC, only PTB-XL AUPRC has the same paired sign in all three seeds. These three paired seeds support descriptive replicated contrasts, not a significance or equivalence claim.
Supplementary Note 6: Directed and bidirectional propagation Supplementary Table 9 reports every ranking-metric contrast from the matched directionality ablation. Differences are directed minus bidirectional. The point estimates average the three within-seed differences, and the paired bootstrap resamples shared exams while holding those seeds fixed. The macro-F1 and AUPRC intervals include zero on both datasets, as does the CODE-Test AUROC interval. PTB-XL AUROC is the one reported contrast whose interval excludes zero, favoring directed propagation by 0.000686 [0.000172, 0.001183].
Supplementary Note 7: Computational efficiency Supplementary Table 8 reports graph construction, training, and batched inference. We built the same first 1000 PTB-XL exams with all 12 leads and 16 CPU workers; node selection was the only changed factor. Across three builds on an AMD Threadripper 7970X, all-points construction processed 39.0 exams/s and turning-point construction processed 150.0 exams/s. Peak resident host memory fell from 875.4 MiB to 275.4 MiB, and HDF5 size fell from 576.7 MB to 72.2 MB. Runtime measurements use the full CODE100 turning-point HDF5, the reported model dimensions, PyTorch 2.11, CUDA 13.0, BF16 autocast, and one RTX 5090. Across 120 recorded epochs from three runs, training averaged 132.0 ± 3.7 seconds per epoch. Complete runs, including validation, final evaluation, and artifact logging, averaged 1.599 ± 0.018 hours. These are measurements of the stated workstation and software stack.
Supplementary Note 8: Delineated regional Shapley audit The structural audit uses a polarity-aware NeuroKit2 Prominence delineator on the stored R anchors. Negative-polarity leads are inverted for delineation. The selected model-output-blind configuration uses maximum QRS interval 204 ms, maximum PR interval 500 ms, maximum Rrise time 200 ms, typical ST segment 164 ms, and maximum P-, R-, and T-basepoint intervals of 100, 250, and 200 ms, respectively. These marks provide technical availability, not clinical fiducial ground truth. For each lead-beat unit, PR runs from P onset to QRS onset, QRS from QRS onset to QRS offset, and T from T onset to T offset. Region masks use the graph’s beat-relative timestamps. The shared PR/QRS boundary node belongs to QRS so that the masks remain disjoint. Deleting a region removes its nodes and their incident edges and then links the last remaining node before the region to the first remaining node after it, so that the beat graph stays connected. The new edge carries the time and amplitude differences between its two nodes, as every other edge does. Units outside the active availability rule remain intact. The three regions define all 23 = 8 structural states. For each exam and trained seed, one state evaluation supplies the outputs for 1dAVb, RBBB, and LBBB. Exact Shapley allocation decomposes the intact-minus-all-regions-deleted logit difference among PR, QRS, and T. The region with the largest logit contribution is the verdict leader. Correct classification is defined from the intact probability at the fixed 0.5 threshold. Thus, statements about expected-region
4
leadership among correct verdicts condition on that threshold and do not cover misclassified verdicts. The main-text fixed-window comparison changes only the region boundaries on the same available beats. Both fixed protocols use PR from −0.35 to −0.07 s and QRS from −0.06 to +0.12 s relative to the stored R anchor. The class-specific T window runs from +0.15 to +0.43 s for 1dAVb and from +0.15 to +0.33 s for RBBB and LBBB. The standardized T window runs from +0.15 to +0.45 s for all three classes. Each mask selects nodes only within its own beat.
Supplementary Note 9: Delineation availability sensitivity The primary beat-complete rule includes a lead-beat unit only when PR, QRS, and T are all marked and ordered. Its three region masks therefore use the same units. The per-region sensitivity rule includes each marked region independently. A unit missing only T can contribute PR and QRS under the per-region rule, while its T nodes remain intact in every state. The rules change the deletion support, so their results are separate sensitivity analyses rather than ordered limits on an underlying effect. Panel A of Supplementary Table 11 reports both availability rules for the full label-positive cohort and the morphology-isolated subset. In the full cohort, LBBB expected-region leadership among correct verdicts changes from 78/83 to 82/83, 1dAVb changes from 47/59 to 45/59, and RBBB changes from 95/96 to 96/96. These are measured sensitivity differences. They do not identify the cause of an individual changed verdict. The morphology-isolated subset excludes concurrent positives among 1dAVb, RBBB, and LBBB only. It does not exclude the other task labels or unmeasured conditions, so it limits one source of co-labeling rather than defining single-disease exams. Panel B of Supplementary Table 11 applies minimum beat-complete coverage filters and then recomputes strict all-seed agreement. For LBBB, the strict counts are 26/30 with no floor, 25/29 at 0.5, 25/27 at 0.6, 24/26 at 0.7, and 20/22 at 0.8. Both numerator and denominator change with the retained cohort, and the agreement fraction is not monotonic across these rows. The floor analysis therefore measures cohort sensitivity; it does not establish causal dilution by missing delineations. Supplementary Fig. 2 plots PR against QRS Shapley contributions for all 276 label-positive verdicts and fades the misclassified points. The reported leadership rates instead condition on the 238 correctly classified verdicts. Within that correct-classification subset, PR leads 47/59 1dAVb verdicts, QRS leads 95/96 RBBB verdicts, and QRS leads 78/83 LBBB verdicts under the primary rule. The 1dAVb points near the PR-equals-QRS diagonal have similar contributions from the two regions. This plot describes model sensitivity under the stated intervention, not physiological causality.
Supplementary Note 10: Paired baseline comparisons Supplementary Table 2 gives the paired macro-F1 comparisons with the baseline reruns.
Supplementary Note 11: External 1dAVb fixed-threshold limitation Across the three strict-SCP PTB-XL evaluations in panel B of Supplementary Table 4, 1dAVb F1 at the fixed 0.5 threshold is 0.440878 ± 0.017711. Precision ranges from 0.301 to 0.350, while recall ranges from 0.671 to 0.736. AUROC remains 0.943680 ± 0.002832. The three-seed result therefore shows a gap between ranking and the transported fixed operating point under the declared strict SCP-code mapping. It does not determine whether the gap arises from score calibration, cohort shift, or differences between the SCP-code and CODE label protocols.
5
Supplementary Note 12: External SB label protocol CODE labels SB at a heart rate of 50 beats/min or less, while the PTB-XL SBRAD statement covers sinus rhythm below 60 beats/min. Supplementary Table 3 stratifies strict-SCP PTB-XL by the heart rate measured from the stored R anchors. SB recall is 0.97 below 50 beats/min and falls to 0.07 between 55 and 60 beats/min, where the CODE protocol would not assign SB. Below 50 beats/min, the model also calls SB in 73% of the 105 exams without SBRAD. The external SB recall of 0.667 therefore reflects the label definition more than a detection failure. ST shows the same agreement with its threshold: recall is 0.92 at 100–105 beats/min, and exams without STACH are called ST below 100 beats/min in only 0.2% of verdicts.
Supplementary Note 13: Timing interventions Supplementary Table 12 adds 95% exam-bootstrap intervals to the sequence interventions of the main text and reports the template with the original beat durations restored. Supplementary Table 13 compares the uniform and the interval-preserving rate change. Supplementary Fig. 3 shows the uniform sweep on both datasets, and Supplementary Fig. 4 plots the intact predictions against the measured heart rate and RR variation. Under uniform scaling, AF-positive PTB-XL verdicts stay AF in 0.81 [0.80, 0.82] of cases at an imposed 40 beats/min and 0.90 [0.89, 0.91] at 180 beats/min, so the AF call does not follow rate. Uniform stretching to 40 beats/min also turns 56% of CODE-Test exams without any target label into 1dAVb calls, which is consistent with a model that reads the absolute PR duration.
Supplementary Note 14: Lead Shapley values Supplementary Fig. 5 shows the mean normalized Shapley value of each lead for each label, and Supplementary Table 14 reports how often one lead alone keeps a correct call. The six limb leads are linear combinations of two independent signals. The exam embedding is an attentionweighted mean of lead embeddings, so a negative Shapley value can reflect dilution of stronger leads rather than evidence against the label.
Supplementary Note 15: Regional deletion for the rhythm labels Supplementary Table 10 applies the eight-state PR–QRS–T game of the main text to SB, AF, and ST. These labels have no expected waveform region, and deleting a region does not remove rate information, because tnorm and the remaining ∆t values still encode beat duration. The table therefore shows where the morphological evidence sits, while the timing interventions test the rhythm calls. The delineator marks a PR region in 96.5% of AF lead–beat units, so for AF this region is the pre-QRS interval rather than a P wave.
6
Per-class ROC Curves In-domain vs. External 1dAVb
1.0
0.4 0.2
0.4
0.0
0.2
0.4
0.6
False Positive Rate
0.8
0.0
1.0
SB
0.0
0.2
0.4
0.6
False Positive Rate
0.8
1.0
AF
0.2
0.6 0.4
0.0
0.2
0.4
0.6
False Positive Rate
0.8
1.0
0.0
0.0
0.2
0.4
0.6
False Positive Rate
0.8
1.0
ST
0.8
0.2 CODE-Test (AUC = 0.998) PTB-XL (AUC = 0.965)
CODE-Test (AUC = 1.000) PTB-XL (AUC = 0.997)
1.0
True Positive Rate
True Positive Rate
0.4
0.4
0.0
0.8
0.6
0.6
0.2 CODE-Test (AUC = 0.999) PTB-XL (AUC = 0.995)
1.0
0.8
True Positive Rate
0.6
0.2 CODE-Test (AUC = 0.995) PTB-XL (AUC = 0.941)
1.0
0.0
0.8
True Positive Rate
0.6
LBBB
1.0
0.8
True Positive Rate
True Positive Rate
0.8
0.0
RBBB
1.0
0.6 0.4 0.2
CODE-Test (AUC = 1.000) PTB-XL (AUC = 0.994)
0.0
0.2
0.4
0.6
False Positive Rate
0.8
1.0
0.0
CODE-Test (AUC = 0.998) PTB-XL (AUC = 0.995)
0.0
0.2
0.4
0.6
False Positive Rate
0.8
1.0
Supplementary Fig. 1: External ranking degrades most for 1dAVb. Run A curves mark the fixed-0.5 operating point; Supplementary Table 4 reports per-class results across all three seeds.
7
PR Shapley contribution (logit)
8
1dAVb
RBBB
PR leads above the diagonal
LBBB
PR leads above the diagonal
PR leads above the diagonal
6 4 2 0 2 2
0
2
4
QRS Shapley contribution (logit)
6
8
PR leads
2
0
2
4
QRS Shapley contribution (logit) QRS leads
T leads
6
8
2
0
2
4
QRS Shapley contribution (logit)
6
8
faded: misclassified
Supplementary Fig. 2: PR and QRS Shapley contributions per verdict. PR against QRS Shapley contribution for every verdict, primary availability rule (N = 276 verdicts: 84 for 1dAVb, 102 for RBBB, and 90 for LBBB). Color marks the leading region; faded points are misclassified verdicts; markers are the three seeds. The dashed line is the PR-equals-QRS diagonal. Axes cross zero because Shapley contributions are signed.
8
a Fraction of verdicts called positive
1.0
CODE-Test
0.8
0.6
0.4
0.2
0.0
b Fraction of verdicts called positive
1.0
PTB-XL
0.8
0.6
0.4
0.2
0.0 40
60
80
100
120
140
160
180
Imposed heart rate (beats/min) no target label SB positive
ST positive called SB
called ST
Supplementary Fig. 3: Uniform rate sweep on both datasets. Fraction of verdicts called SB (solid) or ST (dashed) as every beat’s time axis is scaled to the imposed heart rate. Lines are means over three seeds, and bands span the seeds.
9
a
b
CODE-Test
1.0
0.8
P(SB), seed mean
P(SB), seed mean
1.0
0.6 0.4 0.2 0.0
PTB-XL
0.8 0.6 0.4 0.2 0.0
40
60
80
100
120
140
160
40
c
d
1.0
1.0
0.8
0.8
0.6 0.4 0.2 0.0
80
100
120
140
160
0.6 0.4 0.2 0.0
40
60
80
100
120
140
160
40
Measured heart rate (beats/min)
60
80
100
120
140
160
Measured heart rate (beats/min)
e
f
1.0
1.0
0.8
0.8
P(AF), seed mean
P(AF), seed mean
60
Measured heart rate (beats/min)
P(ST), seed mean
P(ST), seed mean
Measured heart rate (beats/min)
0.6 0.4 0.2 0.0
0.6 0.4 0.2 0.0
0.0
0.1
0.2
0.3
0.4
0.0
RR coefficient of variation
0.1
0.2
0.3
0.4
RR coefficient of variation
class negative
class positive
Supplementary Fig. 4: Intact predictions against measured rhythm descriptors. Seedmean probability of SB and ST against the heart rate measured from the stored R anchors, and of AF against the RR coefficient of variation. Dotted lines mark 50 and 60 beats/min for SB and 100 beats/min for ST.
10
a
CODE-Test 1dAVb RBBB LBBB SB AF ST I
II
III
aVR
aVL
aVF
V1
V2
V3
V4
V5
V6
V1
V2
V3
V4
V5
V6
Lead
b
PTB-XL 1dAVb RBBB LBBB SB AF ST I
II
III
aVR
aVL
aVF
Lead
−0.3
−0.2
−0.1
0.0
0.1
0.2
0.3
Mean normalized lead Shapley value
Supplementary Fig. 5: Mean normalized lead Shapley value per label. Each cell averages, over label-positive verdicts, a lead’s Shapley value divided by the sum of positive lead values. Negative cells can reflect dilution under attention pooling.
11
Supplementary Table 1: Data splits after graph quality control, with exam counts, beat-graph counts, and per-class positives. CODE100 training and validation form a disjoint 98/2% patient-hash split; validation only selects checkpoints. CODE-Test and PTB-XL are used only for evaluation. Multilabel class counts may exceed the exam count. The last row gives the strict PTB-XL SCP-ECG code mapped to each class by code presence: first-degree block only, complete bundle-branch blocks, and AF without atrial flutter. Dataset
Role
Exams
Beat graphs
1dAVb
RBBB
LBBB
SB
AF
ST
CODE100 training
Training
CODE100 validation
Checkpoint selection
2 237 125
279 394 549
34 587
61 558
35 843
36 642
40 357
48 185
46 378
5 818 784
714
1268
731
749
829
CODE-Test
985
In-domain test
827
106 340
28
34
30
16
13
37
PTB-XL
External test
21 799
3 176 537
793
541
536
637
1514
826
1AVB
CRBBB
CLBBB
SBRAD
AFIB
STACH
PTB-XL SCP code
Supplementary Table 2: Paired macro-F1 comparisons with baselines. Values are the macro F1 of LYNX-ECG minus the comparator’s, followed by a 95% percentile confidence interval from 2000 shared-exam bootstrap resamples. The trained seed pairs are held fixed. Comparator
CODE-Test
PTB-XL strict-SCP
DNN [1]
+0.0399 [+0.0136, +0.0704]
+0.0117 [+0.0065, +0.0172]
ViT [6]
+0.2058 [+0.1518, +0.2660]
+0.0150 [+0.0100, +0.0197]
EfficientNet [7]
+0.3069 [+0.2637, +0.3519]
+0.0025 [−0.0023, +0.0074]
ECGFounder-Scratch [8]
+0.0256 [+0.0009, +0.0509]
−0.0004 [−0.0042, +0.0036]
ECGFounder-Finetuned [8]
+0.0315 [+0.0010, +0.0632]
−0.0044 [−0.0090, +0.0002]
Supplementary Table 3: SB and ST recall and false-call rate on strict-SCP PTB-XL by the measured heart rate. Values pool three seeds; brackets give 95% exam-bootstrap intervals. Label SB
ST
Heart rate (beats/min)
Positives
Recall
Negatives
False-call rate
< 50
373
0.97 [0.95, 0.98]
105
0.73 [0.66, 0.81]
50–55
123
0.40 [0.31, 0.48]
1074
0.07 [0.06, 0.08]
55–60
108
0.07 [0.03, 0.13]
2011
0.00 [0.00, 0.00]
≥ 60
33
0.24 [0.12, 0.37]
17972
0.00 [0.00, 0.00]
< 100
20
0.10 [0.02, 0.20]
20125
0.00 [0.00, 0.00]
100–105
273
0.92 [0.89, 0.95]
243
0.40 [0.34, 0.45]
105–110
189
1.00 [0.99, 1.00]
105
0.23 [0.16, 0.31]
≥ 110
344
0.98 [0.97, 0.99]
500
0.30 [0.26, 0.34]
12
Supplementary Table 4: Performance of LYNX-ECG across three seeds at the fixed 0.5 threshold on CODE-Test (panel A) and strict-SCP PTB-XL (panel B). Per-class AUROC, F1, precision, and recall are ranges, whereas per-class AUPRC and all macro metrics are means ± sample SD. Panel C gives the CODE-Test per-class confusion-count ranges. Range endpoints need not come from the same seed. A. CODE-Test Class
AUROC
AUPRC
F1
Precision
Recall
1dAVb
0.9953–0.9964
RBBB
0.9987–0.9991
0.8945 ± 0.0019
0.696–0.830
0.880–0.913
0.571–0.786
0.9785 ± 0.0034
0.877–0.941
0.821–0.941
0.941
LBBB
0.9998–1.0000
0.9980 ± 0.0027
0.947–0.966
1.000
0.900–0.933
SB
0.9978–0.9983
0.8390 ± 0.0544
0.800–0.865
0.667–0.762
1.000
AF
0.9994–0.9999
0.9777 ± 0.0149
0.897–0.929
0.812–0.867
1.000
ST
0.9979–0.9984
0.9638 ± 0.0033
0.895–0.921
0.872–0.943
0.892–0.946
0.998415 ± 0.000050
0.9419 ± 0.0124
0.8890 ± 0.0035
0.8796 ± 0.0158
0.9141 ± 0.0156
F1
Precision
Recall
macro
B. Strict-SCP PTB-XL Class
AUROC
AUPRC
1dAVb
0.9405–0.9458
0.4034 ± 0.0102
0.425–0.460
0.301–0.350
0.671–0.736
RBBB
0.9948–0.9955
0.7713 ± 0.0130
0.740–0.793
0.593–0.677
0.957–0.985
LBBB
0.9966–0.9971
0.9361 ± 0.0024
0.706–0.774
0.551–0.644
0.970–0.979
SB
0.9623–0.9651
0.6957 ± 0.0030
0.691–0.708
0.713–0.764
0.659–0.670
AF
0.9940–0.9944
0.9446 ± 0.0023
0.919–0.923
0.891–0.919
0.927–0.948
ST
0.9949–0.9951
0.8708 ± 0.0042
0.791–0.829
0.676–0.747
0.931–0.953
0.981478 ± 0.000524
0.7703 ± 0.0043
0.7300 ± 0.0012
0.6513 ± 0.0014
0.8673 ± 0.0054
macro
C. CODE-Test confusion counts Class
TP
FP
FN
TN
1dAVb
16–22
2–3
6–12
796–797
RBBB
32
2–7
2
786–791
LBBB
27–28
0
2–3
797
SB
16
5–8
0
803–806
AF
13
2–3
0
811–812
ST
33–35
2–5
2–4
785–788
13
Supplementary Table 5: Per-class AUROC of every model on CODE-Test and strictSCP PTB-XL. Values are means ± sample SD across three training runs. Boldface marks the highest mean and underline marks the second-highest mean in each column and dataset. The macro column repeats Table 1 of the main text. Extended Data Table 1 of the main text gives the per-class F1. Model
1dAVb
RBBB
LBBB
SB
AF
ST
Macro
CODE-Test (n = 827) LYNX-ECG
0.9959 ± 0.0006
0.9989 ± 0.0002
0.9999 ± 0.0001
0.9980 ± 0.0003
0.9996 ± 0.0003
0.9982 ± 0.0002
0.9984 ± 0.0001
DNN [1]
0.9952 ± 0.0018
0.9989 ± 0.0003
0.9990 ± 0.0006
0.9973 ± 0.0002
0.9985 ± 0.0008
0.9968 ± 0.0001
0.9976 ± 0.0002
ViT [6]
0.9783 ± 0.0152
0.9833 ± 0.0040
0.9992 ± 0.0008
0.9821 ± 0.0133
0.9581 ± 0.0528
0.9876 ± 0.0103
0.9814 ± 0.0130
EfficientNet [7]
0.9480 ± 0.0039
0.9707 ± 0.0083
0.9508 ± 0.0247
0.9955 ± 0.0018
0.9980 ± 0.0005
0.9837 ± 0.0059
0.9744 ± 0.0044
ECGFounder-Scratch [8]
0.9934 ± 0.0007
0.9985 ± 0.0006
0.9998 ± 0.0002
0.9985 ± 0.0004
0.9997 ± 0.0003
0.9978 ± 0.0006
0.9979 ± 0.0003
ECGFounder-Finetuned [8]
0.9875 ± 0.0083
0.9983 ± 0.0011
0.9995 ± 0.0003
0.9955 ± 0.0014
0.9986 ± 0.0011
0.9972 ± 0.0010
0.9961 ± 0.0016
PTB-XL (n = 21,799) LYNX-ECG
0.9437 ± 0.0028
0.9951 ± 0.0003
0.9968 ± 0.0002
0.9640 ± 0.0015
0.9942 ± 0.0002
0.9950 ± 0.0001
0.9815 ± 0.0005
DNN
0.9472 ± 0.0037
0.9957 ± 0.0002
0.9956 ± 0.0012
0.9631 ± 0.0033
0.9939 ± 0.0005
0.9901 ± 0.0005
0.9809 ± 0.0008 0.9791 ± 0.0018
ViT
0.9348 ± 0.0070
0.9941 ± 0.0005
0.9945 ± 0.0004
0.9666 ± 0.0015
0.9921 ± 0.0006
0.9924 ± 0.0022
EfficientNet
0.9364 ± 0.0062
0.9950 ± 0.0004
0.9954 ± 0.0009
0.9622 ± 0.0017
0.9932 ± 0.0007
0.9916 ± 0.0004
0.9790 ± 0.0013
ECGFounder-Scratch
0.9473 ± 0.0071
0.9945 ± 0.0006
0.9956 ± 0.0009
0.9666 ± 0.0035
0.9937 ± 0.0002
0.9930 ± 0.0016
0.9818 ± 0.0007
ECGFounder-Finetuned
0.9395 ± 0.0048
0.9937 ± 0.0003
0.9932 ± 0.0018
0.9281 ± 0.0025
0.9915 ± 0.0001
0.9921 ± 0.0004
0.9730 ± 0.0010
Supplementary Table 6: Matched CODE-Test class means across seeds. ∆ is turningpoint selection minus uniform k = 30; positive values favor turning-point selection. F1@0.5
AUPRC
Class
Turning
Uniform
∆
Turning
Uniform
∆
1dAVb
0.783
0.715
+0.068
0.895
0.915
−0.020
RBBB
0.920
0.937
−0.017
0.978
0.979
−0.001
LBBB
0.959
0.954
+0.006
0.998
0.999
−0.001
SB
0.843
0.881
−0.038
0.839
0.920
−0.081
AF
0.918
0.871
+0.047
0.978
0.960
+0.018
ST
0.911
0.911
+0.000
0.964
0.963
+0.001
Supplementary Table 7: Three-seed all-points comparison as mean ± sample SD. Each paired difference uses values from the same seed and is all points minus turning points. For F1, this difference was negative on CODE-Test and positive on PTB-XL in each of the three seeds. Dataset
Metric
CODE-Test
PTB-XL
All points
Turning points
Paired ∆
F1
0.869977 ± 0.010829
0.889040 ± 0.003517
−0.019063 ± 0.007336
AUPRC
0.950773 ± 0.007045
0.941906 ± 0.012364
+0.008866 ± 0.009120
AUROC
0.998528 ± 0.000171
0.998415 ± 0.000050
+0.000113 ± 0.000164
Precision
0.880707 ± 0.020565
0.879622 ± 0.015825
+0.001085 ± 0.006775
Recall
0.884078 ± 0.025188
0.914116 ± 0.015607
−0.030039 ± 0.014806
ECE
0.007952 ± 0.000709
0.007992 ± 0.001015
−0.000041 ± 0.001655
F1
0.742880 ± 0.005454
0.730007 ± 0.001231
+0.012873 ± 0.006673
AUPRC
0.775312 ± 0.004909
0.770333 ± 0.004325
+0.004980 ± 0.001035
AUROC
0.981766 ± 0.000774
0.981478 ± 0.000524
+0.000288 ± 0.000829
Precision
0.672100 ± 0.009546
0.651333 ± 0.001351
+0.020768 ± 0.008216
Recall
0.855815 ± 0.005375
0.867254 ± 0.005354
−0.011439 ± 0.001345
ECE
0.014368 ± 0.001549
0.017375 ± 0.001179
−0.003007 ± 0.000374
14
Supplementary Table 8: Measured computational efficiency. Each graph build used the same 1,000 exams, three builds, and 16 CPU workers; memory is peak RSS and output size is the resulting HDF5 file. Reported training values cover three seeds, 40 epochs, and 454,473 exams per epoch; full-run time includes validation, final evaluation, and artifact logging. Batched inference used 40 batches of 128 exams on one RTX 5090. “Allocated” is peak frameworkallocated GPU memory. The loader used page-cached data on local scratch. Stage
Time or throughput
Output size
Peak memory
Build, all points
25.663 ± 0.095 s; 39.0 exams/s
576.7 MB HDF5
875.4 MiB RSS
Build, turning points
6.667 ± 0.006 s; 150.0 exams/s
72.2 MB HDF5
275.4 MiB RSS
Reported training epochs
132.0 ± 3.7 s/epoch; 3444 exams/s
N/A
N/A
Reported full runs
1.599 ± 0.018 h/run
N/A
N/A
Batched inference
31.9 ms/batch; 4016 exams/s
N/A
3.36 GiB allocated
Supplementary Table 9: Directed and bidirectional ranking metrics. ∆ is directed minus bidirectional; brackets give 95% paired exam-bootstrap intervals. Dataset
Metric
Directed
Bidirectional
∆ [95% interval]
CODE-Test
F1
0.889040
0.875832
+0.013208 [−0.006583, +0.032856]
AUROC
0.998415
0.998441
−0.000026 [−0.000540, +0.000389]
AUPRC
0.941906
0.950522
−0.008616 [−0.020736, +0.007055]
F1
0.730007
0.732977
−0.002970 [−0.006064, +0.000208]
AUROC
0.981478
0.980793
+0.000686 [+0.000172, +0.001183]
AUPRC
0.770333
0.772413
−0.002080 [−0.006112, +0.001808]
PTB-XL
Supplementary Table 10: PR–QRS–T structural deletion for the rhythm labels under the beat-complete rule, pooled over three seeds. Counts give the leading region among correct verdicts; Shapley values are medians [IQR] in logits over all positive verdicts. “Complete” is the fraction of lead–beat units with all three regions delineated. These labels have no expected region, so the leading region does not explain the rhythm call. Dataset
Label
CODE-Test
SB
0.92
48/48
1
45
AF
0.80
39/39
0
39
ST
0.73
101/111
23
78
PTB-XL
Complete
Correct
PR leads
QRS leads
T leads
PR
QRS
T
2
0.55 [0.28, 1.28]
3.83 [2.84, 4.52]
1.60 [1.22, 2.01]
0
1.08 [0.58, 1.94]
4.14 [2.77, 5.32]
−0.65 [−1.08, 0.02]
0
0.40 [0.22, 0.59]
1.04 [0.37, 1.85]
−0.72 [−1.12, −0.31]
SB
0.92
1274/1911
27
1152
95
0.84 [0.10, 1.47]
2.63 [0.81, 4.27]
1.55 [1.06, 2.29]
AF
0.65
4258/4542
472
3747
39
0.90 [0.34, 1.54]
2.76 [1.40, 4.30]
−0.45 [−0.90, −0.08]
ST
0.63
2335/2478
595
1719
21
0.24 [0.05, 0.49]
0.62 [0.16, 1.26]
−0.38 [−0.80, −0.14]
15
Supplementary Table 11: Sensitivity of expected-region verdicts to the availability rule, cohort, and coverage floor. In panel A, cells give expected-region leads among correct verdicts under both availability rules and both cohorts. “Strict” counts exams for which all three seeds agree on the expected region. The isolated cohort excludes concurrent positives among the three morphology labels 1dAVb, RBBB, and LBBB only. Panel B gives strict all-seed agreement under minimum beat-complete coverage floors; with no floor, it equals the strict beat-complete row of panel A. A floor changes the retained cohort, so the rows are not repeated measurements on one fixed set of exams. A. Availability rule and cohort Rule
Cohort
1dAVb
RBBB
LBBB
All
beat-complete
all positive
47/59
95/96
78/83
220/238 (92%)
per-region
all positive
45/59
96/96
82/83
223/238 (94%)
beat-complete
isolated
38/50
83/84
69/74
190/208 (91%)
per-region
isolated
37/50
84/84
73/74
194/208 (93%)
strict, beat-complete, all positive
16/28
32/34
26/30
74/92
strict, per-region, all positive
14/28
34/34
28/30
76/92
B. Coverage floors, strict beat-complete agreement Floor
Exam–class pairs kept
1dAVb
RBBB
LBBB
All
0.5
91
16/28
32/34
25/29
73/91
0.6
88
16/28
31/33
25/27
72/88
0.7
87
16/28
31/33
24/26
71/87
0.8
81
16/28
29/31
20/22
65/81
Supplementary Table 12: Beat-sequence interventions with 95% exam-bootstrap intervals. Cells give the fraction of label-positive verdicts that stay positive. “Template, RR” repeats the median-duration beat but restores each beat’s original duration. Dataset
Label
Intact
Shuffled
Template
Template, RR
Equalized
CODE-Test
1dAVb
0.70 [0.56, 0.85]
0.65 [0.49, 0.80]
0.68 [0.55, 0.81]
0.68 [0.54, 0.82]
0.70 [0.55, 0.85]
RBBB
0.94 [0.85, 1.00]
0.95 [0.87, 1.00]
0.89 [0.79, 0.97]
0.88 [0.78, 0.97]
0.95 [0.87, 1.00]
LBBB
0.92 [0.82, 1.00]
0.90 [0.81, 0.98]
0.94 [0.88, 1.00]
0.94 [0.88, 1.00]
0.92 [0.83, 1.00]
SB
1.00 [1.00, 1.00]
0.97 [0.91, 1.00]
0.76 [0.58, 0.93]
0.73 [0.54, 0.90]
0.92 [0.81, 1.00]
AF
1.00 [1.00, 1.00]
1.00 [1.00, 1.00]
0.00 [0.00, 0.00]
0.00 [0.00, 0.00]
1.00 [1.00, 1.00]
ST
0.91 [0.82, 0.98]
0.91 [0.83, 0.98]
0.92 [0.83, 0.99]
0.92 [0.82, 0.99]
0.91 [0.82, 0.98]
1dAVb
0.61 [0.55, 0.67]
0.60 [0.53, 0.66]
0.55 [0.49, 0.62]
0.55 [0.49, 0.61]
0.59 [0.53, 0.65]
RBBB
0.95 [0.93, 0.98]
0.96 [0.94, 0.98]
0.87 [0.83, 0.91]
0.87 [0.83, 0.91]
0.95 [0.92, 0.97]
PTB-XL
LBBB
0.94 [0.91, 0.97]
0.94 [0.91, 0.97]
0.92 [0.88, 0.95]
0.92 [0.88, 0.95]
0.94 [0.90, 0.97]
SB
0.67 [0.63, 0.70]
0.65 [0.61, 0.69]
0.56 [0.52, 0.59]
0.54 [0.51, 0.58]
0.62 [0.59, 0.66]
AF
0.94 [0.93, 0.95]
0.94 [0.92, 0.95]
0.01 [0.00, 0.01]
0.01 [0.01, 0.01]
0.93 [0.92, 0.94]
ST
0.94 [0.93, 0.96]
0.93 [0.92, 0.95]
0.94 [0.93, 0.95]
0.94 [0.93, 0.95]
0.94 [0.93, 0.96]
16
Supplementary Table 13: Uniform and interval-preserving rate change on CODE-Test. The crossing is the imposed heart rate at which half of the cohort’s verdicts change call, with 95% exam-bootstrap intervals. Interval-preserving rows use verdicts that remain feasible over the whole window. The lower block gives the fraction of conduction-positive verdicts that stay positive. Cohort
Quantity
Uniform
Interval-preserving
No target label
SB crossing (beats/min)
47.8 [47.6, 48.0]
45.4 [44.4, 45.8]
No target label
ST crossing (beats/min)
105.6 [104.9, 106.5]
infeasible
ST positive
ST crossing (beats/min)
99.4 [98.7, 100.5]
101.9 [100.6, 102.7]
SB positive
still SB at 60 beats/min
0.00
0.00
ST positive
still ST at 90 beats/min
0.00
0.00
1dAVb positive
60 / 80 / 100 beats/min
0.77 / 0.20 / 0.00
0.64 / 0.58 / infeasible
RBBB positive
60 / 80 / 100 beats/min
0.92 / 0.84 / 0.49
0.93 / 0.94 / 0.92
LBBB positive
60 / 80 / 100 beats/min
0.97 / 0.83 / 0.47
0.81 / 0.89 / 1.00∗
∗
At 100 beats/min, 24% of RBBB and 7% of LBBB verdicts are feasible.
Supplementary Table 14: Fraction of correct verdicts in which one lead alone keeps the call positive. Top block CODE-Test, bottom block strict-SCP PTB-XL. Label
I
II
III
aVR
aVL
aVF
V1
V2
V3
V4
V5
1dAVb
0.22
0.97
RBBB
0.95
0.97
0.37
0.08
0.48
0.54
LBBB
0.20
0.08
0.51
SB
0.62
0.83
0.46
AF
0.92
0.79
ST
0.79
0.76
1dAVb
0.32
0.89
RBBB
0.96
0.89
LBBB
0.25
0.11
0.45
SB
0.68
0.68
0.36
AF
0.82
0.85
0.30
0.03
0.59
0.30
0.03
0.44
0.78
ST
0.80
0.71
0.38
0.01
0.52
0.62
0.00
0.23
0.64
0.68
0.00
0.02
0.07
0.47
0.56
0.44
0.46
0.81
0.27
0.00
0.00
0.03
0.41
0.80
0.95
0.39
0.00
0.34
0.41
0.96
0.86
0.48
0.08
0.25
0.69
0.56
0.17
0.06
0.02
0.58
0.50
0.60
0.50
0.36
0.08
0.49
0.13
0.00
0.33
0.90
1.00
0.85
0.95
0.47
0.36
0.54
0.11
0.00
0.22
0.61
0.80
0.61
0.76
0.50
0.01
0.09
0.69
0.12
0.27
0.68
0.54
0.52
0.38
0.47
0.33
0.96
0.51
0.00
0.00
0.01
0.42
0.85
0.96
0.07
0.05
0.35
0.60
0.98
0.81
0.37
0.16
0.40
0.37
0.35
0.39
0.01
0.02
0.65
0.56
0.61
0.42
0.96
0.95
0.98
0.77
0.66
0.71
17
V6
Supplementary Table 15: Hyperparameter search space and selected configuration shared by runs with different random seeds. The selected configuration has the highest macro F1 on the CODE100 validation split. Ranges are on a linear scale unless marked “log”. “Integer” marks integer-valued ranges, and braces list categorical choices. Hyperparameter
Search range
Dropout
[0.0, 0.15]
0.012
Head dropout
[0.0, 0.15]
0.118
Weight decay
[10−5 , 10−3 ], log
7.52 × 10−4
Grad-clip norm
[0.5, 2.0]
1.523
nneg
[150 000, 500 000], log
220 514
Learning rate
[10−4 , 5 × 10−3 ], log
1.36 × 10−3
Batch size
{64, 128, 256}
128
Scheduler factor
[0.1, 0.9]
0.589
Max epochs
[20, 60], integer
40
Early-stop patience
[5, 20], integer
15
18
Selected
Supplementary References [1] Ribeiro, A. H. et al. Automatic diagnosis of the short-duration 12-lead ECG using a deep neural network. Nature Communications 11, 1760 (2020). [2] Wagner, P. et al. PTB-XL, a large publicly available electrocardiography dataset. Scientific Data 7, 154 (2020). [3] Wagner, P., Strodthoff, N., Bousseljot, R.-D., Samek, W. & Schaeffter, T. PTB-XL, a large publicly available electrocardiography dataset (version 1.0.3). PhysioNet (2022). URL https://doi.org/10.13026/kfzx-aw45. [4] Goldberger, A. L. et al. Physiobank, physiotoolkit, and physionet: Components of a new research resource for complex physiologic signals. Circulation 101, e215–e220 (2000). [5] Makowski, D. et al. NeuroKit2: A python toolbox for neurophysiological signal processing. Behavior Research Methods 53, 1689–1696 (2021). [6] Dosovitskiy, A. et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR) (2021). URL https://openreview.net/forum?id=YicbFdNTTy. [7] Tan, M. & Le, Q. EfficientNet: Rethinking model scaling for convolutional neural networks. In Proceedings of the 36th International Conference on Machine Learning, Vol. 97 of Proceedings of Machine Learning Research, 6105–6114 (PMLR, 2019). URL https: //proceedings.mlr.press/v97/tan19a.html. [8] Li, J. et al. An electrocardiogram foundation model built on over 10 million recordings with external evaluation across multiple domains. arXiv preprint arXiv:2410.04133 (2024).
19
Related documents
- SparrowSNN: A Hardware/software Co-design for Energy Efficient ECG Classification#152990
- Optimized Machine Learning Algorithms for Real-Time ECG Signal Analysis in IoT Networks#113365
- ReHeartNet: Reconstruct Electrocardiogram From Photoplethysmography by Using Dense Connected Deep Learning Model.#4458
- WITHDRAWN: An Integrated Deep Learning Framework for Small-Sample Biomedical Data Classification: Explainable Graph Neural Networks with Data Augmentation for RNA sequencing Dataset#223953
- Myocardial Strain Drift Correction in Deep Learning Based Ultrasound Tracking#987312
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive