DOI : 10.5281/zenodo.21819591
- Open Access
- Authors : Rajnandini N. Minache, Sharvil K. Naikwade, Apeksha M. Mane, Abhishek S. Kumbhar
- Paper ID : IJERTV15IS070762
- Volume & Issue : Volume 15, Issue 07 , July – 2026
- Published (First Online): 06-08-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Interpretative Sleep Stage Scoring: An Explainable CNN&LSTM-Attention Framework for Single-Channel EEG
Rajnandini N. Minache
Dept. of AI and ML Rajarambapu Institute of Technology
Urun-Ishwarpur, India
Apeksha M. Mane
Dept. of AI and ML Rajarambapu Institute of Technology
Urun-Ishwarpur, India
Sharvil K. Naikwade
Dept. of AI and ML Rajarambapu Institute of Technology
Urun-Ishwarpur, India
Abhishek S. Kumbhar
Dept. of AI and ML Rajarambapu Institute of Technology
Urun-Ishwarpur, India
Abstract – The Challenge
Sleep is a fundamental pillar of human health, but the diagnostic process of sleep disorders still belongs to the manual era. To accurately diagnose sleep disorders, clinicians must spend sleepless hours scoring the brainwave data manually based on the American Academy of Sleep Medicine (AASM) rules (Berry et al., 2017), and in doing so, the inter-scorer reliability is untrustworthy. While deep learning has attempted to automate this process, many models act as black boxes and neglect the imbalanced nature of classes in sleep data, predicting rare N1 stages poorly (Guillot et al., 2020).
Our Approach
For this study, a transparent and robust framework of sleep monitoring has been developed. Specifically, we constructed a 1D- ConvLSTM hybrid neural network leveraging the spatial feature extraction capabilities of a 1D-CNN and the memory or sequential learning aspects of a Bi-LSTM, an architecture shown baseline for time-series-based physiological signal data (Supratak et al., 2017). Crucially, we integrated a Self-Attention mechanism (Vaswani et al., 2017). This layer acts as a magnifying glass of a digital form, identifying certain biomarkers on the EEG such as sleep spindles and K-complexes that contribute to sleep stage classification.
The Results
Using the gold-standard PhysioNet Sleep-EDF Database (Kemp et al., 2000) and a cost-sensitive learning strategy to address class imbalance, the model achieved an overall accuracy of 93%.
Why It Matters
Our findings demonstrate that clinical-grade accuracy is achievable with a single EEG channel. Providing transparency into the operation of AI via attention maps thus helps narrow the complexity gap between clinical and automated procedures. This study paves the way for affordable, home-based sleep monitoring technologies.
Index TermsSleep Staging, Deep Learning, CNN-LSTM, Attention Mechanism, Explainable AI, Class Imbalance.
-
INTRODUCTION
Sleep is a complicated biological process that is essential for cognition, metabolic health as well as emotion regulation. However, sleep disorders such as sleep apnea and insomnia have become a global epidemic and affect nearly 45% of the population.
The Problem: The Black Box and Human Fatigue
First, the current clinical workflow according to the AASM Manual (Berry et al., 2017) requires specialized technicians to manually segment a full-night EEG recording into 30-second epochs. This workflow is not only extremely time-consuming (full manual scoring may take as long as three hours per patient), but it is also subjected to inter-scorer variability.
Even though automated systems have been introduced to ease this burden, these systems face two broad challenges:
Class Imbalance: Stage N2 is in plenty during a typical nights sleep while Stage N1 and REM are in short supply. Most standard AI models suffer mode collapse, where high accuracy is achieved by ignoring the rare stages (Guillot et al., 2020).
Lack of Interpretability: Deep learning models, and most specifically Convolutional Neural Networks (CNN), have been considered as being black boxes. For a clinician, the diagnosis is not trusted unless the model used can explain the brainwaves, such as sleep spindles or K-complexes, that led to the classification.
-
LITERATURE REVIEW
Automated sleep staging has evolved from manual feature extraction using Support Vector Machines (SVM) to end-to-end Deep Learning (DL) architectures. While Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) units have improved performance, existing models often struggle with class imbalancespecifically regarding Stage N1and a lack of interpretability.
Our work proposes an Attention-based CNN-LSTM framework designed to address these limitations. By utilizing a Self-Attention mechanism, the model highlights clinically relevant EEG segments, enhancing both accuracy and transparency. Experimental results on the Sleep-EDF dataset demonstrate a 93% overall accuracy, with significant improvements in identifying minority sleep stages.
-
MATERIALS AND METHODOLOGY
-
Dataset and Data Source
The primary data source for this study is the PhysioNet Sleep-EDF Database (Expanded) [3]. This clinical dataset contains whole- night Polysomnography (PSG) recordings. To ensure demographic diversity, the Sleep Cassette (SC) subset was utilized, which includes healthy subjects aged 25101 years. For this implementation, single-channel EEG signals (Fpz-Cz) were extracted at a sampling rate of 100 Hz. Annotations were based on the Rechtschaffen and Kales (R&K) criteria [4].
-
Data Preprocessing and Annotation
EEG signals were processed using the MNE-Python framework. The following steps were implemented to prepare the data for the deep learning model:
Segmentation: Continuous EEG signals were partitioned into 30-second epochs, consistent with AASM clinical sleep scoring guidelines. Each epoch consists of 3,000 data points.
Label Mapping: Sleep stages were mapped into five distinct categories: Wake (W), N1, N2, N3 (Deep Sleep), and REM (R).
Normalization: To mitigate inter-subject voltage variability, Global Z-score Normalization was applied. This process standardizes the data by achieving a mean of zero and unit variance, ensuring consistent signal amplitude across the dataset.
-
Model Architecture
The proposed architecture integrates Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), and Attention mechanisms to capture both local morphological features and global temporal patterns.
-
Feature Extraction (CNN): Two layers of 1D-Convolutional Neural Networks were employed for multi-scale feature discovery. Layer 1 utilizes a large kernel (50 units) to capture low-frequency patterns, such as Delta and Theta waves. Layer 2 utilizes smaller kernels (8 units) to identify high-frequency transients, specifically sleep spindles.
-
Temporal Sequencing (Bi-LSTM): To model the progression of sleep stages over time, a Bidirectional Long Short-Term Memory (Bi-LSTM) layer with 64 units was integrated. This bidirectional approach allows the model to utilize context from both preceding and succeeding epochs, enhancing the understanding of temporal transitions within the sleep cycle.
-
Self-Attention Mechanism: A Self-Attention layer was implemented to allow the model to dynamically weigh the importance of specific time-steps. The mechanism calculates attention scores () to highlight clinically significant events within the EEG signal. By focusing on these high-impact segments, the model optimizes its internal representations from the CNN and LSTM layers.
-
Classification Head: The final feature vector is passed through a dense classification head. Toprevent overfitting, a Dropout layer (p=0.4) was applied. A Softmax activation function provides the final probability distribution across the five target sleep stages.
-
-
Experimental Setup and Training
The dataset was partitioned into an 80/20 trainvalidation split.
-
-
METHODOLOGY
The proposed pipeline consists of the following ten steps:
-
Signal Acquisition: 30-second EEG segments are extracted from PhysioNet Sleep-EDF.
-
Normalization: Z-score scaling achieves = 0, = 1 for cross-subject consistency.
-
Feature Extraction: 1D-CNNs identify Delta waves and Sleep Spindles.
-
Dimensionality Reduction: Max Pooling and Batch Normalization stabilize training.
-
Temporal Modeling: Bi-LSTM captures sequential sleep cycle dependencies.
-
Attention: A Self-Attention layer highlights clinically relevant epoch segments.
-
Regularization: Dropout (0.4) is applied to prevent overfitting.
-
Probability Mapping: Softmax activation produces a 5-class distribution.
-
Optimization: Balanced Class Weights compensate for N1 minority samples.
-
Hypnogram Synthesis: Generation of the final predicted sleep stage sequence.
-
-
RESULTS AND DISCUSSION
A. Performance Metrics
The model attained a 93% accuracy and 0.81 Macro-F1 score. Performance was analyzed via a Confusion Matrix to observe inter- stage dynamics, particularly the N1-REM transition.
Minority Class Performance: Through cost-sensitive optimization, the N1 stage achieved a 75% recall. This sensitivity is crucial for clinical diagnostics where N1 represents the transition from wakefulness to sleep.
Explainability: The Self-Attention layer highlighted specific morphological features, such as K-complexes and spindles, providing clinical interpretability to the Classification Heads outputs.
Fig. 1. Model Accuracy Trends across 25 epochs.
Fig. 2. Model Loss Trends across 25 epochs.
Fig. 3. Normalized Confusion Matrix of the CNN-LSTM-Attention model showing inter-class dynamics.
-
CONCLUSION AND FUTURE WORK
In this study we made a system that can tell when people are sleeping or awake using brain wave data. The system uses a computer program that puts together techniques and it works really well. It is accurate 93 percent of the time and it scored 0.94 on a big set of sleep data.
Our research fixed two problems. The first problem was dealing with data thats not equal. The second problem was making the system transparent. We made the system focus on the data it did not have a lot of. The system can detect a stage of sleep about 75 percent of the time. This is a lot better than systems. We also added a feature that helps us understand how the system makes decisions. It shows us signs of sleep. The brain wave data system works well. This is important.
The fact that the brain wave data system works well means it could be used in sleep monitors. This could make it easier for people to track their sleep at home. They will not need to go to a clinic. The brain wave data system could help doctors find sleep problems early. The brain wave data system is a tool for sleep tracking.
FUTURE WORK
We plan to take the brain wave data system research in three areas:
-
Clinical Generalization: We want to test the brain wave data system on different types of people. We want to test it on people with Sleep Apnea and Insomnia. We want to see how well the brain wave data system works.
-
Real-Time Optimization: We need to make the brain wave data system work faster. We will try to make it simpler and more efficient. This way it can work well on devices.
-
Multimodal Fusion: We want to combine the brain wave data with other types of data. We want to combine it with heart rate and movement data. This will give us a picture of what happens during sleep. The brain wave data system will be even better.
REFERENCES
- [b1] M. Karim et al., Automated Sleep Stage Classification Using Multi-Channel EEG Time-Frequency Features and CNN-BiLSTM Hybrid Networks, International Conference Control and Robots, Jul. 2025, doi: 10.1109/ICCR67387.2025.11291921.
- [b2] X. Wang, X. Li, J. Li, Y. Fu, D. Zhang, and Y. Peng, RimeSleepNet: A hybrid deep learning network for s-EEG sleep stage classification, Sleep Medicine, Sep. 2025, doi: 10.1016/j.sleep.2025.106835.
- [b3] S. Intarawichian, P. Thiennviboon, J. Laothamatas, and W. Sungkarat, EnsembleNet: Single-Channel EEG Sleep Stage Classification Based on Ensemble Architecture of Deep Convolutional Neural Networks, IEEE Access, 2026, doi: 10.1109/ACCESS.2026.3655811.
- [b4] Q. Wan et al., Automated sleep staging from single-channel electroencephalogram using hybrid neural network with manual features and attention, iScience, Jul. 2025, doi: 10.1016/j.isci.2025.113169.
- [b5] J. Zhong, Dynamic Multi-Scale Feature Fusion for Robust Sleep Stage Classification Using Single-Channel EEG, Journal of Computing and Electronic Information Management, Feb. 2025, doi: 10.54097/1swr9p34.
- [b6] E. Eldele, Z. Chen, C. Liu, M. Wu, C. Kwoh, X. Li, and C. Guan, An Attention-Based Deep Learning Approach for Sleep Stage Classification With Single-Channel EEG, IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 29, pp. 809818, 2021, doi: 10.1109/TNSRE.2021.3076234.
- [b7] T. Li, B. Zhang, H. Lv, S. Hu, Z. Xu, and Y. Tuergong, CAttSleepNet: Automatic End-to-End Sleep Staging Using Attention-Based Deep Neural Networks on Single-Channel EEG, International Journal of Environmental Research and Public Health, vol. 19, no. 9, p. 5199, 2022, doi: 10.3390/ijerpp9095199.
- [b8] D. Pham and R. Mouek, Automatic Sleep Stage Classification by CNN-Transformer-LSTM using Single-Channel EEG Signal, in Proc. IEEE International Conference on Bioinformatics and Biomedicine (BIBM), 2023, doi: 10.1109/BIBM58861.2023.10385687.
- [b9] Q. Wan, Y. Bo, Y. Zhang, M. Li, X. Wang, C. Chen, L. Liu, and W. Wu, Automated Sleep Staging from Single-Channel Electroencephalogram Using Hybrid Neural Network with Manual Features and Attention, iScience, vol. 28, no. 4, p. 113169, 2025, doi: 10.1016/j.isci.2025.113169.
- [b10] J. Y. C. Chen, Z. Han, H. Qiao, C. Li, and H. Peng, EEG-Based Sleep Staging via Self-Attention Based Capsule Network with Bi-LSTM Model, Biomedical Signal Processing and Control, vol. 86, p. 105351, 2023, doi: 10.1016/j.bspc.2023.105351.
- [b11] M. Fu, Y.-T. Wang, Z. Chen, J. Li, F. Xu, X. Liu, and F. Hou, Deep Learning in Automatic Sleep Staging With a Single Channel Electroencephalography, Frontiers in Physiology, vol. 12, p. 628502, 2021, doi: 10.3389/fphys.2021.628502.
- [b12] Z. Xiong, Y. Gou, Y. Zhou, Y. Yang, Y. Peng, Y. Gong, R. Xu, R. Wang, and X. Zeng, KAN-SleepNet: A Deep Learning Model Combining KolmogorovArnold Networks and Bidirectional LSTM for Automated Sleep Staging Using EEG Signals, Digital Health, vol. 11, p. 20552076251398440, 2025, doi: 10.1177/20552076251398440.
- [b13] S. Urbina Fredes, A. D. Firoozabadi, P. Adasme, D. Zabala-Blanco, P. Palacios Jativa, and C. A. Azurdia-Meza, Advanced Sleep Stage Classifiation Through a Convolutional Recurrent Attention-Based Neural Network Model, in Proc. International Computer Science Conference (ICSC), 2025, doi: 10.1109/ICSC64553.2025.10968970.
- [b14] S. Urbina Fredes, A. D. Firoozabadi, P. Adasme, D. Zabala-Blanco, P. Palacios Jativa, and C. A. Azurdia-Meza, Hybrid Deep Learning Approach for Automated Sleep Cycle Analysis, Applied Sciences, vol. 15, no. 12, p. 6844, 2025, doi: 10.3390/app15126844.
- [b15] J. Wang, S. Zhao, H. Jiang, Y. Zhou, Z. Yu, T. Li, S. Li, and G. Pan, CareSleepNet: A Hybrid Deep Learning Network for Automatic Sleep Staging, IEEE Journal of Biomedical and Health Informatics, vol. 28, no. 10, pp. 57655776, 2024, doi: 10.1109/JBHI.2024.3426939.
- [b16] T. Zhu, W. Luo, and F. Yu, Convolution- and Attention-Based Neural Network for Automated Sleep Stage Classification, International Journal of Environmental Research and Public Health, vol. 17, no. 11, p. 4152, 2020, doi: 10.3390/ijerpp7114152.
- [b17] H. Phan, F. Andreotti, N. Cooray, O. Chen, and M. Vos, Automatic Sleep Stage Classification Using Single-Channel EEG: Learning Sequential Features with Attention-Based Recurrent Neural Networks, in Proc. 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2018, doi: 10.1109/EMBC.2018.8512480.
- [b18] C. Liu, Q. Guan, W. Zhang, L. Sun, M. Wang, X. Dong, and S. Xu, MultiScaleSleepNet: A Hybrid CNNBiLSTMTransformer Architecture with Multi-Scale Feature Representation for Single-Channel EEG Sleep Stage Classification, Sensors, vol. 25, no. 20, p. 6328, 2025, doi: 10.3390/s25206328.
- [b19] Z. Lan, M. Dai, Y. Zhou, and L. Sun, Intelligent Automatic Sleep Staging Model Based on CNN and LSTM, Frontiers in Public Health, vol. 10, p. 946833, 2022, doi: 10.3389/fpubh.2022.946833.
- [b20] H. Elmoaqet, M. Eid, M. Ryalat, and T. Penzel, A Deep Transfer Learning Framework for Sleep Stage Classification with Single-Channel EEG Signals, Sensors, vol. 22, no. 22, p. 8826, 2022, doi: 10.3390/s22228826.
- [b21] L. Fiorillo, A. Puiatti, M. Papandrea, P. Ratti, P. Favaro, C. Roth, P. Bargiotas, C. Bassetti, and F. Faraci, Automated Sleep Scoring: A Review of the Latest Approaches, Sleep Medicine Reviews, vol. 48, p. 101204, 2019, doi: 10.1016/j.smrv.2019.07.007.
- [b22] H. Loh, C. Ooi, J. Vicnesh, S. L. Oh, O. Faust, A. Gertych, and U. R. Acharya, Automated Detection of Sleep Stages Using Deep Learning Techniques: A Systematic Review of the Last Decade (20102020), Applied Sciences, vol. 10, no. 24, p. 8963, 2020, doi: 10.3390/app10248963.
- [b23] J. Zhang, Y. Xue, and Y. Li, A Novel CNN Plus Transformer Network for EEG-Based Automatic Sleep Staging, in Proc. 4th International Conference on Computer, Big Data and Artificial Intelligence (ICCBD+AI), 2023, doi: 10.1109/iccbd-ai62252.2023.00018.
- [b24] Z. Wang, Z. Gong, T. Wang, Q. Dong, Z. Huang, S. Zhang, and Y. Ma, MASleepNet: A Sleep Staging Model Integrating Multi-Scale Convolution and Attention Mechanisms, Biomimetics, vol. 10, no. 10, p. 642, 2025, doi: 10.3390/biomimetics10100642.
- [b25] M. Sidhu, R. Sharma, and N. Batra, Automated Sleep Stage Classification Using Deep Learning for Enhanced Sleep Disorder Diagnosis, in Proc. International Conference on Electronics and Computing, Communication Networking Automation Technologies (ICEC2NT), 2025, doi: 10.1109/ICEC2NT65402.2025.11379999.
