Developing Low Complexity Algorithms to Detect QRS Complex and Arrhythmia from ECG signals

Team

Supervisors

Table of content

  1. Project Goal
  2. Abstract
  3. Related works
  4. Methodology
  5. Experiment Setup and Implementation
  6. Results and Analysis
  7. Conclusion
  8. Publications
  9. Links

Project Goal

The detection of the electrocardiogram (ECG) QRS complex and associated abnormalities, such as arrhythmias, has been a well-researched area in the field of biomedical engineering. However, implementing efficient algorithms in low power, low cost solutions remains a challenge. This research aims to develop innovative approaches that enable accurate QRS and arrhythmia detection using low complexity and low memory algorithms, which can be deployed on microcontrollers with severely limited capabilities (< 2kB SRAM, 1-8 MHz clock frequency).

To achieve this goal, the research will initially focus on transforming the ECG data into a sparse, event-driven representation that preserves all essential information while streamlining the computational load. This approach will enable efficient processing of critical events and minimize the need for continuously processing every sample, thereby reducing power consumption and memory requirements.

In addition to data transformation, this research will investigate the application of advanced optimization techniques, such as deep learning and swarm particle optimization (SPO), to determine the most suitable parameters for the detection algorithms. These techniques will be employed to refine and adapt the algorithms for optimal performance under the specific hardware constraints.

Moreover, the research will explore methods to classify ECG waveform events based on signal quality and features present within the signal. By employing a layered architecture, the system will select the best parameters based on the output of a pre-trained classifier, further optimizing the performance of the low-cost algorithm.

Another aspect of the research will delve into the development of adaptive, context-aware algorithms that can dynamically adjust their complexity according to the available resources and signal quality. This approach will ensure that the detection accuracy is maintained while minimizing resource consumption, thus enabling the implementation of these algorithms in a wider range of low-cost devices.

The anticipated outcome of this research is a set of versatile, low complexity algorithms for QRS complex and arrhythmia detection, which can be effectively implemented on low power, low cost microcontroller platforms. These solutions have the potential to significantly impact the field of remote health monitoring, enabling the development of affordable, wearable devices capable of providing real-time, accurate cardiac health assessments to a wider population.

ECG Signal Denoising and Compression

ECG signals are often affected by various types of noise, which can affect the accuracy of the diagnosis. The most significant noises are power line interference, muscular contractions, and baseline wander, which occur in different frequency ranges. ECG denoising techniques have evolved significantly over the years. Initially, classical filters like moving averages and FIR filters were used [1,2], but they have limitations in preserving waveform details. The advent of adaptive filters [3] allowed for dynamic noise estimation and removal. Wavelet transform-based methods provided [4,5] better time-frequency analysis, enabling noise suppression while preserving ECG features. These techniques have been developed and adapted to cater to low-power and real-time devices.

Additionally, due to the large amount of data generated by continuous ECG monitoring, efficient compression techniques have evolved to efficiently store and transmit ECG data while minimizing the impact on diagnostic information. Transform-based methods like discrete cosine transform (DCT) and wavelet transform [6,7,8] were widely used. Wavelet-based compression balances compression ratio and signal quality, maintaining diagnostic features while reducing data size. Recent developments include using machine learning approaches, such as deep neural networks, for ECG compression, allowing for more advanced and adaptive compression algorithms [9, 10]. The evolution of ECG compression techniques continues to focus on achieving high compression ratios with minimal loss of important clinical information.

QRS Complex Detection

The QRS complex is a prominent waveform in the ECG signal and plays a crucial role in automated heart rate determination and detecting cardiac abnormalities. In earlier days, template-based methods have been widely explored and involve the cross-correlation of ECG signals with predefined templates. [11, 12]. The template length and filter are determined experimentally. Although efficient implementations are available [13], the overall computational cost of QRS complex detection remains high due to the sample-by-sample moving comparison with the template across the ECG signals. Another widely explored area is derivative QRS detection methods [14]. Derivative-based methods are computationally efficient and can be implemented in real-time systems. However, these methods are sensitive to noise, and In the presence of abnormal or distorted ECG signals, derivative-based approaches may encounter challenges.

Filtering techniques have also been extensively investigated. Digital filters [15,16,17,18,19] The Pan-Tompkins algorithm [20] is a widely used and effective method for QRS complex detection. It employs low-pass, high-pass, and derivative filters to detect the QRS complex. While this algorithm demonstrates good performance, it may struggle with baseline wander and noise interference and may not perform optimally when faced with diverse morphologies. The Pan-Tompkins algorithm requires a relatively high computational load due to its iterative nature and multiple filtering stages. This can pose challenges for real-time processing applications with limited computational resources. Another widely used approach is wavelet-based QRS detection [21,22,23,24]. These methods are robust to noise. However, the wavelet transform involves complex calculations, and wavelet-based QRS detection methods can be computationally demanding.

Neural networks are a widely used method in QRS detection. CNNs are commonly utilized for QRS detection tasks. They apply convolutional layers to learn local patterns and features from the ECG signal [25, 26]. The novel methods [27] provide noise-resistant and generalizable methods to detect QRS complexes accurately. These methods can be highly accurate. However, Neural networks, especially deep architectures, can be computationally demanding. Real-time QRS detection on low-power devices may face challenges due to the computational requirements of these methods. Optimizations, such as model compression or hardware acceleration, may be necessary. And these additional optimizations introduce additional overhead for actual ECG classification.

