Source-linked AI summary

Robust Transfer Learning for Paper ECG Recognition

Yinghao Xie, Zhenbang Dai, Haojun Wang, Jinyu Cai, Fabio Bonassi, Hongwu Chen, Johan Sundström, Jiawei Li, Antônio H. Ribeiro

arXiv:2609.39581v1cs.LGcs.AI

TL;DR

Paper ECG recognition must remain robust across varied layouts, image degradation, and limited labels. RobECG-CL learns from progressively degraded views with rank-aware contrastive learning. It shows strong synthetic robustness and few-shot transfer, alongside strong hospital-set results.

  • Problem

    Paper ECG images vary in layout and artifacts, and robustness of image-based models under degradation, heterogeneous layouts, and limited labels remains unclear.

    Source: §1 · p. 1
  • Method

    RobECG-CL uses rank-aware contrastive learning to keep same-recording views close while ordering mildly degraded views nearer the clean anchor than severely degraded views.

    Source: §1 · p. 2
  • Results

    Across sex and SHD tasks, RobECG-CL has the strongest overall robustness across four degradation levels and beats ECG-FM with 1% training data; it also achieves best macro AUROC on all 37 hospital labels.

    Source: §1 · p. 2, §3 · p. 4
  • Takeaways & Limitations

    The results support transfer of degradation-aware representations to real-world clinical records.

    Source: §4 · p. 5

    PTB-XL baselines use clean-ECG augmentation rather than progressively degraded positive pairs, and some degraded views may lose features needed for diagnosis.

    Source: §4 · p. 5

Abstract

from arXiv · show

Paper ECG recognition is challenging because real-world ECG images vary in layout, physical artifacts, and label availability. We introduce RobECG-CL, a rank-aware contrastive learning framework for robust paper ECG representation learning. Starting from standard 12-lead ECG recordings, we construct progressively degraded paper ECG views with heterogeneous layouts and train the model to balance same-recording invariance with degradation-aware ordering. Across synthetic stress tests on CODE-II and EchoNext, RobECG-CL improves robustness under severe degradation and few-shot transfer, outperforming contrastive learning baselines and surpassing the waveform-based foundation model, ECG-FM, in the 1% labeled setting. On 312 samples of hospital data with 37 labels, RobECG-CL achieves the best macro AUROC.

1 Introduction and related work

Paper ECG recognition must handle layout and image variation, often with limited labels. RobECG-CL uses rank-aware contrastive learning on progressively degraded views, with strong synthetic robustness and hospital results.

1 Introduction and related work

  • Real-world paper ECGs vary in lead layouts, handling artifacts, and annotations, making transfer across layout shifts, degradation, and few-shot supervision a challenge.In some archives, only paper ECG images remain, while waveform foundation models cannot be applied to those images.Source: §1 · p. 1
  • The pipeline renders clean ECGs in heterogeneous layouts, then creates matched views with increasing degradation severity.The layouts include 3×4 and 6×2 displays, synchronous or asynchronous leads, and lead-II rhythm strips.Source: §1 · p. 1, Figure 1 · p. 2
  • RobECG-CL keeps views from the same ECG close while ranking mildly degraded views closer to the clean anchor than severely degraded ones.This combines invariance across degradation with a degradation-aware ordering.Source: §1 · p. 2
  • Across synthetic tests, RobECG-CL leads robustness across four degradation levels and beats waveform foundation models at 1% labels; on hospital data, it leads macro AUROC across all 37 labels.On the 12 most frequent hospital labels, it achieves the second-best macro AUROC.Source: §1 · p. 2

2 Study design and methods

The study tests whether self-supervised pretraining on progressively degraded paper ECG views supports transfer under layout shifts, image degradation, and limited labels. RobECG-CL combines same-recording invariance with a weak degradation-aware ordering.

2 Study design and methods

  • Each clean ECG is rendered with a shared layout configuration, sampled from 3×4 or 6×2 layouts and synchronous or asynchronous displays, with a lead-II rhythm strip.PTB-XL is used for upstream pretraining; CODE-II and EchoNext are used for controlled transfer.Source: §2 · p. 2
  • The pipeline creates progressively degraded views from each clean-rendered ECG, cumulatively updating degradation states so larger severity levels indicate stronger artifact, blur, and noise.Geometric and color increments are newly sampled at each step.Source: §2 · pp. 2–3
  • A CvT-13 image encoder and two-layer MLP map each view to a normalized embedding; the clean view anchors contrastive learning, same-recording degraded views are positives, and other recordings are negatives.The multi-positive InfoNCE loss treats all degraded views from the same ECG as equally positive.Source: §2 · p. 3
  • Ordinal pairs use Canny-based geometric and CIELAB color distances to identify views consistently closer to the clean anchor than other views.The rank term encourages the less-degraded member of a pair to have greater similarity to the anchor.Source: §2 · p. 3
  • RobECG-CL combines a set-level contrastive loss with a rank loss, learning invariance across degradation levels while weakly ordering views by degradation.Less-degraded views are encouraged to remain more similar to the clean anchor than more-degraded views.Source: §2 · p. 3

