P-QRS-T Localization in ECG Using Deep Learning
P-QRS-T Localization in ECG Using Deep Learning
P-QRS-T Localization in ECG Using Deep Learning
Abstract— This paper describes a work using the capabilities QRS-wave, and the T-wave, embedded in a cardiac complex.
of deep neural networks to predict key wave locations in Past attempts have included manually designed features from
a cardiac complex on an electrocardiogram (ECG) as part the cardiac complexes to each type of diagnoses. Managing
of a challenge introduced by Physionet, a provider of ECG
collections, on detecting critical waveforms that contain essen- multiple versions of manually defined features would not
tial information in cardiology. The key waves include P-wave, be cost effective in practice. A reliable DL method would
QRS-wave, and T-wave. Recent attempts to extract hierarchical generate its own features leading to one capable and easy-
features of cardiac complexes have been reported in literature, to-maintain system.
but finding the accurate position of critical cardiac waves has The task of locating three major waves in cardiac com-
been a challenge in the ECG signal processing research. This
study investigates multiple architectures and learning rates of plexes is one of the primary challenges introduced by Phys-
the deep neural networks and adopts a four-step procedure ioNet [3], a provider of collections of recorded physiologic
to find the best one that can predict the wave locations. A signals. PhysioNet produces a comprehensive dataset, called
remarkable rate of 96.2% of accuracy in the localization task QTDB [3], detecting waveforms in the ECG . For each
has been achieved. This study consists of four parts to produce interval of P-wave, QRS-wave, and T-wave in this dataset, a
output predictions; obtaining the cardiac complexes from QT
Databse (QTDB) ; introduce multiple architectures, including point has been marked. Since the QTDB is an aggregation of
fully-connected networks, LeNet-style ConvNet with dropout, some other datasets, in a few cases, the beginning and end
LeNet-style ConvNet without dropout and train these networks; of the wave are marked, thus establishing two points for one
use an unseen test set to calculate the accuracy of the system interval. Therefore, three points are given, and each point
with different tolerance in each wave interval; compare all these represents a location in a wave interval.
architectures together to analyze the most suitable architecture
for this task.
I. INTRODUCTION
In recent years, with increasing computational power,
several machine learning methodologies have been used
for diagnosing heart diseases by classifying different heart
conditions and abnormalities [1], [2]. These approaches are
the classifiers for heart conditions, and they do not locate
the related wave for the associated symptoms. Finding the
location of major waves, regardless of their morphology,
can augment the possibility of even more accurate medical
diagnoses in automated ECG diagnostic systems, leading to
practical, high-throughput, cost effective population-based
screening. This paper presents the investigation of a par-
ticular branch of machine learning, the deep learning (DL)
methods, which are applied to extracting features necessary
for detecting position of ECG key waves. The DL methods Fig. 1. One instance of a cardiac complex extracted from QTDB.
are attractive since they are capable of learning features on
their own by observing a large amount of instances. The aim Recorded physiological signals are sampled at 250Hz, and
of this research work is to apply DL on ECG reads, to both the QTDB includes 105 fifteen-minutes of two-channel ECG
detect and locate the major waves, namely, the P-wave, the recording, chosen to include a broad variety of QRS and
ST-T morphologies. An automated system has annotated the
This research was supported by Children’s Cardiomyopathy Foundation
Grant.
waveforms and experts made corrections when the automated
1 Hedayat Abrishami, Chia Han and Xuefu Zhou are with the Department system failed to perform annotation [3]. This dataset allows
of EECS, University of Cincinnati, 2600 Clifton Ave, Cincinnati, OH researchers to perform on the entire ECG signal or beat to
45220, USA abrishht@mail.uc.edu han@ucmail.uc.edu beat analysis. Fig. I shows an extracted cardiac complex from
zhoxu@ucmail.uc.edu
2 Matthew Campbell is with the Division of Cardiology QTDB padded to 300 data points sampled at 250Hz (1.2
at Children’s Hospital of Philadelphia, PA 19104, USA second(s)) and 3 marks indicating the location of P-wave,
campbellm5@email.chop.edu QRS-wave, and T-wave. In this work, the ECG beat to beat
3 Richard Czosek is with the Cincinnati Children’s Hospital
Medical Center, 3333 Burnet Ave, Cincinnati, OH 45229,USA within every cardiac complex is analyzed and our focus is
Richard.czosek@cchmc.org not on extracting cardiac complexes but only on finding the
211
TABLE II TABLE IV
C ONVOLUTIONAL NEURAL NETWORK WITHOUT DROPUTS . R ESULT FOR EVERY ARCHITECTURE AND RELATED LEARNING RATES .
212
if every location of the waves predicted randomly, then of delineating, and localization of key waves augments the
the average accuracy would be 150 data points. Therefore, possibility of making impact to future research in cardi-
accuracy percentage can be obtained by Eq.3: ology. By combining the vital information of waveforms
150 − RM SECost with other methods in recognizing symptoms, more accurate
Accuracy = (3) heart related diseases can be diagnosed and high-throughput,
150
automated ECG diagnostic systems can be developed to serve
The best result for the test set in terms of percentage is
the need of large population screening for disease prevention.
96.2%, and it is obtained without considering that the waves
have durations. Table V shows the result of the ECGNEt with R EFERENCES
three different vicinity tolerance ranges, eps, (0, 5, and 10), [1] S. Kiranyaz, T. Ince, and M. Gabbouj. Real-time patient-specific ecg
using the added layer for test loss function introduced in Eq. classification by 1-d convolutional neural networks. IEEE Transactions
on Biomedical Engineering, 63(3):664–675, March 2016.
2. One can notice that when the eps is zero, it means that [2] S. Kiranyaz, T. Ince, and M. Gabbouj. Real-time patient-specific ecg
this added layer for the test has no effect, and the output of classification by 1-d convolutional neural networks. IEEE Transactions
this layer is the same as its input. This means that the exact on Biomedical Engineering, 63(3):664–675, March 2016.
[3] Goldberger et al. Physiobank, physiotoolkit, and physionet compo-
QTDB annotation for the output, and error is calculated. nents of a new research resource for complex physiologic signals.
With a vicinity tolerance of 10 data points, the system’s ”Circulation”, 2000 (June 13).
accuracy on a large variety of cardiac complexes is 99.62%, [4] J. Pan and W. J. Tompkins. A real-time qrs detection algorithm. IEEE
Transactions on Biomedical Engineering, BME-32(3):230–236, March
a phenomenal result considering tis is the very first one to 1985.
find these waves in cardiac complexes using a DL method. [5] Karimipour et al. Real-time electrocardiogram p-qrs-t detection-
delineation algorithm based on quality-supported analysis of charac-
TABLE V teristic templates. Comput. Biol. Med., 52:153–165, September 2014.
ECGN ET WITH VICINITY TOLERANCE . [6] Homaeinezhad et al. Discrete wavelet-aided delineation of PCG signal
events via analysis of an area curve length-based decision statistic.
Test set results for ECGNet Cardiovascular engineering (Dordrecht, Netherlands), 10, 2010.
Vicinity RMSE Error percentage Accuracy [7] Martinez et al. A wavelet-based ecg delineator: evaluation on standard
databases. IEEE Transactions on Biomedical Engineering, 51(4):570–
0 5.57 3.8% 96.2%
581, April 2004.
5 2.33 1.6% 98.4%
[8] Tafreshi et al. Automated analysis of ECG waveforms with atypical
10 1.61 1.1% 98.9%
QRS complex morphologies. Biomedical Signal Processing and
Control, 10:41–49, 2014.
Karimipour [5] has done an extensive research on finding [9] Ouyang et al. Training a nn with ecg to diagnose the hypertrophic
portions of hcm. In 1998 IEEE International Joint Conference on Neu-
P-QRS-T wave-forms using a combination of wavelet-based ral Networks Proceedings. IEEE World Congress on Computational
pre-processing, derivative-based wave-detection, and rule- Intelligence (Cat. No.98CH36227), volume 1, pages 306–309 vol.1,
based decision-maker method. Unlike Karimipour’s work, May 1998.
[10] Q. A. Rahman, L. G. Tereshchenko, M. Kongkatong, T. Abraham,
the proposed method uses a simple median-filter pre- M. R. Abraham, and H. Shatkay. Identifying hypertrophic cardiomy-
processing method and the rest is training the network. opathy patients by classifying individual heartbeats from 12-lead ecg
Martinez [7] proposed a wavelet-based ECG delineator. Table signals. In 2014 IEEE International Conference on Bioinformatics
and Biomedicine (BIBM), pages 224–229, Nov 2014.
VI compare ENCGNet proposed method and Karimipour’s [11] Kaiser et al. Automatic learning of rules. A practical example of
work which shows the lower RMSE in ECGNet. However, using artificial intelligence to improve computer-based detection of
in Karimipour’s work, cardiac complexes are detected by the myocardial infarction and left ventricular hypertrophy in the 12-lead
ECG. Journal of electrocardiology, 29 Suppl:17–20, 1996.
algorithm but our work doesn’t find cardiac complexes, and [12] P. de Chazal and R. B. Reilly. A patient-adapting heartbeat classifier
the only focus is to examine the ability of DL in finding using ecg morphology and heartbeat interval features. IEEE Transac-
different waveforms. tions on Biomedical Engineering, 53(12):2535–2543, Dec 2006.
[13] Warner et al. Improved electrocardiographic detection of left ven-
The training had been done on a CUDA enabled Geforce tricular hypertrophy. Journal of electrocardiology, 35 Suppl:111–5,
GT 740M graphic card and it took approximately one hour 2002.
and twenty minutes to complete the 900 epochs. [14] Krizhevsky et al. Imagenet classification with deep convolutional
neural networks. In Advances in Neural Information Processing
V. C ONCLUSION Systems, page 2012.
[15] Olga et al. Imagenet large scale visual recognition challenge. Int. J.
To our knowledge, there has been no DL research to date Comput. Vision, 115(3):211–252, December 2015.
that has focused on finding the location of major ECG waves, [16] Yann Lecun, Léon Bottou, Yoshua Bengio, and Patrick Haffner.
Gradient-based learning applied to document recognition. In Proceed-
regardless of their morphology. The results in this work ings of the IEEE, pages 2278–2324, 1998.
showed that DL is capable of extracting features necessary [17] Shayne Longpre and Ajay Sohmshetty. Facial keypoint detection.
for detecting the position of ECG key waves. The ability 2016.
[18] Zeiler et al. Visualizing and understanding convolutional networks. In
In Computer Vision–ECCV 2014, pages 818–833. Springer, 2014.
TABLE VI [19] Ashok Kumar Dohare, Vinod Kumar, and Ritesh Kumar. An efficient
new method for the detection of qrs in electrocardiogram. Comput.
C OMPARISON OF ECGN ET WITH OTHERS . Electr. Eng., 40(5):1717–1730, July 2014.
[20] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic
Method QTDB RMSE (ms) optimization. CoRR, abs/1412.6980, 2014.
ECGNet (Proposed) 30% of data 5.57 [21] Srivastava et al. Dropout: A simple way to prevent neural networks
Karimipour [5] 40 records 10.80 from overfitting. J. Mach. Learn. Res., 15(1):1929–1958, January
Martinez [7] 105 records 11.175 2014.
213