Boosting Masked ECG-Text Auto-Encoders as Discriminative Learners

Manh Cuong Pham, Aaqib Saeed, Dong Ma · DOI

Abstract

The accurate interpretation of Electrocardiogram (ECG) signals is pivotal for diagnosing cardiovascular diseases. Integrating ECG signals with accompanying textual reports further holds immense potential to enhance clinical diagnostics by combining physiological data and qualitative insights. However, this integration faces significant challenges due to inherent modality disparities and the scarcity of labeled data for robust cross-modal learning. To address these obstacles, we propose D-BETA, a novel framework that pre-trains ECG and text data using a contrastive masked auto-encoder architecture. D-BETA uniquely combines the strengths of generative with boosted discriminative capabilities to achieve robust cross-modal representations. This is accomplished through masked modality modeling, specialized loss functions, and an improved negative sampling strategy tailored for cross-modal alignment. Extensive experiments on five public datasets across diverse downstream tasks demonstrate that D-BETA significantly outperforms existing methods, achieving an average AUC improvement of 15% in linear probing with only one percent of training data and 2% in zero-shot performance without requiring training data over state-of-the-art models. These results highlight the effectiveness of D-BETA, underscoring its potential to advance automated clinical diagnostics through multi-modal representations.

Introduction

Interpreting Electrocardiograms (ECGs) is a cornerstone of cardiac care, yet training deep learning models for this task typically requires massive amounts of expertly labeled data. While self-supervised learning (SSL) has leveraged unlabeled data, most methods focus exclusively on the ECG signal, neglecting the rich clinical context in accompanying textual reports. Existing multi-modal (ECG + Text) models face two major hurdles: modality disparity, where fundamentally different data types are difficult to align, and the "Normal ECG" problem. In medical datasets, many patients share nearly identical "Normal ECG" reports; standard contrastive learning often treats these identical clinical conditions as negatives, confusing the model and degrading performance.

D-BETA addresses these challenges by combining generative masking with a refined contrastive loss and a sophisticated negative sampling strategy. This hybrid approach enables state-of-the-art performance in zero-shot diagnosis, even surpassing human cardiology residents on key benchmarks.

Methodology

D-BETA is designed as a hybrid architecture that functions as both a generative and discriminative learner. It utilizes a Transformer-based encoder for ECG signals and a pre-trained Flan-T5 model for text, fused via a cross-attention module to learn correspondences between signals and clinical terms.

The D-BETA architecture integrates generative masked auto-encoding with discriminative cross-modal alignment via a fusion module.

Generative and Discriminative Learning

The framework employs Masked ECG Modeling (MEM) and Masked Language Modeling (MLM) to force the model to understand fine-grained data structures. To enhance discriminative power, D-BETA uses an ECG-Text Sigmoid (ETS) loss, which treats every ECG-text pair as an independent binary classification task, avoiding the memory constraints of standard softmax-based contrastive losses.

Nearest-neighbor-based Negative Sampling (N3S)

A core innovation is the N3S strategy. Instead of random negative sampling, the model uses FAISS to identify "hard negatives"—text reports that are semantically similar but not identical to the target. This prevents the model from being penalized for recognizing identical clinical conditions (like "Normal Sinus Rhythm") across different patients, leading to more robust representations.

The N3S strategy identifies hard negatives in the Flan-T5 feature space to improve cross-modal alignment and discriminative robustness.

Experimental Setup

The model was pre-trained on the MIMIC-IV-ECG database, comprising approximately 800,000 ECG-text pairs. Evaluation was conducted across five diverse public datasets: PhysioNet 2021, PTB-XL, CSN, CPSC2018, and the expert-labeled CODE-test benchmark.

Results

D-BETA demonstrates exceptional efficiency and accuracy across multiple evaluation metrics:

  • Low-Data Efficiency: In linear probing with only 1% of training data, D-BETA achieved a 15% average AUC improvement over previous state-of-the-art models.
  • Zero-Shot Performance: D-BETA outperformed the previous best model (MERL) by an average of 2% in zero-shot tasks. On the CODE-test dataset, it reached a 96.79% AUC, surpassing cardiology residents (92.07%) and medical students (93.61%).
  • Lead Flexibility: The model maintains high accuracy even in reduced-lead configurations (e.g., 1-lead or 3-lead), which is vital for wearable applications.

Discussion and Conclusion

The success of D-BETA highlights that generative and discriminative objectives are complementary; simultaneous training allows the model to capture local signal patterns while maintaining a high-level understanding of pathologies. Furthermore, the use of instruction-tuned LLMs like Flan-T5 significantly enhances the handling of complex medical terminology. While pre-training is computationally intensive, the resulting model offers a powerful tool for automated clinical diagnostics. Future work may extend this framework to other modalities, such as echocardiograms, or utilize LLMs to generate synthetic clinical explanations to further refine zero-shot capabilities.

Summary updated

BibTeX
@inproceedings{pham2025boosting,
  author = {Manh Cuong Pham and Aaqib Saeed and Dong Ma},
  title = {{Boosting Masked ECG-Text Auto-Encoders as Discriminative Learners}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=mM65b81LdM},
}
Figure