Table of Contents
Fetching ...

Anomaly Detection in Electrocardiograms: Advancing Clinical Diagnosis Through Self-Supervised Learning

Aofan Jiang, Chaoqin Huang, Qing Cao, Yuchen Xu, Zi Zeng, Kang Chen, Ya Zhang, Yanfeng Wang

TL;DR

This work tackles the challenge of detecting a broad spectrum of ECG anomalies, including rare cases, by reframing anomaly detection as a self-supervised task trained solely on normal ECGs. The authors introduce a masking/restoration framework with a multi-scale cross-attention mechanism and couple it with a trend-aware restoration stream and an attribute prediction module that leverages ECG reports (e.g., age, gender) to reduce inter-patient variability. Evaluated on a large real-world clinical dataset of 478,803 ECG reports, the method achieves AUROC of 91.2% for anomaly detection and Dice of 65.3% for localization, significantly outperforming state-of-the-art baselines across common, uncommon, and rare anomaly subsets. The approach demonstrates strong clinical potential for accurate detection and precise localization, with implications for real-world deployment and opportunities for multi-modal extensions and long-term ECG data integration.

Abstract

The electrocardiogram (ECG) is an essential tool for diagnosing heart disease, with computer-aided systems improving diagnostic accuracy and reducing healthcare costs. Despite advancements, existing systems often miss rare cardiac anomalies that could be precursors to serious, life-threatening issues or alterations in the cardiac macro/microstructure. We address this gap by focusing on self-supervised anomaly detection (AD), training exclusively on normal ECGs to recognize deviations indicating anomalies. We introduce a novel self-supervised learning framework for ECG AD, utilizing a vast dataset of normal ECGs to autonomously detect and localize cardiac anomalies. It proposes a novel masking and restoration technique alongside a multi-scale cross-attention module, enhancing the model's ability to integrate global and local signal features. The framework emphasizes accurate localization of anomalies within ECG signals, ensuring the method's clinical relevance and reliability. To reduce the impact of individual variability, the approach further incorporates crucial patient-specific information from ECG reports, such as age and gender, thus enabling accurate identification of a broad spectrum of cardiac anomalies, including rare ones. Utilizing an extensive dataset of 478,803 ECG graphic reports from real-world clinical practice, our method has demonstrated exceptional effectiveness in AD across all tested conditions, regardless of their frequency of occurrence, significantly outperforming existing models. It achieved superior performance metrics, including an AUROC of 91.2%, an F1 score of 83.7%, a sensitivity rate of 84.2%, a specificity of 83.0%, and a precision of 75.6% with a fixed recall rate of 90%. It has also demonstrated robust localization capabilities, with an AUROC of 76.5% and a Dice coefficient of 65.3% for anomaly localization.

Anomaly Detection in Electrocardiograms: Advancing Clinical Diagnosis Through Self-Supervised Learning

TL;DR

This work tackles the challenge of detecting a broad spectrum of ECG anomalies, including rare cases, by reframing anomaly detection as a self-supervised task trained solely on normal ECGs. The authors introduce a masking/restoration framework with a multi-scale cross-attention mechanism and couple it with a trend-aware restoration stream and an attribute prediction module that leverages ECG reports (e.g., age, gender) to reduce inter-patient variability. Evaluated on a large real-world clinical dataset of 478,803 ECG reports, the method achieves AUROC of 91.2% for anomaly detection and Dice of 65.3% for localization, significantly outperforming state-of-the-art baselines across common, uncommon, and rare anomaly subsets. The approach demonstrates strong clinical potential for accurate detection and precise localization, with implications for real-world deployment and opportunities for multi-modal extensions and long-term ECG data integration.

Abstract

The electrocardiogram (ECG) is an essential tool for diagnosing heart disease, with computer-aided systems improving diagnostic accuracy and reducing healthcare costs. Despite advancements, existing systems often miss rare cardiac anomalies that could be precursors to serious, life-threatening issues or alterations in the cardiac macro/microstructure. We address this gap by focusing on self-supervised anomaly detection (AD), training exclusively on normal ECGs to recognize deviations indicating anomalies. We introduce a novel self-supervised learning framework for ECG AD, utilizing a vast dataset of normal ECGs to autonomously detect and localize cardiac anomalies. It proposes a novel masking and restoration technique alongside a multi-scale cross-attention module, enhancing the model's ability to integrate global and local signal features. The framework emphasizes accurate localization of anomalies within ECG signals, ensuring the method's clinical relevance and reliability. To reduce the impact of individual variability, the approach further incorporates crucial patient-specific information from ECG reports, such as age and gender, thus enabling accurate identification of a broad spectrum of cardiac anomalies, including rare ones. Utilizing an extensive dataset of 478,803 ECG graphic reports from real-world clinical practice, our method has demonstrated exceptional effectiveness in AD across all tested conditions, regardless of their frequency of occurrence, significantly outperforming existing models. It achieved superior performance metrics, including an AUROC of 91.2%, an F1 score of 83.7%, a sensitivity rate of 84.2%, a specificity of 83.0%, and a precision of 75.6% with a fixed recall rate of 90%. It has also demonstrated robust localization capabilities, with an AUROC of 76.5% and a Dice coefficient of 65.3% for anomaly localization.
Paper Structure (36 sections, 9 equations, 5 figures, 6 tables)

This paper contains 36 sections, 9 equations, 5 figures, 6 tables.

Figures (5)

  • Figure 1: The self-supervised ECG anomaly detection framework utilizing both ECG signals and ECG reports.
  • Figure 2: Anomaly localization visualization in a 12-lead ECG illustrating ventricular tachycardia and premature ventricular contraction, with ground truth marked by red boxes. Localization results are compared with a leading method, scored between 0 to 1 to indicate anomaly likelihood.
  • Figure 3: Ablation studies evaluating the impact of masking and restoring (MR), multi-scale cross-attention (MC), trend assisted restoration (TAR), and the attribute prediction module (APM) on various test sets.
  • Figure A.1: The details of multi-scale cross-restoration framework for ECG anomaly detection.
  • Figure A.2: Evaluation of the attribute prediction module: A) Comparison of predicted ages across different age groups for normal and abnormal ECGs; B) Age classification accuracy for normal ECGs depicted across age ranges, showing predicted versus actual age; C) Heart rate prediction deviation compared to a standard reference range (y-axis) across varying anomaly rarity (x-axis); D-G) Analysis of deviations in PR interval, QT interval, corrected QT interval, and QRS complex predictions.