3 Results

RobECG-CL shows stronger transfer under progressive degradation and limited labels across synthetic evaluations, with additional validation on hospital paper ECGs.

3 Results

  • RobECG-CL achieves the best macro AUROC on sex and SHD classification among PTB-XL-pretrained models, with a larger advantage at severity 4.Table 2 covers AUROC across degradation severities for EchoNext SHD classification.Source: Table 2 · p. 4, §3 · p. 4
  • Among 12 hospital-dataset labels with more than 20 positives, RobECG-CL ranks second in macro AUROC and first in macro F1.Table 3 reports per-label AUROC and F1 under five-fold pooled out-of-fold evaluation; the dataset contains 312 real-world paper ECGs.Source: Table 3 · p. 4, §3 · p. 4
  • With 1% training data, RobECG-CL outperforms ECG-FM on both sex and SHD classification.The comparison is notable because paper ECG images provide only an indirect visual observation of the waveform.Source: §3 · p. 4
  • PULSE and GEM transfer to degraded images, but underperform RobECG-CL on sex classification and age prediction with 1% labels.The comparison is reported in Table 4.Source: §3 · p. 4
  • The representation visualization shows alignment to the clean anchor while allowing some severely degraded samples to deviate.The figure depicts sex-prediction representations with 10% labeled training data.Source: §3 · p. 4, Figure 2 · p. 4

4 Conclusion and limitation

RobECG-CL learns degradation-aware representations from paper ECG images and shows transfer performance across synthetic and real-world evaluations, subject to stated data and training limitations.

4 Conclusion and limitation

  • RobECG-CL is a self-supervised framework designed to extract degradation-aware representations from paper ECG images.It uses synthetic progressive degradations to align features across severity levels without forcing unnatural alignments for severely degraded samples.Source: §4 · p. 5
  • The study does not manually filter degraded views that may lose clinically relevant features, and its real-world validation is limited to one center.PTB-XL-pretrained baselines also use clean-ECG augmentation pipelines rather than progressively degraded views as positive pairs.Source: §4 · p. 5
  • The authors report superior classification performance and strong transferability to real-world clinical records.Source: §4 · p. 5

A.1 Supplementary age prediction results

RobECG-CL performs strongly on CODE-II age prediction across the reported label fractions, but PULSE and GEM have lower absolute errors when 10% of labels are available.

A.1 Supplementary age prediction results

  • RobECG-CL achieves the best age-prediction performance among PTB-XL-pretrained methods with both 1% and 10% training data.Table 4 reports transfer performance across degradation severities on CODE-II age prediction, with mean ± standard deviation over five runs.Source: §A.1 · p. 8, Table 4 · p. 8
  • Increasing labeled data from 1% to 10% lowers RobECG-CL’s average MAE and raises its average R2.Source: §A.1 · p. 8
  • RobECG-CL performs better than PULSE and GEM with 1% labels and remains competitive at 10%, when PULSE and GEM achieve lower absolute errors.Source: §A.1 · p. 8

A.2 Supplementary AUPRC results

On CODE-II sex classification and EchoNext SHD classification, RobECG-CL maintains stronger performance as paper ECG degradation increases, with task-specific comparisons against other methods.

A.2 Supplementary AUPRC results

  • RobECG-CL’s AUPRC falls by 0.024 and 0.034 from clean to Severity 4 with 1% and 10% labels, versus MoCo’s 0.128 and 0.118.RobECG-CL has the highest average AUPRC among PTB-XL-pretrained methods under both label fractions; Table 5 covers CODE-II sex classification.Source: §A.2 · p. 8, Table 5 · p. 8
  • For CODE-II sex classification, RobECG-CL also exceeds PULSE, GEM, and waveform foundation models in average AUPRC with 1% labels.Source: §A.2 · p. 8
  • On EchoNext SHD classification, RobECG-CL’s AUPRC drops by 0.023 and 0.029 from clean to Severity 4, versus MoCo’s 0.135 and 0.143.PULSE and GEM have higher average AUPRC but larger degradation-related decreases; RobECG-CL has the highest average AUPRC among PTB-XL-pretrained methods.Source: §A.2 · p. 8

A.3 Supplementary real-world paper ECG results

On 312 real-world paper ECGs with 37 labels, RobECG-CL has the best average macro AUROC across labels and consistent overall discrimination, though rare-label estimates are sample-sensitive. Its label-space visualizations and Grad-CAM maps also show where predictions are more or less distinct and interpretable.

Performance across all diagnostic labels

  • RobECG-CL achieves the best average macro AUROC across all 37 labels and the most consistent overall discrimination, although the best model varies by label.It remains comparable to MoCo and GEM in macro AUPRC and F1; the evaluation uses pooled out-of-fold predictions from five folds.Source: §A.3 · pp. 8–9, Table 7 · p. 9

The real-world semantic prediction space

  • RobECG-CL separates CRBBB, SB, and LVH centroids, while AF and PAC centroids lie close together in the semantic space.The figure plots means of per-label logits projected into two-dimensional UMAP spaces; edges mark the strongest true-label co-occurrences.Source: §A.3 · p. 9, Figure 3 · p. 10

