Classification of ECG Signals Based on MIT-BIH Dataset Using Bi-LSTM Model for Assisting Cardiologists Diagnosis

Classification of ECG Signals Based on MIT-BIH Dataset Using Bi-LSTM Model for Assisting Cardiologists Diagnosis

Sidi Mohammed Hadj Irid* Djilali Moussaoui Mourad Hadjila Omar Azzoug

Department of Telecommunication, Faculty of Technology, University of Tlemcen, Tlemcen 13000, Algeria

English Department, Faculty of Literature and Languages, University of Tlemcen, Tlemcen 13000, Algeria

Corresponding Author Email: 
sidimohammedhadj.Irid@univ-tlemcen.dz
Page: 
3245-3253
|
DOI: 
https://doi.org/10.18280/ts.410640
Received: 
23 April 2024
|
Revised: 
26 September 2024
|
Accepted: 
20 November 2024
|
Available online: 
31 December 2024
| Citation

© 2024 The authors. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

OPEN ACCESS

Abstract: 

It is acknowledged that Heart attacks require immediate and accurate diagnosis to ensure patient survival. For this purpose, this paper endeavors to presents a solution that utilizes Electrocardiogram (ECG) signals, a widely used tool for assessing heart health, to directly diagnose patients. While ECGs capture the heart's electrical activity over time, classifying these signals into specific heart conditions remains a challenge. Given the high mortality rate associated with cardiovascular diseases, researchers are developing automated classification methods to enhance diagnostic accuracy. This work introduces a Bidirectional Long Short-Term Memory (BLSTM) neural network model for ECG signal classification and arrhythmia detection. The model is trained using the MIT-BIH dataset, which contains five classes representing various cardiac conditions. To address class imbalances, re-sampling techniques are applied during data preprocessing. A multi-class classification approach is then implemented to accurately identify the specific type of disease. Our proposed BLSTM model demonstrates remarkable performance, achieving a 98.25% accuracy in classifying the five distinct arrhythmias.

Keywords: 

arrhythmia, deep learning, ECG, LSTM and MIT-BIH dataset models, one-hot encoding

1. Introduction

Cardiovascular disease (CVD) is the top cause of death worldwide, according to the World Health Organization (WHO) [1, 2]. This means we need better ways to classify ECG signals. An ECG is a recording of the heart's electrical activity [3]. It helps identify problems in heartbeats and can also measure things like stress.

Classifying heart rhythm problems is important for medical devices that monitor health. ECG monitoring is useful for spotting changes in heart function. With digital ECGs, using computers to analyze standard 12-lead ECGs has become a key part of diagnosing health issues [4, 5]. However, traditional algorithms have limitations, which makes them less effective as standalone diagnostic tools.

Artificial intelligence (AI) is changing how we classify ECG signals by improving accuracy and efficiency. Traditional ECG analysis often requires manual work and basic machine learning (ML), which can take time and be prone to mistakes. AI, especially with deep learning (DL) models like convolutional neural networks (CNNs) and recurrent neural networks (RNNs), including Long Short-Term Memory (LSTM) networks, can automatically find important features in raw ECG data. This helps detect subtle patterns that humans might miss. These AI models, trained on large datasets, are very good at identifying various heart conditions, such as arrhythmias and heart attacks, often more accurately than traditional methods. AI can also analyze ECG data in real-time, making it valuable for ongoing monitoring and quick diagnosis, especially when used in wearable devices. This feature is crucial for providing timely alerts and interventions, potentially saving lives. Additionally, AI can deliver high-quality diagnostics to large groups of people, including those in remote areas, using portable devices and cloud services.

AI also helps in personalized medicine by customizing ECG analysis for individual patients, improving diagnosis and treatment plans. Moreover, integrating AI with electronic health records (EHRs) allows for better analysis of patient information, leading to improved outcomes. In research, AI can process large amounts of ECG data to find new markers and patterns related to heart diseases, helping drive new ideas in prevention and treatment. Overall, AI is transforming ECG signal classification, changing how we monitor and manage heart health.

In this line of thought, this paper focuses on using a RNN called BLSTM for ECG classification. As unlike regular RNNs, ECG classification has unique challenges. In this endeavor, we explain how we created a deep DL model with a BLSTM network to classify arrhythmias in individual heartbeats. The BLSTM model can read sequences in both directions, capturing more important information and reducing issues with sequence analysis. BLSTM networks have shown success in tasks like speech recognition, translation, and time series prediction.

