Document Type : Original Research

Authors

1 Department of Electrical and Electronic Engineering, Faculty of Engineering, International University of Business Agriculture and Technology, Uttara, Dhaka 1230, Bangladesh

2 Department of Agriculture, International University of Business Agriculture and Technology, Uttara, Dhaka 1230, Bangladesh

3 Department of Computer Science and Engineering, Faculty of Engineering, International University of Business Agriculture and Technology, Uttara, Dhaka 1230, Bangladesh

10.31661/jbpe.v0i0.2307-1636

Abstract

Background: Cardiovascular Diseases (CVD) requires precise and efficient diagnostic tools. The manual analysis of Electrocardiograms (ECGs) is labor-intensive, necessitating the development of automated methods to enhance diagnostic accuracy and efficiency.
Objective: This research aimed to develop an automated ECG classification using Continuous Wavelet Transform (CWT) and Deep Convolutional Neural Network (DCNN), and transform 1D ECG signals into 2D spectrograms using CWT and train a DCNN to accurately detect abnormalities associated with CVD. The DCNN is trained on datasets from PhysioNet and the MIT-BIH arrhythmia dataset. The integrated CWT and DCNN enable simultaneous classification of multiple ECG abnormalities alongside normal signals.
Material and Methods: This analytical observational research employed CWT to generate spectrograms from 1D ECG signals, as input to a DCNN trained on diverse datasets. The model is evaluated using performance metrics, such as precision, specificity, recall, overall accuracy, and F1-score.
Results: The proposed algorithm demonstrates remarkable performance metrics with a precision of 100% for normal signals, an average specificity of 100%, an average recall of 97.65%, an average overall accuracy of 98.67%, and an average F1-score of 98.81%. This model achieves an approximate average overall accuracy of 98.67%, highlighting its effectiveness in detecting CVD. 
Conclusion: The integration of CWT and DCNN in ECG classification improves accuracy and classification capabilities, addressing the challenges with manual analysis. This algorithm can reduce misdiagnoses in primary care and enhance efficiency in larger medical institutions. By contributing to automated diagnostic tools for cardiovascular disorders, it can significantly improve healthcare practices in the field of CVD detection.

Highlights

Tawfikur Rahman (Google Scholar)

Keywords

Introduction

Cardiovascular disorders, encompassing a spectrum of heart and blood vessel conditions, remain a leading cause of global morbidity and mortality. Efficient and accurate diagnosis is paramount for timely intervention and improved patient outcomes [ 1 ]. Electrocardiogram (ECG) signals, capturing the intricate electrical activity of the heart, serve as invaluable sources of information for cardiovascular health assessment [ 2 ]. The analysis of ECG signals involves identifying patterns such as P (The P wave), QRS (the Q, R, and S waves), and T (The T wave represents ventricular repolarization, which is the recovery of the ventricles back to their resting state after contraction) waves, which are indicative of various cardiac conditions [ 1 - 3 ]. The manual analysis of ECG signals is a labor-intensive process prone to subjectivity and variability.

With the advent of data mining, cloud computing, and advanced machine learning techniques, there is a tremendous opportunity to revolutionize the diagnosis of cardiovascular disorders [ 4 ]. The integration of Continuous Wavelet Transform (CWT) and Deep Convolutional Neural Network (DCNN) has emerged as a promising approach [ 5 ]. The CWT serves as a powerful tool for exploring signals across multiple scales, leading to the extraction of intricate patterns from ECG signals [ 5 ]. When combined with the capabilities of Deep Convolutional Neural Networks, which excel at learning hierarchical representations, this integrated approach can automate and improve the classification of cardiovascular disorders with unparalleled accuracy [ 6 ].

The CWT and DCNN were synergistically combined to analyze 1D ECG signals [ 7 ]. By transforming ECG signals into 2D spectrograms using CWT and training DCNN on these images, the method can accurately detect and classify cardiovascular disorders to overcome the limitations of manual analysis and provides a reliable and automated solution [ 8 ] by utilizing datasets from PhysioNet and the MIT-BIH arrhythmia dataset [ 9 ].

The integration of CWT and DCNN not only accelerates and automates ECG signal analysis but also represents a significant advancement in healthcare [ 10 ], which can reduce the time and effort required for interpreting ECG data, allowing healthcare professionals to focus more on patient care. Additionally, the model’s ability to learn intricate patterns and subtle features can help mitigate misdiagnoses, leading to a more objective and consistent evaluation of cardiovascular health [ 11 ]. This, in turn, contributes to elevated patient care standards by enabling early intervention and tailored treatment strategies [ 12 ].

Furthermore, this research signifies the progress of healthcare practices towards data-driven solutions. As digital innovations become increasingly important in healthcare, this study serves as a pioneering effort that addresses the challenges of cardiovascular diagnostics and sets the stage for a more efficient, accurate, and patient-centric healthcare paradigm.

In the last twenty years, there has been substantial progress in the automatic ECG classification techniques, contributing significantly to the improvement of cardiovascular disease diagnosis and treatment. Wang et al. [ 11 ] focused on arrhythmia detection using CWT and CNN techniques to evaluate the MIT-BIH arrhythmia database and improve classification accuracy by decomposing signals with CWT and extracting features with CNN. However, the use of the MIT-BIH arrhythmia database and the data division approach by Chazal et al. [ 12 ] for evaluation underscored their method’s potential. By utilizing CWT for signal decomposition and CNN for feature extraction, the study aimed to improve classification accuracy. Zhao et al. [ 13 ] enhanced wearable ECG monitoring by introducing a noise rejection technique using Modified Frequency Slice Wavelet Transform (MFSWT) and CNN, showcasing commendable classification accuracy. Acharya et al. [ 14 ] anticipated a CNN-based algorithm for automating the detection of normal and Myocardial Infarction (MI) ECG beats, for remarkable accuracies.

