A Hybrid Transformer Model for Obstructive Sleep Apnea Detection Based on Self-Attention Mechanism Using Single-Lead ECG
Shuaicong Hu, Wenjie Cai, Tijie Gao, Ming-Jie Wang
Abstract
<i>Objective</i>: Obstructive Sleep Apnea (OSA) is a widespread sleep disorder that seriously affects human health. Detection of OSA with low cost and high accuracy is of great clinical significance. This study proposes a hybrid Transformer model based on self-attention mechanism for OSA detection using single-lead electrocardiogram (ECG). <i>Methods</i>: To reduce the introduction of expert knowledge, a new method for constructing raw inputs is proposed. The data inputs include the raw ECG signal sequence, R-peak amplitude (RA) sequence, inter-beat (RR) interval (RRI) sequence, and RR interval first-order difference (RRID) sequence. Then a multi-perspective channel-attention (MPCA) block is proposed to focus on the contribution of four input signals automatically and extract the fused multi-perspective features. These features together with their position encodings were fed into Transformer blocks to encode the most important information with self-attention mechanism. Finally, the prediction results were output through the linear layer. <i>Results</i>: The proposed method was verified on the Apnea-ECG database. The per-segment classification accuracy reached 0.91 and the area under the ROC (receiver operating characteristic) curve (AUC) was 0.96. The per-recording classification accuracy reached 100% and the mean absolute error (MAE) was 2.71. Our method achieved better classification performance than other state-of-the-art algorithms. <i>Conclusion</i>: The proposed hybrid Transformer model is able to detect OSA accurately using single-lead ECG in a manner similar to detection process by human experts. <i>Significance</i>: Our method provides a convenient and precise solution for clinical OSA detection.