An explainable spatial–temporal transformer framework with time-stretch encoding for cross-dataset sleep apnea detection
Ji-Jer Huang, Shih-Chung Chen, Irawan Dwi Wahyono
Key points
From the paper's conclusion- Conclusion CN-T with time-stretch encoding provides a generalized, interpretable, and resource-efficient approach for OSA detection across heterogeneous sleep datasets, supporting practical clinical and home-monitoring scenarios.
Abstract
Background Obstructive sleep apnea (OSA) is a prevalent respiratory disorder that disrupts sleep architecture and increases cardiometabolic risk. Despite recent progress, many deep learning detectors remain dataset-dependent and exhibit limited cross-dataset generalization. Objective To develop a lightweight and explainable framework that improves robustness for automatic OSA detection across heterogeneous sleep datasets. Methods An explainable convolutional network–Transformer (CN-T) spatial–temporal network is proposed, integrating multi-scale temporal convolutions for local pattern extraction with Transformer self-attention for long-range dependency modeling. The pipeline incorporates apnea-aware time-stretch preprocessing (S = 0.5), which temporally compresses signal duration while preserving spectral characteristics, and nonlinear relative positional encoding (RPE) to improve temporal invariance. Experiments were conducted on three public sleep datasets spanning polysomnography (PSG)-based signals and electrocardiography (ECG), using subject-wise 5-fold cross-validation and macro-averaged reporting. Results An accuracy (ACC) of 97.1 ± 0.3%, sensitivity (SEN) of 93.9 ± 0.6%, specificity (SPEC) of 97.9 ± 0.2%, and area under the receiver operating characteristic curve (AUC) of 97.8 ± 0.2% were achieved by the proposed method, with consistent outperformance of conventional CNN/RNN/LSTM and hybrid baselines while an efficient computational footprint was maintained (8.3 M parameters; 8.7 ms inference per 30-s epoch on RTX 4090). Conclusion CN-T with time-stretch encoding provides a generalized, interpretable, and resource-efficient approach for OSA detection across heterogeneous sleep datasets, supporting practical clinical and home-monitoring scenarios.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- ECG-based automated detection of sleep apnea using deep neural networks and hidden markov modelsScientific Reports · 2026
- Convolutional Neural Networks for Sleep Apnea Detection from Electrocardiographic SignalsElectronics · 2026
- SApneaNet: Adaptive Squeeze-and-Excitation-Based CNN-Transformer Network with AGFF for Sleep Apnea Event Detection Using ECG Images Under IoMT.Sensors (Basel, Switzerland) · 2026
- Transformer-based deep learning approach for obstructive sleep apnea detection using single-lead ECGFrontiers in Artificial Intelligence · 2026
- A Clinically Informed Cross-Attention Deep Learning Framework for Automated Diagnosis of Obstructive Sleep Apnea.IEEE International Conference on Automation Science and Engineering (CASE) : [proceedings]. IEEE Conference on Automation Science and Engineering · 2026
- Explainable CNN-BiLSTM Framework for Multi-Class Sleep Apnea Severity Detection Using Single-Lead ECG Signals: A Comprehensive Machine Learning Approach.Diagnostics (Basel, Switzerland) · 2026