Skip to main content
Sensors (Basel, Switzerland) logoLink to Sensors (Basel, Switzerland)
. 2021 Oct 8;21(19):6682. doi: 10.3390/s21196682

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

Zubaer Md Abdullah Al 1,*, Keshav Thapa 1, Sung-Hyun Yang 1
Editors: Raffaele Gravina1, Annie Lanzolla1
PMCID: PMC8512633  PMID: 34641007

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.

Keywords: QRS detection, ECG interpretation, biomedical signal processing, machine learning, intelligence medical device

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.

Figure 1.

Figure 1

(a) The yellow line represents the electrical flow in the heart; (b) ECG signal with P, QRS, and T waves.

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.

Figure 2.

Figure 2

Method’s workflow of R peak detection and its sub-systems.

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 ft into K modes uk 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),

ukt =Aktcosφkt (1)

where ukt is a VMF, Akt  is a nonnegative envelope, and φkt is non-decreasing phase function.

The complex conjugate yt of any real-valued function xt of Lp class (Lebesgue spaces) can be calculated by Titchmarsh theorem defined in Equation (2),

xt =1π PVxτtτdτ (2)

in which the PV indicates the principal value of the singular integral.

With the Hilbert Transform, the analytic signal is defined in Equation (3),

zt =xt + iyt =atejθt (3)

where at =x2+y2 and θt =arctanyx.

Here, at is the instantaneous amplitude and θ is phase function. The instantaneous frequency and energy are given by Equations (4) and (5), respectively,

ωinst=dθdt (4)
Einst=at2 (5)
Dynamic Mode Selected Energy (DMSE)

QRS waves were observed within a frequency band, i.e., ωBfl, fh. 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),

ks=truefalse    {(μωinstkσωinstk)fl}{(μωinstk+σωinstk)fh}  otherwise (6)

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=10    fl ωinst  (ωinstfh)otherwise (7)

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). Re and Rω accommodate energy and frequency of QRS components.

Re=ks=1ksωrksEinstks (8)

where ks is the number of chosen VMF.

Rω=ks=1ksωrksωinstks (9)

where ks 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).

Rn=k=1k¬ωrkEinstk (10)

where k is the number of VMF.

The flow-chart of DMSE algorithm is presented in Figure 3.

Figure 3.

Figure 3

DMSE algorithm flow chart.

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).

QRSWi=Peakwidthi2 (11)

where Peakwidthi is the width of i th peak.

WindowStart=PeakLiQRSWi (12)

where PeakLi is the location of i th peak.

WindowEnd=PeakLi+QRSWi (13)
QRSWindow=ComponentWindowStart : WindowEnd (14)

The flow-chart of AWS algorithm is presented in Figure 4.

Figure 4.

Figure 4

Method’s AWS algorithm flow chart.

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.

Table 1.

Extracted features list.

Domain Features Description/Formula Notation
Peak
Features
Height The instantaneous energy at a peak location. FhP
Frequency The instantaneous frequency at a peak location. FfP
Prominence The prominence of a peak FpP
Width The width of a peak FwP
Distance Features Previous Peak Distance PPD=PeakilocationPeaki1location FpD
Forward Peak Distance FPD=Peaki+1locationPeakilocation FfD
Statistical Features of a Window in Frequency and energy Mean μ=i=1NxiN FμE
Fμf
Standard Deviation σ=i=1N(xiμ)2N FσE
Fσf
SNR SNR=μσ FsnrE
Fsnrf
RMS r.m.s=i=1Nxi2N FrmsE
Frmsf
Power P=1Ni=1Nxi2 FpE
Fpf
Area Under Curve A=i=1Nxidx FaE
Faf
Entropy Hx=i=1NP(xi)logPP(xi FhE
Fhf
Kurtosis K=i=1Nxiμ4N1×σ4 FkE
Fkf
Skewness S=Σi=1Nxiμ3N1×σ3 FsE
Fsf
Signal SNR SNR=ReRn FsnrS

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).

IG=1j=1kPj2 (15)

where Pj 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 2n1 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).

Rc=maxkRk4e, Rk3e,, Rke, , Rk+3e,Rk+4e (16)

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.

Figure 5.

Figure 5

GUI software. The presented ECG in GUI is taken from patient in real-time.

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).

Sensitivity=TPTP+FN (17)
Precision=TPTP+FP (18)
DER=FP+FNTP (19)
Accuracy=TPTP+FP+FN (20)
Specificity=TNTN+FP (21)
Recall=TPTP+TN (22)

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).

MRR=1N1n=2NRni (23)
SDNN=1N1n=2NRniMRR2 (24)
RMSSD=1N2n=3NRniRn1i2 (25)

where Rni is the R-R interval between nth and nth1 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.

Figure 6.

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.

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.

Figure 7.

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.

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.

Table 2.

Performance of DMSE algorithm.

Beat Types [32] MIT-BIH Experimental Lost Peaks
False-R 22,145
Normal 75,052 75,007 45
LBBB 8075 8075 0
RBBB 7259 7259 0
APC 2546 2545 1
Aberrated Atrial Premature 150 149 1
Nodal Premature 83 83 0
Ectopic 2 2 0
Premature Ventricular Contraction 7130 7124 6
Fusion 803 802 1
Atrial Escape 16 16 0
Nodal Escape 229 229 0
Ventricular Escape 106 106 0
Paced 7028 7023 5
Fusion of Paced and Normal 982 982 0
Unclassifiable Beat 33 33 0
Total 109,494 131,580 59

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.

Figure 8.

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.

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.

Figure 9.

Figure 9

(a) The adaptive feature window is presented with green color; (b) MSE errors of chosen subsets.

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.

Table 3.

Confusion matrix for validation, test, and MIT-BIH.

Dataset TP FP TN FN
10-fold validation set 87,436 141 17,575 112
Test set 21,871 34 4395 16
MIT-BIH 109,415 43 22,102 20

Table 4.

Performance of classification.

Evaluation Parameters Validation (%) Test (%) MIT-BIH (%)
Sensitivity 99.87 99.93 99.98
Specificity 99.20 99.23 99.81
Precision 99.84 99.84 99.96
Recall 83.26 83.27 83.19
DER 0.29 0.23 0.06
Accuracy 99.71 99.77 99.94
AUC 99.54 99.58 99.89

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.

Figure 10.

Figure 10

Comparison of detected, corrected, and annotated location of R peaks in sample signal.

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.

Table 5.

Comparison with other methods.

Method Beats S (%) P (%) D (%) A (%) MRR SDNN RMSSD
Proposed 131,580 99.98 99.96 0.06 99.940 0.8212 0.1380 0.1715
WTSEE, 2017 [11] 109,494 99.93 99.91 0.163 99.838 0.808 0.145 0.193
ISEE, 2016 [33] 109,532 99.95 99.89 0.159 99.841 - - -
STSE, 2014 [34] 108,494 99.84 99.91 0.247 99.753 - - -
PSEE, 2013 [27] 109,494 99.92 99.92 0.168 99.832 - - -
SEHT, 2012 [35] 109,496 99.93 99.87 0.200 99.800 - - -
DOM, 2008 [21] 109,809 99.95 99.85 0.204 99.796 - - -
WT, 2004 [13] 109,428 99.80 99.86 0.342 99.288 - - -
PT, 1985 [5] 109,809 99.54 99.75 0.717 99.288 0.8174 0.1458 0.1786
Annotated [31] 109,494 - - - - 0.8222 0.1734 0.2206

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.

Footnotes

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

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. doi: 10.1161/CIRCULATIONAHA.110.009522. [DOI] [PubMed] [Google Scholar]
  • 3.Cook D.A., Oh S.-Y., Pusic M.V. Accuracy of Physicians’ Electrocardiogram Interpretations. JAMA Intern. Med. 2020;180:1461. doi: 10.1001/jamainternmed.2020.3989. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. doi: 10.1038/s41598-020-77745-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Pan J., Tompkins W.J. A Real-Time QRS Detection Algorithm. IEEE Trans. Biomed. Eng. 1985;BME-32:230–236. doi: 10.1109/TBME.1985.325532. [DOI] [PubMed] [Google Scholar]
  • 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. doi: 10.3390/s20144003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. doi: 10.1007/s13534-018-0087-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Uchaipichat N., Inban S. Development of QRS Detection using Short-time Fourier Transform based Technique. Int. J. Comput. Appl. 2010;CASCT:7–10. doi: 10.5120/998-32. [DOI] [Google Scholar]
  • 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. doi: 10.3390/s21165302. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. doi: 10.1007/s40031-019-00398-9. [DOI] [Google Scholar]
  • 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. doi: 10.1155/2017/4901017. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. Volume 13. Springer International Publishing; Basingstoke, UK: 2018. 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. doi: 10.1109/cic.2000.898460. [DOI] [Google Scholar]
  • 14.Ramakrishnan A.G., Saha S. ECG coding by wavelet-based linear prediction. IEEE Trans. Biomed. Eng. 1997;44:1253–1261. doi: 10.1109/10.649997. [DOI] [PubMed] [Google Scholar]
  • 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. doi: 10.1016/j.irbm.2014.10.004. [DOI] [Google Scholar]
  • 16.Kadambe S., Murray R., Boudreaux-Bartels G. Wavelet transform-based QRS complex detector. IEEE Trans. Biomed. Eng. 1999;46:838–848. doi: 10.1109/10.771194. [DOI] [PubMed] [Google Scholar]
  • 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. doi: 10.1016/j.bspc.2015.10.011. [DOI] [Google Scholar]
  • 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. doi: 10.1109/cjece.2014.2316852. [DOI] [Google Scholar]
  • 19.Lu X., Pan M., Yu Y. QRS Detection Based on Improved Adaptive Threshold. J. Healthc. Eng. 2018;2018:1–8. doi: 10.1155/2018/5694595. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. doi: 10.1016/j.dsp.2016.06.010. [DOI] [Google Scholar]
  • 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. doi: 10.1016/j.cmpb.2008.04.006. [DOI] [PubMed] [Google Scholar]
  • 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. doi: 10.1016/j.eswa.2015.06.046. [DOI] [Google Scholar]
  • 23.Vulaj Z., Brajovic M., Draganic A., Orovic I. Detection of irregular QRS complexes using Hermite transform and support vector machine; 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; Proceedings of the 15th IEEE International Conference on Machine Learning and Applications (ICMLA); Anaheim, CA, USA. 18–20 December 2016; Piscataway, NJ, USA: IEEE; 2016. pp. 859–864. [DOI] [Google Scholar]
  • 25.Neela T., Namburu S. ECG signal classification using capsule neural networks. IET Netw. 2021;10:103–109. doi: 10.1049/ntw2.12018. [DOI] [Google Scholar]
  • 26.Yuen B., Dong X., Lu T. Detecting Noisy ECG QRS Complexes Using WaveletCNN Autoencoder and ConvLSTM. IEEE Access. 2020;8:143802–143817. doi: 10.1109/ACCESS.2020.3012904. [DOI] [Google Scholar]
  • 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. doi: 10.1016/j.bspc.2013.01.001. [DOI] [Google Scholar]
  • 28.Li C., Zheng C., Tai C. Detection of ECG characteristic points using wavelet transforms. IEEE Trans. Biomed. Eng. 1995;42:21–28. doi: 10.1109/10.362922. [DOI] [PubMed] [Google Scholar]
  • 29.Dragomiretskiy K., Zosso D. Variational Mode Decomposition. IEEE Trans. Signal Process. 2013;62:531–544. doi: 10.1109/TSP.2013.2288675. [DOI] [Google Scholar]
  • 30.Abeysekera R.M.S.S., Bolton R., Westphal L., Boashash B. Patterns in Hilbert transforms and Wigner-Ville distributions of electrocardiogram data; Proceedings of the ICASSP ‘86. IEEE International Conference on Acoustics, Speech, and Signal Processing; Tokyo, Japan. 7–11 April 1986; [DOI] [Google Scholar]
  • 31.Moody G., Mark R. The impact of the MIT-BIH Arrhythmia Database. IEEE Eng. Med. Boil. Mag. 2001;20:45–50. doi: 10.1109/51.932724. [DOI] [PubMed] [Google Scholar]
  • 32.Das M.K., Ari S. ECG Beats Classification Using Mixture of Features. Int. Sch. Res. Not. 2014;2014:1–12. doi: 10.1155/2014/178436. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 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. doi: 10.1007/s12046-016-0485-8. [DOI] [Google Scholar]
  • 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. doi: 10.1016/j.cmpb.2014.04.008. [DOI] [PubMed] [Google Scholar]
  • 35.Manikandan M., Soman K. A novel method for detecting R-peaks in electrocardiogram (ECG) signal. Biomed. Signal Process. Control. 2011;7:118–128. doi: 10.1016/j.bspc.2011.03.004. [DOI] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

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).


Articles from Sensors (Basel, Switzerland) are provided here courtesy of Multidisciplinary Digital Publishing Institute (MDPI)

RESOURCES