Despite the advancements in ECG analysis, there are still limitations, such as the focus on morphological features and potential concerns regarding adaptability. To tackle these issues, this study introduces an automated ECG classification method that integrates CWT and DCNN [ 15 ].

To address the limitations of focusing solely on morphological features, the proposed method incorporates CWT and DCNN for hierarchical analysis of longer ECG fragments [ 15 ]. By generating 2D Scalogram images, the method aimed to improve the differentiation between Normal Sinus Rhythm (NSR), Arrhythmia (ARR), and Congestive Heart Failure (CHF) signals, ultimately enhancing detection accuracy [ 16 ]. By building upon previous studies, this methodology offers a comprehensive solution to advance the precision and generalizability of ECG-based disease estimation models.

Material and Methods

This analytical observational research provides a comprehensive overview of the methodology and procedures to implement a new approach for addressing a research question or hypothesis. Specifically, their focus is on developing and evaluating an automated ECG classification process using the integration of CWT and DCNN.

The Division of Dataset and Database Processing

This study is conducted on the freely available open-source MIT-BIH dataset, collected from PhysioNet, consisting of 180 signal records, approximately 95 of them collected before 2000 and the remaining 85 collected between 2000 and 2005. Each ECG signal has a duration of 30 minutes. A sampling frequency ranging from 128 to 1000 Hz was used to analyze the data, which helps as a valued source for our research, leading to the evaluation of the proposed approach for ECG signal analysis and classification.

In the data pre-processing stage for the given problem, the database level was started, in which each record consists of 54,330 samples or data points. To prepare the database for training a convolutional neural network, specifically AlexNet in our case, each record was divided into smaller signals of a length of 500 samples to expand the scope of the database.

A total of 30 recordings from each category was selected to ensure an equal distribution among the different types (ARR, CHF, and NSR), each of these recordings is further divided into 12 smaller segments, each containing 500 samples. As a result, each category contributed a total of 180 (30×12) recordings that each recording had a size of 500 samples. Consequently, the overall dataset consisted of 1,050 recordings in total.

By performing this pre-processing step, the size and balance of the dataset, which provides a solid foundation for training the convolutional neural network was enhanced, facilitating accurate classification of the different ECG signal categories.

Proposed Workflow

The proposed workflow for ECG signal classification using CWT has been incorporated to enhance the clarity of our study methodology (Figure 1). This visual representation aimed to elucidate the key steps in the process of ECG signal classification. Commencing with the raw ECG signals as input data, the diagram outlined the pivotal role of the CWT in transforming signals into two-dimensional spectrogram images.

Figure 1. The proposed workflow for ECG (electrocardiogram) signal classification using CWT (Continuous Wavelet Transform).

Following this transformation, the preprocessed spectrogram images served as inputs to the DCNN. This neural link is intended to learn and excerpt essential topographies for the subsequent classification task. The culmination of this process is reflected in the classification results, which determine whether the ECG signals are categorized as NSR, ARR, or CHF . By integrating this block diagram into our methodological framework, readers were provided with a visual roadmap that enhances their understanding of the sequential stages involved in our proposed ECG signal classification methodology. This visual representation serves as a valuable tool for readers to grasp the step-by-step process and gain a comprehensive comprehension of how accurate classification of ECG signals was achieved.

ECG Signal

ECG signal is a visual depiction of the heart’s electrical activity throughout a period. Frequently utilized in the diagnosis of diverse heart conditions, the ECG signal is acquired by positioning electrodes on the skin [ 8 ]. These electrodes detect electrical alterations in the heart, generating a waveform that mirrors the heart’s functioning. Subsequently, this signal undergoes processing and analysis to recognize patterns and deviations that could signify cardiovascular disorders [ 3 ]. In recent decades, many methods have been used to diagnose cases of ECG, leading to the observation and recording of electrical activities during heart operations using leads located around the heart [ 11 ]. The study’s adoption of a one-dimensional representation for ECG signals is a strategic decision driven by multiple considerations. By simplifying the data structure to a single dimension, the computational complexity is reduced, enhancing efficiency in processing and training machine learning models [ 7 ]. This representation is in harmony with traditional ECG analysis methodologies, particularly in capturing the essential components, such as P, QRS, and T waves, which were inherently manifested as one-dimensional features [ 3 ]. Moreover, one-dimensional signals are well-suited for established signal processing techniques, facilitating feature extraction and analysis in time and frequency domains.

One-dimensional signal simplicity aligns with utilization of deep learning replicas, mainly CNNs, designed for processing one-dimensional data. The one-dimensional representation consents the prototypical concentration on the temporal dynamics of cardiac electrical activity, crucial for accurate classification, and also harmonizes with the study’s integration of CWT, in which 1D ECG signals are converted into 2D spectrograms to combine temporal and frequency information [ 12 ]. Accordingly, the decision to use a one-dimensional representation aligns well with the inherent characteristics of ECG signals and enables effective processing and analysis in the proposed study. The division of the ECG signal into time segments provides a concise summary of the durations and features, which aid in ECG analysis. Among these segments, the interval is the longest, while the P wave is the shortest, contributing to ECG data interpretation. The CNNs, such as DCNNs, are extensively utilized in biomedical signal processing [ 17 , 18 ].

