Next Article in Journal
Coresets for the Average Case Error for Finite Query Sets
Previous Article in Journal
Tool Condition Monitoring of the Cutting Capability of a Turning Tool Based on Thermography
Previous Article in Special Issue
Development of a Low-Cost Open-Source Measurement System for Joint Angle Estimation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm

Department of Electronic Engineering, Kwangwoon University, Seoul 01897, Korea
*
Author to whom correspondence should be addressed.
Submission received: 6 August 2021 / Revised: 13 September 2021 / Accepted: 30 September 2021 / Published: 8 October 2021
(This article belongs to the Special Issue Data Analytics and Applications of Wearable Sensors in Healthcare)

Abstract

:
R peak detection is crucial in electrocardiogram (ECG) signal analysis to detect and diagnose cardiovascular diseases (CVDs). Herein, the dynamic mode selected energy (DMSE) and adaptive window sizing (AWS) algorithm are proposed for detecting R peaks with better efficiency. The DMSE algorithm adaptively separates the QRS components and all non-objective components from the ECG signal. Based on local peaks in QRS components, the AWS algorithm adaptively determines the Region of Interest (ROI). The Feature Extraction process computes the statistical properties of energy, frequency, and noise from each ROI. The Sequential Forward Selection (SFS) procedure is used to find the best subsets of features. Based on these characteristics, an ensemble of decision tree algorithms detects the R peaks. Finally, the R peak position on the initial ECG signal is adjusted using the R location correction (RLC) algorithm. The proposed method has an experimental accuracy of 99.94%, a sensitivity of 99.98%, positive predictability of 99.96%, and a detection error rate of 0.06%. Given the high efficiency in detection and fast processing speed, the proposed approach is ideal for intelligent medical and wearable devices in the diagnosis of CVDs.

1. Introduction

Cardiovascular diseases (CVDs) cause 31% of global mortality [1]. The burden of CVDs and shortage of physicians will increase to 57% and 42% worldwide by 2034 [2]. In addition, the median accuracy of ECG interpretation is only 54% for all training levels of practicing physicians and cardiologists [3]. The detection of R peaks is the fundamental step for ECG analysis. ECG signal is a non-linear and non-stationary physiological signal that represents the heart’s electrical activities. It is measured by electrodes set on the patient’s skin, forming the Einthoven triangle. Six fiducial points in the ECG signal, i.e., the P, QRS, T, and U, represent heart events during the relaxation or contraction [4] and are presented in Figure 1. The QRS wave is the vital feature for ECG analysis, and the R is the tallest peak in the QRS waves [5]. The ECG morphology varies from person to person, even at a different time for the same individual. In addition, the ECG is generally suffering from power line noise, muscular noise, electrode contact noise, and baseline wander [6]. These factors have added difficulties in R peak detection.
Several methods have been reported for detecting R peak in ECG signal in recent decades, based on Fourier Transform (FT) [7], Short-Time Fourier Transform (STFT) [8,9,10], Wavelet Transform (WT) [11,12,13,14,15,16,17], Empirical Mode decomposition (EMD) [18], adaptive thresholding [5,14,19,20,21], machine learning [22,23], and neural networks [4,24,25,26]. However, the detection efficiency varies with processed signal quality and extracted features [3,5,7,8,9,10,11,12,13]. Adaptive thresholding methods suffer from the miscalculated threshold due to the noise events and require a certain number of previous data points to predict the threshold [5,19,27]. Fourier Transform-based methods collapsed to acquire an accurate frequency spectrum due to the ECG signal’s non-linear and non-stationary characteristics [27]. Short-Time Fourier Transform computes a better frequency spectrum within a window, but a constant window size dimmed to adopt the signal’s characteristics over time [8]. Wavelet Transformation computed the spectrum based on a wavelet, and the wavelet frequencies strictly define the spectrum [11,13,14,28]. Empirical Mode Decomposition and Hilbert Transform quantify the spectral density adaptively, but the recursive decomposition approach increases the computational time complexity of the system [18].
This study proposed DMSE, AWS, and RLC algorithms to improve R peak detection efficiency in real-time. The DMSE algorithm is derived from variational mode decomposition (VMD) [29] and Hilbert Transform (HT) [30], and improved in energy and frequency estimation. The AWS algorithm is derived from the peak detection algorithm and enhances the performance of Region of Interest (ROI) estimation. The R location correction (RLC) algorithm is a search algorithm and progresses in the accuracy of the R location. As a result of these improvements, this study achieved competitive accuracy, sensitivity, and specificity in automatic R peak detection.

2. Materials and Methods

2.1. ECG Signal Dataset Overview

