Detection of Cardiac Arrhythmia Using Multi-Perspective Convolutional Neutral Network for ECG Heartbeat Classification

Detection of Cardiac Arrhythmia Using Multi-Perspective Convolutional Neutral Network for ECG Heartbeat Classification

Devaganugula N.V.S.L.S. IndiraVyakaranam Sita Maha Lakshmi Babu Rao Markapudi Adilakshmi Yannam Munagala Babu Prasad Chandanapalli Suresh Babu Kodepogu Koteswara Rao 

Dept. of IT, S R Gudlavalleru Engineering College, Gudlavalleru, Andhra Pradesh 521356, India

FED Department, PVP Siddhartha Institute of Institute of Technology, Vijayawada 520007, India

Dept. of CSE, S R Gudlavalleru Engineering College, Gudlavalleru, Andhra Pradesh 521356, India

FED Department, NRI Institute of Technology, Agiripally Vijayawada 521211, India

Dept. of CSE, PVP Siddhartha Institute of Institute of Technology, Vijayawada 520007, India

Corresponding Author Email:
8 July 2022
19 August 2022
31 August 2022
| Citation



The leading death cause all over the world is heart disease. The presence of arrhythmias has to be examined to detect heart disease in early stage. The abnormality in heart beat rhythm is known as Arrhythmia. The speed of heart beat can be detected by Arrhythmia, it may be too slow, too fast or irregular patterns of heart beat are considered as Arrhythmia and there are various types of Arrhythmia. The electrocardiogram (ECG) produces signals, classification of such signals is very crucial for knowing the irregularity in the patterns of heart beat. As detection of arrhythmia is a challenging task, there is a great demand for an automatic detection technique to identify abnormal signals produced by heart which cannot be done manually. Therefore this paper provides a method for detection of Cardiac Arrhythmia using Multi-Perspective Convolutional Neutral Network (MPCNN) for ECG Heartbeat Classification. Basing on Physionet's MIT-BIH Arrhythmia Dataset the signals of ECG arrhythmia can be categorized into five classes. Number of layers, filters and size of the filter are appropriate parameters which are heuristically optimized for operating swiftly for operation of MPCNN effectively. Compared with the ultra-modern methods as Quantum Neural Networks and Deep Convolutional Neural Networks, the proposed method results in efficient performance having high level accuracy of 96.46%, 98.1% and 96.2% are the F1 scores for SVP and PVC respectively. The effective detection of heartbeat rhythm and irregularities can be identified using this model.


classification of heartbeat, convolutional neural networks (CNN), arrhythmia, electrocardiogram (ECG)

1. Introduction

Maintenance of health is the most crucial part of human life as it states the quality of life of a person [1]. Out of all the organs in the body, the most important organs that plays key role for human life and body functionality is ones heart. The blood throughout the body is pumped through heart. The vital functionality of heart is to pump blood throughout the organs of the body, so that healthy maintenance of heart is very important. When there is abnormality in functioning of heart, the worst experience a person can have is death. According to 2016 census of the World Health Organization (WHO), the number of people dies because of heart disease 17.9 million i.e.,  more or equal to 31% of the world population died due to heart diseases. It is also identified that under 70 years of age around 17 million people were dead. As per the WHO sources The rhythm of heart beat can be deviated from its electrical activity [2] which is considered as Cardiac Arrhythmia. There are various kinds of Arrhythmia which are harmless. But, when Arrhythmia is caused due to the weakness of damaged heart, it may lead to serious consequences and fatal symptoms [3]. Usually Arrhythmias is classified into two kinds the first one is Brady cardiac which means slow heart beat and the other is tachycardia which means fast heartbeat. When a person has complaints relating to heart functioning, as a part of initial assessment electrocardiogram (ECG) is performed. The ECG device represents the entire process of polarization and re polarization in the form of X-ray sheets.

The structure and functioning of heart can be studied with the help of Electrocardiography (ECG) which is an efficient technique used due to ease of access, non-invasiveness and less expensive [4]. During each heart beat it presents the depolarization and re polarization of muscles of heart is shown in the form of electrophysiological pattern. Due to various factors like baseline wander, external noise, physical variations among individuals [5] the heart beat classification automatically using ECG has become a challenging task. In case of a healthy person also there may be difference in rhythm and morphology of heartbeats during various circumstances [6]. Few elements that are vigorous against such situations are used in classification of heartbeat like characteristic points relating to morphological features, abstract features and transformation features generated by seizure interpretation.