Finally, we share results from the publicly available MIT-BIH Arrhythmia database. The rest of this paper is organized as follows: Section 2 reviews related research in ECG classification using AI. Section 3 describes the dataset used, followed by preprocessing steps in Section 4. Section 5 explains the BLSTM model architecture. Section 6 presents the classification results and their interpretation. Section 7 compares our findings with existing studies on ECG classification using BLSTM and similar methods. Finally, Section 8 concludes by summarizing the key findings, highlighting the contribution of the BLSTM model, and suggesting future research directions.

2. Related Work

Many studies have focused on using artificial intelligence (AI) techniques for classifying ECG signals, often using the MIT-BIH arrhythmia dataset. Researchers have tried different methods, including:

Artificial Neural Networks (ANNs) for general classification [3].

Convolutional Neural Networks (CNNs) for feature extraction [6, 7].

Hybrid CNN-LSTM models to utilize both spatial and sequential information in ECG signals [8, 9].

Beyond the MIT-BIH dataset, other researches have looked at classifying cardiac arrhythmias using both traditional ML [10-13] and deep learning techniques [14-19]. Although these studies show that AI can be effective in ECG analysis, there are few studies specifically using BLSTM networks on the MIT-BIH dataset for arrhythmia classification. This paper aims to fill that gap.

For example, Jambukia et al. [14] discussed the importance of early and accurate ECG classification for diagnosing and planning treatment for heart diseases. They outlined key steps, including preprocessing, feature extraction, normalization, and classification.

Similarly, another study [15] compared backpropagation with multi-layer perceptrons (MLP) and Kernel-Adatron with support vector machines (SVM) for ECG classification, highlighting the importance of preprocessing and wave transformation techniques (like DWT, DCT, CWT) in improving results.

Shimpi et al. [16] used the UCI ML Repository dataset to classify ECG data into sixteen arrhythmia types and explored different methods for improving classification accuracy, including dimensionality reduction and clustering.

Alfaras et al. [17] introduced an Echo State Network for fast ECG arrhythmia classification, testing it on the MIT-BIH and AHA databases. Devi et al. [18] developed an IoT-enabled ECG monitoring system that analyzes raw ECG signals using statistical features.

Sahoo et al. [19] reviewed current methods for detecting cardiac arrhythmias with ECG signals, covering signal decomposition, feature extraction, and ML techniques for automated detection.

Sraitih et al. [20] created an automatic classification system that improves detection of rare arrhythmia types without needing feature extraction. They tested SVM, KNN, Random Forest, and an ensemble on real ECG data from the MIT-BIH database.

Ebrahimi et al. [21] reviewed recent DL methods for ECG classification, including techniques like Deep Belief Networks, CNNs, RNNs, LSTMs, and Gated Recurrent Units (GRU).

Murat et al. [22] examined DL methods for ECG arrhythmia detection, discussing challenges and popular trends. Izci et al. [23] proposed a new 2D CNN architecture for accurately classifying five arrhythmia types using the MIT-BIH dataset.

Isin et al. [24] used a transferred deep CNN (AlexNet) for feature extraction followed by a simple neural network for classifying three cardiac conditions. Huang et al. [25] introduced an intelligent ECG classifier using Fast Compression Residual CNNs for precise arrhythmia classification.

Cui et al. [26] combined traditional feature extraction methods with 1D-CNN to improve classification accuracy, testing it on the MIT-BIH benchmark database. Liu et al. [27] reviewed DL applications in ECG diagnosis, focusing on four main algorithms and their strengths and weaknesses.

Sannino and De Pietro [28] proposed a new DL approach for ECG beat classification on the MIT-BIH dataset.

Aldossary et al. [29] suggested a classification process for MIT-BIH ECG signals following the AAMI standard, which is crucial for early heart disease detection. Their method involved preprocessing raw ECG signals and using a Double Layer Bi-LSTM model for classification, showing improved performance metrics.

Salem et al. [30] looked at identifying and classifying four ECG patterns through transfer learning, applying knowledge from image classification to ECG signals.

Bi-LSTM networks are more effective than traditional LSTMs because they analyze data in both directions—forward and backward. This helps them understand the context better and improves prediction accuracy, making them suitable for tasks that depend on the entire sequence, such as language translation and sentiment analysis. This dual perspective is especially useful in tasks where context is important, leading to better handling of complex data.

3. Dataset

This research leverages the MIT-BIH arrhythmia dataset [30-32] to categorize five distinct arrhythmias, adhering to the Association for the Advancement of Medical Instrumentation (AAMI) EC57 standard. This standard promotes consistency with classifications used in medical devices. The dataset consists of 48 half-hour ECG recordings from 47 patients. Each recording was digitized at 360 Hz per channel with 11-bit resolution and includes two ECG leads (Lead II and Lead V5) capturing a range of 10 mV.

