Deep Metric Learning for the Hemodynamics Inference with Electrocardiogram Signals

Hyewon Jeong, Collin M. Stultz, Marzyeh Ghassemi

Abstract

Heart failure management relies on assessing cardiac pressures, typically through invasive right heart catheterization to measure mean pulmonary capillary wedge pressure (mPCWP). While accurate, this procedure carries risks. Non-invasive alternatives using electrocardiogram (ECG) signals show promise but often suffer from label scarcity and algorithmic bias. This paper introduces a Deep Metric Learning (DML) framework that leverages both labeled and unlabeled ECG data. By using triplet loss and novel distance-based mining, the proposed approach improves mPCWP estimation accuracy and significantly reduces performance disparities across demographic subgroups.

Introduction

Objective assessment of intracardiac pressures is critical for diagnosing and treating heart failure. The current gold standard, cardiac catheterization, is invasive and unsuitable for routine monitoring. While AI models trained on ECG signals offer a non-invasive alternative, they are often limited by the small size of datasets containing invasive pressure labels. Furthermore, standard supervised models frequently exhibit bias, performing less accurately on under-represented patient groups such as women or specific age brackets.

Methodology

The core of this research is the application of Deep Metric Learning (DML) to create a robust embedding space where ECGs representing similar physiological states are clustered together. The researchers explored two primary paradigms: supervised and self-supervised DML.

Overview of the DML framework: (a) Supervised DML using label-based triplet mining and (b) Self-supervised DML using distance-based mining (DTW) on unlabeled data.

Supervised DML

In the supervised setting, the model employs a Triplet Loss function. It selects an "anchor" ECG and learns to pull "positive" samples (those with similar mPCWP labels) closer in the embedding space while pushing "negative" samples (those with dissimilar labels) further away. To adapt this to a regression task, the authors introduced a Continuous Label-Based Mining method.

Self-Supervised DML with Distance-Based Mining

To utilize a massive dataset of 5.4 million unlabeled ECGs, the authors developed a novel self-supervised strategy. Instead of clinical labels, they used Dynamic Time Warping (DTW) and Euclidean distance to identify similar ECG signals. If two signals share a similar morphological rhythm, the model assumes they represent similar hemodynamic states. This "pre-training" allows the encoder to learn meaningful physiological features before any labeled data is introduced.

Datasets

The study utilized data from Massachusetts General Hospital and Brigham and Women’s Hospital:

  • Labeled Dataset: 8,172 12-lead ECGs matched with mPCWP values from catheterization.
  • Unlabeled Dataset: 5,426,614 general patient ECGs.
  • Baselines: The DML models were compared against standard supervised baselines and state-of-the-art self-supervised methods like SimCLR, CLOCS, and PCLR.

Key Results

Improved Predictive Accuracy

The Supervised DML model achieved a Root Mean Square Error (RMSE) of 7.15, significantly outperforming the supervised baseline (7.45) and contrastive baselines like SimCLR (7.58). For the classification task of detecting elevated mPCWP (>18 mmHg), the self-supervised DML model reached an AUC of 79.4, setting a new benchmark for self-supervised methods in this domain.

Advancing Algorithmic Fairness

A significant finding of this work is the reduction of demographic bias. Standard supervised models often show a "Gender Gap" in performance (up to 8.1 points in AUC). Supervised DML reduced this gap to 1.8 points, while the self-supervised version achieved near-perfect demographic parity (a gap of 0.0). By focusing on relative physiological similarity rather than absolute label matching, DML creates a more "physiologically universal" representation.

Conclusion and Future Work

Deep Metric Learning provides a powerful framework for non-invasive hemodynamic inference, effectively addressing both label scarcity and algorithmic bias. While these results are promising, future work is needed to validate the model on external public datasets and explore its utility for other hemodynamic measures. Additionally, adapting this framework for single-lead signals from wearable devices could eventually enable continuous, at-home monitoring for heart failure patients.

Summary updated

Abstract

Heart failure is a debilitating condition that affects millions of people worldwide and has a significant impact on their quality of life and mortality rates. An objective assessment of cardiac pressures remains an important method for the diagnosis and treatment prognostication for patients with heart failure. Although cardiac catheterization is the gold standard for estimating central hemodynamic pressures, it is an invasive procedure that carries inherent risks, making it a potentially dangerous procedure for some patients. Approaches that leverage non-invasive signals – such as the electrocardiogram (ECG) – have the promise to make the routine estimation of cardiac pressures feasible in both inpatient and outpatient settings. Prior models trained to estimate intracardiac pressures (e.g., mean pulmonary capillary wedge pressure (mPCWP)) in a supervised fashion have shown good discriminatory ability but have been limited to the labeled dataset from the heart failure cohort. Furthermore, obtaining large datasets for diverse patient cohorts with intracardiac pressure labels is challenging due to the invasive nature of the procedure. To address these issues and build a robust representation, we apply traditional deep metric learning (DML) and propose a novel self-supervised DML with distance-based mining that improves the performance of a model with limited labels. We use a dataset that contains over 5.4 million ECGs without concomitant central pressure labels to pre-train a self-supervised DML model which showed improved classification of elevated mPCWP compared to self-supervised contrastive baselines. Additionally, the supervised DML model that uses ECGs with access to 8,172 mPCWP labels demonstrated significantly better performance on the mPCWP regression task compared to the supervised baseline. Moreover, our data suggest that DML yields models that are performant across patient subgroups, even when some patient subgroups are under-represented in the dataset.
BibTeX
@inproceedings{jeong2023deep,
  author = {Hyewon Jeong and Collin M. Stultz and Marzyeh Ghassemi},
  title = {{Deep Metric Learning for the Hemodynamics Inference with Electrocardiogram Signals}},
  booktitle = {MLHC},
  year = {2023},
  url = {https://openreview.net/forum?id=2j2cKE6mWO},
}
Figure