Deep learning, which encompasses the principles of neuroscience, statistics, arithmetic, and physics, enables computers to learn from data and make intelligent decisions (s). DCNNs, a type of deep learning algorithm, can directly process ECG data as a 1D vector without the need for preprocessing or feature selection. However, since DCNNs are typically designed to process image data, the proposed approach transforms the ECG data into a 2D representation to achieve higher accuracy [ 19 ]. Doctors can detect individuals with cardiac arrhythmia and cardiovascular disorders by examining ECG records. Additionally, the analysis of specific signal features plays a crucial role in diagnosing heart activities; this signal depicts the electric activity of the heart during a specific timeframe. The ECG signal comprises distinct elements, including the P wave, QRS complex, and T wave, offering valuable insights into the heart’s performance. In the second segment, the 2D amplitude spectrogram of the ECG signal is evident, representing the signal’s frequency distribution over time and providing a detailed depiction of how various frequency components contribute to the overall ECG waveform. The 2D spectrogram helps recognize different patterns and abnormalities within the ECG signal. By analyzing the spectrogram, healthcare professionals can gain insights into the specific frequencies and their variations that may indicate certain cardiac conditions or disorders, leading to the accurate diagnosis and monitoring of cardiovascular health.

Continuous Wavelet Transform

CWT, a mathematical technique, enables an overcomplete representation of a signal by continuously adjusting the translation and scale parameters of the wavelets. In this study, the CWT was implemented on the ECG signal, transforming it into the time-frequency domain to facilitate the extraction of pertinent features [ 11 ]. The CWT is a commonly used technique for time-frequency analysis, which decomposes a signal into its time-frequency components using a set of wavelet functions. It builds upon the concept of the Short-time Fourier Transform (STFT) and provides several advantages. The CWT offers improved time resolution and reduced frequency resolution for higher frequencies, while also providing enhanced frequency resolution and diminished time resolution for lower frequencies. These benefits are achieved by manipulating scale and translation parameters [ 20 ].

Formally, for a given signal x(t), the CWT can be defined as follows:

Ca(b)=1a-∞x(t).φ(t-ba)dt(1)

Where Ca(b) is the CWT coefficients C(a, b), a is the values of the scale parameter, b is the position parameter, and x(t) is the set feet coefficients and t is the time.

The use of the CWT can lead to obtaining a detailed time-frequency illustration of the ECG signal, for more accurate feature extraction and analysis. Additionally, CWT helps gain insights into the different frequency components in the signal and their variations over time. In this case, CWT is a mathematical tool used in signal processing, including the analysis of ECG signals. It allows us to gain insights into the different frequency components present in the signal and how these frequencies vary over time. After applying the CWT to the raw ECG signal, a visual representation was obtained in the form of an image (Figure 2(a)), depicting the amplitude and scaling values in relation to the variation of time (s). In this research, dissimilar scale parameters of CWT were used to convert the one-dimensional (1D) representation of the raw ECG heartbeat signal into a two-dimensional (2D) spectrogram, represented as an Analytical Morlet waveform signal image. The CWT causes us to attain the wavelet factors of the Analytical Morlet wavelet at multiple scales, resulting in a 2D spectrogram of the ECG signal in the time-frequency field. The Analytical Morlet wavelet is known for its excellent time-frequency localization properties, effectively balancing time and frequency resolution. This characteristic makes it particularly suitable for analyzing signals that contain localized oscillatory components, which are commonly found in ECG signals [ 21 ]. Figure 2(b) illustrates the time-domain ECG heartbeat signal and the spectrogram of both a typical and an anomalous heartbeat. These signals are sampled at frequencies ranging from 128 to 1000 Hz, with a sampling interval of 0.002. The CWT is applied to analyze these 1D signals and extract pertinent information. By employing the CWT and representing the ECG signal in the time-frequency domain, a deeper understanding of the signal’s characteristics and temporal variations is attained.

Figure 2. Electrocardiography signal & 2D spectrogram (a) One Dimensional and (b) Visualization [227×227].

This causes the exploration of localized oscillatory components and facilitates the identification of abnormalities within the ECG signal, resulting in contributing to the diagnosis and analysis of cardiovascular conditions with valuable insights for medical practitioners. The CWT coefficients are used to construct Scalograms, which depict the time-frequency characteristics of the signals. These Scalograms are visualized using the “jet” colormap and transformed into images and then classified into “Normal” and “Abnormal” categories based on the signal classification. To prepare the Scalogram images for input into a modified ResNet-50 DCNN model, they undergo resizing to a standardized size of 224×224 pixels. The resulting 150 2D Scalogram images are subsequently fed into the modified ResNet-50 DCNN model. The primary objective of this analysis is to leverage deep learning techniques to identify patterns or abnormalities in the ECG signals. By employing the modified ResNet-50 DCNN model and analyzing the Scalogram images, the current study aimed to detect and classify potential abnormalities in the ECG signals. This approach combines the power of deep learning with the time-frequency representation provided by the CWT to improve the precision and use of ECG signal analysis.

Deep Convolutional Neural Network

