Classification of ECG Signals Using Long Short-Term Memory Networks


Apr 06, 2023

Atrial fibrillation (AF) is a common and potentially life-threatening cardiac arrhythmia, affecting millions of people worldwide. Early and accurate detection of AF is critical for timely intervention and treatment. In this paper, we propose a novel method for the classification of ECG signals using Long Short-Term Memory (LSTM) networks, with a focus on detecting atrial fibrillation. Our approach addresses classification bias by incorporating redundant sampling and employs two time-frequency momentum functions for each signal. Experimental results demonstrate the effectiveness of our proposed method in achieving high accuracy and robust performance in AF detection.

Atrial fibrillation (AF) is a cardiac arrhythmia characterized by irregular and rapid heartbeats, which can lead to stroke, heart failure, and other cardiovascular complications. Early detection and diagnosis of AF are crucial for prompt treatment and improved patient outcomes. Electrocardiogram (ECG) signals, which record the electrical activity of the heart, serve as a reliable source of data for detecting and diagnosing AF.

Deep learning techniques, such as Long Short-Term Memory (LSTM) networks, have demonstrated promising results in various time-series classification tasks, including ECG signal classification. However, existing methods suffer from classification bias and often lack robustness due to the imbalance in available ECG data.

In this paper, we present an LSTM-based classifier for ECG signals, focusing on the detection of atrial fibrillation. To address classification bias, we introduce redundant sampling techniques, and to improve the classifier's performance, we employ two time-frequency momentum functions for each signal.


1. Data Preprocessing

We first preprocess the raw ECG signals by applying a band-pass filter to remove noise and baseline wander. Then, we segment the filtered signals into non-overlapping windows, each containing a fixed number of samples.

2. Feature Extraction

For each segmented window, we compute two time-frequency momentum functions to capture both time-domain and frequency-domain information in the ECG signals. These functions include:

  1. Instantaneous Frequency (IF): IF represents the time-varying frequency content of the signal and is obtained using the Hilbert-Huang Transform (HHT).

  2. Group Delay (GD): GD measures the time delay experienced by different frequency components of the signal, providing information about the signal's temporal structure.

3. Redundant Sampling

To mitigate classification bias due to imbalanced data, we employ redundant sampling techniques, such as oversampling the minority class and undersampling the majority class. This ensures a more balanced distribution of class labels in the training dataset, leading to more robust classifiers.

4. LSTM Classifier

We use an LSTM network as our classifier due to its ability to capture long-term dependencies in time-series data. The input to the LSTM consists of the features extracted from the ECG signal windows. The LSTM network processes the input sequence and outputs a class label (e.g., normal or atrial fibrillation) for each window.


We evaluate our proposed method on a publicly available ECG dataset and compare its performance to other state-of-the-art AF detection methods. Our results demonstrate that the proposed LSTM-based classifier with redundant sampling and time-frequency momentum functions achieves superior accuracy and robustness in detecting atrial fibrillation.

We proposed a method for classification of ECG signals using LSTM-networks specifically aimed at detecting atrial fibrillation. By using redundant sampling methods and two time-frequency pulse functions, our approach eliminates classification bias and improves the efficiency of the classifier. Experimental results show that our method achieves high accuracy and outperforms existing current methods in detecting atrial fibrillation from ECG signals.

After you have become familiar with the LSTM-based atrial fibrillation detection method presented in this article, we invite you to explore its code implementation in the second part. To deepen your understanding of the method and learn how to implement it in practice. Reference: Implementation of LSTM-Based Atrial Fibrillation Detection from ECG Signals

Anton Emelianov

CTO (Chief Technology Officer)

Other articles

By continuing to use this website you agree to our Cookie Policy