Next Article in Journal
Deep Learning Approaches for Classifying Aviation Safety Incidents: Evidence from Australian Data
Previous Article in Journal
Benchmarking Psychological Lexicons and Large Language Models for Emotion Detection in Brazilian Portuguese
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Convolutional Neural Network for Automatic Detection of Segments Contaminated by Interference in ECG Signal

Department of Information and Communication Technologies in Medicine, Faculty of Biomedical Engineering, Czech Technical University in Prague, 128 00 Prague, Czech Republic
*
Author to whom correspondence should be addressed.
AI 2025, 6(10), 250; https://doi.org/10.3390/ai6100250
Submission received: 23 July 2025 / Revised: 12 September 2025 / Accepted: 26 September 2025 / Published: 1 October 2025

Abstract

Various types of interfering signals are an integral part of ECGs recorded using wearable electronics, specifically during field monitoring, outside the controlled environment of a medical doctor’s office, or laboratory. The frequency spectrum of several types of interfering signals overlaps significantly with the ECG signal, making effective filtration impossible without losing clinically relevant information. In this article, we proceed from the practical assumption that it is unnecessary to analyze the entire ECG recording in real long-term recordings. Conversely, in the preprocessing phase, it is necessary to detect unreadable segments of the ECG signal. This paper proposes a novel method for automatically detecting unreadable segments distorted by superimposed interference in ECG recordings. The method is based on a convolutional neural network (CNN) and is comparable in quality to annotation performed by a medical expert, but incomparably faster. In a series of controlled experiments, the ECG signal was recorded during physical activities of varying intensities, and individual segments of the recordings were manually annotated based on visual assessment by a medical expert, i.e., divided into four different classes based on the intensity of distortion to the useful ECG signal. A deep convolutional model was designed and evaluated, exhibiting a 87.62% accuracy score and the same F1-score in automatic recognition of segments distorted by superimposed interference. Furthermore, the model exhibits an accuracy and F1-score of 98.70% in correctly identifying segments with visually detectable and non-detectable heart rate. The proposed interference detection procedure appears to be sufficiently effective despite its simplicity. It facilitates subsequent automatic analysis of undisturbed ECG waveform segments, which is crucial in ECG monitoring using wearable electronics.

1. Introduction

The frequency spectrum of several types of interfering signals, for example, motion artifacts, overlaps significantly with the ECG signal, meaning effective filtration is impossible without losing much clinically relevant information. During long-term vital function monitoring using wearable electronics, it is not necessarily important to analyze the entire recording; rather, it is desirable to detect segments distorted by superimposed interference to an extent where the relevant information, such as heart rate detection, is no longer possible, and focus on analyzing the rest of the signal. In the preprocessing phase, it is necessary to precisely and systematically mark such segments, which can be eliminated and therefore cannot cause erroneous interpretation by subsequent automatic ECG evaluation methods. This is rather important for automatic analysis of physiological state in the field. The problem can therefore be reduced to automatic detection of segments unsuitable for analysis. The effective detection of segments with motion-induced and other interferences in ECG recordings obtained during long-term field monitoring remains a relevant research problem [1,2,3]. Its significance has increased with the widespread deployment of wearable electronic systems across diverse application domains, including vital function monitoring of members of emergency response units or integrated rescue services.
Interference in the ECG signal can be caused by various phenomena, such as muscle activity, electrode movement, sweating, or an external electromagnetic field. These phenomena can be present in the measured signal, for example, as myopotentials, baseline fluctuations and abruptions, or electrical conduction disturbances [4,5]. In practice, a mixture of these interfering phenomena is usually observed. Although various types of interference are readily distinguishable by visual inspection, traditional signal processing methods, like independent component analysis (ICA) [6,7] or discrete wavelet transform (DWT) [8], are often not sufficient for time-efficient automatic detection. These methods typically rely on complex feature extraction methods, making them unapplicable for real-time detection. Machine learning techniques often require significant time and computational resources during the training phase; however, once a model is trained, the inference process can usually be completed in a relatively brief time frame, making these approaches well-suited for applications that demand rapid decision-making.
Drawing inspiration from the work of Zhang et al. [2], we propose a new method for automatic detection of unreadable segments of the ECG signal, distorted by superimposed interference. The method automates the work of a medical professional in marking unreadable sections of an ECG signal based on visual assessment. The result is of comparable quality, but incomparably faster than annotation by a medical expert. Data needed to train the CNN were collected in a controlled experiment and were categorized into four distinct classes based on the intensity of interference present, utilizing this dataset as an input for the CNN. Our approach proved considerably effective by processing both the raw ECG signal and its frequency spectrum obtained using fast Fourier transformation (FFT) [9] as input and predicting the corresponding interference class as output. Furthermore, our findings show that utilizing the frequency spectrum as an input is integral to the solution.
In this paper, we first introduce the experimental design and data collection process, including participant selection, the range of physical activities performed, and the electrodes utilized for ECG recording acquisition. Subsequently, the data preprocessing pipeline and dataset construction are described, followed by a detailed presentation of the proposed CNN-based model for classification. The evaluation results are then reported, particularly regarding classification performance and practical implications. The paper concludes with a discussion of the findings, their limitations, and potential directions for future research alongside a summary of the main contributions of this work.