Deep learning, a subset of machine learning, focuses on developing artificial intelligence systems that can learn from large datasets. It relies on Artificial Neural Networks (ANNs), which are designed to mimic the structure and functionality of the human brain. Within the realm of deep learning, DCNNs have gained significant prominence for their ability to recognize patterns in images and videos. DCNNs are specifically designed to leverage the three-dimensional neural patterns observed in the visual cortex of animals. As a result, DCNNs are widely applied in various domains, including image classification, recommendation systems, and object detection [ 22 ]. Moreover, they are also effective in creating recommendation systems for natural language processing tasks. In the DCNN structure depicted in Figure 3, the initial layer is the “image input layer”, designed to receive input images with dimensions of 224×224 pixels and three-color channels (RGB). Following that, a “convolution2dLayer” is applied, performing a 2D convolution operation on the input with a 7×7 filter size and 64 filters as well as a stride of 2, resulting in a reduction of the feature map dimensions. Padding is applied to ensure that the output size matches the input. After the convolutional layer, a “batch normalization layer” is utilized to standardize the output beginnings by adjusting and scaling them, helping stabilize the learning process and accelerate convergence. A “reluLayer” follows, applying the rectified linear unit (ReLU) beginning function, such as a convolutional layer, batch normalization layer, and ReLU Layer. ReLU circles damaging morals to zero while conserving positive morals, introducing non-linearity, and enhancing the network’s capability to study multifaceted patterns.

Figure 3. Learning process of our proposed deep convolutional neural network architecture.

Next, a “maxPooling2dLayer” is introduced to perform max pooling, which decreases the spatial sizes of the feature maps with a 3×3 pool size, a stride of 2, and padding when necessary. The network continues with another “convolution2dLayer” that employs 1×1 filter with 256 filters. The architecture explores abstract and higher-level features through convolutional, batch normalization, and ReLU layers. These layers are repeated with variations in filter sizes to capture local features. The branches are merged using additional layers, and this pattern is repeated multiple times. A final addition layer merges the branches, surveyed by a ReLU activation layer. The output is then passed through a series of layers, including a max pooling layer, resulting in an output size of 112×112×64. The outputs of the branches are added together, creating an output size of 112×112×320; this process is repeated for three residual blocks, and the output of the 3rd block is conceded through a global average pooling layer, resulting in an output size of 1×1×2048. The output is then connected to a completely related layer with 1000 outputs, shadowed by a softmax activation layer for final cataloging probabilities.

The Parameters of our DCNN Architecture

A typical DCNN comprises multiple layers, with particular emphasis on the convolution layer, which is critical as it applies filters or kernels—sets of weights—to extract pertinent features from the input data. By incorporating additional convolution layers, the DCNN becomes adept at capturing higher-level features. An overview of the learning parameters was employed in our DCNN architecture, as depicted in Table 1. These parameters play a vital role in determining the network’s performance and effectiveness by governing its learning process and weight adjustments during training. One such crucial parameter is the learning rate, which determines the magnitude of weight updates and impacts the convergence speed. A higher learning rate can accelerate convergence but carries the risk of overshooting the optimal solution, whereas a lower rate may result in slower convergence but improved accuracy. The optimization algorithm is another important parameter that determines how the network’s weights are updated using calculated gradients during training. Popular options include Stochastic Gradient Descent (SGD), Adam, and RMSprop. Each algorithm has distinct advantages, and their performance can vary based on the specific problem and dataset. The selection of the appropriate values for these parameters is essential to achieve optimal network performance, often requiring careful experimentation and tuning to strike the right balance between convergence speed and accuracy for a given task.

Type Value
Learning rate initial value 0.0003, 0.0001, 0.003
Convolutional layer kernel size 7, 3,1
Epoch 15
Maximum Iteration 120
Iteration per epoch 8
Learning rate schedule Constant
Frequency 8
Table 1. The Learning parameters of our deep convolutional neural network architecture.

Moreover, regularization techniques are employed to counter overfitting, in which the network becomes overly tailored to the training data and performs poorly on unseen data. Common regularization methods encompass L1 and L2 regularization, dropout, and batch normalization. DCNN techniques help manage the network’s complexity and enhance generalization. Additionally, the batch size denotes the number of training examples processed in a single forward and backward pass during each training iteration, influencing training speed and memory requirements. A higher batch size can expedite the training process but might demand increased memory resources. An epoch signifies a full iteration through the entire training dataset. The selection of the number of epochs dictates how frequently the network undergoes training on the complete dataset. Striking a suitable balance is crucial to prevent overfitting or underfitting of the data. Therefore, the initial values assigned to the weights of the network can greatly impact training performance.

Different weight initialization techniques, such as random initialization, Xavier initialization, or His initialization can be used to ensure that the network starts with suitable initial weights. These learning parameters are carefully selected and fine-tuned to improve the training method with the maximum possible performance for the specific task and dataset. Experimentation and evaluation of different parameter configurations are often performed to find the optimal settings for the DCNN architecture.

Results