This study used the MIT-BIH arrhythmia database from the physionet site [31]. It was the first generally available set of standard test materials for evaluating arrhythmia detectors, and the arrhythmia database has 48 two-channel ambulatory ECG recordings of 30 min each. These signals are sampled at 360 Hz and have a resolution of 11 bits over a spectrum of ten millivolts. This study used the first lead of all 48 records for training, validation, and testing the proposed method’s performance in the analysis phase. There are a total of 112,647 annotated labels. Annotations are two types, i.e., beat annotation and non-beat annotation. This study used 18 types of MIT-BIH beat annotations and considered each beat to have an R peak. There is a total of 109,494 QRS beats in the MIT-BIH arrhythmia database.

2.2. Methods

This proposed method consists of five significant stages: (a) Data Acquisition, (b) QRS Component Extraction, (c) Region of Interest (ROI) estimation, (d) Feature Processing, and (e) Detection. Figure 2 illustrates the block diagram of the proposed method and its sub-systems. In addition, Graphical User Interface (GUI) software is developed to operate the proposed method in real-time.

2.2.1. Data Acquisition

This study interfaces the AD8232 EKG sensor (SparkFun Electronics, Niwot, CO, USA) module with an Arduino board (Arduino, Scarmagno, Italy). A Jetson Nano micro-computer (Nvidia Corporate, Santa Clara, CA, USA) receives data from Arduino at a configurable sampling rate via serial port.

2.2.2. QRS Component Extraction

The QRS Component Extraction section decomposed the ECG signal into modes and computed the Hilbert spectrum using variational mode decomposition (VMD) and Hilbert Transform (HT). Then the dynamic mode selection algorithm determines the QRS components adaptively.

VMD and HT

The VMD decomposed a signal f t into K modes u k   k = 1 , 2 , 3 , , K . These modes are called VMFs, and a VMF is defined as amplitude-modulated frequency-modulated (AM-FM) signals, written as Equation (1),
u k t   = A k t c o s φ k t
where u k t is a VMF, A k t   is a nonnegative envelope, and φ k t is non-decreasing phase function.
The complex conjugate y t of any real-valued function x t of L p class (Lebesgue spaces) can be calculated by Titchmarsh theorem defined in Equation (2),
x t   = 1 π   P V x τ t τ d τ
in which the PV indicates the principal value of the singular integral.
With the Hilbert Transform, the analytic signal is defined in Equation (3),
z t   = x t   +   i y t   = a t e j θ t
where a t   = x 2 + y 2 and θ t   = arctan y x .
Here, a t is the instantaneous amplitude and θ is phase function. The instantaneous frequency and energy are given by Equations (4) and (5), respectively,
ω i n s t = d θ d t
E i n s t = a t 2

Dynamic Mode Selected Energy (DMSE)

QRS waves were observed within a frequency band, i.e., ω B f l ,   f h . The mean and standard deviation of each VMF’s instantaneous frequency is used to select the modes dynamically. The upper and lower frequency scale of each VMF were defined by the spread from mean frequency and limited by the standard deviation. If both degrees’ intersection is within ω B , those VMFs were considered as QRS components. VMFs’ selection process is presented with Equation (6),
k s = t r u e f a l s e         { ( μ ω i n s t k σ ω i n s t k ) f l } { ( μ ω i n s t k + σ ω i n s t k ) f h }     o t h e r w i s e
It was also observed that some data points in the chosen VMFs included frequencies outside the ω B , causing an unexpected rise or fall at the edges. If instantaneous frequency of a data point is out of ω B , then those data points are detected as noisy. It is presented in Equation (7),
ω r = 1 0         f l   ω i n s t     ( ω i n s t f h ) o t h e r w i s e
The elementwise multiplication of ω r with instantaneous energy and frequency of a selected VMF only set the unnecessary data to 0. Then, the integral of all necessary data points of instantaneous energy and frequency is computed by Equations (8) and (9). R e and R ω accommodate energy and frequency of QRS components.
R e = k s = 1 k s ω r k s E i n s t k s
where k s is the number of chosen VMF.
R ω = k s = 1 k s ω r k s ω i n s t k s
where k s is the number of chosen VMF.
To obtain the noise component, this study inverts the ω r and multiplies with instantaneous energy, and finally, the integral of all noise data points is computed with Equation (10).
R n = k = 1 k ¬ ω r k E i n s t k
where k is the number of VMF.
The flow-chart of DMSE algorithm is presented in Figure 3.

2.2.3. ROI Estimation

The ROI was estimated from the integral function of energy in QRS components. The AWS algorithm was developed based on local peaks to find ROI adaptively. A peak finding algorithm detects the local peaks and its height, prominence, and width. To compute the ROI, we kept the peak’s location at the center and spread it to the left and right sides up to the peak width. The ROI window is adaptively computed with Equations (11)–(14).
Q R S W i = P e a k w i d t h i 2
where P e a k w i d t h i is the width of i th peak.
W i n d o w S t a r t = P e a k L i Q R S W i
where P e a k L i is the location of i th peak.
W i n d o w E n d = P e a k L i + Q R S W i
Q R S W i n d o w = C o m p o n e n t W i n d o w S t a r t   :   W i n d o w E n d
The flow-chart of AWS algorithm is presented in Figure 4.

