Learning from VAE Errors to support ECG-based Differential Diagnosis of Myocardial Scar
Organizations: Department of Mathematics, Informatics, and Geosciences, University of Trieste, Italy · Centre of Diagnosis and Management of Cardiomyopathies; Azienda Sanitaria Universitaria Giuliano Isontina; University of Trieste, Italy; Member of Ern Guard-Heart · Department of Medical, Surgical and Health Sciences, University of Trieste, Italy
Abstract
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.
Figures & tables
| Model (CV) | Normalization | Sensitivity | Specificity | Accuracy | AUROC |
|---|---|---|---|---|---|
| Random Forest (5-Fold CV) | Factor-wise | 0.852 0.049 | 0.389 0.074 | 0.657 0.036 | 0.686 0.053 |
| Random Forest (80/20 Split) | Factor-wise | 0.858 0.048 | 0.394 0.086 | 0.664 0.042 | 0.676 0.047 |
| Random Forest (LOSO) | None | 0.873 0.024 | 0.380 0.044 | 0.666 0.028 | 0.672 0.032 |
| Gradient Boosting (LOSO) | Patient-wise | 0.868 0.026 | 0.383 0.046 | 0.664 0.029 | 0.657 0.033 |
| Logistic Regression (LOSO) | Patient-wise | 0.880 0.025 | 0.340 0.042 | 0.653 0.028 | 0.644 0.032 |
| Model (CV, input) | Normalization | Sensitivity | Specificity | Accuracy | AUROC |
|---|---|---|---|---|---|
| Logistic Regression (80/20, DTW errors) | Lead-wise | 0.885 0.078 | 0.191 0.115 | 0.596 0.030 | 0.643 0.068 |
| Extra Trees (80/20, DTW errors) | Lead-wise/None | 0.815 0.067 | 0.383 0.089 | 0.635 0.052 | 0.638 0.066 |
| Logistic Regression (5-Fold CV, DTW errors) | Lead-wise | 0.895 0.078 | 0.188 0.108 | 0.597 0.038 | 0.637 0.081 |
| Extra Trees (5-Fold CV, DTW errors) | Lead-wise/None | 0.801 0.067 | 0.373 0.100 | 0.621 0.057 | 0.626 0.088 |
| Logistic Regression (LOSO, DTW errors) | None | 0.753 0.032 | 0.431 0.042 | 0.618 0.027 | 0.624 0.032 |
| Gradient Boosting (LOSO, latents) | Patient-wise | 0.775 0.033 | 0.308 0.041 | 0.579 0.029 | 0.577 0.034 |