For this work, we concentrated on Lead II ECGs. Following extraction, these signals were processed (e.g., filtering, normalization) to make them suitable for the BLSTM model. The preprocessed ECGs were then divided into five arrhythmia categories, as outlined in Table 1 and depicted in Figure 1.

This dataset contains two CSV files, one for training and the other for testing, with 109446 samples and 188 features respectively (see Table 2).

Table 1. The different categories of arrhythmias

Beat Type

Target

Number of Samples

Normal (N)

0

72494

Supraventricular ectopic (S)

1

2188

Ventricular ectopic (V)

2

5788

Merger (F)

3

613

Figure 1. The different beats plotted from database

Table 2. Description of the files containing the dataset

File Name

Features

Type

mitbih_train.csv

188

Float64

mitbih_test.csv

188

Float64

4. Data Preprocessing

Before presenting a preview of the data, it is essential to import the dataset. As we will be working in a virtual lab, we will use Google Drive to import the data.

4.1 Multi-class classification

This study aims to identify the specific type of cardiac arrhythmia using multi-class classification. To achieve this, we utilize the dataset in its original form, where each class represents a distinct arrhythmia:

Class 0: Normal Heartbeats

Class 1: Ectopic Supra-ventricular Beats

Class 2: Ectopic Ventricular Beats

Class 3: Fusion Beats

Class 4: Unknown Beats

The dataset consists of 109,446 rows, representing individual ECG samples. Each sample has 188 columns. The first 186 columns contain various features extracted from the ECG signal, while the final column (187) represents the target class label. During multi-class classification, this target variable can take values ranging from 0 to 4, corresponding to the specific arrhythmia class as defined earlier.

4.2 One hot encoding

With a purpose to enhance the effectiveness of our multi-class classification model, we will employ a technique called one-hot encoding (Figure 2). This method transforms each class within the target variable ("Label") into a unique binary vector. The length of each vector reflects the total count of distinct classes within the target variable. Each vector will have a single element set to 1, representing the class of the target variable for that specific observation. All other elements in the vector will be set to 0.

Figure 2. One-hot encoding

For instance, consider an observation belonging to class 0. The corresponding one-hot encoded vector would be [1, 0, 0, 0, 0]. Here, the value 1 at the first position signifies class 0, while the remaining positions are set to 0, indicating it doesn't belong to any other class.

One-hot encoding simplifies the classification task for the model by representing categorical data (class labels) numerically in a way that the model can easily understand and utilize during the learning process.

4.3 Data presentation

Before implementing the BLSTM model, we will explore the characteristics of the dataset by classifying and visualizing the data according to its category. This visualization (see Figure 3) will provide insights into the distribution of data points across the different arrhythmia classes. Examining this visual representation can help us understand any potential imbalances or patterns within the data that might influence the model's performance.

Figure 3. Types of beats with their percentage

4.4 Re-sampling technique

Our dataset may have an uneven distribution of data points across different arrhythmia classes. This imbalance can negatively affect the performance of our multi-class classification model. To tackle this issue, we will use a technique called re-sampling.

Re-sampling techniques are important in data analysis and ML. They help improve model performance, especially with imbalanced datasets. Common re-sampling methods include:

Bootstrapping: This method involves repeatedly sampling from the original dataset to create new samples. It allows for robust estimation of statistics like means and confidence intervals without relying on strict assumptions about the data.

Cross-validation: Cross-validation splits the dataset into multiple sections, training the model on some while testing on others. This is repeated several times to assess the model's generalization and minimize overfitting.

In cases of imbalanced datasets, we use oversampling and undersampling to balance the classes:

Oversampling: Oversampling methods, such as SMOTE, generate synthetic samples for the minority class to improve the model's learning from these examples.

Undersampling: This reduces the majority class's sample count. While it can help balance the dataset, it must be managed carefully to avoid losing important information.

These re-sampling strategies improve fairness and accuracy in tasks like fraud detection and medical diagnosis, making the models more robust. However, they have limitations. For example, cross-validation and bootstrapping can be computationally intensive, especially with large datasets. Oversampling might lead to overfitting if the synthetic data doesn’t accurately reflect the true distribution.

In this study, we will use the sklearn resample library in Python. This library offers strong re-sampling functions for arrays and sparse matrices. The default method in sklearn resample uses bootstrapping to create a more balanced dataset for training our BLSTM model (as shown in Figure 4).

By addressing class imbalance, we aim to enhance the model's learning across all arrhythmia categories, ultimately leading to more accurate classification results.