Previous methods primarily focused on evaluating robustness to noise and numerical efficiency. However, they did not consider the performance based on time complexity or power consumption. Utilizing the first derivative of the filtered ECG signal, with or without a moving-average filter, is recommended as it offers high numerical efficiency during the QRS enhancement phase. However, this approach is sensitive to noise and arrhythmia, necessitating an adaptive thresholding or integration-based approach during the detection phase. Both of these methodologies are simple and computationally efficient, making them suitable for detecting QRS complexes in mobile-phone applications. Implementing the classical Pan-Tompkins algorithm is also a viable option in cases with more processing power available. Table I shows a summarized comparison of the different pre-processing steps taken for ECG classification.

Screenshot 2023-06-28 014439

ECG Signal Classification Methods

Over the years, different techniques ranging from simple machine learning classifiers such as linear discriminants (LD) [28-30], decision trees [30-32], Naïve Bayes Classifiers [33], and k-Nearest Neighbors (k-NNs) [34] to more advanced models such as Support Vector Machines (SVM) [35], feed-forward multi-layer perceptron (MLP) neural networks [36], hybrid neural networks [37], and a mixture of fuzzy logic, SVM, and neural networks [38,39] have been developed to classify ECG signals. These traditional implementations mainly have four steps; preprocessing the input ECG signals, extracting the features (attributes) from the preprocessed signals, selecting the subset of essential features from the extracted features, and feeding these features to the classifiers.

Out of the several publicly available databases containing annotated ECG signals [40-42], many previous works have utilized the MIT-BIH arrhythmia database consisting of 48 half-hours, two-channel ambulatory ECG recordings of 47 subjects (male: female 25:22; age range 23–89 years). Most literature has followed the standard from the Association for the Advancement of Medical Instrumentation (AAMI) and partitioned the MIT-BIH database into five groups: normal (N), supraventricular ectopic (SVE), ventricular ectopic (VE), fusion (F), and unknown (Q). Even though it is necessary to increase the number of classes for a more qualitative analysis of the ECG signals, most work report results for either two [43], four [44,45], or five [46] class classifications to compensate for higher performance. This is in part because the feature extraction stage of traditional methods discards critical information.

Deep neural networks have been introduced in recent years to overcome the issues in traditional approaches. For example, in [47], a group of researchers implemented a shallow 11-layer convolutional neural network (CNN) to classify four classes of ECG, eliminating the need for different feature extraction techniques. Furthermore, in [48], a 34-layer CNN has been developed to classify an arbitrary length ECG time series into 14 arrhythmia classes from single-lead ECG signals better than a cardiologist. Much other work that utilizes a combination of deep neural networks, such as CNN, RNN, and LSTMs, has been introduced over the years. For instance, in [49], the authors present a CNN and a bidirectional long-term, short-term memory network (BiLSTM) model to automatically classify ECG heartbeats into five groups in the AAMI standard. Even though these works demonstrate high accuracy, these deep networks dramatically increase computation costs, power consumption, deployment complexity, and inference time.

As a low-power, low-computation cost alternative, the third generation of neural networks, Spiking Neural Networks (SNN), have been explored in the most recent works. As SNNs use the Leaky Integrate and Fire (LIF) neuron models, which transmit information via non-differentiable discrete spikes, standard backpropagation methods are impractical for training SNNs. As a workaround, in [50], a two-stage CNN workflow is proposed for training, with early stopping to reduce the time, while the trained CNN models are converted to SNNs to minimize power consumption at inference time. On the other hand, [51] introduces a binarised SNN that converts high precision weights of the network to binary values, reducing the computational complexity further, while using the spike-time dependent plasticity (STDP) learning algorithm to directly train an SNN without backpropagation. Most previous SNN-based work employs non-event-based algorithms [52,53] or simple rate encoding [50] for ECG signal pattern extraction and encoding. Therefore, [54] proposes an SNN-based pattern extraction method using an STDP layer with the help of a Gaussian layer and an inhibitory layer. Table II shows a summarized comparison of the classification methods categorized into three main types.

Screenshot 2023-06-28 014457

Even though SNN-based methods show a significant improvement in energy consumption, these implementations are still incapable of classifying ECG signals in a microcontroller with severely limited capabilities ($<$2kB SRAM, 1-8 MHz clock frequency). On the other hand, converting and compressing the ECG signal to a sparse, event-based representation, without loss of information and without affecting the classification accuracy for transmission remains an unaddressed challenge.

Methodology

Develop low complexity algorithms for the five main tasks in an arrhythmia classification system for a resource-constrained environment are

  1. Detecting the QRS peaks in the incoming signal
  2. Segment the signal based on the R peaks detected
  3. Identify suspected beats
  4. Compress and transmit the suspected beats to a server
  5. Perform a more accurate classification off the edge device

Experiment Setup and Implementation

QRS Complex Detection and Segmentation

image

image

image

ECG Segment Compression

image

ECG Classification

image

image image

Results and Analysis

image

image

image image

image image

image

Conclusion

image

Publications