2.2.4. Feature Processing

Classification features were processed in two steps, i.e., (a) Feature Extraction and (b) Feature Selection.
This study calculated twenty-five features, i.e., four features related to peak, two from a distance, eighteen statistical features from each peak’s window, and one from estimated noise. All extracted features are presented in Table 1.
Sequential Forward Selection (SFS) method was used to find relevant features for better classification. SFS is a wrapper-approach method based on the greed search algorithm, reduces N-dimensional feature space to an n-dimensional subspace, where n < N . SFS automatically selects a subset of the most relevant features and removes irrelevant features based on criterion values. Criterion refers to the mean squared error (MSE).

2.2.5. Detection Process

The detection process has an ensemble decision tree (DT) model and RLC algorithm. The model classifies R and False-R. The RLC algorithm finds the exact location of R peaks in the time domain. This study creates a dataset based on detected ROI from the ECG signal database to train, validate, and test the classifier model.

Datasets for Classification

This study found that most of the ROIs contain the QRS complex. The QRS containing ROIs are labeled as R otherwise, False-R. The training dataset has been created with 80% of each type of arrhythmia sample from the estimated ROIs. The samples are chosen randomly. The remaining 20% of the data in the ROIs’ dataset is the test dataset. The training dataset is further divided into 10-fold for cross-validation during the training process.

Ensemble Decision Tree

A Decision Tree (DT) is a non-parametric and supervised learning algorithm widely used for classification. It classifies by learning decision rules’ reasoning from the features. A tree starts from a root node, splits into branches or sub-trees until it reaches a terminal or leaf node. The root or parent of a leaf node is decided based on the feature approximation constant. This node is called the decision node, and the approximation constant is the rule. The decision tree uses the Gini index to compute the approximation constant. The Gini index computes the relative degree of disparity within the conveyance of classes and ranges from zero to one. Gini Index is computed with Equation (15).
I G = 1 j = 1 k P j 2
where P j is the probability of   j class.
Utilizing the Gini index, the most excellent features which contain the foremost information concerning the target are recognized. The dataset and the values of these features are then used to ensure that the target function values at the leaf nodes are as perfect as possible. As a result, a series of decision rules are organized in a tree structure that can distinguish. Therefore, a set of decision rules are arranged in a tree structure capable of classifying. The deeper the tree is, the model is fitter but suffers from an overfitting problem. The ensemble decision tree algorithm has overcome this generalization problem.
This study trained a total of 2 n 1 decision trees, where n is the number of selected features. Each DT is trained with a different feature set, and 75% of the samples are randomly chosen for training from the training dataset obtained from the ROIs’ dataset. Sixteen DTs have been selected based on the highest validation accuracy. Next, those sixteen DTs are ensembled, and finally, the majority votes decide which ROI contains an R peak.

R Location Correction (RLC)

This study observed that some of the detected R peaks are slightly dislocated from the annotated position. This dislocation of peak position creates incorrect results in calculating heart rate. To overcome the dislocation problem, we find the maximum value of a correction window. The position of the maximum value in the signal is considered as an R peak location. It has been observed that the dislocation problem occurs inside a window size of eight. We keep the detected location at the center of the correction window and find the correct location and amplitude as presented in Equation (16).
R c = max k R k 4 e ,   R k 3 e , ,   R k e ,   ,   R k + 3 e , R k + 4 e

2.2.6. GUI Software

A utility software has been developed with a graphical user interface presented in Figure 5. It can control the power on and off. Lead placement is checkable. Sampling frequency can be configured to 100 Hz, 150 Hz, 200 Hz, and 360 Hz. Time of acquisition is configurable to 5 s, 10 s, 1 min, 10 min, and in monitoring mode. Monitoring mode will be helpful in longtime observation. Realtime ECG with R location marked by an asterisk can be seen. Heart rate, MRR, SDNN, and RMSSD are also presented in the real-time report section. The patient data and model-generated medical information can be saved as a PDF file or printed with this software.

2.3. Evaluation Methods