Figure 4. Types of beats with their percentages after re-sampling technique

5. Implementation

We present a meticulous approach to ECG signal classification for arrhythmia detection. We prioritize several key steps to ensure the model's effectiveness:

•We address potential class imbalances within the dataset using re-sampling techniques. This ensures the model is exposed to a representative distribution of all arrhythmia types, mitigating bias towards overrepresented classes.

Figure 5. Diagram of the used BLSTM model

•Categorical data (class labels) is preprocessed using one-hot encoding. This transforms these labels into numerical vectors, enabling the model to understand and utilize them efficiently during the learning process.

•After training on a balanced dataset, the BLSTM model is rigorously tested on unseen data to evaluate its generalization and ability to classify arrhythmias accurately in real-world settings.

Figure 5 visually summarizes the entire workflow, encompassing the construction and evaluation of a reliable and precise model for cardiac arrhythmia classification.

This figure presents the core components of a ML pipeline for arrhythmia classification. On the left, data preprocessing begins with the MIT-BIH-ARRHYTHMIA dataset, which undergoes balancing and One-Hot encoding to prepare it for modeling. The model is then built, fitted, and tested to generate results. On the right, the model architecture features a BLSTM layer as the input, followed by two Bidirectional layers (Bidirectional_1 and Bidirectional_2). Two Dense layers (Dense and Dense_1) precede the main output, which is another Dense layer, and finally, a Classification layer predicts 5 classes (0 to 4).

This design is clearly aimed at capturing the intricate temporal patterns in ECG data, with BLSTM and bidirectional layers focusing on both past and future dependencies in the signal. The preprocessing steps are especially critical given the common class imbalance in medical datasets, ensuring robust model performance. The five-class output structure indicates a targeted approach for identifying distinct types of cardiac arrhythmias, demonstrating the model's depth and sophistication in handling complex medical diagnoses.

One-hot encoding is a technique for representing categorical data using binary vectors. Each category is represented by a vector where all values are zero, except one which is one, corresponding to the specific category. This method is commonly used in ML to convert categorical variables into numerical data for algorithmic processing. One-hot encoding thus facilitates data manipulation and improves the performance of ML models in classification and prediction. One-hot encoding offers the following advantages:

•Preservation of categorical information: It makes it possible to represent in a distinct and unambiguous way the different categories of a variable, which facilitates the interpretation and analysis of the data.

•Elimination of ambiguity: By converting the categories into binary vectors, it removes any confusion or erroneous relationship between the categories, thus ensuring a clear and unambiguous representation.

•Improved model performance: By transforming categorical variables into numerical format, one-hot encoding allows ML models to process these variables more efficiently, supporting better pattern detection and precise decision making.

5.1 Model architecture

The proposed DL model architecture is a Multilayer Perceptron (MLP) featuring two hidden layers of the BLSTM type and two dense layers. The hidden BLSTM layers implement the ReLU activation function for improved non-linearity. In contrast, the output layer employs the "softmax" activation function, well-suited for multi-class classification problems.

Each BLSTM layer is configured with 256 neurons, while the subsequent dense layers contain 128 neurons each. The specific number of nodes in the output layer is determined by the classification task being performed.

The categorical cross-entropy loss function measures the difference between the predicted and actual class probabilities. The Adam optimizer is utilized to adjust the model's weights and biases during the training process.

To train the model, it is fitted on the training data for a total of 50 epochs. A batch size of 32 is used, where a batch represents a subset of training samples used for a single training iteration. The model's accuracy serves as the default metric for monitoring performance during training.

Figure 6 represents a summary of the model used with the total number of parameters as well as the trainable and non-trainable parameters.

Figure 6. Summary of the BLSTM model

6. Findings and Analysis

This section details the outcomes of our BLSTM DL model configuration and training. Various tests were conducted to identify the optimal hyperparameter settings. These hyperparameters included, but were not limited to, the number of nodes per layer, training epochs, optimizer function, and activation function for hidden layers.

Figure 7. The model’s accuracy as of function of an epoch during training process

An iterative training approach was employed. The model was trained on the training set while its performance was monitored on the validation set. This process was repeated with different hyperparameter configurations until a combination was identified that yielded the best results in terms of accuracy and loss. Finally, the model's performance was evaluated on the unseen test set for confirmation.

The chosen hyperparameter configuration resulted in a well-performing model, achieving an accuracy of 99.63% on the training set and 98.17% on the validation set, as illustrated in Figure 7. These findings demonstrate the model's effectiveness in learning the patterns within the training data.