In the planned process, the training of the DCNN is a pivotal stage for accurate ECG signal classification in cardiovascular disorders. Initializing the DCNN with random weights and biases sets the foundation for its learning process. By utilizing diverse datasets containing NSR, ARR, and CHF cases from reputable sources such as PhysioNet and the MIT-BIH arrhythmia dataset, ECG signals are transformed using the CWT. This transformation yields two-dimensional spectrograms, which are then fed into a DCNN architecture. The DCNN is strategically designed with pooling layers, fully connected layers, and convolutional layers to hierarchically extract features from the spectrograms. The iterative training process involves presenting batches of ECG signal images to the DCNN, causing the model to compute loss and refine its parameters through backpropagation. Continuous monitoring of accuracy and cross-entropy loss reveals an upward trend and a gradual reduction, respectively. The plotted curves in Figures 4 and 5 illustrate the training and validation performance of the DCNN and CNN, respectively. In these curve plots, the learning curve represents the model’s performance on the training dataset, showcasing its learning capability. Additionally, the validation curve, derived from the validation dataset, reflects the model’s generalization capability. During the evaluation phase, a confusion matrix, such as a mix-up matrix, is utilized to provide detailed insights into the accuracy of the model in classifying normal and abnormal heartbeats. The results obtained from this evaluation, as depicted in Figure 4 and summarized in Table 1, demonstrate the effectiveness of the approach in superior accuracy in ECG signal classification. These promising results affirm the viability of our trained DCNN model and highlight its potential for advancing automated diagnosis in cardiovascular healthcare. The model serves as a robust tool for early detection and intervention, contributing to improved healthcare outcomes.

Figure 4. Deep convolutional neural network training proposed method with Electrocardiogram (ECG) datasets.

Figure 5. Training and validation performances using proposed model accuracy curve of convolutional neural network.

Figure 4 illustrates the accuracy plot based on the number of iterations in the DCNN. The accuracy, which indicates the percentage of correct predictions made by the DCNN model, starts at a modest level of approximately 38% during the initial iterations. However, as the number of iterations increases, the accuracy shows a significant upward trend, reaching a promising level of 98.7% after 600 iterations during the 8th epoch. This improvement in accuracy is a direct result of training the DCNN model with a larger set of scalogram images. With more extensive training, the model becomes more proficient in classifying images, leading to enhanced accuracy.

The deep learning model, focused on ECG images, underwent both training and validation processes, with accuracy and cross-entropy loss plotted against the training steps. The red line represents the training process, indicating how the model’s performance improves over time. The black line corresponds to the validation process, demonstrating how well the model generalizes to new, unseen data. Evaluation involves examining the model’s performance using a confusion matrix, which provides insights into the accuracy of the classification. By analyzing the confusion matrix, a deeper understanding of the model’s ability was attained to correctly classify different classes or categories within the ECG signals.

However, the loss plot reveals an inverse pattern compared to the accuracy plot. The loss, indicative of the error or disparity between predicted and actual values, commences with a higher rate during initial iterations, indicating a significant difference between predicted and actual values (Figure 5). However, as the number of iterations increases during training, the loss gradually diminishes, signifying that the CNN model is improving in accuracy.

Table 1 presents a comparative analysis between the proposed method, utilizing the CWT and DCNN for feature extraction from ECG signals, and three state-of-the-art approaches. Table 1 highlights the superior accuracy of our approach, with an average accuracy of 98.67%, outperforming the other techniques. To comprehensively evaluate the method’s performance, five commonly used metrics—overall accuracy, specificity, precision, F1-score, and recall—are employed. These metrics consider False Positive (FP), True Negative (TN), True Positive (TP), and False Negative (FN) values obtained from classifying normal and abnormal heartbeats. Focusing on the imbalanced heartbeat types, the F1-score is emphasized as a key metric, considering both positive predictive value and sensitivity. Figures 4 and 5, along with the statistical measures, collectively demonstrate the improvement in the CNN model’s classification capabilities during training, emphasizing the model’s capability to correctly calculate and reduce error rates over time.

Figure 6 illustrates the confusion matrix, in which two main classes are depicted: the output class and the target class. Each class further consists of normal and abnormal subclasses. The green region represents the true values, encompassing both TP and TN, while the red region represents the instances classified incorrectly, comprising FP and FN. The remaining portion represents the cross-validation or validation of our classes, providing a comprehensive view of the classification outcomes. Figure 6 displays the confusion matrix that summarizes the classification results in this study. The matrix represents the classification outcomes for three classes: ARR, CHF, and NSR.

Figure 6. Confusion matrix cross-validation

In the case of the ARR class, 50 out of 100 instances were accurately classified as ARR, resulting in a 50% accuracy rate. However, the classifier misinterpreted two instances of ARR as NSR. For the NSR class, the CNN model correctly identified 50 out of 100 instances, yielding a success rate of 50%. Notably, the results for NSR were highly promising, with the classifier correctly identifying all 100 instances as ARR. The overall average success rate of the model in this study stands at 50%, reflecting the combined accuracy across all classes. This underscores the effectiveness of the model in accurately classifying ECG signals and distinguishing between different heartbeat patterns.

Figure 7 visually demonstrates the model’s ability to detect both normal and abnormal classes by emphasizing specific segments of the 2D image representing an ECG signal. The image serves as a visual testament to the model’s proficiency in accurately identifying and classifying ECG signals. The deep learning model underwent rigorous training and validation processes utilizing ECG images, reinforcing its capacity for precise distinctions between different cardiac conditions. To evaluate the model’s performance, accuracy, and cross-entropy loss were measured and plotted against the training steps. The red line represents the training process, while the black line represents the validation process. These plots illustrate the progression and enhancement of the model’s accuracy and loss throughout the training. In the evaluation phase, the performance indicators were determined using a confusion matrix, offering insights into the accuracy of the model’s predictions. This matrix helps assess how well the model classifies ECG signals into their respective classes—normal or abnormal. The accuracy metric derived from the confusion matrix provides a quantitative measure of the model’s performance.

