Journal of Electronic Science and Technology, Volume. 22, Issue 2, 100249(2024)

Efficient ECG classification based on Chi-square distance for arrhythmia detection

Dhiah Al-Shammary1... Mustafa Noaman Kadhim1,*, Ahmed M. Mahdi1, Ayman Ibaida2 and Khandakar Ahmedb2 |Show fewer author(s)
Author Affiliations
  • 1College of Computer Science and Information Technology, University of Al-Qadisiyah, Al Diwaniyah, 58001, Iraq
  • 2Intelligent Technology Innovation Lab, Victoria University, Melbourne, 3011, Australia
  • show less

    This study introduces a new classifier tailored to address the limitations inherent in conventional classifiers such as K-nearest neighbor (KNN), random forest (RF), decision tree (DT), and support vector machine (SVM) for arrhythmia detection. The proposed classifier leverages the Chi-square distance as a primary metric, providing a specialized and original approach for precise arrhythmia detection. To optimize feature selection and refine the classifier’s performance, particle swarm optimization (PSO) is integrated with the Chi-square distance as a fitness function. This synergistic integration enhances the classifier’s capabilities, resulting in a substantial improvement in accuracy for arrhythmia detection. Experimental results demonstrate the efficacy of the proposed method, achieving a noteworthy accuracy rate of 98% with PSO, higher than 89% achieved without any previous optimization. The classifier outperforms machine learning (ML) and deep learning (DL) techniques, underscoring its reliability and superiority in the realm of arrhythmia classification. The promising results render it an effective method to support both academic and medical communities, offering an advanced and precise solution for arrhythmia detection in electrocardiogram (ECG) data.

    Keywords

    1 Introduction

    Cardiovascular diseases, which may lead to myocardial infarctions (MIs), are a major public health issue since they cause a disproportionate share of deaths worldwide. These illnesses account for almost 31% of all deaths each year, with over seventeen million lives lost, as per the World Health Organization. There is a notable subset of cardiovascular diseases known as arrhythmia. Irregular cardiac rhythms fall under this umbrella, and they may cause disorders like tachycardia (very fast heartbeats) or bradycardia (extremely slow pulse rates) [1]. Heart arrhythmia affects the rate and regularity of your heartbeat. It may indicate the presence of cardiovascular diseases. Arrhythmia may cause variations in the rhythm of your heartbeat, resulting in a faster, slower, or irregular heartbeat. The occurrence is attributed to abnormalities in the heart’s electrical impulses or structural anomalies affecting blood circulation inside the organ [2].

    An electrocardiogram (ECG) aids physicians in identifying irregularities in the heart. This test is simple and non-invasive, since it does not need insertion into the body. It monitors the electrical impulses of the heart. ECG displays them as waveforms on a graph, illustrating the heart’s rate and rhythm. Physicians analyze this graph to see whether the heart is exhibiting normal cardiac rhythms or not [3]. Currently, physicians mostly assess heart diseases based on their levels of expertise. However, there is a significant variation across different types of cardiac diseases. Excessive dependence on individuals for identification might result in mistakes and incorrect categorizations.

    Cardiovascular diseases are dangerous. Innovative methods are required to discover and analyze them. Deep learning (DL) and machine learning (ML) are used in that context. They are crucial to modern medicine, particularly in the context of cardiovascular health. The growth of these sectors is rapid, providing us with an expanding array of instruments to use. To identify cardiac arrhythmia, a range of methods are employed, including decision tree (DT) [4,5], K-nearest neighbor (KNN) [6,7], support vector machine (SVM) [8,9], and random forest (RF) [10,11]. The long short-term memory (LSTM) [12], convolutional neural network (CNN) [13,14], and recurrent neural network (RNN) [15,16] are also used. They enable us to distinguish between different types of cardiac arrhythmia. The followings are the main contributions made in the paper:

    1) An efficient classifier that utilizes the Chi-square distance is proposed to address the issues and limitations seen in commonly used classifiers such as KNN, RF, DT, and SVM. Limitations of standard classification methods are shown in different aspects like inefficient detection accuracy based on the data circumstances and context. This approach presents a focused and original method specifically designed for arrhythmia detection using ECG data.

    2) Particle swarm optimization (PSO) is integrated with the Chi-square distance as a fitness function to strengthen the framework for feature selection. This results in the optimization of the chosen features and an improvement in accuracy for arrhythmia detection. Technically, Chi-square classification is independent of PSO as the applied optimization aims to reduce the number of features with potential support to the proposed classification.

    3) The study findings indicate that the suggested approach exhibits an excellent accuracy rate of 98% and reliability in arrhythmia classification, surpassing both related ML and DL methods.

    ECG arrhythmia detection plays a vital role in the medical organization that is required highly for continuous monitoring. Fig. 1 describes the architecture for Chi-square arrhythmia detection. The proposed method deployment would significantly improve medical services and enable patients for having remote monitoring as long as required.

    Arrhythmia detection based Chi-square classification with the medical organization.

    Figure 1.Arrhythmia detection based Chi-square classification with the medical organization.

    2 Related works

    Artificial intelligence (AI) plays a pivotal role in medical prediction and classification within the clinical domain. The use of this technology provides significant support to medical professionals in managing a substantial volume of collected clinical data. These techniques have the potential to facilitate the early detection and diagnosis of diseases. DL and ML algorithms were used to pull out unique features from different parts of the ECG data. SVM, KNN, RF, Naïve Bayes (NB), DT, and other DL and ML techniques are constructed on CNNs and employ artificial neural networks. With respect to the Massachusetts Institute of Technology-Boston’s Beth Israel Hospital (MIT-BIH) dataset, the CNN method suggested in Ref. [17] yielded an accuracy rate of 81.33%. Batra and Jawa [18] proposed an approach that integrated SVM with gradient boosting (GB) to enhance the effectiveness of arrhythmia detection from ECG. The suggested methodology was evaluated by comparing it with existing ML techniques, including DT, GB, RF, and others. The raw data went through extensive processing and feature selection processes before the models were trained. The model had a comprehensive classification accuracy rate of 84.82%.

    The authors in Ref. [19] proposed a distinctive feature selection strategy, utilizing a three-filter method, to extract key features from the MIT-BIH dataset. After that, three classifiers were used: RF, SVM, and repeated incremental pruning. The RF classifier achieved the highest accuracy among other classifiers, reaching 85.58%. NB, RF, and SVM are just a selection of the ML algorithms that have been shown in Ref. [20]. It was suggested that a fusion of linear SVM and RF was used to generate the learner module. An accuracy rate of 77.4% in classification was obtained when the efficacy of the model was assessed using the MIT-BIH dataset that is available to the general public. The method proposed by Sakib et al. [21] used ML to develop a classification system for ECG signals. Classification using the RF and KNN algorithms produced the accuracy rates of 90.21% and 89.83%, respectively.

    To efficiently identify temporal relationships from ECG data, Hiriyannaiah et al. [22] thoroughly examined a number of deep LSTM models. The comparative analysis focused on evaluating the performance of four stacked LSTM models, consisting of three LSTM layers and one bidirectional long short-term memory (BiLSTM) layer. Based on the benchmark statistics derived from publicly accessible datasets, it was observed that the BiLSTM-based model exhibited the best level of accuracy, reaching 95% in comparison with the all-LSTM-stacked models. The duration of each epoch’s training was significantly extended with the integration of BiLSTM, leading to a corresponding rise in the computing expenses associated with this technique. Shin et al. [23] also proposed a DL-based methodology, using MobileNetV2 and BiLSTM approaches. Nevertheless, there has been a decline in performance, resulting in an accuracy rate of 91.7%. A different approach [24] was suggested, which used a deep neural network (DNN) architecture to help with the problems that come up when arrhythmia is found. The methodology included a phase of knowledge acquisition in tandem with a comprehensive feature-extraction procedure. The use of a genetic algorithm enabled the collection of the best attributes. The technique achieved a classification accuracy rate of 94% in categorizing five super-classes of arrhythmia. The lightweight CNN was suggested by Hammad et al. [25] to diagnose arrhythmia using ECG data. In comparison with previous methods, the proposed strategy is simpler, quicker, and less computationally demanding. As high accuracy as 98.8% was attained by the recommended method on the MIT-BIH dataset. The discrete wavelet transform (DWT) feature was used in Wang et al.’s [26] research to extract time and frequency information from the raw data. As high accuracy as 96.82% was attained with this method on the MIT-BIH dataset. SVM was suggested as a classifier while CNN was suggested for feature extraction by Hammad et al. [27] in order to identify conduction disorders and MIs utilizing big Physikalisch Technische Bundesanstalt extra-large (PTB-XL) ECG data. Based on PTB-XL ECG data, the proposed method yielded an accuracy rate of 99.2%.

    The reviewed literature is summarized in Table 1 [1727]. It provides an overview of the breakthroughs and progress made in the field of arrhythmia heartbeat classification, specifically focusing on the use of contemporary ML and DL techniques. In order to address the challenge of successfully handling huge datasets, this study introduces a feasible classifier with PSO for improving feature detection and extraction in the classification of arrhythmia heartbeats. The objective is to construct a scalable, robust, and efficient model for heartbeat classification.

    • Table 1. Literature overview.

      Table 1. Literature overview.

      Ref.YearMethodAccuracyLimitation
      [17]2018CNN81.33%The suggested model takes more time to achieve moderate levels of accuracy on the MIT-BIH dataset.
      [18]2016GB + SVM84.82%The performance of the model was evaluated on a redundant dataset including 500 records, exhibiting average accuracy across many classes.
      [19]2019Best first selection (BFS) + RF85.58%A restricted dataset consisting of just 500 entries was used for 16 classes.
      [20]2022RF + SVM77.4%The use of a traditional hybrid ML approach is associated with moderate precision levels and substantial processing costs.
      [21]2021KNN / RF89.83% / 90.21%It takes a lot of data preparation (3-phase preprocessing) to get moderate results.
      [22]2021BiLSTM95%The computational cost is increased due to the prolonged training time of a deep LSTM-BiLSTM model.
      [23]2022MobileNetV2+ BiLSTM91.7%The model needs a longer period of training in order to provide significant outcomes.
      [24]2020DNN94%The use of DNN in conjunction with a genetic algorithm results in a computational process that incurs significant computing expenses.
      [25]2022Fusion of CNN98.8%The model’s ability to perform well across different scenarios is limited due to its dependence on a small dataset.
      [26]2019DWT + Sparse autoencoder (S-AE)96.82%In the presence of elevated levels of noise, the suggested methodology has a limited capability for accurately identifying the precise positions of R-peaks.
      [27]2022SVM + Deep CNN 99.2%The research did not examine feature selection optimization methods, which may include identification of the most relevant deep features, classification performance optimization, and reduction of computational costs.

    3 Methodology

    The methodology of the proposed approach (shown in Fig. 2) starts by pre-processing the input dataset. Data pre-processing is achieved by min-max normalization. Then, the dataset is divided into training and testing sections. Next, feature selection based on PSO is implemented to randomly select effective features. Next, Chi-square is implemented for arrhythmia detection and then evaluation processing is performed in order to decide the completion of training or go back to PSO for another round with a new set of selected features based on the obtained accuracy.

    Schematic representation of the entire methodology, including the preprocessing, feature selection, and the Chi-square-based classifier.

    Figure 2.Schematic representation of the entire methodology, including the preprocessing, feature selection, and the Chi-square-based classifier.

    3.1 Description of dataset

    The MIT-BIH Arrhythmia Database (https://www.physionet.org/content/mitdb/1.0.0/) contains 48 half-hour excerpts of two-channel ambulatory ECG recordings, obtained from 47 subjects studied by the BIH Arrhythmia Laboratory between 1975 and 1979. MIT-BIH has been widely used for research and medical applications around the world as any enhancement for this dataset use would be positively reflected on many clinics and hospitals to provide potential ECG monitoring and detection. This dataset is completely raw and not compiled, as the researchers need to structure the data and clean it from noise before any experiments. This fact has resulted in unfair evaluation as researchers may use different segments with different statuses and features. The compiled MIT-BIH arrhythmia dataset was extracted from the MIT-BIH Arrhythmia Database. As the recording was digitized at 360 samples per second, 3600 samples were extracted for each segment, to cover 10 s per segment. Segments were extracted with the condition that there is no overlap of statuses, which means segments have one label and one class for all signal cycles. Records were distributed into five classes, with each class having 100 records, as shown in Table 2.

    • Table 2. Details of classes in the dataset.

      Table 2. Details of classes in the dataset.

      ClassDescriptionIncluded beatsNumber of extracted records
      NNon-ectopic beatsNormal beats, left bundle branch block, right bundle branch block, nodal (junctional) escape beat, and atrial escape beat100
      SSupraventricular ectopic beatsAberrated atrial premature beat, supraventricular premature beat, atrial premature beat, and nodal (junctional) premature beat100
      VVentricular ectopic beatsVentricular escape beat and premature ventricular contraction100
      FFusion beatsFusion of ventricular and normal beat100
      QUnknown beatsPaced beat, unclassified beat, and fusion of paced and normal beats100

    3.2 Preprocessing dataset

    At the first stage of preprocessing, the signal undergoes scaling to conform to the range of 0 to 1. The mathematical expression for the min-max scaler is

    $ {M}_{i}=\frac{{X}_{i}-\mathrm{m}\mathrm{i}\mathrm{n}\left({X}_{i}\right)}{\mathrm{max}\left({X}_{i}\right)-\mathrm{min}\left({X}_{i}\right)} $ (1)

    where the symbol $ {M}_{i} $ denotes the normalized signal and $ {X}_{i} $ represents the clean signal. Using the equation in Ref. [28], the difference between the lowest and highest $ {X}_{i} $ values was split. Then, the lowest Xi value was taken out of a signal $ {X}_{i} $ that had been processed. The array values were transformed into a normalized range of 0 to 1. Fig. 3 depicts the unprocessed signal before and after normalization. In fact, some challenges have been faced with the dataset preprocessing, like choosing the effective normalization range, as negative ranges have not provided efficient results, and fixing dataset data overlapping.

    Results of the preprocessing step (a) before and (b) after normalization.

    Figure 3.Results of the preprocessing step (a) before and (b) after normalization.

    3.3 PSO-based feature selection

    Feature selection is a crucial preliminary step that precedes the classification stage. Its primary purpose is to reduce superfluous characteristics and choose a subset that contains significant elements. It has the capability to reduce the dimensions of the classification issue while maintaining the same level of accuracy in classification.

    In PSO, it is customary to refer to each member of the swarm as a particle [29]. Each particle, denoted as $ {P}_{i} $ with i ranging from 1 to $ K $, is associated with a location $ {L}_{i} $ in a search space of dimensions. t represents the current iteration. These particles also possess a velocity $ {V}_{i} $ and maintain a memory of their personal best position, referred to as “pbest”. The variable “gbest” represents the stored location of the best particle discovered so far. The locations and velocities of all particles within each population are updated by using (2) and (3), respectively.

    $ {L}_{i}\left(t+1\right)={L}_{i}\left(t\right)+{V}_{i}\left(t\right) $ (2)

    $ {V}_{i}\left(t+1\right)=wL\left(t\right)+{C}_{1}{R}_{1}\left(\mathrm{p}\mathrm{b}\mathrm{e}\mathrm{s}\mathrm{t}-{L}_{i}\right)+{C}_{2}{R}_{2}\left(\mathrm{g}\mathrm{b}\mathrm{e}\mathrm{s}\mathrm{t}-{L}_{i}\right) $ (3)

    where the inertia weight, denoted as w, typically assumed a constant value within the interval [0.1, 1.0] in PSO; the acceleration coefficients, C1 and C2, were assigned a value of 2; R1 and R2 were both set to 0.5.

    In this research, Chi-square was used as a fitness function in the PSO algorithm to assess the subset dataset. Fig. 4 displays the Chi-PSO feature selection approach. The repetitive nature of this approach enables the algorithm to adaptively adjust the composition of the feature subset, finally converging towards an ideal set that maximizes the classification performance. Mathematically, the Chi-square distance $ \mathrm{D}\mathrm{i}\mathrm{s}\mathrm{t}\left(\mathbf{F}{\mathrm{,}}\;\mathbf{M}\right) $ between two feature vectors, F and M, is calculated as

    Chi-PSO.

    Figure 4.Chi-PSO.

    $ {\mathrm{Fitness}}\; {\mathrm{Function}} = \mathrm{D}\mathrm{i}\mathrm{s}\mathrm{t}\left(\mathbf{F}{\mathrm{,}}\;\mathbf{M}\right){\mathrm{.}} $ (4)

    3.4 Chi-square distance

    This section presents a new classifier that makes use of the Chi-square distance metric. The Chi-square distance has similarities to the Euclidean distance. The weighted distance is a pertinent measure that can be used to examine datasets containing qualitative, category, or nominal information. It provides a reliable method for categorizing fresh samples when dealing with categorical data. Eventually, Chi-square has shown potential efficiency in previous development for optimization and therefore we have expected its success in the new development as new data classification. Following is a description of the method:

    • The training dataset consists of records (vectors) F1, F2, ···, Fn, together with their corresponding labels z1, z2, ···, zn. Here, n is the total number of data training records.

    • For each data testing record (vector) M with s features, the Chi-square distance metric is employed for classification.

    • The Chi-square distance, Dist, between two records, M and F, is computed by

    $ \mathrm{D}\mathrm{i}\mathrm{s}\mathrm{t}=\sum _{i=1}^{D}\frac{{({m}_{i}-{f}_{i})}^{2}}{{m}_{i}+{f}_{i}+\epsilon } $ (5)

    where $ D $ represents the number of attributes or features and ε is a small constant ($ 1/{e}^{10} $) added to the denominator to prevent division by zero.

    • Once the Chi-square distance has been calculated, the k nearest neighbors are chosen by finding the k samples with the smallest Chi-square distance. The involvement of these neighboring entities is of utmost importance in the ensuing voting process aimed at categorizing the new sample. The parameter k may be manipulated (e.g., with the values such as 1, 3, 5, and 7) to exert an impact on the number of neighbors taken into account during the classification procedure.

    • The classification of a new sample is determined by executing a voting method that utilizes the class labels of the k nearest neighbors. The class with the greatest frequency among the neighboring samples is allocated to the new sample, so contributing to the overall classification procedure.

    3.5 Evaluation metrics

    In this work, a range of ML methods, including RF, KNN, SVM, DT, NB, and a new classifier based on the Chi-square distance, were used for classifying the ECG heartbeat. In the subsection, a concise overview of many metrics, including the confusion matrix, recall, F1-score, and precision, is provided prior to the use of ML algorithms.

    • Confusion matrix: The confusion matrix serves as an illustration of the algorithm’s performance. Examining prediction errors visually is made easier with the use of a confusion matrix. Fig. 5 illustrates the four components of the confusion matrix, which are false positive (FP), true positive (TP), true negative (TN), and false negative (FN). The matrix presents real class instances as rows and anticipated class instances as columns [30]. Not only does the confusion matrix show errors graphically, but it may also include other metrics like F1-score, accuracy, and recall.

    Confusion matrix.

    Figure 5.Confusion matrix.

    • Precision: The entire number of guesses the model has made is the basis for its calculation. The number of forecasts divided by the proportion of accurate predictions is the next step [31]. This is the relationship between the total prediction (TP + FP) and the prediction percentage (TP). As an equation, it is written as

    $ \mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}=\frac{\mathrm{T}\mathrm{P}}{\mathrm{T}\mathrm{P}+\mathrm{F}\mathrm{P}}{\mathrm{.}} $ (6)

    • Recall: Another important measure is recall, commonly referred to as sensitivity or the TP rate [32]. The determination of this may be achieved by calculating the ratio of precisely anticipated positive observations to the total number of positive observations. The equation is represented as

    $ \mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}=\frac{\mathrm{T}\mathrm{P}}{\mathrm{T}\mathrm{P}+\mathrm{F}\mathrm{N}}{\mathrm{.}} $ (7)

    • F1-score: F1-score is computed as the mean of recall and precision. In general, this metric is seen as a trustworthy way to compare how well various classifiers perform, especially when the data is imbalanced. The calculation of F1-score involves the consideration in terms of the quantity of prediction mistakes and the nature of the mistakes made by the model. The equation is represented mathematically as

    $ \mathrm{F}1 \text{-}\mathrm{s}\mathrm{c}\mathrm{o}\mathrm{r}\mathrm{e}=\frac{2\times \left(\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}\times \mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}\right)}{\mathrm{R}\mathrm{e}\mathrm{c}\mathrm{a}\mathrm{l}\mathrm{l}+\mathrm{P}\mathrm{r}\mathrm{e}\mathrm{c}\mathrm{i}\mathrm{s}\mathrm{i}\mathrm{o}\mathrm{n}}{\mathrm{.}} $ (8)

    • Accuracy: Accuracy is often considered to be the most intuitive measure of performance since it quantifies the proportion of properly predicted observations out of the total number of observations. The equation is expressed as

    $ \mathrm{A}\mathrm{c}\mathrm{c}\mathrm{u}\mathrm{r}\mathrm{a}\mathrm{c}\mathrm{y}=\frac{\mathrm{T}\mathrm{P}+\mathrm{T}\mathrm{N}}{\mathrm{T}\mathrm{P}+\mathrm{T}\mathrm{N}+\mathrm{F}\mathrm{N}+\mathrm{F}\mathrm{P}}{\mathrm{.}} $ (9)

    4 Results and discussion

    Python version 3.12 was used for the implementation of fundamental programming concepts. Python is a widely used general-purpose programming language that finds extensive applications in the development of both desktop and web-based applications. The primary platform used for implementation is Visual Studio Code, since it offers a streamlined implementation process, improved display of outcomes, and advanced functionalities that can be tailored to meet the requirements of data processing. Table 3 provides further information on the system setup.

    • Table 3. Details of the implementation environment.

      Table 3. Details of the implementation environment.

      ComponentsSpecifications
      Processor6th Generation Intel® Core™ i7
      RAM16 GB
      EditorVisual Studio Code
      Programming languagePython 3.12
      Operating systemWindows 10 Pro

    We will show and discuss the outcomes of our tests on the MIT-BIH arrhythmia dataset in this section that follows. Our primary objective is to compare the performance of our classifier with that of other classifiers, both with and without feature selection.

    4.1 Classification results without feature selection

    The efficacy of conventional classifiers without feature selection was first examined. The classifiers included in this study consist of KNN, RF, SVM, DT, and NB, in addition to our classifier based on the Chi-square distance. The evaluation metrics include F1-score, recall, precision, and accuracy. Table 4 presents the obtained results on the MIT-BIH arrhythmia dataset without feature selection.

    • Table 4. Comparison of our classifier’s performance with that of the standard classifiers without feature selection.

      Table 4. Comparison of our classifier’s performance with that of the standard classifiers without feature selection.

      ClassifierAccuracy (%)F1-score (%)Precision (%)Recall (%)
      KNN8483.3683.4884
      RF7773.2076.1877
      SVM7872.3483.1478
      NB7474.4975.2274
      DT8384.2987.0183
      Our classifier (Chi-square)8989.4390.4089

    Obviously, our suggested classifier performs the best when evaluated using the Chi-square distance without feature selection. When compared with standard classifiers, the classifier exhibits a discernible increase in accuracy, F1-score, precision, and recall. This emphasizes how effectively the Chi-square distance classifies arrhythmia. The classifiers of KNN, RF, SVM, NB, DT, and our Chi-square-based one were evaluated by using a confusion matrix, as shown in Fig. 6. The results appeared to show the ML model (KNN) accurately predicted 67 positive cases and 17 negative cases, the RF model correctly predicted 69 positive cases and 8 negative cases, the SVM model precisely predicted 72 positive cases and 6 negative cases, the NB model accurately predicted 17 negative cases and 57 positive cases, the DT model correctly predicted 70 positive cases and 13 negative cases, and our Chi-square classifier precisely predicted 72 positive cases and 17 negative cases. Nonetheless, a total of 16, 23, 22, 26, 17, and 11 erroneous predictions were observed, including 5, 3, 0, 15, 13, and 8 instances of false negatives, and 11, 20, 22, 11, 4, and 3 instances of false positives, respectively.

    Confusion matrices of (a) KNN, (b) RF, (c) SVM, (d) NB, (e) DT, and (f) our classifier (Chi-square).

    Figure 6.Confusion matrices of (a) KNN, (b) RF, (c) SVM, (d) NB, (e) DT, and (f) our classifier (Chi-square).

    The evaluation results of the confusion matrix further demonstrate that our classifier, which utilizes the Chi-square approach, has excellent performance. Compared with other classifiers, this specific classifier exhibits exceptional performance by attaining the highest number of successfully predicted positive occurrences (72) and the lowest number of incorrect predictions (11). Significantly, it displays a considerable decrease in the occurrence of both FPs and FNs. The reduction in the occurrence of FNs demonstrates the classifier’s efficacy in mitigating the misclassification of real positive cases as negative. Similarly, the reduced incidence of FPs demonstrates the classifier’s capacity to effectively discern negative circumstances without erroneously classifying them as positive. The efficacy of our Chi-square-based technique in identifying arrhythmia is evident from the notable level of performance seen in this investigation. In contrast, alternative classifiers exhibit varying degrees of misclassification, revealing notable trade-offs between the prevalence of FNs and FPs. SVM, for instance, demonstrates a decreased occurrence of FNs, but with the trade-off of an elevated occurrence of FPs. The aforementioned discussion on the intricate aspects of misclassification patterns serves to underscore the robustness and precision of our proposed Chi-square-based classifier in comparison with other classifiers.

    4.2 Classification results with feature selection

    In the previous subsection, the performance of standard classifiers compared with our Chi-square-based classifier without feature selection was evaluated. The findings revealed that the suggested classifier exhibited superior performance when compared with the standard classifiers. In this subsection, the significant features present in the dataset are identified and extracted. The PSO technique, employing the Chi-square-based method, is used to identify and extract the most important features. The primary objective of feature selection is to minimize the inclusion of irrelevant information, hence optimizing classification accuracy. The use of an effective feature selection approach has the potential to decrease the expenses associated with feature measurement while simultaneously enhancing the efficiency of classifiers and improving the accuracy of categorizations. Utilizing the MIT-BIH arrhythmia dataset, Table 5 displays the classifiers’ performance metrics with PSO feature selection.

    • Table 5. Performance comparison of our classifier (Chi-square) and standard classifiers with feature selection.

      Table 5. Performance comparison of our classifier (Chi-square) and standard classifiers with feature selection.

      ClassifierAccuracy (%)F1-score (%)Precision (%)Recall (%)
      KNN9696.0696.2396
      RF9392.8992.8393
      SVM9594.9294.8995
      NB8283.2686.9182
      DT9191.1191.2691
      Our classifier (Chi-square)9898.0398.1898

    The PSO algorithm was used to gather the classifiers utilized in the research in order to extract the most significant features and improve accuracy. The suggested approach, which utilizes the Chi-square test and employs the PSO algorithm for feature extraction, demonstrated superior performance across all evaluation criteria when compared with conventional classifiers. Fig. 7 shows the confusion matrix for each classifier used in this investigation with feature selection.

    Confusion matrices of (a) KNN, (b) RF, (c) SVM, (d) NB, (e) DT, and (f) our classifier (Chi-square).

    Figure 7.Confusion matrices of (a) KNN, (b) RF, (c) SVM, (d) NB, (e) DT, and (f) our classifier (Chi-square).

    The use of PSO in the process of feature selection has shown notable improvements in the predictive performance of many classifiers, including KNN, RF, SVM, NB, DT, and our own Chi-square-based classifier. During the first evaluation, the confusion matrix illustrated the diverse levels of accurate predictions and misclassification observed for each model. After implementing feature selection using PSO, significant improvements are found in the performance of the classifiers.

    For example, the KNN algorithm exhibits a significant improvement in accurately predicting positive instances, with an increase from 67 to 76. This improvement is followed by a decrease in both FN and FP. The RF model demonstrates a significant improvement, accurately forecasting 82 positive instances while effectively reducing both FN and FP. In a similar vein, SVM demonstrates an increase in accurate predictions, namely 83 positive examples. This serves as evidence of the effectiveness of PSO in improving subsets of features. The NB model demonstrates improved accuracy by accurately predicting 64 positive instances while significantly reducing both FN and FP. The performance of DT is enhanced, as shown by its accurate prediction of 80 positive cases and a decrease in misclassification. Significantly, our classifier based on the Chi-square-based method demonstrates resilience, effectively forecasting 78 instances of positive cases and 20 instances of negative cases, while minimizing the occurrence of incorrect predictions.

    The strategic use of PSO in the process of feature selection has shown its effectiveness in enhancing the classification performance of various models. As a result of refinement, specifically in the classifier we created using the Chi-square-based method, the results show that this hybrid technique is very good at classifying arrhythmia. The higher accuracy and recall metrics show how stable the features that PSO chose are, which makes it possible for more accurate and reliable classification. Fig. 8 shows the evaluated metrics for various models and our classifier with as well as without PSO feature selection.

    Evaluated performance of classifiers (a) without and (b) with PSO feature selection.

    Figure 8.Evaluated performance of classifiers (a) without and (b) with PSO feature selection.

    The classification challenge of ECG recordings obtained via the publicly accessible MIT-BIH Arrhythmia Database has been the basis of several studies published in the literature [1724]. Table 6 compares the suggested model’s classification performance with that of similar studies [19,3344]. This suggested strategy presents a novel way to identify ECG signals by using PSO for feature extraction and Chi-square as the classifier. Effective feature selection is potentially empowered by PSO that is evident by the Chi-square classification resultant accuracy. This methodology surpasses the latest technologies with an impressive accuracy rate of 98%.

    • Table 6. Comparison of the approach presented in this paper with similar work on the MIT-BIH arrhythmia dataset.

      Table 6. Comparison of the approach presented in this paper with similar work on the MIT-BIH arrhythmia dataset.

      Ref.YearFeature selectionClassifierAccuracy (%)
      [33]2020Wavelet + Gabor filterBat-rider optimization algorithm deep CNN (BaRoA-DCNN)93.19
      [34]2021Rapid-ramp (RR) + ECG segmentsArtificial deep neural network (ADNN) + Conv1D94.70
      [35]2017Linear discriminant analysis (LDA) + Principal component analysis (PCA) + DWTWeighted k-nearest neighbors (WKNN)96.12
      [19]2019Three-filter feature selection (TFFS)RF + BFS85.58
      [36]2021WaveletCNN97.41
      [37]2020Z-score + High order statistics (HOS) / DWTRF93.45
      KNN72.56
      SVM90.09
      LSTM92.16
      Ensemble SVM94.40
      [38]2019Fractal dimension + Renyi entropy + Fuzzy entropyKNN94.5
      [39]2019HOS + Local binary patterns (LBP) + RREnsemble SVM94.50
      [40]2023ECG segments + RRConv1D MF96.48
      [41]2022RR-intervals + Higher order statistics + DWTEasyEnsemble95.6
      [42]2021Attention mechanismDual-level attentional (DLA) + Convolutional long short-term memory (CLSTM) neural network88.76
      [43]2023Augmented attentionCNN + Attention96.19
      [44]2023Lightweight transformerCNN97.66
      Denoising autoencoder (DAE)97.93
      This workPSOChi-square98

    As illustrated in Table 6, several feature selection techniques have been used in previous studies such as Wavelet, HOS, DWT, and RR. It is noticeable that Wavelet has been used in several models and approaches. On the other hand, both DL, like CNN, and ML methods have been applied for classification. Although, CNN has shown significant accuracy, DAE classification has outperformed other previous approaches with 97.93% accuracy. Technically, the proposed approach outperforms all the previous representative methods with higher accuracy up to 98%.

    5 Conclusion

    In conclusion, the study introduces a feasible classifier for arrhythmia classification using ECG data based on the Chi-square distance. Traditional classifiers, like KNN, SVM, and RF, have limitations and issues that the proposed Chi-square-based classifier attempts to address. Combining PSO with the Chi-square distance shows significant improvements in feature selection, resulting in more precise categorizations of arrhythmia. Technically, Chi-square provides a reliable classification method with significant implications represented by high detection accuracy. The results indicate that the proposed classifier attained a very high degree of precision, reaching 98% on the MIT-BIH arrhythmia dataset. This performance exceeds that of typical classifiers often used in ML and DL techniques. The proposed technique greatly enhances the precise classification of arrhythmia, thereby facilitating future study and progress in the domain of cardiovascular health diagnostics.

    Disclosures

    The authors declare no conflicts of interest.

    [1] Zoghbi W.A., Duncan T., Antman E. et al. Sustainable development goals and the future of cardiovascular health: A statement from the global cardiovascular disease taskforce. J. Am. Heart Assoc., 3, e000504:1-2(2014).

    [4] Mert A., Kilic N., Akan A.. ECG signal classification using ensemble decision tree. J. Trends Dev. Mach. Assoc. Technol., 16, 179-182(2012).

    [7] [7] I. Saini, D. Singh, A. Khosla, Delineation of ECG wave components using Knearest neighb (KNN) algithm: ECG wave delineation using KNN, in: Proc. of 10th Intl. Conf. on Infmation Technology: New Generations, Las Vegas, USA, 2013, pp. 712–717.

    [8] [8] N. Kohli, N.K. Verma, Arrhythmia classification using SVM with ed features, Int. J. Eng. Sci. Technol. 3 (8) (2011) 122–131.

    [9] Celin S., Vasanth K.. ECG signal classification using various machine learning techniques. J. Med. Syst., 42, 241:1-11(2018).

    [10] Kumar R.G., Kumaraswamy Y.S.. Investigating cardiac arrhythmia in ECG using random forest classification. Int. J. Comput. Appl., 37, 31-34(2012).

    [13] Tutuko B., Nurmaini S., Tondas A.E. et al. AFibNet: An implementation of atrial fibrillation detection with convolutional neural network. BMC Med. Inform. Decis., 21, 216:1-17(2021).

    [14] [14] E. Izci, M.A. Ozdemir, M. Degirmenci, A. Akan, Cardiac arrhythmia detection from 2D ECG images by using deep learning technique, in: Proc. of Medical Technologies Congress, Izmir, Turkey, 2019, pp. 1–4.

    [16] Zhang J., Liu A.-P., Gao M., Chen X., Zhang X., Chen X.. ECG-based multi-class arrhythmia detection using spatio-temporal attention-based convolutional recurrent neural network. Artif. Intell. Med., 106, 101856:1-9(2020).

    [17] [17] M. Deshmane, S. Madhe, ECG based biometric human identification using convolutional neural wk in smart health applications, in: Proc. of 4th Intl. Conf. on Computing Communication Control Automation, Pune, India, 2018, pp. 1–6.

    [18] [18] A. Batra, V. Jawa, Classification of arrhythmia using conjunction of machine learning algithms ECG diagnostic criteria, Int. J. Biology Biomedicine 1 (2016) 1–7.

    [19] [19] N. Singh, P. Singh, Cardiac arrhythmia classification using machine learning techniques, in: K. Ray, S.N. Sharan, S. Rawat, S.K. Jain, S. Srivastava, A. Byopadhyay (Eds.), Engineering Vibration, Communication Infmation Processing, Springer, Singape, 2019, pp. 469–480.

    [20] [20] A. Gupta, A. Banerjee, D. Babaria, K. Lotlikar, H. Raut, Prediction classification of cardiac arrhythmia, in: S. Shakya, V.E. Balas, S. Kamolphiwong, K.L. Du (Eds.), Sentimental Analysis Deep Learning, Springer, Singape, 2022, pp. 527–538.

    [23] Shin S., Kang M.-G., Zhang G.-J., Jung J., Kim Y.T.. Lightweight ensemble network for detecting heart disease using ECG signals. Appl. Sci., 12, 3291:1-18(2022).

    [24] Hammad M., Iliyasu A.M., Subasi A., Ho E.S.L., Abd El-Latif A.A.. A multitier deep learning model for arrhythmia detection. IEEE T. Instrum. Meas., 70, 2502809:1-9(2020).

    [25] Hammad M., Meshoul S., Dziwiński P., Pławiak P., Elgendy I.A.. Efficient lightweight multimodel deep fusion based on ECG for arrhythmia classification. Sensors, 22, 9347:1-14(2022).

    [26] Wang D., Si Y.-J., Yang W.-Y., Zhang G., Li J.. A novel electrocardiogram biometric identification method based on temporal-frequency autoencoding. Electronics, 8, 667:1-24(2019).

    [27] Hammad M., Chelloug S.A., Alkanhel R. et al. Automated detection of myocardial infarction and heart conduction disorders based on feature selection and a deep learning model. Sensors, 22, 6503:1-14(2022).

    [28] [28] M.N. Dar, M.U. Akram, A. Usman, S.A. Khan, ECG biometric identification f general population using multiresolution analysis of DWT based features, in: Proc. of 2nd Intl. Conf. on Infmation Security Cyber Fensics, Cape Town, South Africa, 2015, pp. 5–10.

    [29] [29] D. Bratton, J. Kennedy, Defining a stard f particle swarm optimization, in: Proc. of IEEE Swarm Intelligence Symposium, Honolulu, USA, 2007, pp. 120–127.

    [30] Bharti R., Khamparia A., Shabaz M., Dhiman G., Pande S., Singh P.. Prediction of heart disease using a combination of machine learning and deep learning. Comput. Intel. Neurosc., 2021, 8387680:1-11(2021).

    [31] Kumari M., Ahlawat P.. DCPM: An effective and robust approach for diabetes classification and prediction. Int. J. Inf. Technol., 13, 1079-1088(2021).

    [32] Biswas P., Samanta T.. Anomaly detection using ensemble random forest in wireless sensor network. Int. J. Inf. Technol., 13, 2043-2052(2021).

    [33] Atal D.K., Singh M.. Arrhythmia classification with ECG signals based on the optimization-enabled deep convolutional neural network. Comput. Meth. Prog. Bio., 196, 105607:1-19(2020).

    [34] Zhang J., Liu A.-P., Liang D., Chen X., Gao M.. Interpatient ECG heartbeat classification with an adversarial convolutional neural network. J. Healthc. Eng., 2021, 9946596:1-11(2021).

    [36] Wu M.-Z., Lu Y.-D., Yang W.-L., Wong S.Y.. A study on arrhythmia via ECG signal classification using the convolutional neural network. Front. Comput. Neurosc., 14, 564015:1-10(2021).

    [38] Sharma M., Tan R.-S., Acharya U.R.. Automated heartbeat classification and detection of arrhythmia using optimal orthogonal wavelet filters. Inform. Med. Unlocked, 16, 100221:1-12(2019).

    [40] Farag M.M.. A tiny matched filter-based CNN for inter-patient ECG classification and arrhythmia detection at the edge. Sensors, 23, 1365:1-23(2023).

    [41] Wang T., Lu C.-H., Ju W., Liu C.. Imbalanced heartbeat classification using EasyEnsemble technique and global heartbeat information. Biomed. Signal Proces., 71, 103105:1-8(2022).

    [42] Jin Y.-R., Liu J.-L., Liu Y.-Q. et al. A novel interpretable method based on dual-level attentional deep neural network for actual multilabel arrhythmia detection. IEEE T. Instrum. Meas., 71, 2500311:1-11(2021).

    [43] [43] M. Zubair, S. Woo, S. Lim, D. Kim, Deep representation learning with sample generation augmented attention module f imbalanced ECG classification, IEEE J. Biomed. Health (Oct. 2023), doi: 10.1109JBHI.2023.3325540.

    [44] Xia Y., Xiong Y.-Q., Wang K.-Q.. A transformer model blended with CNN and denoising autoencoder for inter-patient ECG arrhythmia classification. Biomed. Signal Proces., 86, 105271:1-15(2023).

    Tools

    Get Citation

    Copy Citation Text

    Dhiah Al-Shammary, Mustafa Noaman Kadhim, Ahmed M. Mahdi, Ayman Ibaida, Khandakar Ahmedb. Efficient ECG classification based on Chi-square distance for arrhythmia detection[J]. Journal of Electronic Science and Technology, 2024, 22(2): 100249

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category:

    Received: Dec. 20, 2023

    Accepted: Apr. 2, 2024

    Published Online: Aug. 8, 2024

    The Author Email: Kadhim Mustafa Noaman (mustafa.noaman@qu.edu.iq)

    DOI:10.1016/j.jnlest.2024.100249

    Topics