The results in Figure 8 depict the loss values obtained during validation training. The training loss reaches approximately 2.5%, while the validation loss reaches around 10.2%. This indicates that the model effectively learns from the training data while maintaining generalization capability to unseen data in the validation set.

Figure 8. The model’s loss as of function of an epoch during training process

Figure 9. Confusion matrix

The success in achieving high accuracy without significant overfitting is attributed to the use of L2 regularization. This technique mitigates overfitting by limiting the model's complexity and reducing its tendency to memorize the training data. The relatively small gap (less than 0.1) between the training and validation errors at the end of the training process further supports this notion. This minimal difference suggests the model avoids overfitting the training examples and generalizes well to unseen data.

Figure 9 presents the confusion matrix for the Bi-LSTM network, covering five classes. This matrix helps evaluate the algorithms through metrics such as accuracy, precision, recall, and the false positive rate [28].

We can observe that the high numbers along the main diagonal of the confusion matrix indicate that our model succeeded in accurately classifying ECG signals for different classes.

In multi-class classification, obtaining true positive (TP), true negative (TN), false positive (FP), and false negative (FN) values differs from binary classification, as these metrics cannot be directly derived. To calculate these values, we define TP as the count where the actual and predicted values match. For false negatives, the FN for a class is determined by summing the corresponding row values, excluding the TP. Conversely, the false positive count is calculated by summing the corresponding column values, again excluding the TP. Finally, the true negative count for a class is obtained by summing all values in the relevant rows and columns, excluding those associated with the specific class being analyzed. This systematic approach allows for a comprehensive evaluation of model performance in multi-class scenarios.

In order to compute accuracy, sensitivity and specificity for each one of the five classes representing different cardiac conditions, we will first compute the following values: TP, FN, FP and TN and we will second use the three formulas:

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

Sensitivity $=\frac{T P}{T P+F N}$                  (2)

Specificity $=\frac{T N}{T N+F P}$                  (3)

The five classes under consideration are: N, S, V, F, and Q, as detailed in Table 1. To evaluate the performance of our classification model for the class "N," we calculate the values of TP, TN, FP, and FN using the confusion matrix illustrated in Figure 9. The values are as follows: TP (N) = 0.99, FN (N) = 0.01, FP (N) = 0.21, and TN (N) = 2.78. Applying these to the respective formulas, we derive the following metrics for the class "N": Accuracy = 94.48%, Sensitivity = 99%, and Specificity = 92.97%. A similar procedure is applied to compute the metrics for the other classes (S, V, F, and Q). For the class "S," the metrics are Accuracy = 97.19%, Sensitivity = 86.86%, and Specificity = 99.75%. For the class "V," we get Accuracy = 97.19%, Sensitivity = 96%, and Specificity = 98.74%. For the class "F," the results are Accuracy = 97.59%, Sensitivity = 90%, and Specificity = 99.49%. Finally, for the class "Q," the metrics are Accuracy = 99.79%, Sensitivity = 99%, and Specificity = 100%. Based on the confusion matrix in Figure 9 and the results above, the average values for accuracy, sensitivity, and specificity across all classes are 97.25%, 94.17%, and 98.25%, respectively. The classification errors observed in the confusion matrix are relatively small, reinforcing the reliability of our approach in classifying ECG signals using LSTM. These encouraging results suggest that our model has the potential for real-world applications in aiding healthcare professionals with the detection and diagnosis of cardiac abnormalities.

ECG signal classification has a significant impact on clinical settings by improving the accuracy, efficiency, and accessibility of cardiac care. Traditionally, interpreting ECG signals requires considerable expertise and time, which can lead to human error due to the complexity of the signals and the subtlety of some cardiac conditions. However, integrating advanced ECG classification systems, particularly those powered by AI and ML, helps mitigate these challenges.

One of the primary benefits of ECG signal classification is enhanced diagnostic accuracy. AI-based classification systems are trained on large datasets, enabling them to recognize a wide range of cardiac abnormalities, from common conditions like arrhythmias to infrequent abnormalities that might be missed by human eyes. This ability is essential for detecting early signs of conditions like atrial fibrillation or myocardial infarction, which require prompt intervention to prevent serious outcomes. By providing more accurate and consistent interpretations, AI-driven ECG classification reduces diagnostic errors, leading to better patient outcomes.

Efficiency in clinical workflows is another significant improvement brought by ECG signal classification. Automated systems can rapidly analyze ECG signals, delivering near-instant results. This speed is vital in emergency settings, where quick decision-making can save lives. For instance, in suspected heart attack cases, immediate and accurate ECG analysis can expedite treatments like thrombolysis or angioplasty, improving survival rates. Automating ECG analysis greatly improves healthcare productivity by enabling professionals to spend more time focused on patient care.

