Sleep Stage Algorithm Based on Brain-Computer Interface:

Sleep staging is a focal area in sleep activity research. With sleep staging, the process of an individual's sleep becomes clearly discernible. Calculating sleep quality metrics such as duration of deep sleep, total sleep time, and sleep efficiency becomes straightforward. Sleep staging is a helpful adjunct in assessing sleep quality. Below is a typical sleep stage chart:

Hypnus, utilizing artificial intelligence technology, has designed a unique automatic sleep staging algorithm to accurately assess users' sleep quality. The algorithm first uses Fourier transforms to extract frequency spectrum characteristics of the EEG signals, including edge frequencies. It then calculates statistical characteristics, such as mean and standard deviation, forming a feature vector. The core parts of the algorithm are as follows:

1. Feature extraction based on frequency domain analysis and statistical calculations:

First, Fourier transforms are used to extract spectral features from the EEG signals, including the power spectral density of the major frequency bands (such as alpha and beta waves) closely associated with human sleep states. Then, statistical features like the mean and standard deviation are calculated, providing additional information on waveform variations.

2. Classification based on Support Vector Machine (SVM):

The extracted features are used as inputs, with SVM as the classifier to categorize different sleep stages. SVM is a supervised learning method effective in handling high-dimensional data and maintaining good generalization capability even with small sample sizes. Model parameters are optimized using cross-validation, and the algorithm's classification performance is evaluated. Cross-validation is a statistical analysis method that involves dividing the data set repeatedly for training and validation processes to ensure the model's generalization ability.

3. Algorithm evaluation:

The algorithm is tested using public sleep data sets, with average accuracy and Kappa coefficient as the evaluation metrics. Average accuracy provides the proportion of correctly classified instances, while the Kappa coefficient is a robust measure of classification accuracy, considering the chance of random classification.

The classification performance of the algorithm has been cross-validated using public data sets, and the feature extraction and cross-validation have been tested, achieving an average accuracy of 92% and a Kappa coefficient of 0.91. These results demonstrate the algorithm's high accuracy and reliability in sleep staging, thus accurately collecting data through our wearable devices and assessing users' sleep quality.

Last updated