Figure 7. Normal and abnormal classification

Overall, the evaluation process provides evidence of the effectiveness of our deep learning model in accurately classifying ECG signals and detecting normal and abnormal classes. Table 1 presents a comparison between three state-of-the-art approaches and the proposed research method, clearly demonstrating the superior accuracy of the approach. The proposed method focuses on extracting features from ECG signals using the CWT and DCNN, resulting in an impressive average accuracy of 98.67% for classifying ECG signals.

Furthermore, the proposed method, leveraging the DCNN, yields promising results in terms of accuracy, sensitivity, and specificity. Accuracy reflects the overall correctness of the model’s predictions, and sensitivity indicates its ability to correctly identify positive cases, and specificity represents its accuracy in identifying negative cases. Table 2 provides a comprehensive comparison of evaluation metrics across three different models: the Proposed Method (DCNN), 1-D CNN, and CNN using AlexNet. Notably, the DCNN achieves the highest accuracy of 98.67%, followed closely by CNN using AlexNet with 95.31%, while 1-D CNN lags behind at 89.40%, highlighting the superior overall correct classification rate of the DCNN.

Model Accuracy (%) Sensitivity (%) Specificity (%)
Proposed Method (DCNN) 98.67 97.25 100
1-DCNN [23] 89.40 68.80 99.50
CNN using AlexNet [24] 95.31 94.21 93.26
DCNN: Deep Convolutional Neural Network, CNN: Convolutional Neural Network
Table 2. Evaluation Metrics Comparison

In terms of sensitivity, the Proposed Method (DCNN) excelled with a rate of 97.25%, showcasing its capability to accurately identify positive cases. CNN using AlexNet followed with 94.21% and 1-D CNN exhibited a lower sensitivity at 68.80%. The Proposed Method (DCNN) also outperformed in specificity, with the highest rate at 99.89%. In comparison, 1-D CNN achieved 99.50%, and CNN using AlexNet demonstrated a specificity of 93.26%, emphasizing on the superior ability of the DCNN to correctly identify negative cases. The results highlight significant advancements with the DCNN when compared to previous studies utilizing 1-D CNN and CNN with AlexNet. The improvements in accuracy, sensitivity, and specificity underscore the superior overall performance of the DCNN, affirming its efficacy in correctly classifying both positive and negative cases.

Comparisons

Wang et al. [ 11 ] focused on arrhythmia detection using a combination of CWT and CNN techniques, resulting in improved classification accuracy. However, the present study introduced a modified algorithm that integrates DCNNs with the CWT. This novel approach capitalizes on the strengths of both methods, leading to remarkable outcomes in the classification of ECG signals.

In this study, a modified algorithm was proposed that combines DCNNs with the CWT. This innovative approach has yielded impressive results in the classification of ECG signals, as demonstrated by the evaluation metrics. The average precision, specificity, recall, overall accuracy, and F1-score values have reached exceptional levels of 100%, 100%, 97.65%, 98.67%, and 98.81%, respectively. These results surpass those achieved by most existing algorithms, as illustrated in Table 3.

Ref. Feature Extraction Classification Accuracy (%)
[4] Principal Component Analysis + Wavelet Support Vector Machine 86.4
[5] Gibbs Sampling Algorithm Hidden Markov Model 88.33
[6] Wavelet Probabilistic Neural Network 92.7
[7] Convolutional neural network Model SoftMax 92.7
[8] Discrete Wavelet Neural Network Wavelet 94
[9] Rescaled Raw Data 1D- Deep convolutional neural network 95.20
[10] Convolution Convolutional neural network Model 97.24
Proposed Continuous Wavelet Transform Deep convolutional neural network Model 98.67
Table 3. Contrast with other prevalent methods

The utilization of DCNNs in conjunction with CWT proves highly effective in accurately classifying ECG signals. The proposed algorithm consistently outperforms previous methods, underscoring its superiority in terms of precision, specificity, recall, overall accuracy, and F1-score. These findings not only demonstrate the potential of the modified algorithm for enhancing the diagnosis and analysis of ECG data but also highlight its exceptional performance compared to state-of-the-art techniques. Acharya et al. [ 14 ] anticipated a CNN-based algorithm for automating the detection of normal and MI ECG beats, with remarkable accuracies. Despite their success in specific beat detection, the current study surpasses this focus by presenting an automated ECG classification method that integrates DCNNs and CWT. The proposed methodology analyzes longer ECG signal fragments with a hierarchical architecture for effective differentiation between NSR, ARR, and CHF signals. This broader classification scope contributes to a more comprehensive understanding of cardiovascular health.

Although previous comparative studies have made significant contributions to ECG signal analysis, the current research stands out due to its unique integration of DCNNs and CWT. This integration provides a more comprehensive and robust solution for accurately classifying a wide range of cardiovascular disorders. Furthermore, the research distinguishes itself by focusing on longer signal fragments and generating 2D Scalogram images. These approaches further enhance the effectiveness and applicability of our study, positioning it as a significant contribution to the field of ECG signal analysis.

Discussion

The current study introduces a novel approach to ECG signal classification, leveraging the integration of the CWT and DCNN. This methodology demonstrates significant advancements over existing approaches, particularly in handling imbalanced heartbeat types. The proposed algorithm exhibits outstanding performance across multiple evaluation metrics, including overall accuracy, specificity, precision, F1-score, and recall. These metrics provide a comprehensive assessment of classification results, with the F1 score, emphasized due to the imbalanced nature of heartbeat types.

