CAttSleepNet: Automatic End-to-End Sleep Staging Using Attention-Based Deep Neural Networks on Single-Channel EEG
Abstract
:1. Introduction
- To obtain more discriminative feature representation, our model makes full use of temporal contextual correlation at both local and global levels to achieve high-precision automatic sleep staging on single-channel EEG.
- To solve the problem whereby traditional CNNs cannot distinguish feature importance due to their limited receptive fields, we add an attention module, which learns the weights of local features by mining the contextual relations of local sequences.
- Our proposed model is evaluated on the public data sets sleep-edfx-2013 and sleep-edfx-2018. The experimental results show that CAttSleepNet outperforms the existing state-of-the-art methods.
2. Related Work
2.1. Machine Learning-Based Sleep Staging Methods
2.2. Deep Learning-Based Sleep Staging Methods
3. CAttSleepNet
3.1. The Attention-Based CNN for Local Sequence Feature Extraction
3.2. The Two-Layer Bi-LSTM for Global Sequence Modeling
3.3. Model Training and Parameter Optimization
4. Experimental Evaluation
4.1. Experiment Datasets and Evaluation Metrics
4.1.1. Experiment Datasets
4.1.2. Evaluation Metrics
- The sleep-edfx-2013 and sleep-edfx-2018 datasets are shuffled into k equal parts. K was set to 20 and 10, correspondingly.
- One of the k equal parts was taken as a test set and the rest as a training set.
- We trained the model and calculated the accuracy on the test set.
4.2. Experimental Results of CAttSleepNet
4.3. Comparison with State-of-the-Art Methods
4.4. Ablation Experiment
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Bjornara, K.A.; Dietrichs, E.; Toft, M. Longitudinal assessment of probable rapid eye movement sleep behaviour disorder in Parkinson’s disease. Eur. J. Neurol. 2015, 22, 1242–1244. [Google Scholar] [CrossRef] [PubMed]
- Zhong, G.; Naismith, S.; Rogers, N.; Lewis, S. Sleep–wake disturbances in common neurodegenerative diseases: A closer look at selected aspects of the neural circuitry. J. Neurol. Sci. 2011, 307, 9–14. [Google Scholar] [CrossRef] [PubMed]
- Wolpert, E.A. A Manual of Standardized Terminology, Techniques and Scoring System for Sleep Stages of Human Subjects. Arch. Gen. Psychiatry 1969, 20, 246. [Google Scholar] [CrossRef]
- Iber, C.; Ancoli-Israel, S.; Chesson, A.; Quan, S.F. The AASM Manual for the Scoring of Sleep and Associated Events: Rules, Terminology and Technical Specifications. 2007. Available online: https://www.sleep.pitt.edu/wp-content/uploads/2020/03/The-AASM-Manual-for-Scoring-of-Sleep-and-Associated-Events-2007-.pdf (accessed on 11 March 2022).
- Li, X.; Cui, L.; Tao, S.; Chen, J.; Zhang, X.; Zhang, G.-Q. HyCLASSS: A Hybrid Classifier for Automatic Sleep Stage Scoring. IEEE J. Biomed. Health Inform. 2017, 22, 375–385. [Google Scholar] [CrossRef]
- Dimitriadis, S.I.; Salis, C.; Linden, D. A novel, fast and efficient single-sensor automatic sleep-stage classification based on complementary cross-frequency coupling estimates. Clin. Neurophysiol. 2018, 129, 815–828. [Google Scholar] [CrossRef] [PubMed]
- Zhu, G.; Li, Y.; Wen, P.P. Analysis and Classification of Sleep Stages Based on Difference Visibility Graphs from a Single-Channel EEG Signal. IEEE J. Biomed. Health Inform. 2014, 18, 1813–1821. [Google Scholar] [CrossRef] [PubMed]
- Seifpour, S.; Niknazar, H.; Mikaeili, M.; Nasrabadi, A.M. A new automatic sleep staging system based on statistical behavior of local extrema using single channel EEG signal. Expert Syst. Appl. 2018, 104, 277–293. [Google Scholar] [CrossRef]
- Adegun, A.A.; Viriri, S.; Ogundokun, R.O. Deep Learning Approach for Medical Image Analysis. Comput. Intell. Neurosci. 2021, 2021, 6215281. [Google Scholar] [CrossRef]
- Astley, J.R.; Wild, J.M.; Tahir, B.A. Deep learning in structural and functional lung image analysis. Br. J. Radiol. 2022, 95, 20201107. [Google Scholar] [CrossRef]
- Said, Y.; Barr, M. Human emotion recognition based on facial expressions via deep learning on high-resolution images. Multimedia Tools Appl. 2021, 80, 25241–25253. [Google Scholar] [CrossRef]
- Aspandi, D.; Sukno, F.; Schuller, B.W.; Binefa, X. Audio-Visual Gated-Sequenced Neural Networks for Affect Recognition. IEEE Trans. Affect. Comput. 2022. [Google Scholar] [CrossRef]
- Comas, J.; Aspandi, D.; Binefa, X. End-to-end Facial and Physiological Model for Affective Computing and Applications. In Proceedings of the 2020 15th IEEE International Conference on Automatic Face and Gesture Recognition (FG 2020), Buenos Aires, Argentina, 16–20 November 2020; pp. 93–100. [Google Scholar]
- Yildirim, O.; Baloglu, U.B.; Acharya, U.R. A Deep Learning Model for Automated Sleep Stages Classification Using PSG Signals. Int. J. Environ. Res. Public Health 2019, 16, 599. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Fernandez-Blanco, E.; Rivero, D.; Pazos, A. Convolutional neural networks for sleep stage scoring on a two-channel EEG signal. Soft Comput. 2020, 24, 4067–4079. [Google Scholar] [CrossRef]
- Sors, A.; Bonnet, S.; Mirek, S.; Vercueil, L.; Payen, J.-F. A convolutional neural network for sleep stage scoring from raw single-channel EEG. Biomed. Signal Process. Control 2018, 42, 107–114. [Google Scholar] [CrossRef]
- Michielli, N.; Acharya, U.R.; Molinari, F. Cascaded LSTM recurrent neural network for automated sleep stage classification using single-channel EEG signals. Comput. Biol. Med. 2019, 106, 71–81. [Google Scholar] [CrossRef]
- Sun, C.; Fan, J.; Chen, C.; Li, W.; Chen, W. A Two-Stage Neural Network for Sleep Stage Classification Based on Feature Learning, Sequence Learning, and Data Augmentation. IEEE Access 2019, 7, 109386–109397. [Google Scholar] [CrossRef]
- Seo, H.; Back, S.; Lee, S.; Park, D.; Kim, T.; Lee, K. Intra- and inter-epoch temporal context network (IITNet) using sub-epoch features for automatic sleep scoring on raw single-channel EEG. Biomed. Signal Process. Control 2020, 61, 102037. [Google Scholar] [CrossRef]
- Supratak, A.; Dong, H.; Wu, C.; Guo, Y. DeepSleepNet: A Model for Automatic Sleep Stage Scoring Based on Raw Single-Channel EEG. IEEE Trans. Neural Syst. Rehabil. Eng. 2017, 25, 1998–2008. [Google Scholar] [CrossRef] [Green Version]
- Sun, C.; Chen, C.; Li, W.; Fan, J.; Chen, W. A Hierarchical Neural Network for Sleep Stage Classification Based on Comprehensive Feature Learning and Multi-Flow Sequence Learning. IEEE J. Biomed. Health Inform. 2019, 24, 1351–1366. [Google Scholar] [CrossRef]
- Lajnef, T.; Chaibi, S.; Ruby, P.; Aguera, P.E.; Eichenlaub, J.-B.; Samet, M.; Kachouri, A.; Jerbi, K. Learning machines and sleeping brains: Automatic sleep stage classification using decision-tree multi-class support vector machines. J. Neurosci. Methods 2015, 250, 94–105. [Google Scholar] [CrossRef]
- Hassan, A.R.; Bhuiyan, M.I.H. Computer-aided sleep staging using Complete Ensemble Empirical Mode Decomposition with Adaptive Noise and bootstrap aggregating. Biomed. Signal Process. Control 2016, 24, 1–10. [Google Scholar] [CrossRef]
- Xu, K.; Ba, J.; Kiros, R.; Cho, K.; Courville, A.; Salakhudinov, R.; Zemel, R.; Bengio, Y. Show, attend and tell: Neural image caption generation with visual attention. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 2048–2057. [Google Scholar]
- Li, C.; Hou, Y.; Wang, P.; Li, W. Joint Distance Maps Based Action Recognition with Convolutional Neural Networks. IEEE Signal Process. Lett. 2017, 24, 624–628. [Google Scholar] [CrossRef] [Green Version]
- Wang, P.; Li, W.; Gao, Z.; Zhang, Y.; Tang, C.; Ogunbona, P. Scene Flow to Action Map: A New Representation for RGB-D Based Action Recognition with Convolutional Neural Networks. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 595–604. [Google Scholar]
- Yang, B.; Zhu, X.; Liu, Y.; Liu, H. A single-channel EEG based automatic sleep stage classification method leveraging deep one-dimensional convolutional neural network and hidden Markov model. Biomed. Signal Process. Control 2021, 68, 102581. [Google Scholar] [CrossRef]
- Memar, P.; Faradji, F. A Novel Multi-Class EEG-Based Sleep Stage Classification System. IEEE Trans. Neural Syst. Rehabil. Eng. 2017, 26, 84–95. [Google Scholar] [CrossRef] [PubMed]
- Phan, H.; Andreotti, F.; Cooray, N.; Chen, O.Y.; De Vos, M. Automatic Sleep Stage Classification Using Single-Channel EEG: Learning Sequential Features with Attention-Based Recurrent Neural Networks. In Proceedings of the 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Honolulu, HI, USA, 18–21 July 2018; pp. 1452–1455. [Google Scholar]
- Goldberger, A.L.; Amaral, L.A.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.-K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation 2000, 101, e215–e220. [Google Scholar] [CrossRef] [Green Version]
- Kemp, B.; Zwinderman, A.; Tuk, B.; Kamphuisen, H.; Oberye, J. Analysis of a sleep-dependent neuronal feedback loop: The slow-wave microcontinuity of the EEG. IEEE Trans. Biomed. Eng. 2000, 47, 1185–1194. [Google Scholar] [CrossRef]
- Tsinalis, O.; Matthews, P.M.; Guo, Y.; Zafeiriou, S. Automatic Sleep Stage Scoring with Single-Channel EEG Using Convolutional Neural Networks. arXiv 2016, arXiv:1610.01683. [Google Scholar]
- Tsinalis, O.; Matthews, P.M.; Guo, Y. Automatic Sleep Stage Scoring Using Time-Frequency Analysis and Stacked Sparse Autoencoders. Ann. Biomed. Eng. 2016, 44, 1587–1597. [Google Scholar] [CrossRef] [Green Version]
- Phan, H.; Andreotti, F.; Cooray, N.; Chen, O.Y.; De Vos, M. DNN Filter Bank Improves 1-Max Pooling CNN for Single-Channel EEG Automatic Sleep Stage Classification. In Proceedings of the 2018 40th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Honolulu, HI, USA, 18–21 July 2018; pp. 453–456. [Google Scholar]
- Phan, H.; Andreotti, F.; Cooray, N.; Chen, O.Y.; De Vos, M. Joint Classification and Prediction CNN Framework for Automatic Sleep Stage Classification. IEEE Trans. Biomed. Eng. 2018, 66, 1285–1296. [Google Scholar] [CrossRef]
- Zhu, T.; Luo, W.; Yu, F. Convolution- and Attention-Based Neural Network for Automated Sleep Stage Classification. Int. J. Environ. Res. Public Health 2020, 17, 4152. [Google Scholar] [CrossRef]
- Mousavi, S.; Afghah, F.; Acharya, U.R. SleepEEGNet: Automated sleep stage scoring with sequence to sequence deep learning approach. PLoS ONE 2019, 14, e0216456. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Cohen, J. A Coefficient of Agreement for Nominal Scales. Educ. Psychol. Meas. 1960, 20, 37–46. [Google Scholar] [CrossRef]
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
Branch | Layer Type | Number of Filters | Kernel Size | Region Size | Stride | Output Shape |
---|---|---|---|---|---|---|
Input | - | - | - | - | - | (200, 1) |
The CNN | Conv1 | 64 | 1 × 5 | - | 3 | (67, 64) |
Conv2 | 64 | 1 × 5 | - | 3 | (23, 64) | |
Conv3 | 64 | 1 × 5 | - | 3 | (8, 64) | |
Conv4 | 128 | 1 × 3 | - | 2 | (4, 128) | |
Conv5 | 128 | 1 × 3 | - | 2 | (2, 128) | |
Conv6 | 128 | 1 × 3 | - | 1 | (2, 128) | |
Conv7 | 256 | 1 × 3 | - | 1 | (2, 256) | |
Max-pooling | - | - | 1 × 2 | 1 | (1, 256) | |
Input | - | - | - | - | - | (400, 1) |
The Attention | Conv1 | 64 | 1 × 7 | - | 3 | (134, 64) |
Conv2 | 64 | 1 × 7 | - | 3 | (45, 64) | |
Conv3 | 64 | 1 × 7 | - | 3 | (15, 64) | |
Max-pooling | - | - | 1 × 2 | 2 | (8, 64) | |
Conv4 | 128 | 1 × 5 | - | 2 | (4, 128) | |
Conv5 | 128 | 1 × 5 | - | 2 | (2, 128) | |
Conv6 | 128 | 1 × 5 | - | 2 | (1, 128) | |
Conv7 | 256 | 1 × 3 | - | 1 | (1, 256) | |
Conv8 | 256 | 1 × 3 | - | 1 | (1, 256) | |
Conv9 | 256 | 1 × 3 | - | 1 | (1, 256) |
Stage | Sleep-Edfx-2013 | Sleep-Edfx-2018 | ||||
---|---|---|---|---|---|---|
Training Set | Test Set | Total | Training Set | Test Set | Total | |
W | 7734 | 292 | 8026 | 55,697 | 10,023 | 65,720 |
N1 | 2666 | 138 | 2804 | 19,207 | 2315 | 21,522 |
N2 | 16,805 | 994 | 17,799 | 89,789 | 6343 | 96,132 |
N3 | 5449 | 254 | 5703 | 11,879 | 1160 | 13,039 |
REM | 7295 | 422 | 7717 | 23,452 | 2383 | 25,835 |
Total | 39,949 | 2100 | 42,049 | 200,024 | 22,224 | 222,248 |
Sleep-Edfx-2013 | Sleep-Edfx-2018 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
EEG Fpz-Cz (%) | EEG Pz-Oz (%) | EEG Fpz-Cz (%) | EEG Pz-Oz (%) | |||||||||
Pre | Rec | F1 | Pre | Rec | F1 | Pre | Rec | F1 | Pre | Rec | F1 | |
W | 88.86 | 90.28 | 89.56 | 89.56 | 89.44 | 89.50 | 92.56 | 91.67 | 92.12 | 89.24 | 90.67 | 89.95 |
N1 | 55.59 | 40.87 | 47.11 | 51.98 | 41.93 | 46.42 | 46.10 | 41.61 | 43.74 | 45.79 | 34.33 | 39.24 |
N2 | 86.24 | 88.21 | 87.22 | 84.63 | 87.10 | 85.84 | 81.71 | 84.90 | 83.28 | 78.52 | 83.79 | 81.07 |
N3 | 86.57 | 83.47 | 84.50 | 82.55 | 79.38 | 80.94 | 77.25 | 76.66 | 76.96 | 71.18 | 65.20 | 68.06 |
REM | 80.05 | 84.30 | 82.12 | 79.45 | 82.09 | 80.75 | 76.51 | 76.89 | 76.70 | 71.01 | 73.16 | 72.07 |
Overall Indicators | ACC | K | MF1 | ACC | K | MF1 | ACC | K | MF1 | ACC | K | MF1 |
84.14 | 78.09 | 78.20 | 82.58 | 75.97 | 76.69 | 80.81 | 73.51 | 74.56 | 78.01 | 69.45 | 70.08 |
Approach | Overall Performance (%) | Per-Class F1-Score (%) | ||||||
---|---|---|---|---|---|---|---|---|
ACC | MF1 | K | W | N1 | N2 | N3 | REM | |
Dataset: Sleep-Edfx-2013 EEG Channel: Fpz-Cz | ||||||||
Tsinalis et al. [32] | 74.8 | 69.8 | - | 65.4 | 43.7 | 80.6 | 84.9 | 74.5 |
Tsinalis et al. [33] | 78.9 | 73.7 | - | 71.6 | 47.0 | 84.6 | 84.0 | 81.4 |
Supratak et al. [20] | 82.0 | 76.9 | 0.76 | 84.7 | 46.6 | 85.9 | 84.8 | 82.4 |
Phan et al. [29] | 79.1 | 69.8 | 0.70 | 75.5 | 27.3 | 86.0 | 85.6 | 74.8 |
Phan et al. [34] | 79.8 | 72.0 | 0.72 | 77.0 | 33.3 | 86.8 | 86.3 | 76.4 |
Phan et al. [35] | 81.9 | 73.8 | 0.74 | - | - | - | - | - |
Zhu et al. [36] | 82.8 | 77.8 | - | 90.3 | 47.1 | 86.0 | 82.1 | 83.2 |
Yang et al. [27] | 82.13 | 73.5 | 0.75 | 87.8 | 23.0 | 86.2 | 90.9 | 81.8 |
CAttSleepNet | 84.1 | 78.2 | 0.78 | 89.6 | 47.1 | 87.2 | 85.0 | 82.1 |
Dataset: Sleep-Edfx-2013 EEG Channel: Pz-Oz | ||||||||
Supratak et al. [20] | 79.8 | 73.1 | 0.72 | 88.1 | 37 | 82.7 | 77.3 | 80.3 |
Yang et al. [27] | 80.54 | 68.7 | 0.72 | 85.3 | 17.5 | 85.0 | 78.2 | 75.8 |
CAttSleepNet | 82.58 | 76.69 | 0.76 | 89.5 | 46.4 | 85.8 | 80.9 | 80.8 |
Dataset: Sleep-Edfx-2018 EEG Channel: Fpz-Cz | ||||||||
Mousavi et al. [37] | 80.03 | 73.55 | 0.73 | 91.72 | 44.05 | 82.49 | 73.45 | 76.06 |
CAttSleepNet | 80.81 | 74.56 | 0.74 | 92.12 | 43.74 | 83.28 | 76.96 | 76.70 |
Dataset: Sleep-Edfx-2018 EEG Channel: Pz-Oz | ||||||||
Mousavi et al. [37] | 77.56 | 70.00 | 0.69 | - | - | - | - | - |
CAttSleepNet | 78.01 | 70.08 | 0.69 | 89.95 | 39.24 | 81.07 | 68.06 | 72.07 |
CAttSleepNet (%) | CAttSleepNet without Attention (%) | |||||
---|---|---|---|---|---|---|
Pre | Rec | F1 | Pre | Rec | F1 | |
W | 88.86 | 90.28 | 89.56 | 83.13 | 83.13 | 83.14 |
N1 | 55.59 | 40.87 | 47.11 | 48.63 | 40.09 | 43.95 |
N2 | 86.24 | 88.21 | 87.22 | 90.05 | 88.20 | 89.57 |
N3 | 86.57 | 83.47 | 84.50 | 78.07 | 78.92 | 78.49 |
REM | 80.05 | 84.30 | 82.12 | 75.58 | 87.64 | 81.87 |
Overall Indicators | ACC | K | MF1 | ACC | K | MF1 |
84.14 | 78.09 | 78.20 | 81.95 | 74.50 | 75.26 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, T.; Zhang, B.; Lv, H.; Hu, S.; Xu, Z.; Tuergong, Y. CAttSleepNet: Automatic End-to-End Sleep Staging Using Attention-Based Deep Neural Networks on Single-Channel EEG. Int. J. Environ. Res. Public Health 2022, 19, 5199. https://doi.org/10.3390/ijerph19095199
Li T, Zhang B, Lv H, Hu S, Xu Z, Tuergong Y. 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. 2022; 19(9):5199. https://doi.org/10.3390/ijerph19095199
Chicago/Turabian StyleLi, Tingting, Bofeng Zhang, Hehe Lv, Shengxiang Hu, Zhikang Xu, and Yierxiati Tuergong. 2022. "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 19, no. 9: 5199. https://doi.org/10.3390/ijerph19095199
APA StyleLi, T., Zhang, B., Lv, H., Hu, S., Xu, Z., & Tuergong, Y. (2022). 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, 19(9), 5199. https://doi.org/10.3390/ijerph19095199