Sleep Stage Classification Using a Pre-trained Deep Learning Model

Hassan Ardeshir,Mohammad Araghi
2023-10-06
Abstract:One of the common human diseases is sleep disorders. The classification of sleep stages plays a fundamental role in diagnosing sleep disorders, monitoring treatment effectiveness, and understanding the relationship between sleep stages and various health conditions. A precise and efficient classification of these stages can significantly enhance our understanding of sleep-related phenomena and ultimately lead to improved health outcomes and disease treatment. Models others propose are often time-consuming and lack sufficient accuracy, especially in stage N1. The main objective of this research is to present a machine-learning model called "EEGMobile". This model utilizes pre-trained models and learns from electroencephalogram (EEG) spectrograms of brain signals. The model achieved an accuracy of 86.97% on a publicly available dataset named "Sleep-EDF20", outperforming other models proposed by different researchers. Moreover, it recorded an accuracy of 56.4% in stage N1, which is better than other models. These findings demonstrate that this model has the potential to achieve better results for the treatment of this disease.
Signal Processing,Machine Learning
What problem does this paper attempt to address?
### Problems the paper attempts to solve This paper aims to solve a key problem in the diagnosis of sleep disorders: **sleep stage classification**. Specifically, the goal of the research is to develop an efficient and accurate machine - learning model for identifying different sleep stages from electroencephalogram (EEG) signals. The accurate classification of these sleep stages is crucial for diagnosing sleep disorders, monitoring the effectiveness of treatment, and understanding the relationship between sleep stages and various health conditions. ### Background and motivation - **Importance of sleep**: Sleep is one of the basic human functions, accounting for about one - third of our lifetime. Good sleep helps enhance learning and memory abilities, improve problem - solving abilities and creativity. Chronic sleep deprivation may lead to multiple psychological problems such as cognitive impairment, stress, and depression, and may also increase various risks to physical health such as obesity, diabetes, hypertension, cancer, and cardiovascular diseases. - **Sleep stages**: Sleep is divided into two main categories: rapid eye movement (REM) and non - rapid eye movement (NREM), where NREM is further subdivided into three stages: N1, N2, and N3. Each sleep cycle usually contains these stages, but some cycles may not contain all of them. - **Limitations of existing methods**: Existing sleep stage classification models are often time - consuming and lack sufficient accuracy, especially in the classification of the N1 stage. ### Research objectives - **Propose the "EEGMobile" model**: This model utilizes a pre - trained deep - learning model and learns from the spectrogram of electroencephalogram (EEG) signals. - **Improve classification accuracy**: On the public dataset "Sleep - EDF20", this model achieved an overall accuracy of 86.97%, outperforming models proposed by other researchers. In particular, in the N1 stage, the accuracy of this model reached 56.4%, also outperforming other models. ### Methods and techniques - **Dataset**: The "Sleep - EDF20" dataset was used, which contains polysomnography (PSG) data of 20 healthy individuals, with a total of 42,308 30 - second data samples. - **Pre - processing**: The EEG signals were converted into spectrograms, calculated using Python's `scipy` library. The generation parameters of the spectrogram include sampling frequency (100 Hz), signal length per segment (30 seconds), number of overlapping points (16), FFT length (1,024), etc. - **Model architecture**: Based on the pre - trained MobileNetV3Large model, a new model "EEGMobile" was constructed by adding a global average pooling layer, a fully - connected layer, and a softmax activation function. The final output of the model corresponds to five sleep stages (awake, N1, N2, N3, REM). - **Training strategy**: 20 - fold cross - validation was used for training. In each fold, the data of one individual was used as the validation set, and the data of the remaining 19 individuals was used as the training set. During the training process, the entire network was trained in the first 5 epochs, and only the last 15 layers were trained in the subsequent 15 epochs to accelerate the training process. ### Results and discussion - **Performance comparison**: Compared with existing models (such as DeepSleepNet, TinySleepNet, EEGSNet), EEGMobile performs well in terms of overall accuracy, F1 score per class, etc., especially in the classification of the N1 stage. - **Training efficiency**: By using different storage media (HDD, SSD, RAM) for data reading, the experimental results show that storing data in RAM can significantly improve the training speed. Each epoch only takes 1 minute, and the entire training process is completed within 400 minutes. ### Conclusion The EEGMobile model proposed in this study performs well in the sleep stage classification task. It not only outperforms existing models in terms of accuracy but also has a significant advantage in training efficiency. Future research can be further extended to other datasets (such as Sleep - EDF8, Sleep - EDF78, SHHS) to verify the generalization ability and stability of the model. In addition, increasing the number of training iterations may also further improve the performance of the model.