The proposed methodology excels in the detection of arrhythmia when compared to other methods, showcasing its robustness and effectiveness. The achieved results align favorably with the current state-of-the-art, demonstrating comparability with various deep-learning approaches applied to the same database.

A pretrained EfficientNet B0 convolutional neural network model achieved a commendable classification accuracy of 97.3% on the PhysioNet dataset. Another investigation [ 24 ] utilizing a hybrid deep learning model achieved a classification accuracy of 97.15% in identifying arrhythmia in the PhysioNet MIT-BIH arrhythmia database [ 25 ]. Additionally, Daydulo et al. [ 25 ] proposed a deep learning convolutional neural network for ECG signal classification from the MIT-BIH Arrhythmia database, reporting a classification accuracy of 91.92% [ 25 ]. Furthermore, a hybrid deep learning model named CNN—LSTM achieved accuracies of 98.0%, 96.0%, and 98.0% for ARR, CHF, and NSR, respectively [ 23 ].

Therefore, the present study not only introduces a powerful tool for automated ECG signal classification but also establishes its efficacy through comprehensive evaluation metrics. The proposed algorithm holds promise for revolutionizing cardiovascular diagnostics, offering accurate and automated identification of various cardiac conditions. Future research could focus on further refining the algorithm and conducting real-world validation to enhance its applicability in diverse healthcare settings.

Conclusion

The current study presents an innovative method for ECG classification that merges the CWT and DCNNs in order to overcome challenges associated with the loss of signal information in different frequency components of ECG heartbeats. The proposed approach initiates by applying CWT to transform ECG signals into the time-frequency domain, facilitating the capture of signal characteristics across diverse frequencies. Subsequently, DCNNs are employed to extract features from the spectrogram generated by the decomposed time-frequency components. By capitalizing on the capabilities of CWT in multidimensional signal processing and DCNNs in image recognition, the proposed method aimed to enhance the accuracy of ECG classification. To assess the effectiveness of this approach, extensive experiments were conducted using the MIT-BIH database. A comparison with existing methods was performed using a confusion matrix. Through cross-validation, the modified algorithm, which combines DCNNs and CWT, achieved remarkable average values: 100% for average precision and average specificity, 100% for average recall, 98.67% for average overall accuracy, and 98.81% for average F1-score. The high accuracy in ECG classification demonstrates the potential of the proposed method as a valuable clinical auxiliary diagnostic tool. Early detection of arrhythmia, a major contributor to cardiovascular disease, plays a crucial role in effective treatment and prevention. The proposed method offers the opportunity for timely identification and intervention, such as employing vagal maneuvers or medications, to reduce arrhythmia and mitigate the risks associated with cardiovascular disease. Moreover, this study recognizes the challenges associated with labeling ECG heartbeats, which can be both costly and time-consuming.

Future research can explore the utilization of unsupervised learning techniques, such as autoencoders, to enhance the performance of the classification task in a more cost-effective manner.

Acknowledgment

The authors are grateful to the Department of Electrical and Electronic Engineering, Faculty of Engineering International University of Business Agriculture and Technology, Dhaka, Bangladesh for providing the lab facilities and the funds.

Authors’ Contribution

T. Rahman conceived the idea. The introduction of the paper was written by T. Rahman and N. Deb. T. Rahman and R. Ahommed gather the images and the related literature and also help with the writing of the related works. The method implementation was carried out by T. Rahman, R. Ahommed, and M. Moniruzzaman. Results and Analysis were carried out by T. Rahman, N. Deb, R. Ahommed, and MK. Kausar. The research work was proofread and supervised by T. Rahman and UK. Das. All the authors read, modified, and approved the final version of the manuscript.

Ethical Approval

Review Board, and ethical approval was obtained prior to data collection. Data collection followed ethical guidelines, and all collected data were stored securely and analyzed anonymously. Personal identifiers were removed during the data anonymization process to protect participant privacy.

Informed Consent

Informed consent was obtained from all human participants prior to their involvement in the study. Participants were provided with detailed information about the research objectives, procedures, potential risks, and their right to withdraw at any time. Confidentiality was maintained by assigning unique participant codes to data, ensuring that personal information remained confidential.

Conflict of Interest

None