Advanced ECG signal classification technologies significantly improve remote monitoring and telemedicine. Wearable devices equipped with ECG sensors can continuously monitor patients, especially those with chronic heart conditions, transmitting data to healthcare providers in real time. AI algorithms analyze these signals and alert clinicians to any abnormalities, enabling timely interventions even when patients are not physically present in a healthcare facility. This capability is particularly beneficial for managing high-risk patients in rural or underserved areas, where access to specialized cardiac care may be limited.

Personalized medicine is also advanced through ECG signal classification. AI systems can tailor their analyses to individual patients by considering historical ECG data and other health records. This personalized approach leads to more accurate diagnoses and treatment plans that suit each patient’s unique health profile. For example, a patient with a history of a specific type of arrhythmia can be closely monitored for that condition, with the AI system learning from the patient’s previous data to enhance future predictions and interventions.

Furthermore, integrating ECG signal classification with EHRs offers a more holistic perspective of a patient's health, allowing for better-coordinated care. Automated ECG interpretation can be seamlessly added to EHRs, where it combines with other diagnostic information to guide treatment decisions. This holistic approach supports more informed clinical decision-making and enhances the overall quality of care provided to patients.

In summary, ECG signal classification technologies significantly enhance clinical settings by improving diagnostic accuracy, speeding up workflows, enabling remote monitoring, supporting personalized medicine, and facilitating integrated care through EHRs. These advancements lead to better patient outcomes, more efficient healthcare delivery, and expanded access to cardiac care, ultimately transforming how heart conditions are managed in modern medicine.

7. Comparative Study

We assessed the efficacy of our BLSTM classifier by comparing its performance against a current ECG classification model built in Matlab [32]. Our proposed BLSTM model achieved promising results. Notably, it attained an accuracy of 98.17%, signifying its ability to precisely classify ECG signals. Additionally, the model exhibited high sensitivity (94%), demonstrating its effectiveness in identifying true positive cases (correctly classifying arrhythmias). Furthermore, the impressive specificity of 95.19% indicates the model's proficiency in accurately recognizing true negative cases (correctly classifying normal ECGs). These results highlight the BLSTM model's strong capability for ECG signal classification.

The proposed BLSTM classifier achieved superior performance compared to the reference approach described in [29], which utilizes Matlab for implementation. The reference model attained an accuracy of 93.9%, slightly lower than the BLSTM model's 98.17% accuracy. This suggests the BLSTM model exhibits better overall classification capability.

Figure 10 visually compares the performance of both models using a histogram, further illustrating the advantages of the BLSTM approach.

Similarly, the reference model's sensitivity of 90.16% indicates it might miss a slightly higher proportion of true positive cases (correctly classified arrhythmias) compared to the BLSTM model's 94% sensitivity. However, it's noteworthy that the reference model maintains a high specificity of 96.16%, implying good proficiency in identifying true negative cases (correctly classified normal ECGs).

Figure 10. Performance comparison

8. Conclusion

In summation, this paper leverages BLSTM networks, a type of RNN, for ECG signal classification. Unlike traditional models, BLSTMs can analyze both past and future information within a sequence. In the context of ECG signals, this allows the model to consider the temporal context of the data surrounding a specific point, leading to more accurate anomaly detection (e.g., arrhythmias).

We employed this BLSTM approach to classify ECG signals in the MIT-BIH dataset. This dataset contains five categories: one for normal ECGs and four for different types of abnormal ECGs. The positive results obtained demonstrate the effectiveness of neural networks, particularly BLSTMs, in processing and classifying ECG signals.

The use of Bi-LSTM networks in the classification of ECG signals offers significant advancements in cardiac diagnostics by effectively capturing both past and future contexts of the signals. This capability enhances the accuracy of detecting complex anomalies, improves sensitivity to temporal dependencies, and increases robustness against noise and artifacts. The ability of Bi-LSTM networks to handle variable data lengths makes them an effective tool for real-time monitoring and integrating multimodal data. This flexibility supports rapid, personalized interventions tailored to individual patient needs. By facilitating personalized medicine, Bi-LSTMs enhance diagnosis and care, ultimately transforming the management of heart disease. Future work can focus on leveraging deep reinforcement learning to develop advanced monitoring systems and enhance patient care.

  References

[1] Carrara, M., Carozzi, L., Moss, T.J., de Pasquale, M., et al. (2015). Classification of cardiac rhythm using heart rate dynamical measures: Validation in MIT–BIH databases. Journal of Electrocardiology, 48(6): 943-946. https://doi.org/10.1016/j.jelectrocard.2015.08.002