Impact of label imbalance

  • Labels with only one to five positive samples are sample-sensitive, and high AUROC may coexist with low AUPRC or zero F1.Five labels have one positive sample, while ten have two to five.Source: §A.3 · p. 10

Grad-CAM

  • Grad-CAM maps mainly highlight precordial leads and QRS complexes, but CRBBB lacks V1/V2 highlighting and STTC maps show no clear specificity.Maps for paced rhythm, PVC, and LVH were most interpretable; multiple diagnoses in one patient produced overlapping highlighted regions.Source: §A.3 · p. 10

B Synthetic dataset curation

The synthetic dataset balances layout and segmentation variants, then applies cumulative degradation in four progressive stages. The stages add realistic visual artifacts with increasing severity.

Dataset composition

  • The synthetic dataset balances two lead layouts and two segmentation strategies, with 50% in each layout and 50% synchronous versus asynchronous.The layouts are 2 × 6 with red grids and 4 × 3 with black-and-white grids.Source: B Synthetic dataset curation · p. 10

Progressive degradation

  • Severity 0 uses clean 224 × 224 renders; Severities 1–4 cumulatively add rotation, color shifts, cropping, noise, blur, and wrinkling.Continuous parameters inherited from the previous stage are incremented by Gaussian sampling; Table 8 summarizes configurations and implementations.Source: B Synthetic dataset curation · p. 10, Table 8 · p. 11

C Real-world dataset curation

The hospital cohort contains 312 scanned paper ECGs in an asynchronous 6 × 2 layout, retaining all 12 leads and acquisition timestamps. Images were de-identified, labeled, resized, and evaluated using nested five-fold cross-validation.

Cohort and image processing

  • The cohort contains 312 scanned ECGs collected at one Nanjing hospital between March and June 2026, with asynchronous 6 × 2 layouts retaining all 12 leads and timestamps.A Ricoh 8001 scanner was used, and the top of each image was cropped to remove machine parameters and personally identifiable information.Source: C Real-world dataset curation · p. 11

Annotation and preprocessing

  • Senior cardiologists provided preliminary opinions, and a Chief Physician conducted final annotation and labeling.A second-year graduate student performed image acquisition; images were converted to RGB and resized to a 384 × 224 canvas while preserving aspect ratio.Source: C Real-world dataset curation · p. 11

Evaluation

  • Evaluation used nested five-fold cross-validation, holding one outer fold out for testing and splitting the remaining data into training and validation sets.Source: C Real-world dataset curation · p. 11

D Baselines and implementations

Baseline pretraining and downstream fine-tuning use shared datasets and settings for comparison. Ordinal-pair distances measure geometric and appearance differences, with the appearance metric approximating rather than computing exact joint color transport.

D Baselines and implementations

  • SimCLR, MoCo, DINO, and BYOL serve as self-supervised pretraining baselines using 224 × 224 PTB-XL images and an ImageNet-initialized CvT-13 encoder.Experiments fixed seed 3407, used batch size 64, and ran on one NVIDIA RTX PRO 6000 GPU with 96 GB memory.Source: D Baselines and implementations · p. 11, Table 9 · p. 12
  • Downstream fine-tuning adds PULSE and GEM to the five pretrained baselines and uses 1% and 10% training data across five seeds.PULSE and GEM each contain 303.5M parameters.Source: D Baselines and implementations · p. 11

E Distances for ordinal pairs

  • Geometric distance measures image discrepancy using binary Canny edge maps and a symmetric Chamfer distance normalized by D.Source: E Distances for ordinal pairs · p. 12
  • Appearance distance averages per-channel Wasserstein-1 distances between marginal histograms in CIELAB space; it is efficient but not exact joint three-dimensional optimal transport.Source: E Distances for ordinal pairs · p. 13

F Ablation study

The ablation varies the rank-loss weight while holding the pretraining and evaluation settings fixed; λ = 0.5 provides the best overall balance between discriminative performance and robustness to progressive degradation.

F Ablation study

  • λ = 0.5 provides the best overall balance between discriminative performance and robustness to progressive degradation.Table 10 reports the ablation outcome.Source: F Ablation study · p. 13, Table 10 · p. 13
  • The ablation varies rank-loss weight λ while fixing the other settings, including set-positive aggregation, ranking margin 0.10, ordinal-edge separation 0.05, and frozen-encoder linear evaluation.Online augmentation is disabled, and the encoder is trained with an initial learning rate of 0.03.Source: F Ablation study · p. 13

G Supplementary related work

  • Waveform-based ECG-FM, ECGFounder, and CSFM are cited as pretrained references for low-label transfer across clinical tasks and data sources [12].These models operate on digital waveforms.Source: G Supplementary related work · p. 13
  • Image-based ECG models address image prediction and screening, while RobECG-CL learns consistent representations across progressively degraded views and preserves their relative degradation relationships [3] [8] [6] [2].The cited visual self-supervised approaches learn transferable representations from paired views, with or without explicit negative samples.Source: G Supplementary related work · p. 13
Loading 2609.39581v1…