Research Article Cardiac Disorder Classification by Electrocardiogram Sensing Using Deep Neural Network

Cardiac disease is the leading cause of death worldwide. Cardiovascular diseases can be prevented if an eﬀective diagnostic is made at the initial stages. The ECG test is referred to as the diagnostic assistant tool for screening of cardiac disorder. The research purposes of a cardiac disorder detection system from 12-lead-based ECG Images. The healthcare institutes used various ECG equipment that present results in nonuniform formats of ECG images. The research study proposes a generalized methodology to process all formats of ECG. Single Shoot Detection (SSD) MobileNet v2-based Deep Neural Network architecture was used to detect cardiovascular disease detection. The study focused on detecting the four major cardiac abnormalities (i.e., myocardial infarction, abnormal heartbeat, previous history of MI, and normal class) with 98% accuracy results were calculated. The work is relatively rare based on their dataset; a collection of 11,148 standard 12-lead-based ECG images used in this study were manually collected from health care institutes and annotated by the domain experts. The study achieved high accuracy results to diﬀerentiate and detect four major cardiac abnormalities. Several cardiologists manually veriﬁed the proposed system’s accuracy result and recommended that the proposed system can be used to screen for a cardiac disorder.


Introduction
According to the Centers for Disease Control and Prevention (CDC) and the American Health Monitoring Organization, the leading cause of death is cardiovascular disease [1].CDC revealed that 74% of the population is affected yearly by heart disease.Cardiovascular diseases can be prevented if an effective diagnostic is made at the initial stages [2].Modern medical science has shown substantial and potent solutions to cope with heart-related problems.In the era of technology, medical issues can be tackled with advanced techniques of Information technology.e most common heart disease detection technique is based on electrocardiogram (ECG), angiography screening, and blood test.e ECG test is also referred to as the diagnostic assistant tool for screening heart diseases [3].ECG is a visual signal captured or measured by placing electrodes on the body's surface to detect voltage changes (Figure 1).ECG represents the possible cardiac abnormalities in their ST segments: normally, the rises in ST segments, changes in segments, or flipping of T waves, or new Q wave; these abnormal segments reflect cardiac disease symptoms.
Researchers [4][5][6] investigated many techniques for automatically detecting cardiovascular disease using machine and deep learning techniques, typically by using ECG in one or twodimensional voltage amplitude data represented as time-series signals.To classify ECG signals in time series, different methods are explored and show a substantial result.Ubeyli [7] used an eigenvector method for feature extraction and to classify ECG beats.Sharma et al. [8] used time frequency-based ECG signals for feature extraction of the eigenvalue decomposition of Hankel matrix and Hilbert transform and used the random forest to detect the cardiovascular disorder.
In the current era, systems are being developed for the automatic detection of cardiac-related issues.ese systems predict high accuracy results based on one-dimensional ECG beats signals but are still not adopted as tools in health care institutes.
e main areas that affect the success of these approaches, i.e., selection of feature, extraction techniques, types of classification algorithms, and the most important, the use of imbalanced data for classification can reduce the recognition accuracy of the minority class [6].Moreover, state-of-the-art studies represents the classical methods to show high accuracy in classification and detection tasks on one lead-based ECG images instead of standard 12-lead-based ECG images.Furthermore, the healthcare institutes used various ECG equipment, presenting results in nonuniform formats of ECG images.
e state-of-the-art research was unable to propose a generalized methodology for nonuniform formats of ECG images.e availability of 12-lead-based ECG source images is not publicly available for researchers.In this research, the main focus is to provide a novel automatic detection tool relatively similar and adaptable for the cardiac hospitals to process the 12-lead-based ECG images.
Automated cardiac disorder detection via a deep neural network using 12-lead-based ECG image processing is critical.Deep neural network works in the same fashion as a human brain, founded on mathematical formulas/models.e mathematics of functional principles of deep neural networks targets to understand and recognize the pattern among different components.
e deep neural network's fundamental unit is a neuron trained by repetitive tasks and gets experienced just like a human brain through acquired knowledge attained in training.e focus of training and acquiring knowledge is to establish a connection between input and output.After training, the system is capable of detecting the objects about what it has been trained.e primary motivation of this study is to develop an efficient automated model for the diagnosis of cardiac disorder on ECG that can feasibly be implemented on portable healthcare devices.Figure 2 shows the structure of forward pass convolutional neural network with SSD detector.
e paper is organized into seven sections.e research community's related work in the current field is presented in section 2 with a close comparison.Section 3 illustrates the collection of the dataset used in this study, and data preprocessing techniques are discussed in section 4. Section 5 illustrates the methodology with the proposed cluster.Simulated results are discussed in section 6. e paper is concluded and discourses the future directions of our work in section 7.

