Learning ECG Image Representations via Dual Physiological-Aware Alignments

Hung Manh Pham, Jialu Tang, Aaqib Saeed, Dong Ma, Bin Zhu, Pan ZhouarXiv 2026

TL;DR

ECG-Scan is a new self-supervised framework that allows AI models to accurately interpret electrocardiogram (ECG) images—such as paper printouts or scans—without needing raw digital signal data. By aligning image features with gold-standard signal and text representations and enforcing fundamental electrophysiological laws during training, ECG-Scan bridges the performance gap between image-based analysis and raw signal foundation models, even outperforming human residents in zero-shot diagnostic tasks.

What Problem Does This Paper Address?

Electrocardiograms (ECGs) are the standard non-invasive tool for diagnosing cardiac conditions. While modern hospitals increasingly use digital systems that record raw 12-lead signal data, billions of historical and active ECG records across the globe exist solely on paper or as static images (PDFs/JPEGs). This is especially true in resource-constrained regions and the Global South.

Figure 1: (a) Common ECG acquisition in a clinical environment, where an ECG machine is connected to a printer to get a paper-based document for patients. Optionally, a local scanner might be connected for digital archive (images, in PDF), depending on the ECG machine types and hardware systems. (b) Patient capturing of ECG printouts using a smartphone camera (or a scanner), resulting in an image-based ECG for their own long-term archive. (c) Possible remote review of ECG images during consultation service, where expert clinicians interpret in-depth cardiac patterns from shared ECG images.

Most state-of-the-art automated ECG analysis models require direct access to raw digital signals. Existing image-based methods typically rely on generic vision encoders (which look for semantic objects rather than dense waveforms) or brittle, multi-step digitization pipelines that fail when faced with real-world noise, artifacts, or grid variations. The challenge is that ECG images encode temporal cardiac dynamics implicitly through spatial layouts, often showing only truncated snippets (e.g., 2.5 seconds) of individual leads.

The authors ask: Can we use self-supervised learning to train an image encoder that extracts generalized, clinically rich representations directly from ECG images alone?

Methods

The authors introduce ECG-Scan, a multimodal self-supervised framework that uses privileged digital signal and text data during pretraining to guide an image encoder.

Figure 2: Illustration of ECG-Scan. We present a multimodal framework that aligns ECG images, signals, and clinical texts through dual physiological-aware alignment strategy.

The architecture relies on two core components, termed Dual Physiological-Aware Alignments:

  1. Gramian-based Contrastive Alignment (Latent Space): Instead of just matching images to text pairs, the model uses a pre-trained, frozen signal encoder (D-BETA) and text encoder (Bio-Med-CPT) as "teachers." It optimizes a standard image-text contrastive loss alongside a Gramian-based three-way alignment loss. This loss measures the volume spanned by the image, text, and signal embeddings, forcing the image encoder to capture higher-order geometric and relational structures inherent to raw cardiac signals.

  2. Soft-Lead Consistency Alignment (Time-Series Space): The framework includes a signal decoder that attempts to reconstruct the full 10-second, 12-lead digital signal from the image representation. To ensure the reconstructed waveforms make medical sense, the authors introduce a regularization loss based on Einthoven’s Law and Goldberger’s Equations. These mathematical rules define how different ECG limb leads physically relate to one another. Rather than enforcing them as rigid, hard constraints (which would destabilize training due to image noise), they are applied as soft constraints to guide the model toward physiologically plausible configurations.

Figure 3: Illustration of Einthoven’s Law and Goldberger’s equations for limb leads of ECG signals.

Datasets

  • Pretraining: MIMIC-IV-ECG, a large-scale dataset containing 789,511 paired 12-lead ECG signals and free-text clinical reports. Because large-scale datasets of real clinical ECG photographs are scarce, the authors dynamically rendered the raw signals into diverse, synthetic ECG images on-the-fly during training, applying stochastic augmentations (geometric warps, noise, contrast shifts, and grid style variations) to mimic real-world paper printouts.
  • Downstream Evaluation: Four widely recognized public benchmarks were used to test the model on various cardiac abnormalities: PTB-XL (split into Super-class, Sub-class, Form, and Rhythm subsets), CPSC2018, CSN, and CODE-test.

Key Insights and Ideas

  • Signals as Privileged Information: The core "aha moment" is that we don't need to explicitly digitize an image to understand it. By forcing an image encoder's latent space to align with a well-trained signal-text foundation model, the vision model implicitly inherits deep electrophysiological and clinical knowledge.
  • Soft vs. Hard Physical Constraints: Real-world ECG recordings contain noise and artifacts that violate strict physical laws. Applying Einthoven's and Goldberger's equations as a soft regularization during signal reconstruction provides the perfect balance—it guides the model to maintain inter-lead consistency without causing the optimization to fail when images are imperfect.
  • Robustness to Truncation: Signal-based models suffer a significant performance drop (~5%) if given truncated 2.5-second signals instead of full 10-second strips. ECG-Scan circumvents this because its image encoder learns global context from the entire visual layout simultaneously, making it inherently more robust to the spatial truncation common in printed ECG formats.

Key Results

ECG-Scan was evaluated using both linear probing (evaluating the frozen representations with a simple linear classifier) and zero-shot classification (matching image embeddings directly to text labels without fine-tuning).

  • Linear Probing: ECG-Scan consistently outperformed general and medical image baselines (like CLIP and MedSigLIP) as well as state-of-the-art image-to-signal digitization pipelines (nnU-Net + D-BETA), showing an absolute improvement of ~3% in 10% and 100% labeled data settings. It closely approached the performance of top-tier signal foundation models that require raw digital data.
  • Zero-Shot Diagnosis: On the CODE-test dataset, ECG-Scan achieved a remarkable 94.78% AUC, outperforming strong signal-text models like MERL (85.14%) and surpassing human medical experts, including cardiology residents (92.07%) and emergency residents (90.52%).
  • Ablation Verification: Removing either the Gramian-based loss or the soft-lead consistency loss resulted in noticeable performance drops, confirming that both latent-space alignment and time-series physical constraints are vital for learning generalized features.

Limitations and Future Work

While ECG-Scan achieves impressive results, the authors note a few limitations:

  • Synthetic Pretraining: The pretraining phase relies entirely on synthetically generated ECG images rather than a large dataset of real-world clinical photographs taken "in the wild" (e.g., crumpled paper, varied lighting, smartphone camera angles).
  • Future Directions: The next step for this research is to scale the pretraining framework using emerging real-world clinical image datasets as they become publicly available, ensuring robust validation under diverse, unconstrained real-world imaging conditions.

Summary updated

BibTeX
@misc{pham2026learning,
  author = {Hung Manh Pham and Jialu Tang and Aaqib Saeed and Dong Ma and Bin Zhu and Pan Zhou},
  title = {{Learning ECG Image Representations via Dual Physiological-Aware Alignments}},
  year = {2026},
  eprint = {2604.01526},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.01526},
}
Figure