Automatic Detection of Noisy Electrocardiogram Signals without Explicit Noise Labels

Radhika Dua, Jiyoung Lee, Joon-myoung Kwon, Edward Choi

TL;DR

This paper introduces a two-stage, unsupervised deep learning framework to automatically detect noisy electrocardiogram (ECG) signals without requiring explicit noise labels during training. By combining a 1D Convolutional Auto-encoder trained purely on clean data with a cluster-conditioned Mahalanobis distance metric, the method effectively flags both slightly and heavily corrupted ECG samples, even demonstrating strong transferability to unseen datasets.

What Problem Does This Paper Address?

Electrocardiograms (ECGs) are vital tools for diagnosing cardiovascular diseases, yet real-world ECG collections are frequently plagued by noise artifacts like muscle movement, power line interference, and baseline wander. Medical professionals categorize these signals into three tiers: Level 1 (clean), Level 2 (slightly noisy), and Level 3 (unusable/very noisy).

Examples of ECG noise levels across datasets

Noisy data wastes clinicians' time during manual reviews and severely degrades the performance of automated deep learning diagnostic models. While prior research attempted to classify noise types, those methods typically relied on synthetic, artificially injected noise, which rarely matches real-world conditions. This paper tackles the challenge of automatically filtering out Level 2 and Level 3 noise using only clean data for training, eliminating the need for tedious, expert-annotated noise labels.

Methods

The authors frame noise detection as an Out-of-Distribution (OOD) detection problem and propose a two-stage framework:

  1. Stage 1: Latent Feature Extraction
    The authors train a 1D Convolutional Auto-encoder (CAE) solely on clean (Level 1) ECG signals. The network learns to compress the input into a low-dimensional latent space and reconstruct it. Because it only learns the distribution of clean data, its latent space naturally organizes clean features efficiently.

  2. Stage 2: Cluster-Conditioned Detection
    Instead of relying purely on reconstruction error (a standard but often flawed baseline), the authors extract the latent features of the clean training data and split them into $m$ clusters using a Gaussian Mixture Model (GMM). For any new test sample, they compute its Mahalanobis distance to the nearest cluster center. Samples that fall too far from any clean cluster are flagged as noisy.

To boost robustness, the authors implement an Ensembling approach, running the GMM clustering multiple times with different numbers of clusters ($m$) and averaging the resulting noise scores.

Datasets

The framework was validated on two distinct datasets:

  • BUTQDB (Brno University of Technology ECG Quality Database): A publicly available dataset containing expert-annotated ECGs from 15 subjects. It includes 22,828 clean samples, 4,568 Level 2 samples, and 1,150 Level 3 samples.
  • Private ECG Dataset: A dataset collected from 2,927 subjects in Asia, featuring a balanced set of 1,314 clean samples alongside 172 Level 2 and 172 Level 3 noisy samples.

Key Insights and Ideas

  • Noise as an Out-of-Distribution Phenomenon: Treating noise detection as an OOD task allows the model to succeed without ever seeing a single noisy sample during training.
  • Latent Space Geometry: Principal Component Analysis (PCA) visualizations reveal that Level 2 (slightly noisy) samples cluster tightly around clean samples, whereas Level 3 samples are significantly warped and shifted away. This geometric reality explains why Level 3 samples are dramatically easier to detect.
Figure 2. (top) PCA visualization of clean (Level 1) samples from BUTQDB and Private ECG datasets to demonstrate the location of clean samples. (bottom) PCA visualization of clean (Level 1) samples overlapped by PCA visualization of noisy samples (Level 2 and Level 3) from BUTQDB and Private ECG datasets to demonstrate the location of Level 2 and Level 3 samples relative to Level 1 samples. In both the datasets, Level 3 samples are more shifted from the Level 1 samples compared to Level 2 samples
  • The Value of Pre-training for Transfer Learning: Directly transferring a model from one dataset to another without modification (zero-shot) fails due to distribution shifts caused by different equipment or patient demographics. However, pre-training on a large public dataset (BUTQDB) and fine-tuning on a tiny fraction of target data yields much better results than training on the target dataset from scratch.

Key Results

The proposed ensemble method consistently outperformed standard baselines, such as using pure CAE reconstruction error or a Convolutional Variational Auto-encoder (CVAE) log-probability score.

  • BUTQDB Performance: For highly noisy (Level 3) samples, the ensemble method achieved an AUROC of 95.84% and an AUPRC of 94.25%, vastly outperforming the CAE reconstruction baseline (84.43% AUROC). For the trickier Level 2 samples, it still achieved a respectable 77.82% AUROC.
  • Private Dataset Performance: The ensemble method achieved an AUROC of 80.25% on Level 3 samples and 74.28% on Level 2 samples.
  • Transferability: When transferring the BUTQDB-trained model to the Private ECG dataset, fine-tuning on just 40% of the target dataset's clean samples was enough to unlock strong noise-detection capabilities, outperforming baselines trained entirely from scratch on the private data.

Limitations and Future Work

While the model excels at catching severely corrupted Level 3 signals, detecting Level 2 (slightly noisy) signals remains a distinct challenge because their latent representations overlap significantly with clean data. Additionally, the framework cannot perform zero-shot transfer across different hospital environments without at least a small amount of fine-tuning data, as domain shifts (e.g., ethnicity, recording setups) alter the baseline clean distribution. Future work will likely focus on improving the resolution between clean and marginally noisy signals.

Summary updated

Abstract

Electrocardiogram (ECG) signals are beneficial in diagnosing cardiovascular diseases, which are one of the leading causes of death. However, they are often contaminated by noise artifacts and affect the automatic and manual diagnosis process. Automatic deep learning-based examination of ECG signals can lead to inaccurate diagnosis, and manual analysis involves rejection of noisy ECG samples by clinicians, which might cost extra time. To address this limitation, we present a two-stage deep learning-based framework to automatically detect the noisy ECG samples. Through extensive experiments and analysis on two different datasets, we observe that the deep learning-based framework can detect slightly and highly noisy ECG samples effectively. We also study the transfer of the model learned on one dataset to another dataset and observe that the framework effectively detects noisy ECG samples.
BibTeX
@inproceedings{dua2022automatic,
  author = {Radhika Dua and Jiyoung Lee and Joon-myoung Kwon and Edward Choi},
  title = {{Automatic Detection of Noisy Electrocardiogram Signals without Explicit Noise Labels}},
  booktitle = {Workshops @ ICPR},
  year = {2022},
  url = {https://openreview.net/forum?id=ufaJRtN7Fo},
}
Figure