Amir Ali Vakili, Salar Jahanshiri, Armin Salimi-Badr
Abstract
Automatic sleep staging is a critical task in healthcare due to the global prevalence of sleep disorders. This study focuses on single-channel electroencephalography (EEG), a practical and widely available signal for automatic sleep staging. Existing approaches face challenges such as class imbalance, limited receptive-field modeling, and insufficient interpretability. This work proposes TempoSleep, a context-aware framework for single-channel EEG sleep staging, with particular emphasis on improving detection of the N1 stage. Many prior models operate as black boxes with stacked layers, lacking clearly defined and interpretable feature extraction roles.
Introduction
Artificial intelligence (AI) has become a transformative tool in modern disease diagnosis, enabling automated, data-driven analysis across a wide range of medical applications, including medical imaging, biomedical signal processing, and clinical decision support systems [1,2]. By learning complex patterns from large-scale and high-dimensional healthcare data, AI-based methods have demonstrated the potential to improve diagnostic accuracy, reduce clinician workload, and enable early detection of diseases. In particular, deep learning techniques have shown remarkable success in modeling temporal and spatial dependencies in physiological signals, making them well suited for tasks involving continuous health monitoring [3–5].
Materials and methods
In this section, we first explain the problem along with the underlying dataset. To enrich our training samples and improve the generalization of the proposed method, some data-augmentation processes are applied, too. Next, we explain the TempoSleep in detail.
Results
To evaluate TempoSleep, we performed a series of experiments to analyze it from several aspects. First, we examined our overall performance under a cross-validation protocol and analyze the outcomes across different stages. Secondly, we compared the overall and per-class performance of our method with established baselines using standard evaluation metrics to show its distinctive advantages. Finally, we performed an ablation study to show the contribution of individual components of our method to the overall performance.
Discussion
The findings demonstrate that the proposed method effectively addresses several key challenges in automatic single-channel EEG sleep staging, particularly the need to capture temporal information at multiple scales and the persistent class-imbalance problem associated with the N1 stage. Across the evaluated benchmarks, the proposed framework achieves strong overall and class-level performance while relying only on the Fpz–Cz EEG channel. The context-aware preprocessing strategy divides conventional 30-second epochs into finer sub-epoch segments and incorporates neighboring information, allowing the model to represent short-term transitions together with their surrounding temporal context.
Conclusion
As discussed earlier, data imbalance and limited receptive-field modeling remain among the most critical challenges in automatic sleep staging. In addition, developing lightweight models that can operate efficiently in real-time settings is an important practical requirement. In this work, we proposed a novel and lightweight single-channel EEG-based architecture built upon an efficient multi-branch convolutional compressor and a hierarchical BiLSTM framework, combined with class-weighted loss functions and data augmentation strategies to address class imbalance.
Citation: Vakili AA, Jahanshiri S, Salimi-Badr A (2026) A context-aware temporal modeling through unified multi-scale temporal encoding and hierarchical sequence learning for single-channel EEG sleep staging. PLoS One 21(9): e0358241. https://doi.org/10.1371/journal.pone.0358241
Editor: Fo Hu, Institute of Wenzhou, Zhejiang University, CHINA
Received: January 7, 2026; Accepted: August 28, 2026; Published: September 30, 2026
Copyright: © 2026 Vakili et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: The data underlying this study are publicly available from PhysioNet as part of the Sleep-EDF dataset at https://www.physionet.org/content/sleep-edfx/1.0.0/. The dataset can be accessed by researchers in accordance with the access and data-use requirements specified by PhysioNet. The authors did not have any special or privileged access to the data.
Funding: The author(s) received no specific funding for this work.
Competing interests: The authors have declared that no competing interests exist.