[2] Falhi, H.M., Khleaf, H.K. (2023). Design an intelligent real time ECG monitoring system using convolution neural network. Revue d'Intelligence Artificielle, 37(2): 323-329. https://doi.org/10.18280/ria.370210

[3] Kulkarni, S.P. (2015). DWT and ANN based heart arrhythmia disease diagnosis from MIT-BIH ECG signal data. International Journal on Recent and Innovation Trends in Computing and Communication, 3(1): 276-279.

[4] Tsoutsouras, V., Azariadi, D., Xydis, S., Soudris, D. (2016). Effective learning and filtering of faulty heart-beats for advanced ECG arrhythmia detection using MIT-BIH database. EAI Endorsed Transactions on Pervasive Health and Technology, 2(8): e5. https://doi.org/10.4108/eai.14-10-2015.2261640

[5] Apandi, Z.F.M., Ikeura, R., Hayakawa, S. (2018). Arrhythmia detection using MIT-BIH dataset: A review. In 2018 International Conference on Computational Approach in Smart Systems Design and Applications (ICASSDA), Kuching, Malaysia, pp. 1-5. https://doi.org/10.1109/ICASSDA.2018.8477620

[6] Singh, V., Tewary, S., Sardana, V., Sardana, H.K. (2019). Arrhythmia detection—A machine learning based comparative analysis with MIT-BIH ECG data. In 2019 IEEE 5th International Conference for Convergence in Technology (I2CT), Bombay, India, pp. 1-5. https://doi.org/10.1109/I2CT45611.2019.9033665 

[7] Shaker, A.M., Tantawi, M., Shedeed, H.A., Tolba, M.F. (2020). Generalization of convolutional neural networks for ECG classification using generative adversarial networks. IEEE Access, 8: 35592-35605. https://doi.org/10.1109/ACCESS.2020.2974712

[8] Obeidat, Y., Alqudah, A.M. (2021). A hybrid lightweight ID CNN-LSTM architecture for automated RCG beat-wise classification. Traitement du signal, 38(5): 1281-1291. https://doi.org/10.18280/ts.380503  

[9] Torres-Alegre, S., Fombellida, J., Piñuela-Izquierdo, J.A., Andina, D. (2020). AMSOM: Artificial metaplasticity in SOM neural networks—Application to MIT-BIH arrhythmias database. Neural Computing and Applications, 32(17): 13213-13220. https://doi.org/10.1007/s00521-018-3576-0

[10] Kuila, S., Dhanda, N., Joardar, S. (2020). Feature Extraction and Classification of MIT-BIH Arrhythmia Database. In: Kundu, S., Acharya, U.S., De, C.K., Mukherjee, S. (eds) Proceedings of the 2nd International Conference on Communication, Devices and Computing. ICCDC 2019, Lecture Notes in Electrical Engineering, Springer, Singapore. https://doi.org/10.1007/978-981-15-0829-5_41 

[11] Shoughi, A., Dowlatshahi, M.B. (2021). A practical system based on CNN-BLSTM network for accurate classification of ECG heartbeats of MIT-BIH imbalanced dataset. In 2021 26th International Computer Conference, Computer Society of Iran (CSICC), Tehran, Iran, pp. 1-6. https://doi.org/10.1109/CSICC52343.2021.9420620

[12] Khalaf, A.J., Mohammed, S.J. (2021). Verification and comparison of MIT-BIH arrhythmia database based on number of beats. International Journal of Electrical and Computer Engineering, 11(6): 4950. https://doi.org/10.11591/ijece.v11i6.pp4950-4961

[13] Fadhel, A.A., Hasan, H.M. (2023). Enhancing ECG signal classification accuracy through Gaussian Modeling method. Traitement du Signal, 40(4): 1425-1434. https://doi.org/10.18280/ts.400411

[14] Jambukia, S.H., Dabhi, V.K., Prajapati, H.B. (2015). Classification of ECG signals using machine learning techniques: A survey. In 2015 International Conference on Advances in Computer Engineering and Applications, Ghaziabad, India, pp. 714-721. https://doi.org/10.1109/ICACEA.2015.7164783

[15] Bulbul, H.I., Usta, N., Yildiz, M. (2017). Classification of ECG arrhythmia with machine learning techniques. In 2017 16th IEEE International Conference on Machine Learning and Applications (ICMLA), Cancun, Mexico, pp. 546-549. https://doi.org/10.1109/ICMLA.2017.0-104

