Explainable Transformer Model Accurately Detects Sleep Apnea Across
A newly developed deep learning framework combining convolutional networks and Transformers achieved 97.1 percent accuracy in detecting obstructive sleep apnea across diverse physiological datasets. Researchers Ji-Jer Huang, Shih-Chung Chen, and Irawan Dwi Wah
Illustrative imageA newly developed deep learning framework combining convolutional networks and Transformers achieved 97.1 percent accuracy in detecting obstructive sleep apnea across diverse physiological datasets. Researchers Ji-Jer Huang, Shih-Chung Chen, and Irawan Dwi Wahyono designed the system to address a persistent limitation in automated respiratory screening, where many deep learning detectors remain dataset-dependent and exhibit limited cross-dataset generalization. Obstructive sleep apnea is a prevalent respiratory disorder that disrupts sleep architecture and increases cardiometabolic risk, motivating the development of a lightweight, explainable detection architecture that improves robustness across heterogeneous sleep datasets.
The proposed architecture, termed the convolutional network–Transformer or CN-T spatial–temporal network, integrates multi-scale temporal convolutions for local pattern extraction with Transformer self-attention for long-range dependency modeling. To improve cross-dataset robustness, the pipeline incorporates an apnea-aware time-stretch preprocessing stage using a compression factor of S = 0.5. This preprocessing step temporally compresses signal duration while preserving critical spectral characteristics. In addition, the network employs nonlinear relative positional encoding to improve temporal invariance across recorded signals.
To evaluate performance, the investigators tested the CN-T pipeline on three public sleep datasets spanning polysomnography-based signals and electrocardiography recordings. Experimental validation was conducted using a subject-wise five-fold cross-validation scheme, with performance evaluated through macro-averaged reporting. Across these heterogeneous benchmarks, the framework achieved an accuracy of 97.1 ± 0.3 percent, a sensitivity of 93.9 ± 0.6 percent, a specificity of 97.9 ± 0.2 percent, and an area under the receiver operating characteristic curve of 97.8 ± 0.2 percent.
These evaluation results showed consistent outperformance over conventional baseline models, including standard convolutional neural networks, recurrent neural networks, long short-term memory models, and hybrid deep learning architectures. Alongside high detection accuracy, the proposed framework maintained an efficient computational footprint during testing. The complete model architecture contains 8.3 million parameters and required an inference time of 8.7 milliseconds per 30-second epoch when evaluated on an RTX 4090 processor.
According to the authors, the CN-T architecture with time-stretch encoding provides a generalized, interpretable, and resource-efficient approach for obstructive sleep apnea detection across heterogeneous sleep datasets. By maintaining high classification performance while minimizing computational demands, the framework is designed to support practical clinical workflows and home-monitoring scenarios.
Subject of Research: Cross-dataset obstructive sleep apnea detection using deep learning
Article Title: An explainable spatial–temporal transformer framework with time-stretch encoding for cross-dataset sleep apnea detection
Article References: Huang, J.-J., Chen, S.-C., & Wahyono, I. D. (2026). An explainable spatial–temporal transformer framework with time-stretch encoding for cross-dataset sleep apnea detection. Discover Applied Sciences. https://doi.org/10.1007/s42452-026-09654-2
Image Credits: AI Generated
DOI: 10.1007/s42452-026-09654-2
Keywords: obstructive sleep apnea, spatial-temporal transformer, time-stretch encoding, cross-dataset generalization, polysomnography, electrocardiography, relative positional encoding, convolutional network, deep learning, respiratory disorders, sleep architecture, cardiometabolic risk, model interpretability, macro-averaged reporting, home monitoring, RTX 4090
News Source: Denise Maddox. (November 27, 2026). Explainable Transformer Model Accurately Detects Sleep Apnea Across Heterogeneous Datasets. Scienmag.
