Convolutional Neural Networks for Electrocardiogram Classification

  • Mohamad M. Al Rahhal
  • Yakoub Bazi
  • Mansour Al Zuair
  • Esam Othman
  • Bilel BenJdira
Original Article


In this paper, we propose a transfer learning approach for Arrhythmia Detection and Classification in Cross ECG Databases. This approach relies on a deep convolutional neural network (CNN) pretrained on an auxiliary domain (called ImageNet) with very large labelled images coupled with an additional network composed of fully connected layers. As the pretrained CNN accepts only RGB images as the input, we apply continuous wavelet transform (CWT) to the ECG signals under analysis to generate an over-complete time–frequency representation. Then, we feed the resulting image-like representations as inputs into the pretrained CNN to generate the CNN features. Next, we train the additional fully connected network on the ECG labeled data represented by the CNN features in a supervised way by minimizing cross-entropy error with dropout regularization. The experiments reported in the MIT-BIH arrhythmia, the INCART and the SVDB databases show that the proposed method can achieve better results for the detection of ventricular ectopic beats (VEB) and supraventricular ectopic beats (SVEB) compared to state-of-the-art methods.


ECG classification Convolutional neural networks (CNNs) 

JEL Classification




The authors would like to extend their sincere appreciation to the Deanship of Scientific Research at King Saud University for its funding this Research group NO.(RG -1435-050).

Compliance with Ethical Standards

Conflicts of interest

