Source-linked AI summary

Learning from VAE Errors to support ECG-based Differential Diagnosis of Myocardial Scar

Shayan Sharifi, Riccardo Treu, Ilaria Gandin, Federico Garoia, Marco Merlo, Giulia Cisotto

arXiv:2609.05294v1cs.LGstat.ML

TL;DR

LGE is clinically useful for myocardial-scar assessment, but limited CMR accessibility motivates ECG-based screening. This study compares ECGx.AI and a shallower β-VAE, finding that latent features and DTW reconstruction errors discriminate LGE+ from LGE- patients, with error-based representations offering a compact screening alternative.

  • Problem

    Limited accessibility of CMR motivates ECG-based screening for LGE-defined myocardial scar in cardiomyopathy patients.

  • Method

    The study compares LGE classification using ECGx.AI and a shallower β-VAE trained on normal ECGs, alongside DTW-based reconstruction errors.

  • Results

    ECGx.AI achieved AUROC 0.686 with Random Forest, the proposed β-VAE achieved AUROC 0.577 with Gradient Boosting, and DTW errors achieved AUROC 0.643 with Logistic Regression.

  • Takeaways & Limitations

    DTW-based errors from a lighter β-VAE captured meaningful scar-related anomalies and provided a compact, interpretable alternative for assisting CMR prioritization.

  • Takeaways & Limitations

    External multi-center validation, clinical-variable integration, and improved reconstruction-classification balancing remain necessary to assess and improve clinical utility.

Abstract

from arXiv · show

Late Gadolinium Enhancement (LGE) on cardiac magnetic resonance is a key marker of myocardial scar, but its limited accessibility motivates routine ECG-based screening. We evaluated whether $β$-variational autoencoder (VAE)-derived ECG representations can discriminate LGE+ from LGE- cardiomyopathic patients in a local cohort of 300 subjects. We compared 32-dimensional features from the foundation ECGx.AI model with those from a shallower $β$-VAE trained on normal PTB-XL ECGs, evaluating downstream classification and Dynamic Time Warping (DTW)-based reconstruction errors. ECGx.AI reached an area under ROC of 0.686 with Random Forest, while the proposed $β$-VAE reached 0.577 with sensitivity of 0.775 with Gradient Boosting. Notably, DTW-reconstruction errors significantly differed between classes in 10 out of 12 leads according to Mann-Whitney U test and help in classification, leading to an area under ROC of 0.643 with Logistic Regression, supporting their potential as markers of scar-related ECG alterations.

1 Introduction and state of the art

LGE-visible myocardial scar is clinically useful but difficult to assess because CMR is costly and not uniformly available. ECG-based machine learning is therefore investigated as a screening approach for imaging-defined cardiac abnormalities.

  • CMR-detectable myocardial fibrosis and scar support diagnosis, risk stratification, and clinical decision-making in cardiomyopathies.
  • CMR is costly, time-consuming, and not uniformly available, motivating ECG-based screening to prioritize patients for evaluation.
  • Fibrosis and focal scar may alter ventricular depolarization and repolarization, producing subtle QRS, ST-segment, and T-wave changes.
  • Deep learning has inferred imaging-defined cardiac phenotypes from ECG, but supervised approaches require large disease-specific labelled datasets.

2 Materials and Methods

The study compares ECG representations from a pretrained foundation β-VAE and a shallower β-VAE trained on normal ECGs, then evaluates classifiers and DTW-based reconstruction errors for LGE discrimination. The pipeline varies representations, normalization, models, and validation while testing whether reconstruction errors differ between LGE classes.

  • Datasets and preprocessing: The local cohort contained 300 patients with 10-second 12-lead ECGs, including 174 LGE+ and 126 LGE- cases; 3000 normal PTB-XL ECGs trained the proposed model.
  • Baseline foundation model: The ECGx.AI baseline uses a 32-dimensional latent space, seven-layer convolutional encoder and decoder, and training on 1.1 million ECGs from an unselected clinical population.
  • Proposed β-VAE model: The proposed β-VAE has four encoder layers, four decoder layers, a deterministic decoder, and training exclusively on normal PTB-XL ECGs.
  • Reconstruction-error representation: The proposed model reconstructed local-cohort ECGs and converted lead-wise block-wise DTW errors into a 12-dimensional feature vector per subject.
  • Representative reconstructions: Representative reconstructions showed higher MSE and DTW errors for LGE+ than LGE- samples in Lead II.
  • Downstream classification: Classification varied input representation, normalization, machine-learning model, and cross-validation strategy, using five classifiers and multiple validation schemes.
  • Validation and tuning: Hyperparameters were tuned within outer validation splits using inner three-fold grid search, while identical data splits were maintained across representations and models.
  • Statistical analysis: A two-tailed Mann-Whitney U test assessed lead-wise differences in DTW reconstruction-error distributions between LGE+ and LGE- patients.

3 Results and Discussion

ECGx.AI latent features achieved the strongest classification performance, while DTW-based reconstruction errors substantially improved the shallow β-VAE pipeline and differed between LGE classes across nearly all leads.

  • 0.686 AUROC was achieved by ECGx.AI with Random Forest, alongside 0.657 accuracy and 0.852 sensitivity.The corresponding specificity was 0.389.
  • 0.577 AUROC and 0.775 sensitivity were achieved by the shallow β-VAE with Gradient Boosting.
  • 0.643 AUROC was reached by Logistic Regression when DTW-based reconstruction errors were used as shallow β-VAE input features.Extra Trees achieved 0.635 accuracy and 0.383 specificity with the same error-based representation.
  • Significant DTW-reconstruction-error distribution differences were found between LGE+ and LGE- patients in all but two leads.The comparison used a two-sided non-parametric Mann-Whitney U test.

4 Conclusions

The study evaluated ECG-derived representations for distinguishing LGE-defined myocardial scar in cardiomyopathy patients and compared a foundation encoder with a lighter β-VAE and its reconstruction errors. The results suggest that DTW-based errors can capture scar-related anomalies and offer a compact, interpretable screening alternative, although further validation is needed.

  • The study compared ECGx.AI and a shallower β-VAE for LGE+ versus LGE- classification and evaluated DTW-based reconstruction errors for discrimination.
  • DTW-based reconstruction errors from the lighter β-VAE captured meaningful scar-related anomalies, whereas foundation representations had stronger latent discriminative capacity.
  • Error-based representation learning provided a compact and interpretable screening alternative to assist CMR prioritization.
  • External multi-center validation, clinical-variable integration, and improved balancing of reconstruction and classification objectives remain necessary to assess and improve clinical utility.
Loading 2609.05294v1…