Pie de Boer

Pie de Boer

Software Developer, Tech Nerd

I like computers... 🤓

Conditional Diffusion Models for ECG Signal Denoising

Oct 2023 - Jun 2024

Watch Display

The denoising of ECG signals is important for doing correct diagnosis with devices such as smart watches.

Reconstructions

We utilized Gram Angular Fields to have loselessly embedding of ECG signals (1D) into the image domain (2D). This allowed us to directly work with the SR3 model.

Reconstructions

The original goal of SR3 is to recreate a high resolution (target) given a low resolution (source) image. We utilized it to map a noisy ECG signal to a clean ECG by embedding the ECG signals as Gram Angular Fields.

Highlights

  • Novel Approach: Used SR3, a model originally designed for image upscaling, to denoise ECG signals by transforming them into Gram Angular Fields. This allowed us to apply advanced image processing techniques to 1D ECG data.
  • Multi-Noise Removal: Unlike traditional methods that are designed to remove only one type of noise, our model was capable of eliminating multiple types of noise simultaneously (e.g., electrode motion, muscle artifacts, and composite noise).
  • Superior Performance: Our approach demonstrated superior performance compared to conventional signal processing methods like adaptive filters, low-pass filters, and moving averages that are commonly used in MATLAB toolboxes.
  • Training & Resources: The model was trained from scratch using Google Cloud services, making use of the trial period and a low-tier GPU with CUDA interfacing through the Linux terminal.

Technologies Utilized:

Java Logo Python
JavaFX Logo PyTorch
JavaFX Logo scikit-learn
JavaFX Logo Google Cloud
JavaFX Logo Debian
JavaFX Logo Debian
JavaFX Logo MATLAB

Abstract

This study adapts the Super-Resolution via Repeated Refinement (SR3) conditional diffusion model for ECG noise removal. We aimed to develop a single model capable of eliminating electrode motion (EM), muscle artifacts (MA), and composite noise, which are particularly challenging to remove at low signal-to-noise ratios (SNRs) without data-driven methods. We employed Gram Angular Fields for lossless embedding of 1D signals into the image domain. The model’s performance was compared against various filters, including an LMS adaptive filter, FIR low pass filter (LPF), moving average, and a hybrid filter (LPF with LMS), depending on the noise type. Initially, the model was trained on MIT-BIH Arrhythmia Database (ARDB) data with added noise from the MIT-BIH Noise Stress Test Database. We further assessed the model’s performance on the MIT-BIH Atrial Fibrillation Database (AF) to evaluate its generalization ability. Our model effectively tackled EM, MA, and composite noise across SNRs ranging from 0 to 15 decibels (dB). It outperformed baseline models in handling single noise types (EM, MA) at low SNRs (0 and 5 dB). While excelling in removing composite noise on ARDB across all SNRs, its effectiveness diminished for single noise types at high SNRs. Retraining our model on atrial fibrillation data significantly improved its ability to denoise these types of signals. Our methodology presents an innovative yet computationally demanding approach to ECG noise removal, excelling in low SNR and multi-noise settings.

Results (Highights):

Reconstructions

We can see that our model is able to maintain the underlying essential features of the ECG signal while removing the added electrode motion noise.

Reconstructions

The same model that removed the electrode motion noise is also able to tackle muscle artificat noise, while maintaining essential signal characteristics.

Reconstructions

Our model shows competitive performance compared to established approaches taken from literature.

Watch Display

Removal of composite noise by our model.

Watch Display

The results show that our model(s) outperform traditional methods, such as least-mean square filter found in Matlab.