2. Related Work

The application of machine learning and neural networks for detecting and categorizing interference in ECG signals has gained significant attention in recent years. Several studies have explored the use of CNNs for ECG interference detection. For instance, Yoon et al. [10] proposed a CNN model to categorize signals into acceptable and unacceptable, which contain different types of ECG interference, achieving an F1-score of 80.00%.
Zhang et al. [2] employed a cascade of CNNs to categorize ECG signal quality. Their architecture consisted of two main subnetworks. The first subnetwork categorized the signal into three classes: motion artifacts, myopotentials, and minimally disturbed signals. Its output was then passed to the second subnetwork, which further categorized motion artifacts and myopotentials into mild and severe categories. This hierarchical approach enabled robust discrimination between artifact types. Evaluation also considered classification performance across different arrhythmias represented in the dataset, yielding an overall accuracy of 92.70%.
Recurrent neural networks (RNNs) have also shown promise in this domain. Antczak [11] employed a long short-term memory (LSTM) network to detect and remove motion artifacts from experimentally generated and interfered ECG signals, achieving a substantial signal-to-noise ratio improvement. Additionally, Boljanić et al. [3] proposed an LSTM-based neural network, which demonstrated an accuracy of 90.10%. The dataset was closely related to the objectives of our paper, as it consisted of single-lead ECG signals collected from mountain rescuers during field interventions.
He et al. [12] employed a CNN–LSTM hybrid model to categorize ECG signal quality into three categories, ranging from the least interfered to proposed for discarding. Achieving 98.65% accuracy, though comparable in its objective and experimental setup to our work, the computational complexity may limit real-time applicability.
Some researchers have explored the potential of unsupervised learning approaches. For example, Zhou et al. [13] developed an autoencoder-based method for ECG anomaly detection, demonstrating its effectiveness across various types of abnormalities. Another unsupervised approach was explored by Satija et al. [14], who developed an automated framework for detecting baseline wander, muscle artifacts, and powerline interference in ECG signals using time–frequency domain features and a decision rule-based classifier. However, due to the extensive preprocessing involved, the approach is not readily applicable for real-time solutions, highlighting the need for lightweight methods in practical monitoring scenarios.

3. Materials and Methods

An experiment was designed to collect ECG data using different types of electrodes during various physical activities selected to represent a wide range of loads during daily activities. A total of 10 healthy volunteers participated in the experiment, including three females and seven males. The age and gender composition of the group was carefully chosen to match the target group for future use of the developed method, the integrated rescue system (IRS) members, specifically firefighters. The participants’ ages ranged from 21 to 42 years, the average weight was 67.67 ± 9.53 kg and 81.29 ± 7.99 kg for female and male participants respectively, and the average height was 171.33 ± 6.34 cm for females and 181.71 ± 5.67 cm for males. The average chest circumference was 80 ± 6.53 cm and 93 ± 6.61 cm for female and male participants respectively, ensuring adequate skin-electrode contact considering the minimal chest-belt adjustment.
Subjects were selected randomly, with no specific conditions for participation other than being medically fit to perform the required tasks. Interpersonal variability in the morphology of the ECG signal is desirable, as the proposed interference detection method should be robust to such variability.
The data collected in the experiment was utilized to develop, train, and test the proposed CNN model. Finally, after obtaining the predictions on the test dataset, the model performance was assessed and discussed using standard statistical analysis methods, including confusion matrices.

3.1. Experiment Methodology