True-Positive (TP), False-Positive (FP), True-Negative (TN), and False-Negative (FN) are the four quantities required to calculate the classification evaluating parameters such as sensitivity, precision, detection error, rate, accuracy, specificity, and recall. TP and TN represent the total number of correctly classified R and False-R. FP and FN indicate the inaccurately detected R and False-R. The evaluation parameters are computed with Equations (17)–(22).
S e n s i t i v i t y = T P T P + F N
P r e c i s i o n = T P T P + F P
D E R = F P + F N T P
A c c u r a c y = T P T P + F P + F N
S p e c i f i c i t y = T N T N + F P
R e c a l l = T P T P + T N
The Heart Rate Variability (HRV) is the evaluating parameter for R peak location accuracy. Three types of HRV, i.e., mean of R-R intervals (MRR), the standard deviation of normal-to-normal R-R intervals (SDNN), and root mean square of successive heartbeat interval differences (RMSSDs) are computed with the Equations (23)–(25).
M R R = 1 N 1 n = 2 N R n i
S D N N = 1 N 1 n = 2 N R n i M R R 2
R M S S D = 1 N 2 n = 3 N R n i R n 1 i 2
where R n i is the R-R interval between n t h and n t h 1 peak.

2.4. Experimental Tools and Environment

This study used a computer with Intel Core i9-9900K CPU (Intel Corporation, Santa Clara, CA, USA), 16 GB of memory, and Ubuntu 20.04 LTS as OS. MATLAB R2020b, Simulink, signal processing and machine learning toolbox are used for signal analysis, machine learning models, simulations, and system modeling. The algorithm is deployed into a practical instrument with an AD8232 EKG sensor module, Arduino board, and Jetson Nano. The desktop-based graphical user interface (GUI) application is deployed to the Jetson Nano micro-computer. This software and device are used to detect real-time R peaks on persons.

3. Results and Discussions

The proposed methods’ performance was computed using the MIT-BIH arrhythmia database. For a reasonable evaluation of performance, this study accesses section-wise performance and presented in (a) QRS Component Extraction, (b) ROI estimation, (c) Feature Processing, and (d) Performance of RLC. Finally, the proposed approach is evaluated in comparison to alternative methods in Section 3.5.

3.1. Performance of QRS Component Extraction

The VMD method decomposes an ECG signal into nine variational mode functions (VMFs), and the Hilbert Transform (HT) converts the modes into time-frequency-energy, shown in Figure 6.
In this example signal (Figure 6a), there are nine QRS complexes. It has been observed that in VMF-6, there are nine prominent peaks with low noises. Therefore, the VMF-6 represents the best time, frequency, and energy for this signal, although it can be different for different ECGs. The DMSE algorithm determines the VMFs which contain the best QRS data; otherwise, noises are considered. It suppresses all unnecessary waves like P, T, and U from the ECG signal presented in Figure 7.
For estimating the DMSE algorithm’s performance, this study counts the real, missing, and false R peaks in the integral function of the QRS component. There are 15 types of heartbeats in the MIT-BIH arrhythmia database and a total of 109,494 beats. Aberrated Atrial Premature, Fusion, Paced, Premature Ventricular Contraction, APC and Normal types suffer a loss of 0.66, 0.12, 0.07, 0.084, 0.039, 0.059%. The rest are nine types of beats and suffer zero loss. Considering the True beat counts, the mean error of the DMSE algorithm is 0.0538%. A total of 22,145 false R peaks were detected. The DMSE algorithm removes 89.887% of P, T, and noise-associated peaks. We present the performance of the DMSE algorithm in Table 2.

3.2. Performance of ROI Estimation

The purpose of the AWS algorithm is to obtain the accurate feature of QRS. Therefore, a feature set with a lower error represents the performance of the AWS algorithm. This approach used the sequential forward selection (SFS) approach for choosing the best features. The SFS method measures the feature importance or criterion one by one and includes it into the selected subsets. An ensemble decision tree algorithm was chosen for classification based on the feature distribution as shown in Figure 8c.
This study has eight subsets of features from twenty-five features. The mean squared error of each subset reveals the performance of each subset. We achieved the lowest MSE 0.001 for the eighth subset and the highest 0.0077 MSE for the first subset. In Figure 9, the adaptive feature window and performance of the AWS algorithm are presented.

3.3. Performance of Detection

The sensitivity, specificity, precision, recall, detection error rate (DER), and accuracy are measured for evaluating the classification performance. The sensitivity and specificity represent the ability to classify R and False-R accurately. Precision reports the rate of accurately classified R among all detected R. On the other hand, recall tells the rate of accurately detected R and False-R. DER notifies the ratio of incorrect and correct classification of R and False-R. Finally, accuracy represents the percentage of correct classification. The overall classification performance of the proposed method is measured by the area under the ROC curve (AUC).
The classifier model is evaluated with a 10-fold cross-validation dataset and test dataset. To analyze the performance in a real-time scenario, 1.5 s long window with 0.5 s overlapping was considered as a sample signal. Thus, R peaks in each signal file of MIT-BIH arrhythmia database are predicted, representing the actual performance of our proposed model.
The confusion matrix and performance evaluating parameters for the 10-fold validation, test, and MIT-BIH are presented in Table 3 and Table 4.

3.4. Performance of RLC

