cs.CVAug 3, 2026

SWINSleepNet: A Hierarchical Context-Aware Framework for Sleep Staging (v2)

Authors: Chongjian WangJunjie Gao

Organizations: School of Mathematics and Systems Science, Shandong University of Science and Technology, Qingdao 266590, Shandong, China · School of Artificial Intelligence, Shandong Women’s University, Jinan 250352, Shandong, China

Abstract

Automatic sleep staging is a critical role in sleep disorder diagnosis, sleep quality assessment, and long-term health monitoring; however, existing approaches suffer poor performance on ambiguous and transition-related sleep stages, caused by inadequate modeling of fine-grained intra-epoch structures and complex cross-region spectral dependencies. Traditional epoch-level encoders commonly fail to extract subtle temporal microstructures and intra-epoch cross-region interactions, resulting in unsatisfactory recognition accuracy for hard categories such as the N1 stage. To tackle these drawbacks, we propose SwinSleepNet, a hierarchical context-aware dual-stream framework that separately optimizes intra-epoch representation learning and inter-epoch contextual modeling. Concretely, we characterize each sleep epoch from two complementary perspectives: raw time-domain EEG signal and its time-frequency transformation. The time-domain branch adopts convolutional encoders to capture fine waveform temporal details, and the time-frequency branch uses Swin Transformer to extract local spectro-temporal features, hierarchical multi-scale information and long-range spatial dependencies. The multi-branch extracted features are fused into integrated embeddings, which are optimized by a bidirectional context module to capture cross-epoch temporal dependencies for final sleep stage classification. Comprehensive experiments on Sleep-EDF-20, Sleep-EDF-78 and SHHS datasets verify that our method achieves competitive overall performance, and exhibits stronger robustness and stability on difficult N1 stages and transitional epochs. The results prove that optimized intra-epoch representation learning based on hierarchical architecture greatly benefits automatic sleep staging tasks.

Explore similar work

May 7, 2026cs.LG

STDA-Net: Spectrogram-Based Domain Adaptation for cross-dataset Sleep Stage Classification

Accurate sleep stage classification across datasets remains challenging due to variability in EEG channel montages, sampling rates, recording environments, and subject populations. Although deep learning has shown considerable promise for automated sleep staging, most existing cross-dataset methods rely on one-dimensional EEG signal representations, whereas the use of two-dimensional spectrogram-based inputs within an unsupervised domain adaptation framework has remained largely unexplored. Here, we propose STDA-Net (Spectrogram-based Temporal Domain Adaptation Network), a framework that combines a convolutional neural network (CNN) for spectrogram-based feature extraction, a bidirectional long short-term memory (BiLSTM) module for temporal modeling of sleep dynamics, and a domain-adversarial neural network (DANN) for source-to-target feature alignment without requiring any labeled target-domain data during training. Experiments are conducted on three publicly available datasets Sleep-EDF, SHHS-1, and SHHS-2 under six cross-dataset transfer settings. Results show that the proposed framework achieves an average accuracy of 89.03% and an average macro F1-score of 87.64%, consistently outperforming existing 1D baseline methods in terms of balanced classification performance, with substantially lower variance across five independent runs, indicating improved stability and reproducibility. Overall, these findings demonstrate that 2D spectrogram-based representations, combined with temporal modeling and adversarial domain adaptation, provide a robust and competitive alternative to conventional 1D EEG inputs for cross-dataset sleep staging.
Unaza Tallal, Shruti Kshirsagar, Ankita Shukla
Jul 28, 2026cs.CV

LGFNet: A CTC-Guided Local-Global Fusion Framework for Single-Channel Sleep Staging

Sleep staging remains challenging due to long-range temporal dependencies, ambiguous stage transitions-particularly in N1-and substantial distribution shifts across subjects, sampling rates, and EEG montages. These difficulties are further amplified in single-channel, low-latency scenarios required by wearable and real-world applications. To address these issues, we propose LGFNet, a CTC-guided sequence-to-sequence framework for robust sleep staging. LGFNet introduces a Local-Global Fusion encoder that jointly models fine-grained temporal dynamics and long-range sleep structure, overcoming the limitations of conventional serial hybrid architectures. A CTC-Attention joint training paradigm is adopted to unify temporal alignment with context-dependent modeling, enabling more accurate recognition of stage boundaries and transitions. Furthermore, a three-stage decoding strategy is devised, leveraging CTC-guided decoding and Viterbi-based smoothing to reduce error accumulation and enforce physiological consistency. Extensive cross-dataset evaluations on five public benchmarks demonstrate that LGFNet consistently outperforms state-of-the-art single-channel methods. In particular, on Sleep-EDF-78, LGFNet surpasses DMIN by +1.27% accuracy, +1.74% macro-F1, and +1.93% kappa, with pronounced gains on N1 and transition segments, highlighting its robustness and strong generalization across diverse sampling rates, montages, and recording environments.
Chongjian Wang, Zhenghang Hou, Junjie Gao +3
Jul 6, 2026cs.LG

Lightweight ML-Based Automatic Sleep Staging Framework with Constrained CNN and Mamba for Small-Sample EEG Datasets

Automatic sleep staging is a key technology for precise diagnosis and treatment of sleep disorders as well as long-term home sleep monitoring. Portable electroencephalogram (EEG) devices have become the focus of research due to their convenience in data collection. However, current methods still face three major challenges: large parameter sizes that easily lead to overfitting on small datasets, low accuracy in classifying difficult stages such as N1 and REM, unclear optimal training dataset size, and difficulty in deployment. This paper proposes GamSleepNet, a lightweight and low-latency automatic sleep staging framework for single-channel EEG. The framework features the FEB module, which combines improved Gabor kernels with learnable filters for feature extraction, uses the Mamba architecture to build a temporal classification network, introduces a novel contrastive loss and a two-stage training strategy, and experimentally validates the optimal dataset size for single-channel EEG sleep staging models. On the Sleepedf dataset, this model achieves an overall accuracy of 87.86 percent with only 30.86 thousand parameters, with all metrics reaching SOTA levels and significantly improving the identification accuracy of challenging sleep stages.
Zihao Wei, Yulin Gong, Yudan Lv