Convolutional Recurrent Neural Networks for Electrocardiogram Classification

Martin Zihlmann, Dmytro Perekrestenko, Michael Tschannen

Abstract: This paper presents a robust deep learning framework for identifying heart arrhythmias, specifically Atrial Fibrillation (AF), from single-lead ECG recordings. Researchers from ETH Zurich demonstrate that combining the spatial feature extraction capabilities of Convolutional Neural Networks (CNNs) with the temporal memory of Long Short-Term Memory (LSTM) networks, supported by specialized data augmentation, effectively addresses the challenges of variable-length medical signals. The proposed Convolutional Recurrent Neural Network (CRNN) achieved a high $F_1$ score of 82.1% in the PhysioNet/CinC Challenge 2017.

Introduction

Atrial Fibrillation (AF) affects 1-2% of the global population and is a primary risk factor for stroke and heart failure. Automated detection is critical but faces significant hurdles: ECG recordings vary in length, high-quality labeled datasets are scarce, and real-world signals are often contaminated by noise from patient movement or electrode contact issues. Existing automated methods frequently rely on hand-crafted features that may fail to capture the complex, episodic nature of AF.

Methodology

The researchers evaluated two primary deep learning architectures, both utilizing a logarithmic spectrogram as the input representation. This transformation converts the 1D ECG signal into a 2D time-frequency representation, which preliminary tests showed significantly improved classification accuracy over raw signals.

  1. CNN-only: A 24-layer deep convolutional network that employs global average pooling to aggregate features across the temporal dimension.
  2. CRNN: A 24-layer CNN for initial feature extraction followed by a 3-layer bidirectional LSTM. The LSTM layer allows the model to "read" the sequence of features, capturing how heart rhythms evolve over time rather than just averaging them.
Architectural comparison between the CNN-only model (left) and the CRNN model (right).

Data Augmentation: The "Secret Sauce"

To prevent overfitting on the relatively small challenge dataset, two novel augmentation techniques were introduced:

  • Dropout Bursts: Simulating brief losses of electrode contact by randomly setting 50ms chunks of the signal to zero.
  • Random Resampling: Stretching or shrinking the signal to emulate heart rates between 60 and 120 bpm, making the model robust to natural physiological variations.

Datasets

The models were primarily developed using the PhysioNet/CinC Challenge 2017 dataset, which contains 8,528 single-lead ECG recordings ranging from 9 to 61 seconds. Recordings are classified into four categories: Normal rhythm (N), AF (A), Other rhythm (O), and Noisy (~). The PTB Diagnostic ECG Database was also used for preliminary pre-training experiments.

Key Results and Insights

The CRNN ensemble reached an $F_1$ score of 82.1% on the hidden challenge test set, placing it among the top entries. A critical finding was that while simple temporal averaging in the CNN-only model acts as a smoother, it can "wash out" brief episodic events. In contrast, the LSTM aggregates features non-linearly, preserving the signatures of critical rhythmic changes.

Classification performance (Accuracy and F1-score) for CNN and CRNN architectures with data augmentation applied during cross-validation.

Data augmentation proved essential, increasing the $F_1$ score by approximately 4-5 percentage points. This underscores that for medical AI, the method of expanding the dataset is as vital as the architecture itself. Furthermore, the model demonstrated high robustness in handling the "Noisy" class, a common failure point in clinical automation.

Conclusion and Future Work

While highly effective, the CRNN required a specific 3-phase training protocol (CNN training, then LSTM training, then joint fine-tuning) to ensure convergence. Future improvements could involve using a patient's actual heart rate to guide resampling augmentation rather than assuming a fixed baseline. Interestingly, pre-training on high-quality diagnostic databases (PTB) did not yield significant gains, suggesting that features learned from clean data do not always translate to the noisier environments of single-lead, real-world recordings.

Summary updated

BibTeX
@inproceedings{zihlmann2017convolutional,
  author = {Martin Zihlmann and Dmytro Perekrestenko and Michael Tschannen},
  title = {{Convolutional Recurrent Neural Networks for Electrocardiogram Classification}},
  booktitle = {CinC},
  year = {2017},
  url = {https://openreview.net/forum?id=ok5E8ec1ORM},
}
Figure