The peaks are detected from an integral function of instantaneous energy. During the signal decomposition, the exact locations of peaks are slightly shifted due to the delay of the Wiener filter used in VMD. The RLC algorithm updates the position of the detected R to the exact place. The output of the RLC algorithm is presented in Figure 10.
This study observed that a few R peaks are detected at inaccurate positions. Despite the correction of the detected position, errors still exist. For measuring the RLC algorithm’s performance, this study calculates MMR, SDNN, and RMSSD from R-R intervals extracted from R peaks. A precise “R” position is required to compute R-R distance because it is used to compute the heart rate. The heart rate variability is a vital diagnosis measurement for analyzing CVDs. The mean R-R intervals (MRR), the standard deviation of R-R intervals (SDNN), and the root mean square of R-R intervals are three significant parameters for evaluating the R positional accuracy.
The proposed approach yielded an error of 0.0048, 0.0276, and 0.042 in MRR, SDNN, and RMSSD, comparing physicians.

3.5. Performance Comparison

The proposed method has shown significant performance improvement with an accuracy of 99.94%, which has a sensitivity of 99.98%, positive predictability of 99.96%, and a detection error rate of 0.06%. The results are comparable to the best results published in the literature regarding classification performance and HRV. The proposed method’s success on the MIT-BIH arrhythmia database compared to other existing methods is in Table 5.

4. Conclusions

This proposed method’s novelties are fourfold: (1) The proposed DMSE algorithm extracts the best integral function of QRS energy from the ECG signal. (2) The proposed AWS algorithm improved in extracting features of the QRS by suppressing the possibility of mixing the P and T waves features and enhancing the QRSs’ feature only. (3) The proposed RLC algorithm improves R position accuracy. (4) As a result of the DMSE and AWS algorithm, this method significantly improves classifying “R” peaks in the ECG signal. The VMD and HT are used to extract the frequency and energy adaptively and non-recursively. The accuracy of the power spectrum is very high, except for some edge errors. This study overcomes the mode selection by the proposed DMSE algorithm and edge errors by the dropout method. The feature was extracted from a localized position, and the proposed AWS algorithm fixed the window size adaptively. Then, sixteen decision trees are ensembled to distinguish R peaks from other peaks. Finally, a location correction method is used to update to the actual location. The proposed method achieved better performance in sensitivity of 99.98%, the precision of 99.96%, DER of 0.06%, and accuracy of 99.94% than other existing methods.

Author Contributions

