Multimodal contrastive learning for diagnosing cardiovascular diseases from electrocardiography (ECG) signals and patient metadata

Tue Minh Cao, Nhat Hong Tran, Phi Le Nguyen, Hieu H. PhamarXiv 2023 · DOI

Introduction

The 12-lead electrocardiogram (ECG) remains the clinical gold standard for diagnosing cardiovascular diseases, providing a comprehensive spatial view of the heart's electrical activity. However, the proliferation of wearable technology—such as smartwatches and portable monitors—often limits data collection to a fraction of these leads (typically 1 to 6). This "missing leads problem" creates a significant gap between high-fidelity clinical diagnostics and the practical constraints of remote monitoring. Traditional machine learning approaches often treat limited-lead data as a standalone input, essentially accepting the inherent information loss. This research explores a novel alternative: can we leverage the rich information in 12-lead ECGs to guide and improve models that operate on restricted data?

Methodology: A Two-Step Contrastive Framework

The researchers propose a multimodal contrastive learning approach designed to transfer knowledge from a feature-rich "teacher" environment to a data-constrained "student" environment. The framework is divided into two distinct phases.

Step 1: Establishing the Gold Standard

In the first step, a model is trained using the full 12-lead ECG signals alongside relevant patient metadata (age, sex, height, and weight). The architecture utilizes InceptionTime, a specialized 1D-Convolutional Neural Network (CNN), to extract deep features from the raw signals. Simultaneously, patient metadata is processed through 1D-Conv layers. These features are concatenated and passed through a projection head into an embedding space. Finally, a "pseudo-classifier" (a Multi-Layer Perceptron) maps these embeddings to diagnostic labels. This phase establishes a high-quality latent representation of the cardiac state.

Step 2: Knowledge Transfer via Embedding Alignment

The second step focuses on training a model for a reduced number of leads (e.g., 2, 3, or 6 leads). To ensure the reduced model retains as much diagnostic power as possible, the weights of the pseudo-classifier from Step 1 are frozen.

The core innovation lies in the loss function. In addition to standard classification loss, the authors introduce a similarity loss (Sim). This loss forces the embedding generated from the limited-lead ECG to align closely with the embedding generated from the corresponding 12-lead ECG of the same patient. By minimizing the distance between these two representations in the latent space, the model learns to extract "12-lead-like" features even when the physical sensors are missing.

The two-step contrastive learning framework for knowledge transfer from 12-lead to limited-lead ECG models.

Data and Experimental Setup

The framework was evaluated using the PTB-XL dataset, a large-scale public collection of over 21,000 12-lead ECG recordings. Each recording is 10 seconds long and is associated with "super-diagnostic" labels representing major heart conditions. A key component of this study is the inclusion of patient metadata (weight, height, age, and gender), which provides critical context that may compensate for missing electrical leads.

Results and Discussion

The performance of the proposed method was measured using Macro-AUC. The results demonstrate a consistent improvement across all lead configurations when contrastive learning (pseudo=True) is applied compared to traditional training (pseudo=False).

Comparison of Macro-AUC scores between traditional training and the proposed contrastive learning method across different lead counts.

A striking observation from the results is that the 4-lead model using contrastive learning (0.9227) outperformed the 6-lead model trained traditionally (0.9007). This suggests that the quality of the latent representation and the guidance from the 12-lead "teacher" can effectively overcome the physical absence of sensors. The model learns to infer missing spatial information by identifying patterns in the available leads that correlate with the full 12-lead signature.

Conclusion

This research highlights the potential of contrastive learning to bridge the gap between clinical-grade diagnostics and consumer-grade hardware. By treating the 12-lead model as a guide in the embedding space, the researchers have developed a way to "distill" complex cardiac knowledge into simpler models. Future work may involve exploring more sophisticated similarity metrics or testing the framework on heterogeneous hardware to account for real-world signal noise. Ultimately, this approach paves the way for more accurate heart monitoring in everyday wearable devices.

Summary updated

Abstract

This work discusses the use of contrastive learning and deep learning for diagnosing cardiovascular diseases from electrocardiography (ECG) signals. While the ECG signals usually contain 12 leads (channels), many healthcare facilities and devices lack access to all these 12 leads. This raises the problem of how to use only fewer ECG leads to produce meaningful diagnoses with high performance. We introduce a simple experiment to test whether contrastive learning can be applied to this task. More specifically, we added the similarity between the embedding vectors when the 12 leads signal and the fewer leads ECG signal to the loss function to bring these representations closer together. Despite its simplicity, this has been shown to have improved the performance of diagnosing with all lead combinations, proving the potential of contrastive learning on this task.
BibTeX
@misc{cao2023multimodal,
  author = {Tue Minh Cao and Nhat Hong Tran and Phi Le Nguyen and Hieu H. Pham},
  title = {{Multimodal contrastive learning for diagnosing cardiovascular diseases from electrocardiography (ECG) signals and patient metadata}},
  year = {2023},
  eprint = {2304.11080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.11080},
}
Figure