Related Work
In the past few decades, the research community has focused on artificial intelligence by working in digital image processing, computer vision, and machine learning to provide a platform between human and machine theory [6][7][8][9].is work is widely recognized by several companies and medical fields for classification, detection, and identification of cardiac disorder, which play a vital role in the health community.Techniques used for the identification of cardiac disorder using deep learning have been focused on for many years.
In recent studies, the state-of-the-art research on deep learning gained the potential growth with satisfactory results in detection and classification tasks on medical images [9].Most studies treated dimensional ECG signals as time-series classification by keeping in the view of deep learning.For example, PCGs and ECGs are used to diagnose heart disease.PCGs (also known as heart sound auscultation) is commonly In the state-of-the-art research studies, these time-series data used feature selection manually, which is not adaptable in different application environments.Moreover, ECG's time-series data with signal leads are not appropriate for stable baseline wanders, muscle contraction, and power line interface.In general, the practical methods normally adopted by a cardiologist for screening cardiac patients are 12-lead-based ECG images.In standard 12-lead-based ECG images, six leads are considered "limb leads" because they are placed on the individual's arms and/or legs.e other six leads are considered "precordial leads" because they are placed on the torso (precordium).e six limb leads are lead I, II, III, aVL, aVR, and aVF.e six precordial leads are called leads V1, V2, V3, V4, V5, and V6. Figure 3 shows sample 12-lead-based ECG image used in this study.
As concerned with ECG images, this research study is unique.In the real, collection of ECG images is done by recording or screening from Telehealth ECG diagnostic tool used in healthcare institutes.It is hard to gain these 12-leadbased on ECG images.Moreover, these images are used as a standard tool to detect the cardiac disorder in real-time applications.
In this research, the main focus is to provide a novel automatic detection tool relatively similar and adaptable for cardiac hospitals by using a deep neural network (DNN).e DNN has been widely recognized as a reliable approach to directly detect the characteristics of features from medical images [20,21].DNN is best suited for medical images problem; that is the main reasons authors used SSD MobileNet V2, a deep neural network-based architecture to detect the cardiac disorder on 12-lead-based ECG images.

Dataset
e steps involved in collecting the 12-lead-based ECG Images data required to develop the system is thoroughly described in this section.
3.1.Link Identification.Data resource identification was the main and primary challenge for the cardiac disease detection system.Consequently, in the first phase, various sites, repositories were explored.However, in spite of all efforts, all publicly available datasets that can be collected are timeseries data.Nevertheless, those available datasets are inconsistent with the data needed for this study.e manual collection of 12-lead-based standard ECG images directly from the cardiac institute is a difficult task.
e authors approached one of the best cardiac institutes, i.e., Ch.Pervaiz Elahi Institute of Cardiology Multan, Pakistan, for data collection.e manual collection of ECG images from the cardiac institute took several months.e ECG images collected have been endorsed and annotated by numerous cardiologists and reexamined by the domain experts who have experience in ECG interpretation. 1 shows the total numbers of Images used for cardiac disorder detection used for each class.is study has collected data uploaded to a data repository [22], which contains complete data-related information to help the scientific community.

Data Preprocessing
Data preprocessing is an important step before inputting the data into the model for training.In this phase, data can be organized into meaningful information.Figure 4 shows the steps used in data preprocessing.

Data Resizing.
e ECG images are higher than the 800 KB in size, requiring lots of time to train the algorithm, so all images required modification.e ECG images were modified to less than 300 KB in size to achieve more training steps in lesser time.

Data Labeling.
is study collected data required to label all 12 leads of each ECG image before training.In this study, LabelImg tool is used to label the dataset classes, which means authors labelled 48 objects of all four classes shown in Figure 5 that our trained model will need to detect.