Conceptualization, M.A.A.Z.; methodology, M.A.A.Z.; software, M.A.A.Z.; validation, M.A.A.Z. and K.T.; formal analysis, K.T. and M.A.A.Z.; investigation, M.A.A.Z.; resources, M.A.A.Z.; data collations, M.A.A.Z.; writing, M.A.A.Z.; review and editing, M.A.A.Z., K.T. and S.-H.Y.; visualization, M.A.A.Z. and K.T.; supervision, S.-H.Y.; project administration, S.-H.Y.; funding acquisition, S.-H.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Ministry of Trade, Industry & Energy of the Republic of Kores as IoT home appliance Big-Data utilization support project (A0080517000103) and conducted under research grant from Kwangwoon University in 2021.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The MIT-BIH arrhythmia database can be found at the following website: https://physionet.org/content/mitdb/1.0.0/ (accessed on 8 February 2021).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Heron, M. Deaths: Leading Causes for 2013; U.S. Department of Health & Human Services: Hyattsville, MD, USA, 2016. [Google Scholar]
  2. Fuster, V.; Kelly, B.B.; Vedanthan, R. Promoting Global Cardiovascular Health. Circulation 2011, 123, 1671–1678. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  3. Cook, D.A.; Oh, S.-Y.; Pusic, M.V. Accuracy of Physicians’ Electrocardiogram Interpretations. JAMA Intern. Med. 2020, 180, 1461. [Google Scholar] [CrossRef] [PubMed]
  4. Silva, P.; Luz, E.; Silva, G.; Moreira, G.; Wanner, E.; Vidal, F.; Menotti, D. Towards better heartbeat segmentation with deep learning classification. Sci. Rep. 2020, 10, 1–13. [Google Scholar] [CrossRef] [PubMed]
  5. Pan, J.; Tompkins, W.J. A Real-Time QRS Detection Algorithm. IEEE Trans. Biomed. Eng. 1985, BME-32, 230–236. [Google Scholar] [CrossRef] [PubMed]
  6. Chen, A.; Zhang, Y.; Zhang, M.; Liu, W.; Chang, S.; Wang, H.; He, J.; Huang, Q. A Real Time QRS Detection Algorithm Based on ET and PD Controlled Threshold Strategy. Sensors 2020, 20, 4003. [Google Scholar] [CrossRef]
  7. Kumar, A.; Ranganatham, R.; Komaragiri, R.; Kumar, M. Efficient QRS complex detection algorithm based on Fast Fourier Transform. Biomed. Eng. Lett. 2018, 9, 145–151. [Google Scholar] [CrossRef]
  8. Uchaipichat, N.; Inban, S. Development of QRS Detection using Short-time Fourier Transform based Technique. Int. J. Comput. Appl. 2010, CASCT, 7–10. [Google Scholar] [CrossRef]
  9. Yue, Y.; Chen, C.; Liu, P.; Xing, Y.; Zhou, X. Automatic Detection of Short-Term Atrial Fibrillation Segments Based on Frequency Slice Wavelet Transform and Machine Learning Techniques. Sensors 2021, 21, 5302. [Google Scholar] [CrossRef]
  10. Gupta, V.; Mittal, M. QRS Complex Detection Using STFT, Chaos Analysis, and PCA in Standard and Real-Time ECG Databases. J. Inst. Eng. Ser. B 2019, 100, 489–497. [Google Scholar] [CrossRef]
  11. Park, J.-S.; Lee, S.-W.; Park, U. R Peak Detection Method Using Wavelet Transform and Modified Shannon Energy Envelope. J. Healthc. Eng. 2017, 2017, 1–14. [Google Scholar] [CrossRef] [Green Version]
  12. Rodriguez Jorge, R.; García, E.M.; Córdoba, R.T.; Bila, J.; Mizera-Pietraszko, J. Adaptive Threshold, Wavelet and Hilbert Transform for QRS Detection in Electrocardiogram Signals; Springer International Publishing: Basingstoke, UK, 2018; Volume 13, pp. 777–786. [Google Scholar]
  13. Martínez, J.P.; Olmos, S.; Laguna, P. Evaluation of a wavelet-based ECG waveform detector on the QT database. Comput. Cardiol. 2000, 27, 81–84. [Google Scholar] [CrossRef]
  14. Ramakrishnan, A.G.; Saha, S. ECG coding by wavelet-based linear prediction. IEEE Trans. Biomed. Eng. 1997, 44, 1253–1261. [Google Scholar] [CrossRef] [Green Version]
  15. Lin, H.-Y.; Liang, S.-Y.; Ho, Y.-L.; Lin, Y.-H.; Ma, H.-P. Discrete-wavelet-transform-based noise removal and feature extraction for ECG signals. IRBM 2014, 35, 351–361. [Google Scholar] [CrossRef]
  16. Kadambe, S.; Murray, R.; Boudreaux-Bartels, G. Wavelet transform-based QRS complex detector. IEEE Trans. Biomed. Eng. 1999, 46, 838–848. [Google Scholar] [CrossRef] [PubMed]
  17. Yochum, M.; Renaud, C.; Jacquir, S. Automatic detection of P, QRS and T patterns in 12 leads ECG signal based on CWT. Biomed. Signal Process. Control. 2016, 25, 46–52. [Google Scholar] [CrossRef]
  18. Tan, X.; Chen, X.; Hu, X.; Ren, R.; Zhou, B.; Fang, Z.; Xia, S. EMD-Based Electrocardiogram Delineation for a Wearable Low-Power ECG Monitoring Device. Can. J. Electr. Comput. Eng. 2014, 37, 212–221. [Google Scholar] [CrossRef]
  19. Lu, X.; Pan, M.; Yu, Y. QRS Detection Based on Improved Adaptive Threshold. J. Healthc. Eng. 2018, 2018, 1–8. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  20. Yazdani, S.; Vesin, J.-M. Extraction of QRS fiducial points from the ECG using adaptive mathematical morphology. Digit. Signal Process. 2016, 56, 100–109. [Google Scholar] [CrossRef] [Green Version]
  21. Yeh, Y.-C.; Wang, W.-J. QRS complexes detection for ECG signal: The Difference Operation Method. Comput. Methods Programs Biomed. 2008, 91, 245–254. [Google Scholar] [CrossRef]
  22. Khalaf, A.F.; Owis, M.I.; Yassine, I.A. A novel technique for cardiac arrhythmia classification using spectral correlation and support vector machines. Expert Syst. Appl. 2015, 42, 8361–8368. [Google Scholar] [CrossRef]
  23. Vulaj, Z.; Brajovic, M.; Draganic, A.; Orovic, I. Detection of irregular QRS complexes using Hermite transform and support vector machine. In Proceedings of the 59th International Symposium ELMAR-2017, Zadar, Croatia, 18–20 September 2017; pp. 59–62. [Google Scholar]
  24. Jun, T.J.; Park, H.J.; Minh, N.H.; Kim, D.; Kim, Y.-H. Premature Ventricular Contraction Beat Detection with Deep Neural Networks. In Proceedings of the 15th IEEE International Conference on Machine Learning and Applications (ICMLA), Anaheim, CA, USA, 18–20 December 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 859–864. [Google Scholar] [CrossRef]
  25. Neela, T.; Namburu, S. ECG signal classification using capsule neural networks. IET Netw. 2021, 10, 103–109. [Google Scholar] [CrossRef]
  26. Yuen, B.; Dong, X.; Lu, T. Detecting Noisy ECG QRS Complexes Using WaveletCNN Autoencoder and ConvLSTM. IEEE Access 2020, 8, 143802–143817. [Google Scholar] [CrossRef]
  27. Zhu, H.; Dong, J. An R-peak detection method based on peaks of Shannon energy envelope. Biomed. Signal Process. Control. 2013, 8, 466–474. [Google Scholar] [CrossRef]
  28. Li, C.; Zheng, C.; Tai, C. Detection of ECG characteristic points using wavelet transforms. IEEE Trans. Biomed. Eng. 1995, 42, 21–28. [Google Scholar] [CrossRef]
  29. Dragomiretskiy, K.; Zosso, D. Variational Mode Decomposition. IEEE Trans. Signal Process. 2013, 62, 531–544. [Google Scholar] [CrossRef]
  30. Abeysekera, R.M.S.S.; Bolton, R.; Westphal, L.; Boashash, B. Patterns in Hilbert transforms and Wigner-Ville distributions of electrocardiogram data. In Proceedings of the ICASSP ‘86. IEEE International Conference on Acoustics, Speech, and Signal Processing, Tokyo, Japan, 7–11 April 1986. [Google Scholar] [CrossRef]
  31. Moody, G.; Mark, R. The impact of the MIT-BIH Arrhythmia Database. IEEE Eng. Med. Boil. Mag. 2001, 20, 45–50. [Google Scholar] [CrossRef]
  32. Das, M.K.; Ari, S. ECG Beats Classification Using Mixture of Features. Int. Sch. Res. Not. 2014, 2014, 1–12. [Google Scholar] [CrossRef]
  33. Rakshit, M.; Panigrahy, D.; Sahu, P.K. An improved method for R-peak detection by using Shannon energy envelope. Sadhana 2016, 41, 469–477. [Google Scholar] [CrossRef] [Green Version]
  34. Zidelmal, Z.; Amirou, A.; Ould-Abdeslam, D.; Moukadem, A.; Dieterlen, A. QRS detection using S-Transform and Shannon energy. Comput. Methods Programs Biomed. 2014, 116, 1–9. [Google Scholar] [CrossRef] [Green Version]
  35. Manikandan, M.; Soman, K. A novel method for detecting R-peaks in electrocardiogram (ECG) signal. Biomed. Signal Process. Control. 2011, 7, 118–128. [Google Scholar] [CrossRef]