In the field of biomedical signal processing and digital image processing [7] shows high demand for the deep learning algorithms which involves structures such as neural networks. A Machine Learning (ML) based technique called Deep Learning (DL) has the capacity of automatic feature extraction. A layer of favorable features are determined from the input data using deep learning without involving any feature extraction method [8]. Analysis of physiological information, image categorization and speech identification are the traditional practices. Compared with these conventional methods effective results are exhibited by using Deep Learning techniques. Convolutional Neural Network (CNN) [9] is a branch or an application of deep learning. Two shape dimensional data [10] can be processed by using CNN technique.

Different data classification techniques such as wavelet transform, Artificial Neural Networks (ANN), Support Vector Machine (SVM) and hidden Markov models were developed previously for automatic detection of ECG data classification approach. Signal pre-processing and Feature extraction are the important features of these techniques. The medical expert is required for feature extraction by using hand-crafted methods [11, 12].

As these techniques are performed manually they consume lot of time, costly and there may be chance of losing data during the phase of extracting features. Therefore these features faced lot of challenges in identification of arrhythmia symptoms may exhibit different morphological signal during different circumstances [13]. Due to these elements, the performance classification was not achieved when applying new ECG data.

The various sections in this paper are well thought-out as follows: Section II refers to the literature survey. Section III refers to the detection method of Cardiac Arrhythmia using Multi-Perspective Convolutional Neutral Network for ECG Heartbeat Classification. Section IV presents the evaluation of experiment and its results. Section V explains about conclusion and works to be performed and developed in future.

2. Literature Survey

Kachuee et al. [14] presents a technique for accurate classification of heartbeat into five types of arrhythmia basing on AAMI EC57 standards which are based on deep convolutional neural networks. Further, a method is suggested for transfer of knowledge developed basing on classification of myocardial infarction (MI) task. Two datasets named PTB Diagnostics dataset and Physion Net’s MIT-BIH datasets are used for evaluation of the proposed method. Basing on this evaluation, the prediction of accuracies of arrhythmia classification and MI classification are 93.4% and 95.9% respectively.

Teijeiro et al. [15] conducted studies over pure knowledge based approaches for heartbeat classification of ECG signals effectively by using appropriate abstract features secured by undergoing the physiological process interpretation within the signals. As a result of abductive interpretation of the ECG, qualitative morphological features and rhythm features are recorded for respectively heartbeat. In order to diminish the effect of possible errors during interpretation a clustering algorithm called QRS is applied. Hence, a tag is assigned to each cluster basing classifier. When compared with the performance of any sort of automatic approach, MIT-BIH Arrhythmia tested Database records has shown significant performance. The deficiency of Accuracy parameter is the research gap of this paper.

Cheng and Dong [16] suggested feature extraction basing on relationship among incoming ECG signals and regular pre-existing QRS template of a person for classification and detection of arrhythmia. QRS detection is required to obtain personalized features for R-peak detection which is highly vulnerable to anomaly. Six features are calculated basing on the R-peak. The machine learning based Support Vector Machine (SVM) technique is utilized in classification.

Zhang et al. [17], explained about study and classification of ECG heartbeats using clustering techniques and recurrent neural networks (RNN). A representative training data set can be obtained by using Clustering technique and RNN is loaded with beat morphology information to obtain classification result. Therefore, his method has obtained vigorous performance in terms of accuracy and evaluation of ECG classification.

Kiranyaz et al. [18] explains about a patient specific accurate electrocardiogram (ECG) classification in swift mode and a system is developed for monitoring. The one dimensional Convolutional Neural Networks (CNNs) method is developed used inherently for integration of two major ECG classification blocks into a single cluster for classification and feature extraction. Therefore, a simple CNN will be trained for each patient by utilizing specific patient training data which is relative common dataset. Thus, the classification performance can be improved further by using such patient-specific feature extraction dataset. In the detection of Ventricular Ectopic Beats (VEB) and Supra Ventricular Ectopic Beats (SVEB) has obtained optimal classification of database by means of the consequences over the MIT-BIH arrhythmia benchmark. This method showed high accuracy when compared with other conventional practices. The research gap of this paper is that only two types of heartbeat classifications are identified in this paper.