The experiment duration for one subject was approximately 30 min; 15 min were reserved for the measurements themselves, and the remaining 15 min were dedicated to the logistics of changing electrodes and transitioning between physical activities. The activities were deliberately selected to ensure a progressive increase in physical load, present a variety of upper and lower body movements, all while remaining reproducible with commonly available laboratory instrumentation such as a treadmill.
The selected activities, their order, and information about the physical load and body involvement are presented in Table 1. Each activity was reserved for one minute; the presented sequence of activities was repeated three times, each time using a different set of electrodes. The order of activities ensured a gradual increase in physical load, even though the rising heart rate should not affect the occurrence of interference in the recorded data. Additionally, between each set of activities, subjects had the time to rest during the electrode replacement process, allowing their heart rate to return to near-resting levels before the following measurements.

3.2. Electrode Types

For each of the subjects, the ECG was first recorded using medical disposable ECG electrodes, followed by a chest belt equipped with stainless steel dry electrodes (Figure 1, bottom), and finally, a chest belt featuring textile electrodes (Figure 1, top). The dimensions of a single stainless steel electrode were 6 × 4.5 cm, and those of a single textile electrode were 6 × 4 cm. The disposable Ag/AgCl electrodes of choice were EKG H34 SG KendallTM by CovidienTM, which contain hydrogel suitable for long-term monitoring. Both chest belts are a part of the experimental system FlexiGuard/MOSENZ [15].
The experiment was designed to minimize the need for the subjects’ skin preparation. Disposable self-adhesive Ag/AgCl electrodes contain a conductive coating, requiring no additional skin preparation. Stainless steel and textile electrodes exhibit improved performance when mild perspiration is present, as it enhances the conductive properties of the skin-electrode interface. The selected activities did not impose extreme physical exertion, inducing excessive sweating, thus diminishing the possibility of reduced-impedance-related artifacts.
Given the intended use of the solution for long-term field monitoring, both chest straps were placed approximately below the pectoral muscle, the gel electrodes copying the dry electrodes’ position on the strap. Although standard for sports and fitness, this placement has also proven successful in designing monitoring systems for firefighters [15]. One electrode was positioned approximately at the center of the chest, while the other two were placed symmetrically on the left and right sides of the ribcage. The central electrode was designated as the reference electrode, while the other two served as active electrodes, forming a single-lead system for ECG recording.

3.3. Wearable ECG Sensor

The ECG signal was recorded using the 24-bit ADS1293 analog front-end module developed by Texas Instruments to capture biopotentials in wearable ECG devices accurately. The sampling frequency was 800 Hz, with a margin to ensure capture of all significant frequencies in the ECG signal. This configuration delivers a signal quality comparable to clinical-grade ECG recordings during rest. Intentionally, no additional analog or digital filtering was performed, ensuring the device outputs raw data. The used circuit also includes an active reference electrode (so-called driven leg), which, with the three-electrode placement used in this paper, provides an increase in the common-mode rejection ratio (CMRR), as opposed to standard sport testers, which usually utilize only two electrodes.
The module also utilizes digital indications of the status of the electrode connection. The analog front end was connected via SPI interface to a 32-bit microcontroller from the AT SAMD21 family (Arm Cortex-M0 architecture), equipped with firmware that ensured ECG continuous data reading and transmission via a USB interface to a connected PC. The device is part of the experimental system mentioned above, designed to monitor the vital functions of IRS members. A detailed description of the module, including the exact utilized sensors and digitalization device, is presented in the original FlexiGuard/MOSENZ paper [15]. The configuration used in this study is based on the platform designed by Veselý et al. [16], using a proprietary set of chest belts and electrodes.
The experiment utilized software integral to the described hardware solution, an experimental platform used for continuous physiological state monitoring of IRS members, specifically firefighters. It enables real-time data digitization, visualization, and recording, and the output data can be exported into a .csv file for further data analysis and preprocessing. Each line in the .csv file corresponds to one sample of the ECG signal, including a timestamp. Additionally, the software allows for robust R-wave detection in the ECG signal using the Hamilton-Tompkins algorithm [17], heart rate detection, and acoustic signalization of each detected heartbeat.

3.4. Class Definitions

The data was annotated into four distinct categories, each defined by characteristic properties described below. Each segment was two seconds long, considering real-time applicability and the feasibility of manual annotation. Since a single segment may contain varying levels of interference intensity, we categorized it based on the dominant features presented in Table 2. Note that a cardiac cycle is considered fully readable when all ECG waveforms observed in a given subject are visible. The goal was not to recognize individual types of artifacts from a technical viewpoint, but to evaluate the degree of readability of the useful ECG signal in individual segments from a medical perspective. The categories were defined after a consultation with biomedical experts.

3.4.1. Class 1

