A spatio-temporal learning-based model for sleep apnea detection using single-lead ECG signals

Junyang Chen, Mengqi Shen, Wenjun Ma, Weiping ZhengFrontiers in Neuroscience 2022 · DOI

TL;DR

Researchers have developed a deep learning model called CNN-BiGRU that detects sleep apnea with state-of-the-art accuracy using only a single-lead ECG signal. By stacking "spatio-temporal blocks" that combine convolutional layers with bidirectional gated recurrent units, the model captures both the physical shape of heartbeats and the complex timing patterns between them to outperform existing diagnostic tools.

What Problem Does This Paper Address?

Sleep Apnea (SA) is a chronic disorder where breathing repeatedly stops and starts during sleep, leading to serious risks like stroke, cognitive decline, and cardiovascular disease. The "gold standard" for diagnosis is Polysomnography (PSG), which requires a patient to spend a night in a lab hooked up to dozens of sensors. It is expensive, uncomfortable, and often unavailable.

While home-based monitoring using single-lead ECG (electrocardiogram) signals is a promising alternative, it is technically challenging. ECG signals are noisy, and the indicators of apnea—such as subtle changes in the shape of the R-peak (morphology) and variations in heart rate (RR intervals)—are difficult for traditional algorithms to extract reliably. This paper aims to bridge the gap between portable convenience and clinical-grade accuracy.

Methods

The authors propose an end-to-end deep learning architecture named CNN-BiGRU. The core innovation is the Spatio-Temporal Block, which is repeated three times in the model. Each block consists of:

  1. 1D-Convolutional Neural Network (CNN): Extracts "spatial" or morphological features—essentially the geometric shape of the ECG wave.
  2. Max-Pooling: Reduces data dimensionality and helps the model focus on the most salient features.
  3. Bidirectional Gated Recurrent Unit (BiGRU): Extracts "temporal" features. Unlike standard RNNs, the BiGRU looks at the signal both forward and backward in time, capturing long-range dependencies in heart rate variability.

To provide context, the model doesn't just look at a single minute of sleep; it processes a 5-minute window (the target minute plus two minutes on either side). Finally, an Attention Mechanism is applied to the output of the last block, allowing the model to "weigh" which parts of the 5-minute segment are most indicative of an apnea event before making a final classification.

Datasets

The model was trained and validated on two prominent, publicly available datasets:

  • PhysioNet Apnea-ECG Dataset: Contains 70 recordings (35 for training/validation, 35 for testing). The experts labeled each 1-minute segment as either "SA" or "Normal."
  • University College Dublin Sleep Apnea Database (UCDDB): Contains 25 full-night recordings. This was used primarily to test the model's robustness and generalizability across different patient populations.

Key Insights and Ideas

  • Morphology + Timing: Most previous models focused on either the shape of the heartbeat or the timing between beats. By stacking CNNs and BiGRUs together in repeated blocks, this model learns how these two features interact at multiple levels of abstraction.
  • The Power of Context: Sleep apnea isn't an instantaneous event; it has a "lead-in" and a "recovery" phase. By using a 5-minute sliding window, the model captures the physiological transitions that a 1-minute snapshot would miss.
  • Attention is All You Need (for ECG): The inclusion of an attention layer allows the model to ignore signal noise or "normal" heartbeats within a window and focus specifically on the rhythmic disturbances caused by breathing interruptions.

Key Results

The CNN-BiGRU model achieved results that the authors describe as "obviously superior" to existing methods:

  • Apnea-ECG Dataset: Achieved a per-minute accuracy of 91.22% and an F1-score of 88.30%.
  • UCDDB Dataset: Demonstrated high robustness with a per-minute accuracy of 92.3%.
  • Per-Recording Diagnosis: When used to diagnose a patient's overall condition (rather than just a single minute), the model reached an accuracy of 97.1%, misclassifying only one patient out of 35 in the test set.
  • Correlation: The model’s calculated Apnea-Hypopnea Index (AHI) showed a very high correlation (0.984) with the actual clinical AHI, making it a highly reliable screening tool.

Limitations and Future Work

Despite the high accuracy, the authors noted that cross-dataset performance remains a hurdle. When a model trained on the Apnea-ECG dataset was tested directly on the UCDDB dataset without fine-tuning, accuracy dropped significantly. This is likely due to differences in hardware sampling rates and patient demographics (e.g., UCDDB includes patients with central apnea, which has different signatures).

Future work will focus on improving the model's ability to generalize across different populations and hardware types, with the ultimate goal of deploying the system into real-world healthcare platforms for remote patient monitoring.

Summary updated

Abstract

Sleep apnea (SA) is a common chronic sleep breathing disorder, which would cause stroke, cognitive decline, cardiovascular disease, or even death. The SA symptoms often manifest as frequent breathing interruptions during sleep and most individuals with sleeping disorders are not aware of the SA events. Using a portable device with single-lead ECG signal is an effective way to help an individual to monitor their sleep conditions at home. However, the SA detection performance of ECG-based methods is still difficult to meet the clinical practice requirement. In this study, we propose an end-to-end spatio-temporal learning-based SA detection method, which consists of multiple spatio-temporal blocks. Each block has the identical architecture with a convolutional neural network (CNN) layer, a max-pooling layer, and a bi-gated recurrent unit (BiGRU) layer. This architecture with repeated spatio-temporal blocks can well capture the morphological spatial feature information as well as the temporal feature information from ECG signals. The proposed SA detection model was evaluated on the publicly available datasets of PhysioNet Apnea-ECG dataset (Apnea-ECG) and University College Dublin Sleep Apnea Database (UCDDB). Extensive experimental results show that our proposed SA model on both Apnea-ECG and UCDDB datasets achieves state-of-the-art results, which are obviously superior to existing ECG-based SA detection methods. It means that our proposed method has the potential to be deployed into a healthcare system to provide a sleep monitoring service, which can screen out SA population with high risk and help to take timely interventions to prevent serious consequences.
BibTeX
@inproceedings{chen2022spatio,
  author = {Junyang Chen and Mengqi Shen and Wenjun Ma and Weiping Zheng},
  title = {{A spatio-temporal learning-based model for sleep apnea detection using single-lead ECG signals}},
  booktitle = {Frontiers in Neuroscience},
  year = {2022},
  doi = {10.3389/fnins.2022.972581},
}
Figure