Ye et al. [19] described a model basing on morphological and dynamic feature combination designed a system for classification of heartbeat. Morphological features are extracted from each heartbeat by applying Independent Component Analysis (ICA) and Wavelet transformation. The dynamic features are provided by computing RR interval information. The final classification decision is made by integrating two leads of ECG and two decisions by applying the independent procedure. The baseline MITBIH arrhythmia database is used for validating the proposed method. It lead to an accurate result of 99.3% approximately i.e., 99.7% with 2.4% denunciation on the basis of “class-oriented” evaluation. In subject oriented evaluation the accuracy is observed to be 86.4%. These automatic heartbeat classification results are compared with the state-of-the-art results.

Llamedo et al. [20] conducted studies for validation of plain heartbeat classification basing on feature models of ECG signals with more concentration on generalization capability development. Publicly available databases such as MIT-BIH Arrhythmia, The St. Petersburg Institute of Cardio logical Techniques (INCART) database and MIT-BIH Supra ventricular Arrhythmia are used in generalization, evaluation and performance classification. From the proposed method the obtained results are recorded as 93% for global accuracy of normal heartbeat; 95% for sensitivity (S), 98% for positive predictive value (P+), P+39% for supra ventricular beats, S 77%, and P+87% for ventricular beats S 81%. Only few features are present in this classifier model and the results obtained are improved than other state-of-the-art methods. Classification accuracy of different heartbeat types are very less compared to MPCNN based heartbeat classification.

Different literature regarding to heartbeat classification types is discussed above. Our proposed model of MPCNN based heartbeat classification is efficient one which fulfills the research gaps of previous methods.

3. Electrocardiogram Heartbeat Classification

Overall framework of detection of Cardiac Arrhythmia using Multi-Perspective Convolutional Neutral Network for ECG Heartbeat Classification is represented in below Figure 1.

Figure 1. Block diagram of ECG heartbeat classification

The MIT-BIH Arrhythmia based Database is utilized in data processing of this paper as represented in the above Figure 1. The ECG signals are classified and data augmentation is performed as presented in the above figure. This dataset was recorded from 48 individual subjects and it consists of two channels ECG signals of total 48 records which is recorded around the duration of 30 minutes. For the performance investigation of 1D convolutional neural network model, a total of 109446 beats at 125 Hz sampling frequency are collected from 44 records for evaluation of testing and training patterns in this research paper. When the signal features are not adequate for sound processing they are eliminated from the evaluation process.

Basing on the suggestion from AAMI, ECG heartbeat can be classified into 5 heartbeat types they are as follows:

  1. N–Normal Beat

  2. SVP–Supra Ventricular Premature beat

  3. PVC–Premature Ventricular Contraction Beat

  4. FVN–Fusion of Ventricular and Normal Beat

  5. FPN–Fusion of Paced and Normal Beat

To produce the ECG beats from a specified ECG waveform, there are dissimilar forms of preprocessing required to improve the ECG signal efficiency enhancement. As ECG signals involves various forms of destructive noises, few steps are suggested and adopted for ECG signal database processing in three phases, the first one is de-noising the ECG dataset and then QRS peak detection is performed which is a remarkable waveform in ECG diagnosis and later, in the final step heartbeat signals are segmented in different clusters for each single beat of an individual is performed.

The entire dataset must be augmented to the same level for training the model effectively. This can be performed by selecting the smallest heartbeat sample classes. The data is down sampled due to the imbalance of the dataset that results in misclassification. The raw data of individual heartbeats is represented with fixed dimensions of 188 samples.

Later, Symbolic Baseline Corrected approximation (SBCX) is performed in the next step. In this phase, SBCX explains about the consideration specially by using symbolization method widely for a particular time series known as Symbolic Aggregate approximation (SAX). Symbolization and dimension reduction are the two steps involved in SAX.

The input heartbeat signal can be examined for a baseline approximation by the SBCX. By using a single heartbeat signal, heuristic finding of ECG signal baseline is a challenging task. Basing on the nature of the stately biomedical signal, an effective approach is designed. The input signal of heartbeat is taken as x=x1, ..., xi, ..., xn when normalized with the global maximum value (vmax). Later, the signal amplitude of the global minimum value (vmin) of training data is given as follows:

$x_i^{\mid}=\frac{x_i-v_{\min }}{v_{\max }-v_{\min }}$      (1)

Baseline Correction Normalization: A baseline corrected normalization method is introduced using mode $\left(x^{\mid}\right)$ as the approximate baseline.

$\sigma_{m o d e}=\sqrt{\frac{\sum_i\left(x_i^{\mid}-\operatorname{mode}\left(x^{\mid}\right)\right)^2}{n}}$       (2)

$z_i=\frac{x_i^{\mid}-\operatorname{mode}\left(x^{\mid}\right)}{\sigma_{\text {mode }}}$       (3)

After baseline correction, the signal values are divided by σ mode in order divide the heartbeat signals into various segments having similar “scale of amplitude”. The normalized signal z=z1….zi….zn step is performed.

After completion of the normalization process, a breakpoint list α and a corresponding vocabulary list A are used for symbolization as represented in the following Eq. (4).

$z_i^{\mid}=a_k$, if $\alpha_{k-1} \leq z_i<\alpha_k$           (4)

The final SBCX representation is $z^{\mid}=z_1^{\mid}, \ldots . z_i^{\mid} \ldots . z_n^{\mid}$ where $a_k \in A$ A is the mapped signal symbol. SBXC is a sequence of symbol.

ECG signal is transformed into symbolic representation of SBCX by using the SBCX method. The embedding vectors are present for all symbols in lookup table which is a trainable matrix. The symbol sequence of the signal is further transformed into an embedding matrix represented as $S_{\text {signal }} \in R^{d \times n}$.

$S_{\text {signal }}=\left[\begin{array}{ccccc}\mid & & \mid & & \mid \\ S_1 & \cdots & S_i & \cdots & S_n \\ \mid & & \mid & & \mid\end{array}\right]$          (5)

where, $S_i \in R^d$ is the vector that is mapped to $z_i^{\mid}$ and the embedding dimension is represented as ' $\mathrm{d}$ '.

The SBCX parameters are nontrainable and grid searching is performed for determining them. The various signal vector values in A are derived from the trainable weights from the entire model. During training stage, they are randomly initialized and the MPCNN weights are optimized simultaneously by minimizing the loss function. The heartbeat feature extraction in embedding matrix is performed by Multi Perspective Convolutional Neural Network (MPCNN) and the kind of input heartbeat is predicted. Such kind of layer combination is observed as an effective method in various applications.

Figure 2. Architecture of MPCNN

The Figure 2 explains the detailed architecture of Described MPCNN, which consists of variety of channels that consists of various stack modules. The signal amplitude consists of information which is directly exploited by the shallow channels such as M11, M21, and M41. In the same way high level features are extracted by the deeper channels such as M51-M52 and M31-M32 in relation with the global shape information and morphological structure. The type of heartbeat can be predicted by concatenating the multi perspective representations and feeding them into a softmax layer. It is to be noted that deeper channels have to be tried in beginning of the experiment. From the experiment results it can be observed that the deeper dataset structure may not improve the performance but makes large difference in risk over fitting.

Apart from different types of channel extraction for representation of multi perspective heartbeat, a one Dimensional layer in the basic module is filtered with different lengths. The ECG waves are fitted using different filters of different wavelength such as QRS complex and P wave. The max pooling layer is of different sizes which are followed by the 1D-convolution layer among the modules M11, M21, and M41. Different max pooling layers consists of outputs which are integrated with each other.

4. Results Analysis

The performance of the model can be assessed by using MPCNN and MITBIH Arrhythmia dataset for automatic categorization of ECG heartbeat signals. 109150 beat samples are present in training set and the testing set consists of 4000 beat samples. Each class consists of 800 samples in heartbeat dataset.

In this paper, MPCNN model is suggested which was developed basing on the Physionet's MIT-BIH Arrhythmia dataset. This dataset consists of ECG signals classified into five types: Normal (N), Supra-ventricular premature (SVP), Premature ventricular contraction (PVC), Fusion of ventricular and normal (FVN) and Fusion of paced and normal (FPN) are represented in Figure 3.

Figure 3. ECG arrhythmia heartbeat signal of five classes