Heart rate is detectable, with all cardiac cycles fully readable. At least one cycle is free from interference; this class includes two characteristic cases:
  • No interference—such segments are rare in field monitoring during motion, but occur in resting phases (Figure 2a).
  • Minimal interference—at least one cardiac cycle is entirely interference-free. Superimposed noise has a low amplitude, often originating from myopotentials (Figure 2b).

3.4.2. Class 2

Heart rate is detectable, with at least one cardiac cycle fully readable. Interference is present in all cycles, but its amplitude does not exceed half of the R-wave amplitude (Figure 2c).

3.4.3. Class 3

Heart rate is detectable, but no individual cardiac cycle is fully readable. The interference may resemble ECG waves, with amplitudes exceeding half of the R-wave amplitude, often accompanied by superimposed sharp waves (Figure 2d).

3.4.4. Class 4

The primary distinction from the previous classes is that the heart rate is no longer readable. This category encompasses two specific cases:
  • The noise is superimposed on the entire segment, with an amplitude that prevents a robust QRS detector from accurately identifying R-waves, because of interference resembling waves outside the refractory phase (Figure 2e).
  • At least one undetectable R-wave is present, often due to signal saturation. From a spectral analysis perspective, such a segment can easily be miscategorized, as the interference is not superimposed on the entire segment (Figure 2f).

3.5. Data Preprocessing

After splitting the data into 2-s-long segments without overlap and loading them into a dataset, normalization was applied to ensure compatibility with data recorded by possibly different ECG sensors and sensor electrode placements. Given that the provided wearable ECG sensor utilizes a 24-bit AD converter, the data was min-max normalized to a range of 0 to 1. Subsequently, the frequency component in the form of the amplitude spectrum was extracted from the normalized ECG recordings for each segment using FFT, ranging from 0 to 100 Hz with a frequency step of 0.5 Hz. Including higher frequencies did not introduce any additional information to the model.
Finally, the resulting dataset containing ECG segments with corresponding amplitude spectra was partitioned into training, validation, and test sets, with 70% of the data designated for training, 10% for validation, and the remaining 20% reserved for testing. The split was stratified with respect to the class, ensuring that all four classes were represented in the training, validation, and test sets in the same proportions as in the original dataset. Figure 3 illustrates the entire data preprocessing pipeline.

3.6. Dataset

The final dataset comprises 4602 2-s segments, each annotated into one of the above classes by a medical expert. The resulting split leaves 3681 segments for training, and 921 segments for the final evaluation of our model, amounts which proved to be sufficient for both effective training and testing. Table 3 shows that the dataset is slightly imbalanced in terms of interference class. However, this distribution corresponds to the real representation of individual classes in a given sequence of performed activities. Class, age, and gender distributions are maintained in the individual dataset splits.

3.7. Prediction Mechanism

The predictions of the proposed model are constructed from the final latent representation through a fully connected output layer followed by the Softmax activation function. The Softmax function transforms the raw output scores into a normalized probability distribution over the target classes. Formally, for a given input vector x with components xi, the probability assigned to class i is defined by Equation (1), where k denotes the number of classes.
softmax ( x i ) = e x i j = 1 k e x j
This formulation guarantees that 0 softmax ( x i ) 1 , and that the sum of all probabilities equals one, thereby enabling probabilistic interpretation of the network output. The predicted class corresponds to the index of the maximum probability, while the full probability vector provides information about the model’s confidence and potential class ambiguity.

3.8. CNN Architecture

