Source-linked AI summary

LSTM-Based ECG Classification for Continuous Monitoring on Personal Wearable Devices

Saeed Saadatnejad, Mohammadhosein Oveisi, Matin Hashemi

arXiv:1812.04818v3eess.SPcs.HCcs.NE

TL;DR

Intermittent arrhythmias motivate continuous ECG monitoring, but wearable devices require accurate classification with low computational intensity. The paper combines wavelet features with multiple LSTM recurrent neural networks and reports superior classification performance while meeting real-time timing requirements on low-power hardware.

  • Problem

    Intermittent arrhythmias are difficult to detect in short ECG windows, while wearable devices require accurate, lightweight classification on small low-power processors.

  • Method

    The algorithm combines wavelet and RR-interval features with multiple LSTM recurrent neural networks trained using local patient data and global representative heartbeats.

  • Results

    In VEB detection, F1 score is 19.8%, 1.6%, and 3.3% higher than previous works in datasets A, B, and C, respectively.

  • Takeaways & Limitations

    The proposed algorithm achieves superior classification performance with low computational costs and meets timing requirements for continuous execution on wearable devices.

Abstract

from arXiv · show

Objective: A novel ECG classification algorithm is proposed for continuous cardiac monitoring on wearable devices with limited processing capacity. Methods: The proposed solution employs a novel architecture consisting of wavelet transform and multiple LSTM recurrent neural networks. Results: Experimental evaluations show superior ECG classification performance compared to previous works. Measurements on different hardware platforms show the proposed algorithm meets timing requirements for continuous and real-time execution on wearable devices. Conclusion: In contrast to many compute-intensive deep-learning based approaches, the proposed algorithm is lightweight, and therefore, brings continuous monitoring with accurate LSTM-based ECG classification to wearable devices. Significance: The proposed algorithm is both accurate and lightweight. The source code is available online [1].

I. INTRODUCTION

Continuous wearable ECG monitoring requires classification that is both accurate and lightweight. The proposed approach combines wavelet features with multiple smaller LSTM models to improve accuracy while meeting wearable-device constraints.

  • Motivation: 17.7 million people died from cardiovascular diseases in 2015, motivating improved detection of cardiac arrhythmias.Cardiovascular diseases represented 31% of reported global deaths that year.
  • Motivation: Intermittent arrhythmias are difficult to detect from short ECG windows, making continuous heartbeat monitoring important.ECG signals represent cardiac electrical activity and are widely used for arrhythmia detection and classification.
  • Motivation: Wearable devices support local ECG classification, enabling continuous operation despite network availability and keeping data on-device.Local execution also avoids privacy issues associated with cloud-assisted processing.
  • Problem: The central design requirement is simultaneous accuracy and low computational intensity on small, low-power wearable processors.The paper contrasts this setting with desktop and server processors, which are much faster.
  • Proposed approach: The proposed algorithm uses LSTM recurrent neural networks because ECG waveforms contain temporal dependencies arising from the heart’s electrical conduction sequence.It also combines wavelet features with LSTM models and merges predictions from multiple smaller models.
  • Proposed approach: Multiple smaller LSTM models have lower total computational cost than one larger LSTM model.The approach is intended to increase classification accuracy without significantly increasing computational costs.
  • Results: The proposed method reports superior classification performance and meets timing requirements for continuous real-time execution on small, low-power hardware.The evaluation uses ECG signals conforming to AAMI standards and compares against previous methods.

II. RELATED WORKS

Prior ECG classification work spans handcrafted signal-processing methods and deep-learning models, with differing accuracy, computational demands, data requirements, and class coverage. The proposed method is designed for real-time wearable execution and comparison under AAMI standards.

  • Classical methods: Earlier methods used morphological features and classical techniques including frequency analysis, Hermite decomposition, wavelets, support vector machines, and hidden Markov models.Examples include patient-adaptable mixture-of-experts and personalized linear-discriminant approaches.
  • Deep learning: Deep-learning approaches include one-dimensional and deeper convolutional neural networks, recurrent neural networks, and regression networks for ECG analysis.Their targets and operating settings vary across heartbeat, rhythm, and long-term ECG classification.
  • Deployment constraints: Some prior methods are unsuitable for wearable execution because of high computational intensity or because they require entire recorded ECG signals for offline processing.One cited deep CNN is reported as about 10,000X slower than the proposed method.
  • Comparability: Several published methods are not directly comparable because they omit standard AAMI arrhythmia classes or address different ECG-analysis problems.The proposed solution fully complies with AAMI standards.
  • Proposed pipeline: The proposed pipeline segments ECG into heartbeats, extracts RR-interval and wavelet features, processes them with two RNN-based models, and blends their predictions.Heartbeat segments contain fixed windows around detected R peaks.
  • Real-time processing: Continuous operation requires buffering because some RR features use near-future heartbeat information unavailable when processing only the current heartbeat.The algorithm classifies the heartbeat in the middle of a small FIFO buffer to access near-past and near-future information.

B. Wavelet Features