The performance of the MPCNN model can be analyzed basing on parameters like Accuracy, precision, recall and F1-score. The metric equations can be represented in Eqns. (6)-(9) respectively.

ECG arrhythmia signals to be divided into five categories based on the WHO data servey.

The indicator of the accuracy is the ratio between the number of correctly classified samples and that of the whole test samples. Its mathematical expression is defined as:

Accuracy $=\frac{T P+T N}{T P+T N+F N+F P}$           (6)

The precision value represents classifier model’s exactness.

Precision $=\frac{T P}{T P+F P}$             (7)

The recall value represents the model’s completeness.

Recall $=\frac{T P}{T P+F N}$             (8)

F1-Score is a weighted average of the recall and precision.

$F 1-$ Score $=2 * \frac{\text { Precision } * \text { Recall }}{\text { Precision }+\text { Recall }}$           (9)

where, TP is True Positive, TN is True Negative, FP is False Positive and FN is False Negative. The performance appraising metrics are provided in Table 1.

Table 1. MPCNN based heartbeat classification

ECG Beat Type

Accuracy (%)

Precision (%)

Recall (%)

F1-Score (%)


























Weighted average





The graphical representation of accuracy and precision is represented in below Figure 4.

Figure 4. Graphical representation of accuracy and precision values

The graphical representation of Recall and F1-score are represented in below Figure 5.

Figure 5. Graphical representation of recall and f1-score parameters

The accuracy of MPCNN based heartbeat classification method is compared with other models of heartbeat classification such as Quantum Neural Networks and Deep Convolutional Neural Networks to evaluate the efficiency of the described model which is represented in below Table 2.

From results it is clear that, accuracy of MPCNN based heartbeat classification is high than the other models. The major incentive that we put forward SBCX is to assurance the good feature extraction and classification performance of the downstream MPCNN under inter-patient paradigm. The symbolic illustration (e.g., our proposed SBCX) could diminish the influence of some personalized signal structures, which services the network to extract more generic features that are illustrative for the patients both in training set and test set. The effectiveness of classified model can be justified by an overall accuracy of 96.46% is obtained by the model.

Table 2. Accuracy comparison for different methods

Used method

Obtained Accuracy (%)

Quantum Neural Networks


Deep Convolutional Neural Networks


Multi-Perspective Convolutional Neutral Network


5. Conclusions

In this paper, detection of Cardiac Arrhythmia using Multi-Perspective Convolutional Neutral Network for ECG Heartbeat Classification is described. Several processing steps such as de-noising, peak detection and segmentation of heart beat are used for processing the ECG signals for improving its performance. Physionet's MIT-BIH Arrhythmia Datasets are used for validating the performance of the proposed system of ECG heartbeat classification. The correction ability in baseline of SBCX can be visualized for representing the real heartbeat. From the results obtained by experiment represents that an overall classification accuracy of 96.46% is obtained by the suggested model. Whereas 95.46% and 96.02% are recorded as overall precision and recall respectively. The MIT-BIH Arrhythmia Dataset ECG recording will be transformed from the input ECG grayscale images is extended by implementation of 2-D MPCNN in the future implementations in order to enhance the performance of proposed framework.


[1] Bhatt, V., Chakraborty, S. (2021). Real-time healthcare monitoring using smart systems: A step towards healthcare service orchestration Smart systems for futuristic healthcare. In 2021 International Conference on Artificial Intelligence and Smart Systems (ICAIS), Coimbatore, India, pp. 772-777.

[2] Vasanth, K., Kameswari, D.V., Celin, S. (2021). Effect of curve fitting in an automated cardiac arrhythmia detection system. In 2021 6th International Conference on Communication and Electronics Systems (ICCES), Coimbatre, India, pp. 1862-1867.

[3] Wang, J., Li, R., Li, R., Fu, B., Xiao, C., Chen, D.Z. (2020). Towards interpretable arrhythmia classification with human-machine collaborative knowledge representation. IEEE Transactions on Biomedical Engineering, 68(7): 2098-2109.

[4] Manilo, L.A., Nemirko, A.P., Evdakova, E.G., Tatarinova, A.A. (2021). ECG database for evaluating the efficiency of recognizing dangerous arrhythmias. In 2021 IEEE Ural-Siberian Conference on Computational Technologies in Cognitive Science, Genomics and Biomedicine (CSGB), Novosibirsk - Yekaterinburg, Russia, pp. 120-112.

[5] Liao, Y., Xiang, Y., Du, D. (2020). Automatic classification of heartbeats using ECG signals via higher order hidden Markov model. In 2020 IEEE 16th International Conference on Automation Science and Engineering (CASE), Hong Kong, China, pp. 69-74.

[6] Kumari, C.U., Ankita, R., Pavani, T., Vignesh, N.A., Varma, N.T., Manzar, M.A., Reethika, A. (2020). Heart rhythm abnormality detection and classification using machine learning technique. In 2020 4th International Conference on Trends in Electronics and Informatics (ICOEI) (48184), Tirunelveli, India, pp. 580-584.

[7] Qaddoum, K., Alazzam, A., Al Azawi, R. (2020). A deep neural network heartbeat classification approach for arrhythmia detection. In 2020 Seventh International Conference on Information Technology Trends (ITT), Abu Dhabi, United Arab Emirates, pp. 131-134.

[8] Balaskas, K., Siozios, K. (2019). ECG analysis and heartbeat classification based on shallow neural networks. In 2019 8th International Conference on Modern Circuits and Systems Technologies (MOCAST), pp. 1-4.

[9] Ma, M., Mao, Z. (2020). Deep-convolution-based LSTM network for remaining useful life prediction. IEEE Transactions on Industrial Informatics, 17(3): 1658-1667.

[10] Jiang, S.Y., Wang, L.H. (2018). Enhanced machine learning feature selection algorithm for cardiac arrhythmia in a personal healthcare application. In 2018 IEEE Asia Pacific Conference on Postgraduate Research in Microelectronics and Electronics (PrimeAsia), Chengdu, China, pp. 39-42.

[11] Al-Masri, E. (2018). Detecting ECG heartbeat abnormalities using artificial neural networks. In 2018 IEEE International Conference on Big Data (Big Data), Seattle, WA, USA, pp. 5279-5281.

[12] Biswas, S.K., Chowdhury, S.R., Chakraborty, M., Purkayastha, B. (2018). A medical expert system to identify major factor of diseases using P-Rules. In 2018 International Conference on Intelligent Autonomous Systems (ICoIAS), Singapore, pp. 82-87.

[13] Techatraiphum, V., Laivanit, M., Phokaipisit, S., Laotriphet, B., Tharnuraikun, A., Chutimaskul, W., Funilkul, S. (2018). Monitoring and warning system for the elderly: A case study of cardiac arrhythmias. In 2018 Seventh ICT International Student Project Conference (ICT-ISPC), Nakhonpathom, Thailand, pp. 1-6.

[14] Kachuee, M., Fazeli, S., Sarrafzadeh, M. (2018). ECG heartbeat classification: A deep transferable representation. In 2018 IEEE International Conference on Healthcare Informatics (ICHI), New York, NY, USA, pp. 443-444.

[15] Teijeiro, T., Félix, P., Presedo, J., Castro, D. (2016). Heartbeat classification using abstract features from the abductive interpretation of the ECG. IEEE Journal of Biomedical and Health Informatics, 22(2): 409-420.

[16] Cheng, P., Dong, X. (2017). Life-threatening ventricular arrhythmia detection with personalized features. IEEE Access, 5: 14195-14203.

[17] Zhang, C., Wang, G., Zhao, J., Gao, P., Lin, J., Yang, H. (2017). Patient-specific ECG classification based on recurrent neural networks and clustering technique. In 2017 13th IASTED International Conference on Biomedical Engineering (BioMed), pp. 63-67.

[18] Kiranyaz, S., Ince, T., Gabbouj, M. (2015). Real-time patient-specific ECG classification by 1-D convolutional neural networks. IEEE Transactions on Biomedical Engineering, 63(3): 664-675.

[19] Ye, C., Kumar, B.V., Coimbra, M.T. (2012). Heartbeat classification using morphological and dynamic features of ECG signals. IEEE Transactions on Biomedical Engineering, 59(10): 2930-2941.

[20] Llamedo, M., Martínez, J.P. (2010). Heartbeat classification using feature selection driven by database generalization criteria. IEEE Transactions on Biomedical Engineering, 58(3): 616-625.