References

  1. Rajamhoana SP, Devi CA, Umamaheswari K, Kiruba R, Karunya K, Deepika R. Analysis of neural networks based heart disease prediction system. 11th international conference on human system interaction (HSI). Gdansk, Poland: IEEE; 2018. p. 233-9.
  2. Balamurugan R, Ratheesh S, Venila YM. Classification of heart disease using adaptive Harris hawk optimization-based clustering algorithm and enhanced deep genetic algorithm. Soft Computing. 2022; 26(5):2357-73. DOI
  3. Olanrewaju RF, Ibrahim SN, Asnawi AL, Altaf H. Classification of ECG signals for detection of arrhythmia and congestive heart failure based on continuous wavelet transform and deep neural networks. Indonesian Journal of Electrical Engineering and Computer Science. 2021; 22(3):1520-8. DOI
  4. Pashoutan S, Baradaran Shokouhi S. Reconstructed State Space Features for Classification of ECG Signals. J Biomed Phys Eng. 2021; 11(4):535-50. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  5. Rashed-Al-Mahfuz M, Moni MA, Lio’ P, Islam SMS, Berkovsky S, Khushi M, Quinn JMW. Deep convolutional neural networks based ECG beats classification to diagnose cardiovascular conditions. Biomed Eng Lett. 2021; 11(2):147-62. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  6. Gutiérrez-Gnecchi JA, Morfin-Magana R, Lorias-Espinoza D, Del Carmen Tellez-Anguiano A, et al. DSP-based arrhythmia classification using wavelet transform and probabilistic neural network. Biomedical Signal Processing and Control. 2017; 32:44-56. DOI
  7. Nurmaini S, Umi Partan R, Caesarendra W, Dewi T, Naufal Rahmatullah M, Darmawahyuni A, Bhayyu V, Firdaus F. An automated ECG beat classification system using deep neural networks with an unsupervised feature extraction technique. Appl Sci. 2019; 9(14):2921. DOI
  8. Mazidi MH, Eshghi M, Raoufy MR. Premature Ventricular Contraction (PVC) Detection System Based on Tunable Q-Factor Wavelet Transform. J Biomed Phys Eng. 2022; 12(1):61-74. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  9. Yıldırım Ö, Pławiak P, Tan RS, Acharya UR. Arrhythmia detection using deep convolutional neural network with long duration ECG signals. Comput Biol Med. 2018; 102:411-20. DOI | PubMed
  10. Izci E, Ozdemir MA, Degirmenci M, Akan A. Cardiac arrhythmia detection from 2d ecg images by using deep learning technique. 2019 medical technologies congress (TIPTEKNO). Izmir, Turkey: IEEE; 2019. p. 1-4.
  11. Wang T, Lu C, Sun Y, Yang M, Liu C, Ou C. Automatic ECG Classification Using Continuous Wavelet Transform and Convolutional Neural Network. Entropy (Basel). 2021; 23(1):119. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  12. Japkowicz N. Learning from imbalanced data sets: a comparison of various strategies. In AAAI workshop on learning from imbalanced data sets. Menlo Park: AAAI Press; 2000. p. 10-15.
  13. Zhao Z, Liu C, Li Y, Li Y, Wang J, Lin BS, Li J. Noise rejection for wearable ECGs using modified frequency slice wavelet transform and convolutional neural networks. IEEE Access. 2019; 7:34060-7. DOI
  14. Acharya UR, Fujita H, Oh SL, Hagiwara Y, Tan JH, Adam M. Application of deep convolutional neural network for automated detection of myocardial infarction using ECG signals. Information Sciences. 2017; 415:190-8. DOI
  15. AL-Bayati MD, Mohammed DY, Sarfraz M. A Novel Approach for ECG Classification Using Probability Continuous Wavelet Transform and Alexnet-Deep Neural Network. International Journal of Intelligent Engineering & Systems. 2022; 15(2):307-15. DOI
  16. Zhang X, Gu K, Miao S, Zhang X, Yin Y, Wan C, et al. Automated detection of cardiovascular disease by electrocardiogram signal analysis: a deep learning system. Cardiovasc Diagn Ther. 2020; 10(2):227-35. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  17. Radhakrishnan T, Karhade J, Ghosh SK, Muduli PR, Tripathy RK, Acharya UR. AFCNNet: Automated detection of AF using chirplet transform and deep convolutional bidirectional long short term memory network with ECG signals. Comput Biol Med. 2021; 137:104783. DOI | PubMed
  18. Mollakazemi MJ, Asadi F, Tajnesaei M, Ghaffari A. Fetal QRS Detection in Noninvasive Abdominal Electrocardiograms Using Principal Component Analysis and Discrete Wavelet Transforms with Signal Quality Estimation. J Biomed Phys Eng. 2021; 11(2):197-204. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  19. Jun TJ, Nguyen HM, Kang D, Kim D, Kim D, Kim YH. ECG arrhythmia classification using a 2-D convolutional neural network [Internet]. arXiv [Preprint]. 2018. [cited 2018 Apr 18]. Available from: https://arxiv.org/abs/1804.06812
  20. Boda S, Mahadevappa M, Dutta PK. An automated patient-specific ECG beat classification using LSTM-based recurrent neural networks. Biomedical Signal Processing and Control. 2023; 84:104756. DOI
  21. Ashtiyani M, Navaei Lavasani S, Asgharzadeh Alvar A, Deevband MR. Heart Rate Variability Classification using Support Vector Machine and Genetic Algorithm. J Biomed Phys Eng. 2018; 8(4):423-34. Publisher Full Text | DOI | PubMed [ PMC Free Article ]
  22. Kiranyaz S, Ince T, Gabbouj M. Real-Time Patient-Specific ECG Classification by 1-D Convolutional Neural Networks. IEEE Trans Biomed Eng. 2016; 63(3):664-75. DOI | PubMed
  23. Ince T, Kiranyaz S, Eren L, Askar M, Gabbouj M. Real-time motor fault detection by 1-D convolutional neural networks. IEEE Transactions on Industrial Electronics. 2016; 63(11):7067-75. DOI
  24. Gaddam PG, Sreehari RV. Automatic classification of cardiac arrhythmias based on ECG signals using transferred deep learning convolution neural network. J Phys: Conf Ser. 2021; 2089(1):012058. DOI
  25. Daydulo YD, Thamineni BL, Dawud AA. Cardiac arrhythmia detection using deep learning approach and time frequency representation of ECG signals. BMC Med Inform Decis Mak. 2023; 23(1):232. Publisher Full Text | DOI | PubMed [ PMC Free Article ]