[16] Shimpi, P., Shah, S., Shroff, M., Godbole, A. (2017). A machine learning approach for the classification of cardiac arrhythmia. In 2017 International Conference on Computing Methodologies and Communication (ICCMC), Erode, India, pp. 603-607. https://doi.org/10.1109/ICCMC.2017.8282537

[17] Alfaras, M., Soriano, M.C., Ortín, S. (2019). A fast machine learning model for ECG-based heartbeat classification and arrhythmia detection. Frontiers in Physics, 7: 103. https://doi.org/10.3389/fphy.2019.00103

[18] Devi, R.L., Kalaivani, V. (2020). Machine learning and IoT-based cardiac arrhythmia diagnosis using statistical and dynamic features of ECG. The Journal of Supercomputing, 76(9): 6533-6544. https://doi.org/10.1007/s11227-019-02873-y

[19] Sahoo, S., Dash, M., Behera, S., Sabut, S. (2020). Machine learning approach to detect cardiac arrhythmias in ECG signals: A survey. IRBM, 41(4): 185-194. https://doi.org/10.1016/j.irbm.2019.12.001

[20] Sraitih, M., Jabrane, Y., Hajjam El Hassani, A. (2021). An automated system for ECG arrhythmia detection using machine learning techniques. Journal of Clinical Medicine, 10(22): 5450. https://doi.org/10.3390/jcm10225450 

[21] Ebrahimi, Z., Loni, M., Daneshtalab, M., Gharehbaghi, A. (2020). A review on deep learning methods for ECG arrhythmia classification. Expert Systems with Applications: X, 7: 100033. https://doi.org/10.1016/j.eswax.2020.100033

[22] Murat, F., Yildirim, O., Talo, M., Baloglu, U.B., Demir, Y., Acharya, U.R. (2020). Application of deep learning techniques for heartbeats detection using ECG signals-analysis and review. Computers in Biology and Medicine, 120: 103726. https://doi.org/10.1016/j.compbiomed.2020.103726 

[23] Izci, E., Ozdemir, M.A., Degirmenci, M., Akan, A. (2019). Cardiac arrhythmia detection from 2d ECG images by using deep learning technique. In 2019 Medical Technologies Congress (TIPTEKNO), Izmir, Turkey, pp. 1-4. https://doi.org/10.1109/TIPTEKNO.2019.8895011 

[24] Isin, A., Ozdalili, S. (2017). Cardiac arrhythmia detection using deep learning. Procedia Computer Science, 120: 268-275. https://doi.org/10.1016/j.procs.2017.11.238

[25] Huang, J.S., Chen, B.Q., Zeng, N.Y., Cao, X.C., Li, Y. (2023). Accurate classification of ECG arrhythmia using MOWPT enhanced fast compression deep learning networks. Journal of Ambient Intelligence and Humanized Computing, 14: 5703-5720. https://doi.org/10.1007/s12652-020-02110-y

[26] Cui, J., Wang, L., He, X., De Albuquerque, V.H.C., AlQahtani, S.A., Hassan, M.M. (2023). Deep learning-based multidimensional feature fusion for classification of ECG arrhythmia. Neural Computing and Applications, 35: 16073-16087. https://doi.org/10.1007/s00521-021-06487-5

[27] Liu, X., Wang, H., Li, Z., Qin, L. (2021). Deep learning in ECG diagnosis: A review. Knowledge-Based Systems, 227: 107187. https://doi.org/10.1016/j.knosys.2021.107187

[28] Sannino, G., De Pietro, G. (2018). A deep learning approach for ECG-based heartbeat classification for arrhythmia detection. Future Generation Computer Systems, 86: 446-455. https://doi.org/10.1016/j.future.2018.03.057

[29] Aldossary, L.A., Ali, M., Alasaadi, A. (2021). Securing SCADA systems against cyber-attacks using artificial intelligence. In 2021 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT), Zallaq, Bahrain, pp. 739-745. https://doi.org/10.1109/3ICT53449.2021.9581394

[30] Salem, M., Taheri, S., Yuan, J.S. (2018). ECG arrhythmia classification using transfer learning from 2-dimensional deep CNN features. In 2018 IEEE Biomedical Circuits and Systems Conference (BioCAS), Cleveland, OH, USA, pp. 1-4. https://doi.org/10.1109/BIOCAS.2018.8584808

[31] MIT-BIH Arrhythmia Database Directory. https://www.physionet.org/physiobank/database/html/mitdbdir/mitdbdir.htm.

[32] Rexy, J., Velmani, P., Rajakumar, T. (2021). Heart beat classification in MIT-BIH arrhythmia ECG dataset using double layer BI-LSTM model. International Journal of Mechanical Engineering, 6: 337-344.