Figure 1. (a) The yellow line represents the electrical flow in the heart; (b) ECG signal with P, QRS, and T waves.
Figure 1. (a) The yellow line represents the electrical flow in the heart; (b) ECG signal with P, QRS, and T waves.
Sensors 21 06682 g001
Figure 2. Method’s workflow of R peak detection and its sub-systems.
Figure 2. Method’s workflow of R peak detection and its sub-systems.
Sensors 21 06682 g002
Figure 3. DMSE algorithm flow chart.
Figure 3. DMSE algorithm flow chart.
Sensors 21 06682 g003
Figure 4. Method’s AWS algorithm flow chart.
Figure 4. Method’s AWS algorithm flow chart.
Sensors 21 06682 g004
Figure 5. GUI software. The presented ECG in GUI is taken from patient in real-time.
Figure 5. GUI software. The presented ECG in GUI is taken from patient in real-time.
Sensors 21 06682 g005
Figure 6. (a) Sample ECG signal. * Illustrated the R peaks. (bu) Represents the decomposed VMFs and time-frequency-energy of each of the VMFs obtained from Hilbert Transform.
Figure 6. (a) Sample ECG signal. * Illustrated the R peaks. (bu) Represents the decomposed VMFs and time-frequency-energy of each of the VMFs obtained from Hilbert Transform.
Sensors 21 06682 g006
Figure 7. (a) QRS component of instantaneous energy; (b) The noise of the QRS component; (c) The instantaneous frequency of QRS components; (d) Detected peaks in the QRS component.
Figure 7. (a) QRS component of instantaneous energy; (b) The noise of the QRS component; (c) The instantaneous frequency of QRS components; (d) Detected peaks in the QRS component.
Sensors 21 06682 g007
Figure 8. (a) R and P represent the Pearson correlation and significance of the features; (b) Cross-correlation between features indicates redundancy; (c) Distribution of features.
Figure 8. (a) R and P represent the Pearson correlation and significance of the features; (b) Cross-correlation between features indicates redundancy; (c) Distribution of features.
Sensors 21 06682 g008
Figure 9. (a) The adaptive feature window is presented with green color; (b) MSE errors of chosen subsets.
Figure 9. (a) The adaptive feature window is presented with green color; (b) MSE errors of chosen subsets.
Sensors 21 06682 g009
Figure 10. Comparison of detected, corrected, and annotated location of R peaks in sample signal.
Figure 10. Comparison of detected, corrected, and annotated location of R peaks in sample signal.
Sensors 21 06682 g010
Table 1. Extracted features list.
Table 1. Extracted features list.
DomainFeaturesDescription/FormulaNotation
Peak
Features
HeightThe instantaneous energy at a peak location. F h P
FrequencyThe instantaneous frequency at a peak location. F f P
ProminenceThe prominence of a peak F p P
WidthThe width of a peak F w P
Distance FeaturesPrevious Peak Distance P P D = P e a k i l o c a t i o n P e a k i 1 l o c a t i o n F p D
Forward Peak Distance F P D = P e a k i + 1 l o c a t i o n P e a k i l o c a t i o n F f D
Statistical Features of a Window in Frequency and energyMean μ = i = 1 N x i N F μ E
F μ f
Standard Deviation σ = i = 1 N ( x i μ ) 2 N F σ E
F σ f
SNR S N R = μ σ F s n r E
F s n r f
RMS r . m . s = i = 1 N x i 2 N F r m s E
F r m s f
Power P = 1 N i = 1 N x i 2 F p E
F p f
Area Under Curve A = i = 1 N x i d x F a E
F a f
Entropy H x = i = 1 N P ( x i ) l o g P P ( x i F h E
F h f
Kurtosis K = i = 1 N x i μ 4 N 1 × σ 4 F k E
F k f
Skewness S = Σ i = 1 N x i μ 3 N 1 × σ 3 F s E
F s f
SignalSNR S N R = R e R n F s n r S
Table 2. Performance of DMSE algorithm.
Table 2. Performance of DMSE algorithm.
Beat Types [32]MIT-BIHExperimentalLost Peaks
False-R22,145
Normal75,05275,00745
LBBB807580750
RBBB725972590
APC254625451
Aberrated Atrial Premature1501491
Nodal Premature83830
Ectopic220
Premature Ventricular Contraction713071246
Fusion8038021
Atrial Escape16160
Nodal Escape2292290
Ventricular Escape1061060
Paced702870235
Fusion of Paced and Normal9829820
Unclassifiable Beat33330
Total109,494131,58059
Table 3. Confusion matrix for validation, test, and MIT-BIH.
Table 3. Confusion matrix for validation, test, and MIT-BIH.
DatasetTPFPTNFN
10-fold validation set87,43614117,575112
Test set21,87134439516
MIT-BIH109,4154322,10220
Table 4. Performance of classification.
Table 4. Performance of classification.
Evaluation ParametersValidation (%)Test (%)MIT-BIH (%)
Sensitivity99.8799.9399.98
Specificity99.2099.2399.81
Precision99.8499.8499.96
Recall83.2683.2783.19
DER0.290.230.06
Accuracy99.7199.7799.94
AUC99.5499.5899.89
Table 5. Comparison with other methods.
Table 5. Comparison with other methods.
MethodBeatsS (%)P (%)D (%)A (%)MRRSDNNRMSSD
Proposed131,58099.9899.960.0699.9400.82120.13800.1715
WTSEE, 2017 [11]109,49499.9399.910.16399.8380.8080.1450.193
ISEE, 2016 [33]109,53299.9599.890.15999.841---
STSE, 2014 [34]108,49499.8499.910.24799.753---
PSEE, 2013 [27]109,49499.9299.920.16899.832---
SEHT, 2012 [35]109,49699.9399.870.20099.800---
DOM, 2008 [21]109,80999.9599.850.20499.796---
WT, 2004 [13]109,42899.8099.860.34299.288---
PT, 1985 [5]109,80999.5499.750.71799.2880.81740.14580.1786
Annotated [31]109,494----0.82220.17340.2206
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Abdullah Al, Z.M.; Thapa, K.; Yang, S.-H. Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm. Sensors 2021, 21, 6682. https://0-doi-org.brum.beds.ac.uk/10.3390/s21196682

AMA Style

Abdullah Al ZM, Thapa K, Yang S-H. Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm. Sensors. 2021; 21(19):6682. https://0-doi-org.brum.beds.ac.uk/10.3390/s21196682

Chicago/Turabian Style

Abdullah Al, Zubaer Md., Keshav Thapa, and Sung-Hyun Yang. 2021. "Improving R Peak Detection in ECG Signal Using Dynamic Mode Selected Energy and Adaptive Window Sizing Algorithm with Decision Tree Algorithm" Sensors 21, no. 19: 6682. https://0-doi-org.brum.beds.ac.uk/10.3390/s21196682

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop