Skip to main content

Automatic QRS complex detection using two-level convolutional neural network



The QRS complex is the most noticeable feature in the electrocardiogram (ECG) signal, therefore, its detection is critical for ECG signal analysis. The existing detection methods largely depend on hand-crafted manual features and parameters, which may introduce significant computational complexity, especially in the transform domains. In addition, fixed features and parameters are not suitable for detecting various kinds of QRS complexes under different circumstances.


In this study, based on 1-D convolutional neural network (CNN), an accurate method for QRS complex detection is proposed. The CNN consists of object-level and part-level CNNs for extracting different grained ECG morphological features automatically. All the extracted morphological features are used by multi-layer perceptron (MLP) for QRS complex detection. Additionally, a simple ECG signal preprocessing technique which only contains difference operation in temporal domain is adopted.


Based on the MIT-BIH arrhythmia (MIT-BIH-AR) database, the proposed detection method achieves overall sensitivity Sen = 99.77%, positive predictivity rate PPR = 99.91%, and detection error rate DER = 0.32%. In addition, the performance variation is performed according to different signal-to-noise ratio (SNR) values.


An automatic QRS detection method using two-level 1-D CNN and simple signal preprocessing technique is proposed for QRS complex detection. Compared with the state-of-the-art QRS complex detection approaches, experimental results show that the proposed method acquires comparable accuracy.


Electrocardiogram (ECG) is a graphical representation of the electric activity of the heart and has been commonly used for cardiovascular disease diagnosis. A typical ECG-based heartbeat mainly consists of three waves including P-wave, QRS complex, and T-wave. The QRS complex is the most prominent feature and it can be used to obtain additional useful clinical information from ECG signals, such as RR interval, QT interval, and PR interval, etc. Thus, QRS detection is critical for ECG-based health evaluation.

The methods of QRS complex detection proposed in the past decades mainly consist of the preprocessing stage and the decision-making stage.

The preprocessing stage comprising nonlinear and/or linear filtering aims at reducing noise and facilitating lexical analysis afterwards. The preprocessing approaches in many previous studies mainly adopt linear filtering and wavelet transform for noise removal in ECG [1,2,3,4,5]. After filtering, the signals are further processed through numerous techniques, such as moving average filter [1, 6], squaring function [7], and Hilbert transform [8].

The preprocessing stage is followed by decision stage where the envelope of a signal is extracted and the final QRS complex location is decided. The decision-making stage usually adopts heuristic methods to detect the real QRS complex location. A number of algorithms based on derivative [8, 9], digital filters [10], and wavelet transform [11] have frequently been used for QRS detection. With the improvement of hardware environment, much more methods adopt wavelet transforms. In wavelet-based techniques, the efficiency of wavelet transform strongly depends on the choice of the mother wavelets. Other detection algorithms proposed in the literatures including mathematical morphology [12], hidden Markov model [13], S-transform [14], Hilbert transform [2], regular grammar [15], quadratic filter [16], multiresolution entropy [17], sparse representation [18], and singular value decomposition (SVD) [19]. Although the above detection methods present high accuracy with their experimental datasets, their performance largely depends on selected mother wavelets in wavelet transform as well as knowledge-based and fixed parameters in other methods. Therefore, in case of ECG patterns, which are physiological variations due to times, individuals, or circumstances, the choice of appropriate mother wavelets and parameters becomes difficult. In addition, extracting hand-crafted features manually for QRS complex detection may introduce significant computational complexity of overall process, especially in the transform domains.

To adapt with various morphologies of ECG signals, some algorithms adopt adaptive threshold which is a very important parameter in QRS complex detection. There are two categories of adaptive threshold, including single level [20,21,22,23] and multiple levels [24, 25]. However the adaptive threshold helps to improve detection accuracy at the expense of computational complexity, which makes it difficult for real-time QRS detection. Artificial neural network (ANN) based approaches have been proposed for real-time detection [26, 27]. Based on ECG signals in the CSE Data Set-3 library [28], Vijaya et al. [26] employs ANN for R-wave detection. Only 1491 QRS complexes are used for performance evaluation, which makes it difficult to prove the robustness of the method. Arbateni et al. [27] utilizes ANN-based whitening filter, matched filter, squaring and moving average filter for ECG preprocessing. Then the position of QRS complex is located by decision logic. Although the algorithm achieves an average detection error rate of 0.28%, it introduces much computational complexity for processing ECG signals. This may hinder the detection method from the usage in the light-weight healthcare devices.

In order to solve the drawbacks mentioned above, an attention-based two-level 1-D convolutional neural network (CNN) is proposed for extracting morphological features of QRS complex automatically. CNNs have achieved the state-of-the-art performance in deep learning tasks [29, 30]. It is also worth noting that visual attention models have been applied in computer vision problems for fine-grained object detection [31] and fine-grained categorization [32]. The attention model is able to process candidate regions for classification with different resolution and reduce processing cost by focusing on a restricted set of regions. With the help of the attention model, discriminatory power could be focused on the specific parts of the input pattern, which helps to classify the pattern accurately [33].

For reducing computational cost, adapting with variations of ECG signals, discarding hand-crafted features, and improving accuracy of QRS detection, an accurate method for QRS detection based on CNN is proposed. In our context, two-level CNN comprised of object-level and part-level CNNs is adopted to extract ECG morphological features for QRS complex detection. To our knowledge, this is the first study where the two-level 1-D CNN is used for ECG-based QRS complex detection. In addition, only difference and averaging operations are applied for ECG signal preprocessing.

Materials and overview

ECG samples

The ECG signals in the MIT-BIH arrhythmia (MIT-BIH-AR) database and the St. Petersburg Institute of Cardiological Technics 12-lead Arrhythmia (INCART) database are used in this study. We divide the signals of the MIT-BIH-AR database into training part and testing part, and adopt the signals of the INCART database to estimate the robustness of the proposed detection method.

The MIT-BIH-AR database contains 48 ECG recordings from 47 subjects, and each recording is sampled at 360 Hz for 30 min with 11-bit resolution over a 10 mV range. Each recording comprises two ECG leads, one lead is modified-lead II (MLII) and the other lead is mainly lead V1, sometimes V2, V4 or V5, which are summarized in Table 1. In this study, only MLII is used, and therefore record 102 and record 104 are not taken into consideration. The database consists of annotations for both heartbeat class information and R-wave position information verified by two or more expert cardiologists. All beats of the database are assigned corresponding labels by using a 17-label set. The INCART database contains 75 annotated recordings of 12-lead ECG signals. Each of them is 30 min long, sampled at 257 Hz, and gained varying from 250 to 1100 analog-to-digital converter (ADC) units per 1 mV. To match with the MIT-BIH-AR database, each recording of the INCART database should be resampled at 360 Hz. This database contains over 175,000 annotated beats.

Table 1 Summary of the channel distribution of the records in the MIT-BIH-AR database

Overview of the proposed method

The proposed method consists of three steps, including signal preprocessing, feature extraction, and QRS complex location decision. The overview diagram is shown in Fig. 1. First, difference operation and averaging operation are used to process raw ECG signals. The outputs of this step are sent to two-level 1-D CNN for feature extraction. The two-level CNN is applied to focus on different parts of the ECG signals and extract different grained morphological features. The CNN adopts hierarchical architecture, and each layer consists of 1-D convolution and 1-D subsampling. The coarse-grained features are extracted by object-level CNN and the fine-grained features are extracted by part-level CNN. All the extracted features are fed into MLP for QRS complex location decision.

Fig. 1
figure 1

Overview of the proposed QRS complex detection method



The raw ECG signal \(s_r(n)\) is differentiated to accentuate the QRS complex which is characterized by a high slope. The difference ECG signal is obtained by making subtraction between adjacent samples, which is shown as follows:

$$\begin{aligned} s_d[n]=s_r[n]-s_r[n-1] \end{aligned}$$

where \(s_r[n]\) is the raw ECG signal data at time n, and \(s_d[n]\) is the difference data at time n. The two signals are illustrated in Fig. 2a, b. It is not necessary to normalize ECG signal as other methods do [34,35,36]. Then, the difference signal are sent to part-level CNN for fine-grained feature extraction.

Fig. 2
figure 2

Outputs obtained at preprocessing stage of the proposed method. a Raw ECG signal from record 200 in the MIT-BIH-AR database; b signal obtained by difference operation; c signal obtained by averaging operation; d signal obtained by averaging operation followed by difference operation

In addition, the raw ECG signal \(s_r(n)\) is averaged per several adjacent samples, which is followed by difference operation. Then, the difference signal is fed into object-level CNN for coarse-grained feature extraction. The averaging and difference operations are represented as follows:

$$\begin{aligned} s_a[n]=\frac{1}{N_i}\sum _{i=1}^{N_i}{s_r[n*N_i+i]} \end{aligned}$$
$$\begin{aligned} s_{ad}[n]=s_a[n]-s_a[n-1] \end{aligned}$$

where \(s_a(n)\) represents the average ECG signal shown in Fig. 2c, and \(s_{ad}(n)\) represents the average difference signal shown in Fig. 2d. The number of samples in \(s_r(n)\) is \(N_i\) times more than that in \(s_a(n)\).

ECG signal segmentation

A heartbeat is commonly composed of P-wave, QRS complex, and T-wave. Therefore, we choose segment length of 56 sampling points from difference and average difference ECG signal respectively, which is shown in Fig. 3. 22 sampling points before the current detection point and 33 sampling points after it. Given the raw ECG signal in the MIT-BIH-AR database sampled at 360 Hz, all of the 56 samples equivalent to 0.78 s in average difference signal and 0.16 s in difference signal. In this way, it can cover a whole heartbeat cycle as well as QRS complex when the current detection point is R-peak.

Fig. 3
figure 3

Segment method used for ECG signal

Attention-based two-level feature extraction and QRS detection

To extract different grained morphological features from difference ECG signal as well as average difference ECG signal, an attention-based automatic feature extraction system comprised of object-level 1-D CNN and part-level 1-D CNN is proposed, which is shown in Fig. 4. The object-level CNN is applied to extract coarse-grained features corresponding to object-level segment. The segmented ECG signal is preprocessed by averaging and difference operations. The part-level CNN is used to extract fine-grained features by focusing attention on part-level segment. The ECG signal of this segment is preprocessed by difference operation only. The two levels of the system are combined for training with back-propagation (BP) scheme. The two-level CNN adopts hierarchical structure, in which different abstract features are extracted from different layers. In the low-level layer, low-level features are extracted. Then, the extracted features are propagated to the next hidden layer for extracting higher-level features. Each layer of the two-level CNN consists of convolution stage and subsampling stage. Convolution stage applies convolution operation to the input, and then output the result to the next stage. Weights are shared and several feature maps can be computed at the stage. Subsampling stage combines the outputs of clustered neurons at convolution stage into one. There are mainly two kinds of subsampling operations including max-subsampling and mean-subsampling. Max-subsampling outputs the maximum value of clustered neurons. Mean-subsampling outputs the average value of clustered neurons. In this study, mean-subsampling operation is adopted. In order to extract different grained features corresponding to different-level segmentation, the number of layers between part-level and object-level CNNs can be implementation defined. All of the features extracted by the two-level CNN are concatenated and sent to MLP for final QRS complex detection.

Fig. 4
figure 4

Structure of attention-based two-level 1-D CNN

The QRS detection process is composed of two steps including training and decision. The training process is utilized for optimizing weights and biases, and then the neural network configured with the trained weights and biases are used to detect QRS complexes. The relationships among CNN and MLP layers are presented in Fig. 5.

Fig. 5
figure 5

1-D CNN structure in the proposed detection system

The intermediate value as well as final output of the kth neuron at CNN layer l are computed as Eqs. 4 and 5 respectively, and the output of the jth neuron at MLP layer m is computed as Eq. 6.

$$\begin{aligned} a_k^l=f\left(\sum _{i=1}^{N_{l-1}}1Dconv(w_{ki}^{l-1},\,s_i^{l-1})+b_k^l\right) \end{aligned}$$
$$\begin{aligned} s_k^l=1Dsubs(a_k^l) \end{aligned}$$
$$\begin{aligned} s_j^m=f\left(\sum _{k=1}^{N_l}w_{jk}^{l}s_k^l+b_j^m\right) \end{aligned}$$

where \(w_{ki}^{l-1}\) is 1-D weight kernel between kth neuron at layer l and ith neuron at layer \(l-1.\) \(s_i^{l-1}\) is the output of ith neuron at layer \(l-1.\) \(a_k^l\) is the intermediate activation value of kth neuron at layer l. \(b_k^l\) is the bias value of kth neuron at layer l. 1Dconv and 1Dsubs represent 1-D convolution and 1-D subsampling respectively. f(.) represents activation function. In this study, the rectified linear unit (Relu) activation function is adopted in CNN layers as well as MLP hidden layers, and Softmax activation function is used in MLP output layer for final QRS complex location decision. The goal of training is to minimize objective function E by adjusting the kernel weights and biases:

$$\begin{aligned} E=E(y_1,\,y_2,...,y_N)=\sum _{j=1}^N\left(t_j-y_j\right)^2 \end{aligned}$$

where N is the total neuron number of output layer. For a given input vector \(\varvec{v},\) \([t_1,\,t_2,\ldots ,t_N]\) and \([y_1,\,y_2,\ldots ,y_N]\) are the corresponding target output vector and predicted output vector respectively. The weights and the biases are updated with the learning rate \(\eta \) as represented in Eqs. 8 and 9. In this study, we set the initial learning rate as \(\eta =0.005,\) and slightly decrease it by 0.0001% during each learning iteration.

$$\begin{aligned} w_{ki}^l(t)=w_{ki}^l(t-1)-\eta \frac{\partial E}{\partial w_{ki}^l(t-1)} \end{aligned}$$
$$\begin{aligned} b_k^l(t)=b_k^l(t-1)-\eta \frac{\partial E}{\partial b_k^l(t-1)} \end{aligned}$$

After the two-level CNN as well as the MLP are trained, both a given difference ECG signal and its corresponding average difference ECG signal are sent to the neural network system for QRS position decision.


As mentioned above, for the two-level CNN, it is feasible to adopt different depths for focusing on different-level segmentations. Two CNN layers are used for object-level feature extraction, and one CNN layer is used for part-level feature extraction. The detail configuration of the two-level CNN is described in Table 2. The outputs of the two levels are concentrated and sent into two-layer MLP for QRS location decision. The first MLP layer contains 20 neurons which are fully connected with neuron of the following layer. In this study, we find that the accuracy of QRS detection is not improved while the number of neurons in the first MLP layer exceeds 20. The second MLP layer contains four neuron used for QRS detection. The four neurons are adopted to detect Q wave, R wave, S wave and non-QRS segment respectively.

Table 2 Detail description of the proposed attention-based two-level 1-D CNN configuration

The preprocessing and segmentation are processed by Matlab, and the neural network is trained by using high-level Python library Keras [37]. Keras allows for easy and fast prototyping of the neural networks.

For training the proposed two-level CNN, 400 representative QRS complexes, along with their associated non-QRS segments are selected from the MIT-BIH-AR database. The ECG signals for testing contain 46 ECG records from the MIT-BIH-AR database as well as all ECG records from the INCART database. Only MLII of the MIT-BIH-AR database and lead II of the INCART database are used. The measured metrics adopted for evaluating detection performance are sensitivity (Sen), positive predictivity rate (PPR), detection error rate (DER), and accuracy (Acc), which are calculated by:

$$\begin{aligned} Sen\,(\%) = \frac{TP}{TP+FN}*100 \end{aligned}$$
$$\begin{aligned} PPR\,(\%) = \frac{TP}{TP+FP}*100 \end{aligned}$$
$$\begin{aligned} DER\,(\%) = \frac{FN+FP}{TP+FN}*100 \end{aligned}$$
$$\begin{aligned} Acc\,(\%) = \frac{TP}{TP+FP+FN}*100 \end{aligned}$$

The above four metrics are computed by the quantity of true positive (TP), false positive (FP), and false negative (FN). TP is number of correct QRS prediction. FP is number of incorrect QRS prediction. FN is number of incorrectly rejected QRS.

The QRS complex detection performance achieved by using the 46 ECG records in the MIT-BIH-AR database is shown in Table 3. As the table shows, the overall Sen = 99.77%, PPR = 99.91%, and DER = 0.32%. All the Sen and PPR values are higher than 99%. For 20 cases of detection in the MIT-BIH-AR database, Sen values are 100.00%. For 23 cases of detection in the database, PPR values are 100.00%. In addition, only 4 cases have error values greater than 1%. These records are 106, 223, 228, and 233. The number of undetected and false positive QRS complexes results in the consequence. Records where the error values exceed 1% are mainly due to two reasons: the morphology of Q-wave is much like the R-wave in some segmentations or in other cases the slope of QRS complex is quite gentle.

Table 3 Performance evaluation of the proposed method using the MIT-BIH-AR database

The performance comparison between the proposed method and other eight state-of-the-art approaches is shown in Table 4. The DER value reflects the general performance of these approaches, and thus the order of each algorithm is sorted based on this index. As presented in the table, for the MIT-BIH-AR database, the performance of our proposed method is comparable to other state-of-the-art algorithms. The maximal and minimal average DER values are 0.51 and 0.25% respectively.

Table 4 Comparison of performance of several QRS detection methods using the MIT-BIH-AR database

The representative examples of incorrect detection performed by the proposed detection method are shown in Fig. 6. The record 203 in the MIT-BIH-AR database contains much noise and irregular heartbeats in the aspect of morphology, which leads to a considerable number of FNs and FPs.

Fig. 6
figure 6

Examples of incorrect detection in record 203

Table 5 shows comparison result of the DER values by evaluating records 105, 108, 121, 200, 202, and 217 from the MIT-BIH-AR database. The best result for each record is emphasized by italicface. The DER values of records 108, 121, and 202 from the proposed algorithm are minimal at 0.00%. In addition, to assess the robustness of the proposed detection method to noise, we add Gaussian noise with 9 different signal-to-noise ratio (SNR) values to the raw ECG signals including records 105, 108, 121, 200, 202, and 217, and the corresponding detection results are presented in Table 6. As to SNR value greater than 30 dB, the proposed detection method provides high Sen values which exceed 99%. As to SNR value greater than 20 dB, the method provides high PPR values which exceed 99%. Fig. 7 presents the variation of Sen, PPR, and DER values depending on different SNR values. Compared with detection performance using noise-free ECG signals, both the Sen and PPR values are close to the values without noise when the SNR value is larger than 10 dB. The reasons behind the robustness to noise mainly focus on two reasons. One is that the proposed signal preprocessing approach can eliminate noise to some extent. The other is that the ECG signals used at the training stage are also combined with noise, so that the proposed method can extract features of ECG signals and detect QRS complexes with noise.

Fig. 7
figure 7

Sen variation according to different SNR values based on 105, 108, 121, 200, 202, and 217 ECG records

Table 5 Comparison of DER values on 105, 108, 121, 200, 202, and 217 records of the MIT-BIH-AR database
Table 6 Detection performance with noise added and without noise

In this study, more than 170,000 beats of the INCART database are also used to estimate the capability of the proposed QRS detection method. As presented in Table 7, based on the database, the proposed technique achieves Sen = 99.86%, PPR = 99.89%, DER = 0.25%, and Acc = 99.75%.

Table 7 Performance evaluation of the proposed method using the INCART database

The proposed detection method is also evaluated in the aspect of computational complexity. A computer with Intel Core i3 CPU 3.5 GHz is used for evaluation. For example, the time consumed for the QRS detection on 30-min ECG record 100 (2273 beats) of the MIT-BIH-AR database is 14.53 s, which is faster than other state-of-the-art approaches [5, 23]. The method presented by Karimipour [5] takes more than 8 ms to detect one QRS complex and Mourad [23] takes 141 s for QRS detection for the same record. The outperformance is due to the proposed simple signal preprocessing technique and light-weight CNN.


QRS complex is the most protruding feature in the ECG with R-peak as the most significant wave. With the help of QRS detection, other components in the ECG signals can be found, such as P wave, T wave, RR interval and PR interval, etc. [11]. Also, QRS detection can provide useful information for biological signal processing, such as heartbeat classification [38], the heart rate computation [39], ECG compression [40], biometrics [41], etc. Although QRS detection is important, the diagnoses of some abnormalities do not have to detect QRS. In the study of Acharya et al. [34, 35], CNN is used for automatic arrhythmia and coronary artery disease detection. All the raw ECG signals are downsampled and removed noise at first. Then, the ECG signals are separated into two different durations of segments and sent to corresponding CNNs for final arrhythmia classification.

The detection for QRS complex as well as many abnormalities in the ECG is complicated at the presence of noise. However, the noise can be used to improve the detection robustness to noise. One of the reasons behind the robustness to noise of the proposed method is that the ECG signals used at the training stage are combined with noise. Similarly, in the study of Acharya et al. [36], both the noisy and the denoised ECG signals are segmented using the detected R-peaks and then sent to CNN for training. Although the noise reduces the overall performance, the trained CNN can be implemented for detection of abnormalities with and without noise.

In order to facilitate feature extraction and reduce computational complexity, only difference and averaging operations are applied for preprocessing in the proposed method. Then, the two-level 1-D CNN is used for automatic extracting different grained morphological features which are sent to MLP for final QRS detection. The performance of our proposed method is comparable to the performances showed in Tables 4 and 5. The robustness to noise of the proposed method is also assessed and shown in Table 6.

The advantages of our proposed method are summarized below:

  1. (1)

    Both the feature extraction and final QRS detection are automatic by using two-level CNN and MLP.

  2. (2)

    The computation cost of the proposed QRS detection method is low.

  3. (3)

    The proposed detection method is robust to noise.

The shortages of our proposed method are as follows:

  1. (1)

    The training of the proposed method is a time-consuming process.

  2. (2)

    The length of input ECG signal is fixed once the structures of the CNN and the MLP are determined.


In this paper, an automatic QRS complex detection method is proposed, which adopts morphological features of ECG signals. The coarse-grained and fine-grained morphological features are extracted using attention-based two-level 1-D CNN, negating the necessity to extract features manually. In order to facilitate feature extraction mentioned above, a simple preprocessing technique is also adopted. The experimental results obtained by using the MIT-BIH-AR database and the INCART database show that the proposed QRS detection method provides robustness to noise and high detection performance.

Based on the identified QRS complex, the rest of the ECG waves can be detected. The work assists medical diagnoses and serves as an entry point to almost all automated ECG analysis. In future work, we will combine ECG signals and other biomedical signals to improve the accuracy and the robustness to noise of QRS complex detection. In addition, the detected waves will be used for heartbeat classification which is crucial in cardiovascular disease diagnosis.







analog-to-digital converter


artificial neural network




convolutional neural network


detection error rate




St. Petersburg Institute of Cardiological Technics 12-lead Arrhythmia


MIT-BIH arrhythmia


modified-lead II


multi-layer perceptron


positive predictivity rate


rectified linear unit




signal-to-noise ratio


singular value decomposition


true positive


false positive


false negative


  1. Hadj Slimane ZE, Naït-Ali A. QRS complex detection using empirical mode decomposition. Digit Signal Process. 2010;20:1221–8.

    Article  Google Scholar 

  2. Manikandan MS, Soman KP. A novel method for detecting R-peaks in electrocardiogram (ECG) signal. Biomed Signal Process Control. 2012;7:118–28.

    Article  Google Scholar 

  3. Zhu H, Dong J. An R-peak detection method based on peaks of shannon energy envelope. Biomed Signal Process Control. 2013;8:466–74.

    Article  Google Scholar 

  4. Bouaziz F, Boutana D, Benidir M. Multiresolution wavelet-based QRS complex detection algorithm suited to several abnormal morphologies. IET Signal Process. 2014;8:774–82.

    Article  Google Scholar 

  5. Karimipour A, Homaeinezhad MR. Real-time electrocardiogram P-QRS-T detection–delineation algorithm based on quality-supported analysis of characteristic templates. Comput Biol Med. 2014;52:153–65.

    Article  Google Scholar 

  6. Chouakri SA, Bereksi-Reguig F, Taleb-Ahmed A. QRS complex detection based on multi wavelet packet decomposition. Appl Math Comput. 2011;217:9508–25.

    MathSciNet  MATH  Google Scholar 

  7. Adnane M, Jiang Z, Choi S. Development of QRS detection algorithm designed for wearable cardiorespiratory system. Comput Methods Programs Biomed. 2009;93:20–31.

    Article  Google Scholar 

  8. Madeiro JP, Cortez PC, Marques JA, Seisdedos CR, Sobrinho CR. An innovative approach of QRS segmentation based on first-derivative, Hilbert and Wavelet Transforms. Med Eng Phys. 2012;34:1236–46.

    Article  Google Scholar 

  9. Arzeno NM, Deng ZD, Poon CS. Analysis of first-derivative based QRS detection algorithms. IEEE Trans Biomed Eng. 2008;55:478–84.

    Article  Google Scholar 

  10. Keselbrener L, Keselbrener M, Akselrod S. Nonlinear high pass filter for R-wave detection in ECG signal. Med Eng Phys. 1997;19:481–4.

    Article  Google Scholar 

  11. Sharma T, Sharma KK. QRS complex detection in ECG signals using locally adaptive weighted total variation denoising. Comput Biol Med. 2017;87:187–99.

    Article  Google Scholar 

  12. Trahanias PE. An approach to QRS complex detection using mathematical morphology. IEEE Trans Biomed Eng. 1993;40:201–5.

    Article  Google Scholar 

  13. Coast DA, Stern RM, Cano GG, Briller SA. An approach to cardiac arrhythmia analysis using hidden Markov models. IEEE Trans Biomed Eng. 1990;37:826–36.

    Article  Google Scholar 

  14. Zidelmal Z, Amirou A, Adnane M, Belouchrani A. QRS detection based on wavelet coefficients. Comput Methods Programs Biomed. 2012;107:490–6.

    Article  Google Scholar 

  15. Hamdi S, Ben AA, Bedoui MH. Real time QRS complex detection using DFA and regular grammar. Biomed Eng Online. 2017;16:31.

    Article  Google Scholar 

  16. Phukpattaranont P. QRS detection algorithm based on the quadratic filter. Expert Syst Appl. 2015;42:4867–77.

    Article  Google Scholar 

  17. Farashi S. A multiresolution time-dependent entropy method for QRS complex detection. Biomed Signal Process Control. 2016;24:63–71.

    Article  Google Scholar 

  18. Zhou Y, Hu X, Tang Z, Ahn AC. Sparse representation-based ECG signal enhancement and QRS detection. Physiol Meas. 2016;37:2093.

    Article  Google Scholar 

  19. Jung WH, Lee SG. An R-peak detection method that uses an SVD filter and a search back system. Comput Methods Programs Biomed. 2012;108:1121–32.

    Article  Google Scholar 

  20. Choi S, Adnane M, Lee GJ, Jang H, Jiang Z, Park HK. Development of ECG beat segmentation method by combining lowpass filter and irregular R–R interval checkup strategy. Expert Syst Appl. 2010;37:5208–18.

    Article  Google Scholar 

  21. Zhang CF, Bae TW. VLSI friendly ECG QRS complex detector for body sensor networks. IEEE J Emerg Sel Top Circuits Syst. 2012;2:52–9.

    Article  Google Scholar 

  22. Zhang F, Lian Y. QRS detection based on morphological filter and energy envelope for applications in body sensor networks. J Signal Process Syst. 2011;64:187–94.

    Article  Google Scholar 

  23. Kholkhal M, Reguig FB. Efficient automatic detection of QRS complexes in ECG signal based on reverse biorthogonal wavelet decomposition and nonlinear filtering. Measurement. 2016;94:663–70.

    Article  Google Scholar 

  24. Lee JW, Kim KS, Lee B, Lee B, Lee MH. A real time QRS detection using delay-coordinate mapping for the microcontroller implementation. Ann Biomed Eng. 2002;30:1140–51.

    Article  Google Scholar 

  25. Christov II. Real time electrocardiogram QRS detection using combined adaptive threshold. Biomed Eng Online. 2004;3:1–9.

    Article  Google Scholar 

  26. Vijaya G, Kumar V, Verma HK. ANN-based QRS-complex analysis of ECG. J Med Eng Technol. 1998;22:160.

    Article  Google Scholar 

  27. Arbateni K, Bennia A. Sigmoidal radial basis function ANN for QRS complex detection. Neurocomputing. 2014;145:438–50.

    Article  Google Scholar 

  28. Willems JL, Arnaud P, van Bemmel JH, Bourdillon PJ, Degani R, Denis B, Graham I, Harms FM, Macfarlane PW, Mazzocca G. A reference data base for multilead electrocardiographic computer measurement programs. J Am Coll Cardiol. 1987;10:1313–21.

    Article  Google Scholar 

  29. Girshick R, Donahue J, Darrell T, Malik J. Rich feature hierarchies for accurate object detection and semantic segmentation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. 2014; p. 580–7.

  30. Li H, Lin Z, Shen X, Brandt J, Hua G. A convolutional neural network cascade for face detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015; p. 5325–34.

  31. Gonzalez-Garcia A, Vezhnevets A, Ferrari V. An active search strategy for efficient object class detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015; p. 3022–31.

  32. Zhang N, Donahue J, Girshick R, Darrell T. Part-based R-CNNs for fine-grained category detection. In: European conference on computer vision. 2014; p. 834–49.

  33. Xiao T, Xu Y, Yang K, Zhang J, Peng Y, Zhang Z. The application of two-level attention models in deep convolutional neural network for fine-grained image classification. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2014; p. 842–50.

  34. Acharya UR, Fujita H, Lih OS, Hagiwara Y, Tan JH, Adam M. Automated detection of arrhythmias using different intervals of tachycardia ECG segments with convolutional neural network. Inf Sci. 2017;405:81–90.

    Article  Google Scholar 

  35. Acharya UR, Fujita H, Lih OS, Adam M, Tan JH, Chua CK. Automated detection of coronary artery disease using different durations of ECG segments with convolutional neural network. KnowledgeBased Syst. 2017;132:62–71.

    Google Scholar 

  36. Acharya UR, Fujita H, Lih OS, Hagiwara Y, Tan JH, Adam M. Application of deep convolutional neural network for automated detection of myocardial infarction using ECG signals. Inf Sci. 2017;415:190–8.

    Article  Google Scholar 

  37. Chollet F. Accessed 22 Nov 2017.

  38. Banerjee S, Mitra M. Application of cross wavelet transform for ECG pattern analysis and classification. IEEE Trans Instrum Meas. 2014;63:326–33.

    Article  Google Scholar 

  39. Langley P, Bowers EJ, Murray A. Principal component analysis as a tool for analyzing beat-to-beat changes in ECG features: application to ECG-derived respiration. IEEE Trans Biomed Eng. 2010;57:821–9.

    Article  Google Scholar 

  40. Singh AA, Lakshminarayan C, Principe JC. Time-based compression and classification of heartbeats. IEEE Trans Biomed Eng. 2012;59:1641–8.

    Article  Google Scholar 

  41. Wübbeler G, Stavridis M, Kreiseler D, Bousseljo RD, Elster C. Verification of humans using the electrocardiogram. Pattern Recognit Lett. 2007;28:1172–5.

    Article  Google Scholar 

Download references

Authors’ contributions

YX, ZL, and JM carried out the research. YX developed the method and drafted the manuscript. YX performed the experiments. All authors read and approved the final manuscript.


Not applicable.

Competing interests

The authors declare that they have no competing interests.

Data availability

ECG signals are taken from the MIT-BIH arrhythmia database and the INCART database. MIT-BIH arrhythmia database: INCART database:

Ethics approval and consent to participate

Not applicable.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Jianyi Meng.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Xiang, Y., Lin, Z. & Meng, J. Automatic QRS complex detection using two-level convolutional neural network. BioMed Eng OnLine 17, 13 (2018).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: