Universal ECG Noise Filter

Gabriel Soares Ferreira
Universidade Federal do Ceará


Abstract

The analysis of ECG signals is fundamental in modern medicine, as it provides vital information about a patient's cardiac health. However, the accuracy of this analysis can be compromised by the presence of noise, which often contaminates ECG signals, leading to erroneous or delayed diagnoses. Detecting and removing noise from ECG signals is therefore of utmost importance. 

In this study, we propose a new way to filter ECG signals, in which we use two transformer-based models. The first receives a signal and returns, as output, a three-element vector: the start position, the end position, and the class (0 for clean signal, 1 for noisy signal). The start and end positions indicate where the noisy (or clean, depending on the returned class) signal segment begins and ends. This model was trained with clean signals, to which noisy segments were artificially added, so it is possible to keep a record of where the noisy segments begin and end.

The second model receives a completely noisy signal segment and returns a filtered signal. This model was trained using a set of clean signals, to which noise was artificially added. Thus, we maintain a completely clean signal, which serves as a benchmark in a supervised learning process.

The operation of our algorithm is based on YOLO (a computer vision model). Initially, we segment the signal into windows and pass these windows to the first model, which returns the positions of the noisy segments. We concatenate the subsequent positions and then obtain the start and end points of the noisy segments of the complete signal, which are passed to the second model that filters the signal.

The results show that our model can filter different types of noise, without the need for pre-established filtering tools (or filters).