Figure 4 illustrates the proposed deep CNN architecture, which processes a raw 2-s ECG segment and its frequency spectrum, obtained using FFT, as inputs. The frequency input is first preprocessed using two 1D convolutional layers, with 64 and 128 filters, enabling feature extraction, with a kernel size 5. After each layer, maximum pooling with a kernel size of 2 is applied. The resulting feature maps are flattened and concatenated with the raw ECG input. After that, the resulting vector is gradually downsampled to a dimension of 64, using dropout layers with a 10% dropout rate between dense layers for regularization. From the final dimension of 64, the prediction vector is constructed.
The output layer uses the Softmax activation function (Equation (1)); therefore, the output neurons represent probabilities for each class, and the target variable had to be one-hot encoded to match the output format. The rectified linear unit (ReLU) activation function (Equation (2)) is utilized in the hidden layers, a common choice in deep convolutional architectures due to its computational efficiency and effectiveness in addressing the vanishing gradient problem.
R e L U ( x ) = max ( 0 , x )
The model was trained using the Adam optimization algorithm [18], and categorical cross-entropy is the loss function of choice for multi-class classification. The architecture was implemented using the Keras (https://keras.io (accessed on 23 July 2025)) API, which operates on top of the TensorFlow (https://www.tensorflow.org (accessed on 23 July 2025)) framework, and it was trained on a MacBook Pro 2019 with a 2.4 GHz Quad-Core Intel Core i5 processor and 16 GB of LPDDR3 RAM.

4. Results

All results presented in this section are based on predictions obtained from the test set using the final proposed model, which was optimized by including the validation set during training. The test set remained reserved exclusively for the final performance evaluation.

Classification

The proposed CNN has 3,971,012 internal trainable parameters, making it prone to overfitting the data. The training and validation curves diverge a few epochs into training, as illustrated in Figure 5. After experimenting with various methods, such as batch normalization and L2 regularization, with minimal improvement, implementing learning rate scheduling helped with learning curve divergence and stabilized the overall training process; results can be seen in Figure 6. The initial learning rate exponentially decreases in each epoch, as defined in Equation (3), where k = 0.1 is a parameter.
l r = l r · e ( k ) · e p o c h
The final model was trained for 50 epochs; the model’s loss and accuracy stabilized after approximately 30 epochs without any signs of divergence, rendering early stopping unnecessary.
For classification into four classes, the resulting accuracy on the test set is 82.63%, and the F1 Score is 82.68%, illustrating the model’s ability to predict both the minority and majority classes effectively. The inability to detect the heart rate distinctly identifies class 4; however, the distinctions between the other three classes are less pronounced. The precision and recall values for individual classes are presented in the first two columns of Table 4 below, showing that the model frequently miscategorizes Classes 2 and 3. This observation is further supported by the confusion matrix in Figure 7a, which reveals that the model frequently miscategorized segments between Classes 1 and 2 and between Classes 2 and 3.
Working with the assumption that Classes 2 and 3 are frequently miscategorized and their characteristics could therefore be redundant, the aggregation of these two classes significantly improved the predictions, as seen in the confusion matrix in Figure 7b. The accuracy and F1 score for the test data increased to 87.62%; precision and recall metrics for individual classes are reported in the second two columns of Table 4. From a practical point of view, Class 1 comprises segments that can be utilized to detect the heart rate and interpret the ECG curve. In contrast, Class 4 contains segments with interference patterns proposed for exclusion. The combined class thus contains segments that facilitate heart rate detection; however, other characteristics may no longer be readable.
The model’s performance in accurately categorizing segments with detectable and non-detectable heart rates is demonstrated in Figure 7c. Aggregating the predictions for the first three classes, in which the heart rate is detectable, we obtained a final accuracy and F1 Score of 98.70% on the test set. The precision and recall values in the last two columns of Table 4 indicate that the model tends to miscategorize segments with non-detectable heart rate more often than segments with a detectable one.

5. Discussion

Although the proposed model can correctly predict the class in 87.62% of cases when working with three aggregated classes and 98.70% for classification into two classes, an improvement to the results achieved by Yoon et al. [10] and Boljanić et al. [3], the design and implementation process yielded numerous observations from which potential future improvements to the proposed solution can be derived. Given the wide variety of machine learning architectures available, it was not feasible to explore all options within the scope of this paper. The model was designed experimentally, and only limited hyperparameters and values were searched using a grid-search method. However, we established that inputting frequency spectrum into the model is necessary, as no architecture in our experiments exceeded 40% accuracy on the validation set using only raw ECG as input. The study primarily tested various deep and convolutional architectures. Future work could include incorporating LSTM layers [3,11] that are particularly well-suited for processing time series or employing support vector machines (SVM) [19,20] for classification.
Another potential improvement is using data collected in real field conditions in combination with an already conducted controlled experiment. Such data would better reflect real-world scenarios, enabling the resulting model to address the problem more accurately. The solution is intended for IRS members, specifically firefighters, who are expected to wear heavy protective clothing, which introduces an additional source of interference.
Data quantity is critical for classification accuracy, as observed in this study. The model was incrementally trained on available data, and classification accuracy improved as more data became available. A similar improvement was observed when the validation set was incorporated into the final model training. Increasing the dataset size could prove beneficial by involving more subjects in experiments or annotating the data through sliding windows.
Since data quality is just as crucial, further research could only utilize data from a single type of electrode, either stainless steel or textile ones, as these demonstrated superior performance. Disposable self-adhesive Ag/AgCl electrodes performed the worst, as running and walking possibly caused the conductive gel to move together with the inertial mass of the electrodes and cause interference. The analysis of the influence of different types of electrodes on the quality of the ECG signal under different operating conditions was not within the scope of this work.
Although we have tried to define the categories in a way that minimizes overlap, the proposed classes are, of course, not strictly mutually exclusive. Segments that share characteristics of two classes have been identified as problematic. Annotating data using shorter time windows could reduce the likelihood of multiple interference categories appearing within a single segment. A more efficient solution might involve annotating individual cardiac cycles. This approach requires robust R-wave detection and finding a solution for instances where R-waves cannot be identified. The solution introduces the need for an even more detailed manual and very time-consuming annotation in the process.
Further optimization could focus on the number of classes used in the classification task, as initial experiments suggest that optimization of class definitions could yield better results. In the four-class classification task, 95.00% of all miscategorized segments were predicted to be one class away from the correct one. In contrast, 4.40% of segments were miscategorized by two classes and only 0.60% of segments by three. Aggregating classes with significant overlap substantially improved classification accuracy, as seen in Table 4 and Figure 7. A potential refinement could involve distinguishing between two types of segments currently categorized under Class 4: those with non-detectable heart rate due to superimposed interference versus signal saturation.
Short inference time is essential for the proposed solution to be applicable for real-time monitoring. Predictions were calculated separately for each segment in the test dataset, and the resulting average prediction time for the extent of interference in a single segment is 48 milliseconds using the same hardware utilized for training the model. This duration is inherently dependent on the hardware in use, and further research can focus on deploying the solution on embedded systems with limited computational resources.

6. Conclusions

We have designed, implemented, and experimentally verified a novel CNN-based method capable of automatically assessing the degree of interference in real ECG signals. The method simulates the tedious work of a healthcare professional in marking unreadable sections of an ECG signal by automatically categorizing them into several classes, ranging from the least interfered to the extremely interfered and therefore not assessable from a medical analysis perspective.
The final model, which combines both time-domain and frequency spectrum inputs during training, achieves an accuracy of 87.62% for classification into three classes and 98.70% for classification into two classes. This result is demonstrably better than what was achieved by Yoon et al. [10] and Boljanić et al. [3] in similar previous attempts. While both of these studies rely on a 10-s window, our approach is based on a shorter 2-s window, thereby enhancing the time resolution of the solution and future applicability in real-time scenarios. The proposed solution can be a suitable complement to existing methods based on classical digital filtering. Additionally, the model has potential for real-time application with an acceptable inference time per segment, suggesting its suitability for future deployment in wearable monitoring systems.

Author Contributions

Conceptualization, V.K. and P.S.; methodology, V.K. and P.S.; experiments, V.K.; software, V.K. and P.S.; annotation, training and validation, V.K. and R.K.; formal analysis, T.V.; investigation, V.K. and P.S.; resources, M.V., A.Z. and P.Š.; data curation, V.K.; writing—original draft preparation, V.K.; writing—review and editing, P.S.; visualization, P.Š.; supervision, P.S. and R.K.; project administration, A.Z.; funding acquisition, P.S.; All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Ministry of Interior of Czech Republic, grant number VJ02010031 (Modular multisensory professional clothing for risk management, health protection and safety of IRS members using artificial intelligence methods).

Institutional Review Board Statement

The study was conducted in accordance with the Declaration of Helsinki and approved by the Institutional Review Board (or Ethics Committee) of the Faculty of Biomedical Engineering, Czech Technical University in Prague (protocol C5/0117, date of approval 15 May 2017).

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

The original data and implementation presented in the study are openly available in GitHub at https://github.com/fbme-ictm/ECG-interference (accessed on 26 August 2025).

Acknowledgments

The authors would like to thank all the subjects who took part in the experiment.

Conflicts of Interest

The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
ADCAnalog-to-digital converter
CMRRCommon-mode rejection ratio
CNNConvolutional neural network
DWTDiscrete wavelet transform
ECGElectrocardiogram
FFTFast Fourier transform
ICAIndependent component analysis
IRSIntegrated rescue system
LSTMLong short-term memory
ReLURectified linear unit
RNNRecurrent neural network
SVMSupport vector machine

References

  1. Noitz, M.; Mörtl, C.; Böck, C.; Mahringer, C.; Bodenhofer, U.; Dünser, M.W.; Meier, J. Detection of Subtle ECG Changes Despite Superimposed Artifacts by Different Machine Learning Algorithms. Algorithms 2024, 17, 360. [Google Scholar] [CrossRef]
  2. Zhang, Q.; Fu, L.; Gu, L. A Cascaded Convolutional Neural Network for Assessing Signal Quality of Dynamic ECG. Comput. Math. Methods Med. 2019, 2019, 1–12. [Google Scholar] [CrossRef] [PubMed]
  3. Boljanić, T.; Malešević, J.; Kvascev, G. Deep Neural Network Approach for Artifact Detection in Raw ECG. In Proceedings of the IX International Conference on Electrical, Electronic and Computing Engineering (IcETRAN), Novi Pazar, Serbia, 6–9 June 2022; ISBN 978-86-7466-930-3. [Google Scholar]
  4. Pérez-Riera, A.R.; Barbosa-Barros, R.; Daminello-Raimundo, R.; de Abreu, L.C. Main artifacts in electrocardiography. Ann. Noninvasive Electrocardiol. 2018, 23, e12494. [Google Scholar] [CrossRef] [PubMed]
  5. Littmann, L. Electrocardiographic artifact. J. Electrocardiol. 2021, 64, 23–29. [Google Scholar] [CrossRef] [PubMed]
  6. Milanesi, M.; Martini, N.; Vanello, N.; Positano, V.; Santarelli, M.F.; Landini, L. Independent component analysis applied to the removal of motion artifacts from electrocardiographic signals. Med. Biol. Eng. Comput. 2007, 46, 251–261. [Google Scholar] [CrossRef] [PubMed]
  7. Chawla, M.P.S. PCA and ICA processing methods for removal of artifacts and noise in electrocardiograms: A survey and comparison. Appl. Soft Comput. 2011, 11, 2216–2226. [Google Scholar] [CrossRef]
  8. Bhoraniya, D.V.; Kher, R.K. Motion artifacts extraction using dwt from ambulatory ECG (A-ECG). In Proceedings of the 2014 International Conference on Communication and Signal Processing, Bangalore, India, 22–25 July 2014. [Google Scholar] [CrossRef]
  9. Cooley, J.W.; Tukey, J.W. An algorithm for the machine calculation of complex Fourier series. Math. Comput. 1965, 19, 297–301. [Google Scholar] [CrossRef]
  10. Yoon, D.; Lim, H.S.; Jung, K.; Kim, T.Y.; Lee, S. Deep learning-based electrocardiogram signal noise detection and screening model. Healthc. Inform. Res. 2019, 25, 201–211. [Google Scholar] [CrossRef] [PubMed]
  11. Antczak, K. Deep Recurrent Neural Networks for ECG Signal Denoising. arXiv 2019, arXiv:1807.11551. [Google Scholar] [CrossRef]
  12. He, C.; Wei, Y.; Wei, Y.; Liu, Q.; An, X. Dynamic Electrocardiogram Signal Quality Assessment Method Based on Convolutional Neural Network and Long Short-Term Memory Network. Big Data Cogn. Comput. 2024, 8, 57. [Google Scholar] [CrossRef]
  13. Zhou, Y.; Yang, Y.; Gan, J.; Li, X.; Yuan, J.; Zhao, W. Multi-scale Masked Autoencoder for Electrocardiogram Anomaly Detection. arXiv 2025, arXiv:2502.05494. [Google Scholar]
  14. Satija, U.; Ramkumar, B.; Manikandan, M.S. Automated ECG noise detection and classification system for unsupervised healthcare monitoring. IEEE J. Biomed. Health Inform. 2018, 22, 722–732. [Google Scholar] [CrossRef] [PubMed]
  15. Schlenker, J.; Socha, V.; Smrčka, P.; Hána, K.; Begera, V.; Kutilek, P.; Hon, Z.; Kašpar, J.; Kučera, L.; Mužík, J.; et al. FlexiGuard: Modular biotelemetry system for military applications. In Proceedings of the International Conference on Military Technologies (ICMT), Brno, Czech Republic, 19 May 2015; pp. 1–6. [Google Scholar]
  16. Veselý, T.; Smrčka, P.; Kliment, R.; Vítězník, M.; Hon, Z.; Hána, K. Accuracy improvement of energy expenditure estimation through neural networks: A pilot study. AI 2024, 5, 2914–2925. [Google Scholar] [CrossRef]
  17. Hamilton, P.S.; Tompkins, W.J. Quantitative Investigation of QRS Detection Rules Using the MIT/BIH Arrhythmia Database. IEEE Trans. Biomed. Eng. 1986, BME-33, 1157–1165. [Google Scholar] [CrossRef]
  18. Kingma, D.; Ba, J. Adam: A Method for Stochastic Optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR), San Diego, CA, USA, 7–9 May 2015. [Google Scholar]
  19. Castaño, F.A.; Hernández, A.M. Motion Artifacts Recognition in Electrocardiographic Signals through Artificial Neural Networks and Support Vector Machines for Personalized Health Monitoring. In IFMBE Proceedings; Springer: Singapore, 2017; pp. 425–428. [Google Scholar] [CrossRef]
  20. Kher, R.; Pawar, T.; Thakar, V.; Shah, H. Physical activities recognition from ambulatory ECG signals using neuro-fuzzy classifiers and support vector machines. J. Med. Eng. Technol. 2015, 39, 138–152. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Chest belts with textile and stainless steel electrodes.
