Automatic Sleep Stage Classification
Automatic Sleep
Stage Classification
Team Project @ EE4057 Biomedical Engineering Lab
Team Project @ EE4057
Biomedical Engineering Lab
Develop an mobile alarm application
to monitor our sleep quality
Sleep plays a crucial part in our daily life and people concern about their sleep quality nowadays. In this project, we aimed to monitor our electroencephalogram (EEG) signal to determine our sleep stage. After that, we design a mobile alarm application to wake us up on right time. The whole project is divided into several subtasks, in which the implemented techniques are listed below. Also, the introduction and demo video is shown above on Figure 1.
1. Data Acquisition and Preprocessing
We use Physionet SleepEDF database, which we only use the subjects without insomnia. After that, we use EDF browser to visualize our EEG signal amplitude and remove the artifacts. Also, we applied filters to smooth the data and normalized to reduce the variance of difference subjects.
2. Traditional Learning
First, we implement feature extraction including time, frequency, time-frequency, and entropy analysis. After then, we used XGBoost as our training model, which we can select features by importance and analye their characteristic. In this technique, we got 83.5% accuracy score.
3. Deep Learning
For deep learning technique, we use convolutional neural network (CNN) to solve EEG signal classification problem. While the convolutional layers learn the feature extraction part, the fully connected layer learn the classification part. In this technique, we got 86% accuracy score.
4. Application - Alarm Clock
We used mindWave mobile to monitor our EEG signal and transmitted the data to our computer by bluetooth. After that, we inferenced and got our sleep stage in our local computer and upload classification results to Google Cloud Platform. Finally, the application on user's phone will get the results from cloud platform and display on the screen, which the alarm clock will go off at right time.
For more information, please refer to our report (in Chinese). Our code is also publically available on GitHub.