Methodology
e methodology used in this paper is to process the 12-leadbased ECG images to detect a cardiac abnormality.Single shot detector (SSD) MobileNet v2 is used in this study for model design.SSD is used to detect the objects that can classify and locate the objects in one step.e block diagram of the model used in this research study is shown in Figure 6.

Model Configuration.
In this study, the model is implemented using Tensorflow API and Google Colab to

Dataset Splitting.
e dataset used in this study is split so that 80% of the images are used for training the algorithms, while the remaining 20% is used for testing each class.

Number of Classes.
Classes mean the number of objects that the model should learn and detect after training.In this case, the algorithms are responsible for detecting 4 classes (i.e., normal, abnormal heartbeat, myocardial infarction, and previous history of MI), and each class contains 12 leads; therefore, the number of objects is set to 48.

Learning Rate.
A default learning rate of 0.0002 has been used to train the algorithms.

5.2.
Training.Once all hyperparameters are configured, then the training process starts with an average step speed of 0.50 s.Training will take almost 4 days to complete the desired steps.e model will validate itself on the test dataset on each iteration and then display the prediction accuracy and loss.A sufficient number of steps are required for a better prediction of the model.Figure 7 shows the average loss (price paid for the wrong detection) of the model.e code used in this study can be found at https://github.com/alijiskani/ECG_Object_Detection, which contains code configuration files, source code, and a user manual.

Results
SSD MobileNet V2 was used to detect cardiovascular disease detection.High accuracy results were calculated for cardiac disease detection.
e mean average precision against all four classes is evaluated.e study showed high accuracy results to differentiate and detect four cardiac abnormalities."Myocardial Infarction" and "Previous History of MI" both classes achieved high accuracy among the results of all four classes.Table 2 shows the mean average precision (mAP) of all classes.
Figure 8 shows the original label and the predicted output results from the proposed model and their accuracy results.
e authors compare the cardiac disorder detection system performance with existing research studies related to ECG cardiac classification works.However, the mentioned work has a different dataset based on time-series data and different types of classes, so it is not justified to directly compare their results.is study achieved remarkable results on the detection of four cardiac abnormalities and achieved high accuracy results.Table 3 shows the comparative results related to the study.

Confusion Matrix.
e confusion matrix presents true positive, false positive, false negative, and true negative categories in each class (i.e., myocardial infarction, abnormal heartbeat, previous history of MI, and normal class).Table 4 displays the confusion matrix of the related study.e class "myocardial infarction" generates the highest average score.e two major aspects of good prediction are low variance and large datasets.e training dataset has an important and effective role while learning high-level attributes, but the variance plays a vital role in emphasizing key features.

Conclusion
Cardiac disorder detection plays a significant role in medical and health science.e study focuses on processing the ECG images to detect cardiac abnormalities.
e deep neural network has proven its capabilities in various applications of image processing and computer vision.is paper critically discusses the related work and analysis, specifically on cardiac disease detection.e study proposes a generalized methodology to process all formats of ECG.Single shoot detection (SSD) MobileNet v2 based Deep Neural Network architecture was used to detect cardiovascular disease detection.
e study presented high accuracy results in differentiating and detecting four major cardiac abnormalities and showed remarkable results with an average accuracy of 98%.Several cardiologists manually verified the proposed system's accuracy result and recommended that the proposed system be used to screen for cardiac disorder.
e work is relatively rare based on their dataset using standard 12-lead-based ECG images used by cardiac professors in health care institutes.
is work can be extended by training a larger dataset, particularly on more cardiac abnormalities, validating the recognition ratio using DNNs.e extraction of advanced features on ECG images with image acquisition, adaptive image enhancement, and various boundary detection algorithms on various cardiac-related issues can be detected with medical experts' help with new developing tools.e way of learning domain adaptation is another big task for researchers to do in the future.

Practical Implication
is study achieved high accuracy results in detecting cardiac abnormalities, and several cardiologists manually verified the accuracy result of the proposed system.Moreover, this model can be implemented in the "mobile cardiac unit" as a beta version where no or fewer cardiac facilities are available.

Figure 2 :
Figure 2: Structure of a forward pass convolutional neural network with SSD detector.