The method uses discrete wavelet features alongside ECG and RR-interval inputs, then processes these representations through two complementary RNN-based models. Multiple smaller RNNs and feature preprocessing target efficient wearable execution.

  • Wavelet Features: Discrete wavelet transform captures both time- and frequency-domain information from each non-stationary heartbeat ECG signal.The implementation selects the Daubechies family and uses db2 as a middle-ground time–frequency choice.
  • Wavelet Features: Downsampling Xecg by a factor of 2 reduces wavelet-output length and the computational requirement of subsequent processing.The stated rationale is that computational cost is proportional to input size.
  • RNN-based Models: Each heartbeat supplies Xecg, RR-interval features Xrr, and wavelet features Xw to two separate RNN-based models.Model α and model β produce separate arrhythmia predictions that are blended into the final heartbeat prediction.
  • Feature integration: Using Xrr and Xw alongside Xecg provides processed information that helps the RNNs capture ECG patterns more efficiently.The paper links these additional features to accurate results with smaller and faster RNNs.
  • Model architecture: Multiple smaller RNNs in parallel replace one larger RNN, increasing accuracy without significantly increasing computational costs.This architecture is presented as a computationally efficient design choice.
  • Model α: Model α processes separate concatenations of Xrr with Xecg and Xrr with Xw in two branches before producing arrhythmia-class probabilities.Its predicted class is determined by the maximum output probability.
  • Model β: Model β combines downsampled Xecg, Xrr, and Xw before applying PCA and processing the resulting input in one branch.This contrasts with model α’s separate ECG and wavelet branches.

D. RNN Cell Types

The simple RNN cell carries state vectors across time to encode previous information, but its accumulated history can create long-dependency gradient problems.

  • D. RNN Cell Types: The simple RNN cell carries input xt and state vectors ht and ct across time, with ht serving as the cell output.The state vectors act as memory by encoding previous information.
  • D. RNN Cell Types: Its internal state accumulates information over time, so the output can depend on all previous inputs.The cell forms an intermediate vector from the current input and previous output before updating its state.

Simple RNN Cell:

The simple RNN cell accumulates information from previous inputs in its internal state, but long temporal dependencies can cause gradient instability. LSTM addresses this by controlling information flow with forget, input, and output gates.

  • Simple RNN Cell:: The simple RNN cell forms an intermediate vector from the current input and previous output, then accumulates it in the state over time.Its output is therefore related to all previous inputs.
  • Simple RNN Cell:: Gradient-based training may fail when temporal dependencies become too long because gradients can increase or decrease exponentially.
  • Long Short-Term Memory (LSTM):: LSTM allows the model to forget according to dependencies automatically extracted from data.Forget, input, and output gates implement this control.
  • Long Short-Term Memory (LSTM):: The gate signals are formed from the current input x_t and previous output h_t−1.
  • Long Short-Term Memory (LSTM):: The forget gate controls state transfer, the input gate adjusts state accumulation, and the output gate adjusts the emitted output.The output applies tanh to the state before output-gate adjustment.
  • Long Short-Term Memory (LSTM):: LSTM neither completely discards nor completely carries previous information; gate signals control its influence on the current state.

LSTM with Peepholes:

The paper compares recurrent-cell designs and motivates using multiple smaller RNNs, whose quadratic hidden-unit cost can be lower than one larger RNN. The proposed blend combines predictions from two models while limiting computational requirements.

  • LSTM with Peepholes:: A peephole LSTM adds connections from the internal state vector to the forget, input, and output gates.The gate signals then use x_t, h_t−1, and c_t−1.
  • Computational Cost:: The LSTM cell requires four Nh × Nx and four Nh × Nh matrix-vector multiplications, plus vector operations of size Nh.
  • Computational Cost:: RNN-cell complexity grows quadratically with hidden units, so multiple smaller RNNs can cost less than one larger RNN.Two RNNs with Nh = X have lower total runtime than one RNN with Nh = 2X.
  • Blend Model:: The proposed algorithm blends predictions from two RNN-based models, α and β, for each heartbeat.Each model independently produces probabilities for all output arrhythmia classes before blending.
  • Blend Model:: The blend model is an MLP with two hidden layers, using 2 × Ny input neurons and Ny output neurons.

IV. TRAINING PROCEDURE

Training is patient-specific and combines limited local ECG data with representative global data, after which classification runs continuously in real time. The RNN models are trained with BPTT and Adam, and hyper-parameters are selected independently.

  • A. Patient-Specific Training: Each patient receives individual model training once, followed by continuous real-time ECG monitoring and heartbeat classification.
  • A. Patient-Specific Training: Patient training combines local ECG data with global representative heartbeats from all arrhythmia classes.Local data can be at most five minutes long; global data covers patterns absent from local data.
  • A. Patient-Specific Training: A single model trained on many patients is not used because ECG waveforms vary significantly among patients.
  • B. Train the RNN Models: RNN training uses sequential heartbeat batches, back-propagation through time, and Adam optimization.Weights are updated after each batch by back-propagating through the network unfolded over time.
  • C. Train the Blend Model: The two RNN models are trained independently, then their training-set predictions train the MLP blend model using back propagation.
  • D. Hyper-Parameter Selection: Hyper-parameter search varies recurrent layers, hidden units, and cell types, with selection performed independently for each model.
  • D. Hyper-Parameter Selection: LSTM models with 50 hidden units and one recurrent layer achieve consistently strong results.

V. EXPERIMENTAL RESULTS

The proposed algorithm is evaluated on ECG data using AAMI-aligned comparisons and seven heartbeat classes, with strong performance against previous works in VEB and SVEB detection.

  • A. Setup and ECG Data: The MIT-BIH ECG arrhythmia database provides the evaluation data, with two leads and independent cardiologist annotations.The database includes DS100 and DS200 subsets used in the evaluation.
  • A. Setup and ECG Data: Each model is trained per patient using combined global and local data, while testing uses DS200 records after skipping their first five minutes.Global data samples representative heartbeats from DS100; local data uses each patient’s first five minutes in DS200.
  • A. Setup and ECG Data: The evaluation classifies every heartbeat into seven arrhythmia classes, then merges L and R into N for comparison with five-class previous works.The seven-class setup separately identifies left and right bundle branch blocks before the comparison is reduced to five classes.
  • B. Classification Performance: The comparison uses accuracy, sensitivity, specificity, positive predictivity, F1, and G scores derived from binary-classification confusion matrices.F1 and G combine sensitivity and positive predictivity, while the reported binary tasks are VEB and SVEB detection.
  • B. Classification Performance: In VEB detection, accuracy exceeds 99%, while F1 score is 19.8%, 1.6%, and 3.3% higher than previous works in datasets A, B, and C.The corresponding accuracy improvements are 4.5%, 0.2%, and 0.6% for datasets A, B, and C.
  • B. Classification Performance: In SVEB detection, accuracy is 3.1% and 1.7% higher than previous works in datasets B and C, while F1 score is 24.5% and 15.5% higher.The paper identifies F1 score as more meaningful than accuracy for this comparison.

C. Real-time Execution

The proposed algorithm is designed for low-power wearable processors and is evaluated for repeated real-time inference. It classifies each heartbeat within the available timing window on the tested platforms.

  • C. Real-time Execution: Wearable devices use small, low-power processors, so continuous execution requires the heartbeat classifier to have low computational intensity.These processors are much slower than desktop and server processors.
  • C. Real-time Execution: Only the inference phase runs repeatedly in real time; the training phase is performed once at the beginning.Execution time is evaluated on the small, low-power hardware platforms shown in Fig. 5(a).
  • C. Real-time Execution: The evaluation covers hardware platforms, measured execution time, and execution-time distribution.These three views are presented in Fig. 5(a)–(c).
  • C. Real-time Execution: 30 to 60 milliseconds per heartbeat fits within the at-least-300-millisecond window available at a maximum heart rate of 200 bpm.The reported timing demonstrates continuous ECG classification on the tested small, low-power platforms.

VI. DISCUSSION

Ablation experiments show that wavelet features and blending materially support classification performance, while selected component choices balance accuracy with computational cost.

  • Wavelet Features: Removing wavelet features reduces F1 score by 5.1% for VEB and 8.3% for SVEB detection.The wavelet transform adds very small overhead to overall execution time.
  • Wavelet Types: db2 and db3 yield the best performance among tested wavelet types, whereas db1 and db4 degrade F1 score.db2 is selected over db3 because its 4-point convolution kernel provides a more lightweight configuration.
  • RNN Cell Types: Replacing LSTM cells with simple RNN or GRU cells degrades classification performance, while Peephole performance remains very close to LSTM.LSTM is retained because Peephole cells require extra computations.
  • Model Blending: Using only model α lowers F1 score by 6% for VEB and 9% for SVEB detection compared with blending models α and β.The experiment indicates that blending the two models increases classification performance.

No Blending (Model

The experiments examine model execution and performance under reduced hardware or data settings. The proposed design maintains practical operation while showing trade-offs between model size, available ECG leads, and local training data.

  • Execution Time: Model β has longer execution time than model α because it uses a larger LSTM cell.Its hidden-state size is specified as Nβ_h = 30, while two smaller LSTMs together have lower total computational cost than one larger LSTM.
  • Limited ECG Data: With one ECG lead, the proposed algorithm achieves relatively lower but still acceptable classification performance.The baseline experiments use two ECG leads, while the single-lead evaluation uses the first lead.
  • Limited ECG Data: Reducing patient-specific local training data from 5 minutes to 2.5 minutes lowers classification performance but remains acceptable.The initial 5 minutes must be visually inspected and labeled by a specialist; halving it can reduce associated time and costs.
  • Conclusion: The proposed LSTM-based algorithm combines superior classification performance with low computational cost and timing suitable for continuous wearable execution.The conclusion targets devices with limited processing power.
Loading 1812.04818v3…