Figure 1. Chest belts with textile and stainless steel electrodes.
Ai 06 00250 g001
Figure 2. Examples of segments with respective classes.
Figure 2. Examples of segments with respective classes.
Ai 06 00250 g002
Figure 3. An UML activity diagram representing the data preprocessing pipeline.
Figure 3. An UML activity diagram representing the data preprocessing pipeline.
Ai 06 00250 g003
Figure 4. Proposed CNN architecture.
Figure 4. Proposed CNN architecture.
Ai 06 00250 g004
Figure 5. CNN model training before learning rate scheduling.
Figure 5. CNN model training before learning rate scheduling.
Ai 06 00250 g005
Figure 6. CNN model training after learning rate scheduling.
Figure 6. CNN model training after learning rate scheduling.
Ai 06 00250 g006
Figure 7. Classification confusion matrices.
Figure 7. Classification confusion matrices.
Ai 06 00250 g007
Table 1. Sequence and characteristics of selected physical activities.
Table 1. Sequence and characteristics of selected physical activities.
OrderPhysical ActivityPhysical LoadBody Involvement
1Resting--
2Arm movementsLowUpper body
3Walking (4 km/h)ModerateLower body
4Running (8 km/h)HighLower body
5SquatsHighLower and upper body
Table 2. Summary of class definitions and characteristic properties.
Table 2. Summary of class definitions and characteristic properties.
Class 1Class 2Class 3Class 4
Heart rateDetectableDetectableDetectableNon-detectable
Cardiac cycleAll cycles fully readableAt least one cycle fully readableNo cycle fully readable-
Table 3. Distribution of classes, age, and gender across dataset splits.
Table 3. Distribution of classes, age, and gender across dataset splits.
TotalTraining SetValidation SetTest Set
Total46023220461921
Class 120991469210420
Class 216961186170340
Class 34613234692
Class 43462423569
Age (mean ± SD)28 ± 7.3928 ± 7.4228 ± 7.4028 ± 7.27
Gender (M/F)3216/13862257/963324/137635/286
Table 4. Precision and recall metrics for classification.
Table 4. Precision and recall metrics for classification.
Class 2 and 3 AggregatedClass 1, 2 and 3 Aggregated
Class Precision (%) Recall (%) Precision (%) Recall (%) Precision (%) Recall (%)
Class 188.2087.1488.2087.1499.3099.30
Class 278.3477.6586.5087.50
Class 368.0073.91
Class 491.3091.3091.3091.3091.3091.30
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kalousková, V.; Smrčka, P.; Kliment, R.; Veselý, T.; Vítězník, M.; Zach, A.; Šrotýř, P. Convolutional Neural Network for Automatic Detection of Segments Contaminated by Interference in ECG Signal. AI 2025, 6, 250. https://doi.org/10.3390/ai6100250

AMA Style

Kalousková V, Smrčka P, Kliment R, Veselý T, Vítězník M, Zach A, Šrotýř P. Convolutional Neural Network for Automatic Detection of Segments Contaminated by Interference in ECG Signal. AI. 2025; 6(10):250. https://doi.org/10.3390/ai6100250

Chicago/Turabian Style

Kalousková, Veronika, Pavel Smrčka, Radim Kliment, Tomáš Veselý, Martin Vítězník, Adam Zach, and Petr Šrotýř. 2025. "Convolutional Neural Network for Automatic Detection of Segments Contaminated by Interference in ECG Signal" AI 6, no. 10: 250. https://doi.org/10.3390/ai6100250

APA Style

Kalousková, V., Smrčka, P., Kliment, R., Veselý, T., Vítězník, M., Zach, A., & Šrotýř, P. (2025). Convolutional Neural Network for Automatic Detection of Segments Contaminated by Interference in ECG Signal. AI, 6(10), 250. https://doi.org/10.3390/ai6100250

Article Metrics

Back to TopTop