The authors that they declare no conflict of interest.


  1. 1.
    Hinton, G. E., Osindero, S., & Teh, Y. W. (2006). A fast learning algorithm for deep belief nets. Neural Computation, 18(7), 1527–1554. Scholar
  2. 2.
    Sun, X., Nasrabadi, N. M., & Tran, T. D. (2015). Task-driven dictionary learning for hyperspectral image classification with structured sparsity constraints. IEEE Transactions on Geoscience and Remote Sensing, 53(8), 4457–4471. Scholar
  3. 3.
    Li, J.-C., Ng, W. W. Y., Yeung, D. S., & Chan, P. P. K. (2014). Bi-firing deep neural networks. International Journal of Machine Learning and Cybernetics, 5(1), 73–83. Scholar
  4. 4.
    Zhang, J., Ding, S., Zhang, N., & Shi, Z. (2016). Incremental extreme learning machine based on deep feature embedded. International Journal of Machine Learning and Cybernetics, 7(1), 111–120. Scholar
  5. 5.
    Swietojanski, P., Ghoshal, A., & Renals, S. (2014). Convolutional neural networks for distant speech recognition. IEEE Signal Processing Letters, 21(9), 1120–1124. Scholar
  6. 6.
    Schmidhuber, J. (2015). Deep learning in neural networks: an overview. Neural Networks, 61, 85–117. Scholar
  7. 7.
    Gao, Z., Wang, L., Zhou, L., & Zhang, J. (2017). HEp-2 cell image classification with deep convolutional neural networks. IEEE Journal of Biomedical and Health Informatics, 21(2), 416–428. Scholar
  8. 8.
    Li, W., Wu, G., Zhang, F., & Du, Q. (2016). Hyperspectral image classification using deep pixel-pair features. IEEE Transactions on Geoscience and Remote Sensing, 55(2), 844–853. Scholar
  9. 9.
    Huang, Y., Wu, R., Sun, Y., Wang, W., & Ding, X. (2015). Vehicle logo recognition system based on convolutional neural networks with a pretraining strategy. IEEE Transactions on Intelligent Transportation Systems, 16(4), 1951–1960. Scholar
  10. 10.
    Hariharan, B., Arbelaez, P., Girshick, R., & Malik, J. (2017). Object instance segmentation and fine-grained localization using hypercolumns. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(4), 627–639. Scholar
  11. 11.
    Wu, X., Du, M., Chen, W., Li, Z. (2016). Exploiting deep convolutional network and patch-level CRFs for indoor semantic segmentation. Presented at the 2016 IEEE. In: 11th Conference on Industrial Electronics and Applications (ICIEA). pp. 150–155.
  12. 12.
    Liu, Y., Chen, X., Peng, H., & Wang, Z. (2017). Multi-focus image fusion with a deep convolutional neural network. Information Fusion, 36, 191–207. Scholar
  13. 13.
    Prentašić, P., & Lončarić, S. (2016). Detection of exudates in fundus photographs using deep neural networks and anatomical landmark detection fusion. Computer Methods and Programs in Biomedicine, 137, 281–292. Scholar
  14. 14.
    Bai, J., Wu, Y., Zhang, J., & Chen, F. (2015). Subset based deep learning for RGB-D object recognition. Neurocomputing, 165, 280–292. Scholar
  15. 15.
    Huang, Z., Wang, R., Shan, S., & Chen, X. (2015). Face recognition on large-scale video in the wild with hybrid Euclidean-and-Riemannian metric learning. Pattern Recognition, 48(10), 3113–3124. Scholar
  16. 16.
    Tao, Q.-Q., Zhan, S., Li, X.-H., & Kurihara, T. (2016). Robust face detection using local CNN and SVM based on kernel combination. Neurocomputing, 211, 98–105. Scholar
  17. 17.
    Cai, M., & Liu, J. (2016). Maxout neurons for deep convolutional and LSTM neural networks in speech recognition. Speech Communication, 77, 53–64. Scholar
  18. 18.
    Li, X., Yang, Y., Pang, Z., & Wu, X. (2015). A comparative study on selecting acoustic modeling units in deep neural networks based large vocabulary Chinese speech recognition. Neurocomputing, 170, 251–256. Scholar
  19. 19.
    Jiao, Z., Gao, X., Wang, Y., & Li, J. (2016). A deep feature based framework for breast masses classification. Neurocomputing, 197, 221–231. Scholar
  20. 20.
    Sun, W., Tseng, T.-L., Zhang, J., & Qian, W. (2017). Enhancing deep convolutional neural network scheme for breast cancer diagnosis with unlabeled data. Computerized Medical Imaging and Graphics, 57, 4. Scholar
  21. 21.
    Jiang, F., Li, H., Hou, X., Sheng, B., Shen, R., Liu, X.-Y., et al. (2017). Abdominal adipose tissues extraction using multi-scale deep neural network. Neurocomputing, 229, 23–33. Scholar
  22. 22.
    Havaei, M., Davy, A., Warde-Farley, D., Biard, A., Courville, A., Bengio, Y., et al. (2017). Brain tumor segmentation with deep neural networks. Medical Image Analysis, 35, 18–31. Scholar
  23. 23.
    Gao, X. W., Hui, R., & Tian, Z. (2017). Classification of CT brain images based on deep learning networks. Computer Methods and Programs in Biomedicine, 138, 49–56. Scholar
  24. 24.
    Kleesiek, J., Urban, G., Hubert, A., Schwarz, D., Maier-Hein, K., Bendszus, M., et al. (2016). Deep MRI brain extraction: a 3D convolutional neural network for skull stripping. NeuroImage, 129, 460–469. Scholar
  25. 25.
    Kamnitsas, K., Ledig, C., Newcombe, V. F. J., Simpson, J. P., Kane, A. D., Menon, D. K., et al. (2017). Efficient multi-scale 3D CNN with fully connected CRF for accurate brain lesion segmentation. Medical Image Analysis, 36, 61–78. Scholar
  26. 26.
    Spampinato, C., Palazzo, S., Giordano, D., Aldinucci, M., & Leonardi, R. (2017). Deep learning for automated skeletal bone age assessment in X-ray images. Medical Image Analysis, 36, 41–51. Scholar
  27. 27.
    Tang, Z., Li, C., & Sun, S. (2017). Single-trial EEG classification of motor imagery using deep convolutional neural networks. Optik - International Journal for Light and Electron Optics, 130, 11–18. Scholar
  28. 28.
    Rahhal, M. M. A., Bazi, Y., AlHichri, H., Alajlan, N., Melgani, F., & Yager, R. R. (2016). Deep learning approach for active classification of electrocardiogram signals. Information Sciences, 345, 340–354. Scholar
  29. 29.
    Kiranyaz, S., Ince, T., & Gabbouj, M. (2016). Real-time patient-specific ECG classification by 1-D convolutional neural networks. IEEE Transactions on Bio-Medical Engineering, 63(3), 664–675. Scholar
  30. 30.
    Xiong, P., Wang, H., Liu, M., Zhou, S., Hou, Z., & Liu, X. (2016). ECG signal enhancement based on improved denoising auto-encoder. Engineering Applications of Artificial Intelligence, 52, 194–202. Scholar
  31. 31.
    De Chazal, P., O’Dwyer, M., & Reilly, R. B. (2004). Automatic classification of heartbeats using ECG morphology and heartbeat interval features. IEEE Transactions on Bio-Medical Engineering, 51(7), 1196–1206. Scholar
  32. 32.
    Homaeinezhad, M. R., Atyabi, S. A., Tavakkoli, E., Toosi, H. N., Ghaffari, A., & Ebrahimpour, R. (2012). ECG arrhythmia recognition via a neuro-SVM–KNN hybrid classifier with virtual QRS image-based geometrical features. Expert Systems with Applications, 39(2), 2047–2058. Scholar
  33. 33.
    Zhang, Z., Dong, J., Luo, X., Choi, K. S., & Wu, X. (2014). Heartbeat classification using disease-specific feature selection. Computers in Biology and Medicine, 46, 79–89. Scholar
  34. 34.
    De Chazal, P., & Reilly, R. B. (2006). A patient-adapting heartbeat classifier using ECG morphology and heartbeat interval features. IEEE Transactions on Bio-Medical Engineering, 53(12 Pt 1), 2535–2543. Scholar
  35. 35.
    Hu, Y. H., Palreddy, S., & Tompkins, W. J. (1997). A patient-adaptable ECG beat classifier using a mixture of experts approach. IEEE Transactions on Bio-Medical Engineering, 44(9), 891–900. Scholar
  36. 36.
    Ince, T., Kiranyaz, S., & Gabbouj, M. (2009). A generic and robust system for automated patient-specific classification of ECG signals. IEEE Transactions on Bio-Medical Engineering, 56(5), 1415–1426. Scholar
  37. 37.
    Jiang, W., & Kong, S. G. (2007). Block-based neural networks for personalized ECG signal classification. IEEE Transactions on Neural Networks, 18(6), 1750–1761. Scholar
  38. 38.
    Azizpour, H., Razavian, A. S., Sullivan, J., Maki, A., & Carlsson, S. (2016). Factors of transferability for a generic ConvNet representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(9), 1790–1802. Scholar
  39. 39.
    Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. In F. Pereira, C. J. C. Burges, L. Bottou, & K. Q. Weinberger (Eds.), Advances in neural information processing systems 25 (pp. 1097–1105). USA: Curran Associates Inc.Google Scholar
  40. 40.
    Simonyan, K., Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition .
  41. 41.
    Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., et al. (2015). Going deeper with convolutions, Presented at the 2015. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). (pp. 1–9).
  42. 42.
    Priya, K. D., Rao, G. S., & Rao, P. S. V. S. (2016). Comparative analysis of wavelet thresholding techniques with wavelet-Wiener filter on ECG signal. Procedia Computer Science, 87, 178–183. Scholar
  43. 43.
    Yochum, M., Renaud, C., & Jacquir, S. (2016). Automatic detection of P, QRS and T patterns in 12 leads ECG signal based on CWT. Biomedical Signal Processing and Control, 25, 46–52. Scholar
  44. 44.
    Remya, R. S., Indiradevi, K. P., & Babu, K. K. A. (2016). Classification of myocardial infarction using multi resolution wavelet analysis of ECG. Procedia Technology, 24, 949–956. Scholar
  45. 45.
    Nannaparaju, V., & Narasimman, S. (2015). Detection of T-wave alternans in ECGs by wavelet analysis. Procedia Materials Science, 10, 307–313. Scholar
  46. 46.
    Thomas, M., Das, M. K., & Ari, S. (2015). Automatic ECG arrhythmia classification using dual tree complex wavelet based features. AEU—International Journal of Electronics and Communications, 69(4), 715–721. Scholar
  47. 47.
    Mahapatra, S., Mohanta, D., Mohanty, P., Nayak, Sk, & Behari, Pk. (2016). A neuro-fuzzy based model for analysis of an ECG signal using wavelet packet tree. Procedia Computer Science, 92, 175–180. Scholar
  48. 48.
    Kumar, R., Kumar, A., & Singh, G. K. (2016). Hybrid method based on singular value decomposition and embedded zero tree wavelet technique for ECG signal compression. Computer Methods and Programs in Biomedicine, 129, 135–148. Scholar
  49. 49.
    Mourad, K., & Fethi, B. R. (2016). Efficient automatic detection of QRS complexes in ECG signal based on reverse biorthogonal wavelet decomposition and nonlinear filtering. Measurement, 94, 663–670. Scholar
  50. 50.
    Vincent, P., Larochelle, H., Lajoie, I., Bengio, Y., & Manzagol, P. (2010). Stacked denoising autoencoders: learning useful representations in a deep network with a local denoising criterion. Journal of Machine Learning Research, 11, 3371–3408.MathSciNetzbMATHGoogle Scholar
  51. 51.
    PhysioNet. (2016). ECGPUWAVE (MATLAB/Octave version). Accessed 11 July 2017.
  52. 52.
    Nocedal, J. (1980). Updating quasi-Newton matrices with limited storage. Mathematics of Computation, 35(151), 773–782. Scholar
  53. 53.
    Srivastava, N., Hinton, G., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. (2014). Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1), 1929–1958.MathSciNetzbMATHGoogle Scholar
  54. 54.
    Bengio, Y., Courville, A., & Vincent, P. (2013). Representation learning: a review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8), 1798–1828. Scholar
  55. 55.
    Kutlu, Y., & Kuntalp, D. (2012). Feature extraction for ECG heartbeats using higher order statistics of WPD coefficients. Computer Methods and Programs in Biomedicine, 105(3), 257–267. Scholar
  56. 56.
    Rahhal, M. M. A., Bazi, Y., Alajlan, N., Malek, S., Al-Hichri, H., Melgani, F., et al. (2015). Classification of AAMI heartbeat classes with an interactive ELM ensemble learning approach. Biomedical Signal Processing and Control, 19, 56–67. Scholar

Copyright information

© Taiwanese Society of Biomedical Engineering 2018

Authors and Affiliations

  1. 1.College of Applied Computer SciencesKing Saud UniversityRiyadhSaudi Arabia
  2. 2.College of Computer and Information SciencesKing Saud UniversityRiyadhSaudi Arabia
  3. 3.Raytheon Chair for Systems Engineering, Advanced Manufacturing InstituteKing Saud UniversityRiyadhSaudi Arabia
  4. 4.Research Unit Signals and Mechatronic Systems SMS, National Engineering School of CarthageCarthage UniversityTunisTunisia

Personalised recommendations