Sleep stage classification method, system and wearable apparatus

By aligning the improved DeepSleepNet model with data from a polysomnography system, the problem of low accuracy in sleep stage classification in existing technologies is solved, achieving high-accuracy sleep stage classification suitable for wearable devices.

WO2026137982A1PCT designated stage Publication Date: 2026-07-02GUANGDONG HYPNUSE BIOTECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GUANGDONG HYPNUSE BIOTECHNOLOGY CO LTD
Filing Date
2025-09-09
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

Existing sleep stage classification methods are not accurate enough and lack contact-based sleep stage classification devices with a good user experience.

Method used

A basic model for sleep stage classification was constructed using the DeepSleepNet model. Data was aligned with a polysomnography system using a self-made auxiliary device for pre-training and fine-tuning. Combined with multi-channel input of sensor data, end-to-end sleep stage classification was achieved.

Benefits of technology

It improves the accuracy of sleep stage classification to 86.4%, which is 11 percentage points higher than traditional methods, and is easy to apply to wearable devices, providing a better user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025119927_02072026_PF_FP_ABST
    Figure CN2025119927_02072026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of sleep monitoring. Specifically disclosed are a sleep stage classification method, system and wearable apparatus. The method comprises: collecting sleep stage data of a subject and performing classification label mapping to obtain an experimental dataset; constructing a basic sleep stage classification model on the basis of a DeepSleepNet model; using a public dataset to pre-train the basic sleep stage classification model, so as to obtain a pre-trained sleep stage classification model; and using the experimental dataset to fine-tune and test the pre-trained sleep stage classification model, so as to obtain a sleep stage classification model. The wearable apparatus is provided with an inner layer, an outer layer, and a sensor assembly, a mainboard assembly and a display and button assembly, which are embedded between the inner layer and the outer layer, so as to apply the sleep stage classification model. The present invention uses less input data, has relatively high classification accuracy, is easily applicable to a wearable apparatus, and has relatively good use experience.
Need to check novelty before this filing date? Find Prior Art

Description

A method, system and wearable device for classifying sleep stages Technical Field

[0001] This invention relates to the field of sleep monitoring technology, and in particular to a method, system and wearable device for classifying sleep stages. Background Technology

[0002] Traditional sleep stage classification research mainly includes three processes: data preprocessing, feature extraction, and classifier classification. Traditional classification methods, such as the K-means algorithm and Support Vector Machine (SVM), rely on manual filtering and feature extraction of signals, which is highly subjective and has weak generalization ability. Recently, with the innovation of computer hardware, big data technology, and deep learning technology, natural language processing technology based on various large corpora and image recognition technology based on large image databases have made significant progress, and their applications in the field of sleep have gradually increased. Convolutional Neural Networks (CNNs) were first used to study sleep stage classification, automatically extracting features without relying on manual intervention and achieving end-to-end automatic sleep stage classification, but the classification effect was still inferior to traditional methods of the same period. Given the advantages of Recurrent Neural Networks (RNNs) in time series signal processing, they were introduced into the CNN model, effectively improving the classification effect of sleep models. While the introduction of deep learning models effectively avoided the subjectivity of feature selection, the application effect was not ideal due to the imbalanced small datasets of the original sleep datasets.

[0003] Sleep monitoring systems can be broadly categorized into two types: non-contact systems, such as those based on microwave radar, and contact systems, such as polysomnography (PSG). Microwave radar-based systems offer unobtrusive monitoring, but their accuracy is limited due to interference from clothing and bedding, and incomplete data collection. PSG, considered the "gold standard" for diagnosing sleep disorders, typically requires participants to undergo monitoring of their sleep activities over multiple nights at a qualified hospital. The numerous electrodes and complex connections can cause psychological stress and physical discomfort, potentially making it harder for participants to fall asleep. Technical issues

[0004] This invention provides a method, system, and wearable device for classifying sleep stages. The technical problem it solves is that the accuracy of existing sleep stage classification methods is still not high enough, and there is a lack of a contact-type sleep stage classification device with high classification accuracy and a good user experience. Technical solutions

[0005] To address the above technical problems, this invention provides a method for classifying sleep stages, comprising the following steps:

[0006] S1. By collecting sleep stage data from the subjects and mapping the data with classification labels, the experimental dataset was obtained.

[0007] S2. Construct a basic model for sleep stage classification based on the DeepSleepNet model. The number of input channels of the basic model for sleep stage classification is equal to the number of data types in the experimental dataset.

[0008] S3. The sleep stage classification base model is pre-trained using a public dataset to obtain a sleep stage classification pre-trained model.

[0009] S4. Fine-tune and test the sleep stage classification pre-trained model using the experimental dataset to obtain the sleep stage classification model.

[0010] S5. Real-time acquisition of user's sleep stage data is input into the sleep stage classification model, and the sleep stage classification model outputs the corresponding classification result.

[0011] Further, step S1 specifically includes:

[0012] The sensor was fixed to the subject, and the polysomnography system was connected to the corresponding part of the subject's body;

[0013] Data was collected simultaneously from sensors and a polysomnography system during the subjects' sleep.

[0014] Using the automatic sleep stage determination function of the polysomnography system, the data of the user is classified at preset time intervals.

[0015] Correct the classification results output by the polysomnography system;

[0016] The corrected classification results are mapped to the collected sensor data and used as the classification labels for the sensor data to obtain the experimental dataset.

[0017] Furthermore, in step S2, the improvement of the sleep stage classification base model compared to the DeepSleepNet model lies in:

[0018] The CNN structure for representation learning of the DeepSleepNet model is expanded from a single channel to a multi-channel structure with the same number of channels as the sensor data.

[0019] After passing the multi-channel input signals through convolution and pooling operations, the resulting features are summed and then input into the sequence residual learning of the DeepSleepNet model.

[0020] The input signals for the multi-channel system use multiple signals within the same time period.

[0021] Furthermore, in step S4, before fine-tuning and testing the sleep stage classification pre-trained model using the experimental dataset, the structure of the first convolutional layer of each input channel of the sleep stage classification pre-trained model is modified to correspond to the sampling rate of the experimental dataset; during the fine-tuning process, the first convolutional layer of each input channel is randomly assigned as the initial value of the parameters, while the remaining parts are trained directly using the parameter values ​​of the pre-trained sleep stage classification pre-trained model as the initial values.

[0022] Furthermore, in step S3, the loss function used in pre-training the sleep stage classification model is the cross-entropy loss function.

[0023] Furthermore, in step S4, the loss function used to fine-tune the sleep stage classification pre-training model is the cross-entropy loss function.

[0024] Furthermore, the sensor is worn and fixed to the forehead of the subject or user, and the sensor collects two data streams of red light and infrared light related to heart rate; in step S1, the mapped classification labels include wakefulness, light sleep stage 1, light sleep stage 2, deep sleep, and REM sleep.

[0025] The present invention also provides a sleep stage classification system, the key of which is that it includes an experimental unit, a model building unit, a model pre-training unit, a model fine-tuning and testing unit, and a model application unit. The experimental unit, the model building unit, the model pre-training unit, the model fine-tuning and testing unit, and the model application unit are respectively used to execute steps S1 to S5 in the sleep stage classification method.

[0026] Preferably, the model building unit, the model pre-training unit, and the model fine-tuning and testing unit are intelligent devices that include processors capable of performing model building, pre-training, model fine-tuning, and testing respectively.

[0027] The model application unit is an intelligent module capable of carrying and running the sleep stage classification model.

[0028] This invention also provides a wearable device for sleep stage classification, the key features of which are: an inner layer, an outer layer, and a sensor assembly, a motherboard assembly, and a display and button assembly embedded between the inner and outer layers; both the inner and outer layers are made of flexible materials adapted to the user's monitoring area; the sensor assembly sends the collected user data to the motherboard assembly, the motherboard assembly inputs the user data into a sleep stage classification model generated by the aforementioned sleep stage classification method, and the sleep stage classification model sends the classification results of each stage to the display and button assembly for display. Beneficial effects

[0029] This invention provides a sleep stage classification method, system, and wearable device. It obtains an experimental dataset by collecting sleep stage data from subjects and mapping it to classification labels; constructs a basic sleep stage classification model based on the DeepSleepNet model; pre-trains the basic sleep stage classification model using a public dataset to obtain a pre-trained sleep stage classification model; and fine-tunes and tests the pre-trained sleep stage classification model using the experimental dataset to obtain the final sleep stage classification model. The outstanding contribution of this invention is:

[0030] 1. By aligning the self-made auxiliary device with a professional polysomnography device, it is easy to collect sensor sequence data and accurate label pairs during the sleep stages of the subjects, thus providing a data foundation for subsequent supervised model training.

[0031] 2. An improved DeepSleepNet model was proposed to meet the needs of multi-channel sensors. At the same time, considering the limited amount of self-collected experimental data, it was proposed to pre-train the model using a large public sleep dataset and then fine-tune the model using a small experimental dataset. The resulting sleep stage classification accuracy reached 86.4%, which is more than 11 percentage points higher than the traditional SVM model.

[0032] 3. When applying the sleep stage classification model, less input data is required, the classification accuracy is high, it is easy to apply to wearable devices, and the user experience is good. Attached Figure Description

[0033] Figure 1 is a flowchart of a sleep stage classification method provided in an embodiment of the present invention;

[0034] Figure 2 is a flowchart of obtaining experimental datasets provided in an embodiment of the present invention;

[0035] Figure 3 is a data example diagram of the polysomnography device and the self-made auxiliary device provided in the embodiment of the present invention;

[0036] Figure 4 is a research framework diagram of sleep stage classification provided in an embodiment of the present invention;

[0037] Figure 5 is a comparison diagram of the framework of the DeepSleepNet model and the improved model provided in the embodiments of the present invention;

[0038] Figure 6 is a schematic diagram of the first layer adjustment of the sleep stage classification pre-training model provided in an embodiment of the present invention;

[0039] Figure 7 is a diagram of training and testing results provided in an embodiment of the present invention;

[0040] Figure 8 is a flowchart of the processing based on the SVM model provided in an embodiment of the present invention;

[0041] Figure 9 is a diagram of the MAX30102 sensor data filtering process within 30 seconds provided in an embodiment of the present invention;

[0042] Figure 10 is a peak point diagram of the MAX30102 sensor data within 30 seconds provided in the embodiment of the present invention;

[0043] Figure 11 is an exploded view of a sleep stage classification wearable device provided in an embodiment of the present invention.

[0044] Reference numerals: 1-Inner layer, 2-Outer layer, 3-Sensor assembly, 4-Battery assembly, 5-Main board assembly, 6-Display and button assembly, 7-Magnetic charging port. Embodiments of the present invention

[0045] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The embodiments are given for illustrative purposes only and should not be construed as limiting the present invention. The accompanying drawings are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.

[0046] An embodiment of the present invention provides a sleep stage classification method, as shown in Figure 1, comprising the following steps:

[0047] S1. By collecting sleep stage data from the subjects and mapping the data with classification labels, the experimental dataset was obtained.

[0048] S2. Construct a basic model for sleep stage classification based on the DeepSleepNet model. The number of input channels of the basic model for sleep stage classification is equal to the number of data types in the experimental dataset.

[0049] S3. Use public datasets to pre-train the basic model for sleep stage classification to obtain a pre-trained model for sleep stage classification.

[0050] S4. Fine-tune and test the sleep stage classification pre-trained model using experimental datasets to obtain the sleep stage classification model.

[0051] S5. Real-time acquisition of user sleep stage data is input into the sleep stage classification model, and the sleep stage classification model outputs the corresponding classification results.

[0052] In step S1, appropriate sensors are generally used to acquire physiological signals of the subject during sleep, obtaining sleep stage data. In this embodiment, the subject's sleep stage data includes at least two types of data (which can be acquired using the same or different sensors), and to ensure a good user experience, the number of data types does not exceed five. This embodiment uses the acquisition of red light and infrared data (heart rate signals) at preset time intervals (30 seconds in this example) using a MAX30102 sensor as an example. To correctly label each segment of dual-channel data acquired from the red light and infrared light sources, this embodiment also uses a polysomnography (PSG) system for classification detection during the acquisition of dual-channel data. This aligns the acquired red light and infrared light data with the data acquired by the PSG system in time, and uses the classification results of the PSG system to label each segment of dual-channel data, thus obtaining a labeled dual-channel dataset, i.e., the experimental dataset.

[0053] More specifically, to collect data for training and testing the sleep stage classification model, this embodiment designed the experimental scheme shown in Figure 2. A simple auxiliary device was self-made, mainly composed of a MAX30102 sensor and an STM32F407, used to collect data from both red light and infrared sources. The benchmark polysomnography (PSG) system, i.e., the Philips Alice 6 LDxS, covers 63 channels including EEG, EMG, EEG, ECG, and body position. The environment was relatively quiet, and the subjects slept in bed all night during the experiment. The sensors of the polysomnography system were connected to the corresponding parts of the subjects' bodies according to the guidance of a professional doctor, and the sensors of the self-made auxiliary device were fixed to the forehead of the subjects in a head-mounted form. There were three data flow paths: from the subject to the polysomnography system, from the subject to the self-made auxiliary device, and from the self-made auxiliary device to the polysomnography system. The last one was used to align the data from the first two in time. In addition, a camera was installed in the experimental environment to track abnormal sleep patterns of the subjects.

[0054] This embodiment selected 20 participants aged 30-50 (male to female ratio 3:2) for a sleep experiment. More than half of these participants had varying degrees of sleep disorders. Each participant completed a full night's sleep experiment according to the aforementioned sleep protocol. Some data are shown in Figure 3, where (a) is a screenshot of data from a polysomnography device and (b) is a screenshot of data from a self-made auxiliary device, containing data from the red and infrared channels of the MAX30102 sensor. A total of 16,956 valid data segments were collected in 30-second intervals.

[0055] After collecting the data, data calibration is completed in the following three steps:

[0056] (1) Automatic classification. Using the automatic sleep stage determination function provided by Philips Alice 6 LDxS, the collected data is divided into three stages: wakefulness, light sleep stage 1, light sleep stage 2, deep sleep, or REM sleep stage, in 30-second increments.

[0057] (2) Professional correction. The results of automatic classification are corrected by a professional physician based on the channel data curves collected by the Philips Alice 6 LDxS.

[0058] (3) Label mapping. The corrected classification results are mapped to the data collected by the self-made auxiliary device according to the time period, and used as its classification label. The data pairs are in the form of (sequence MAX30102 data in 30s units, classification label), which serve as the raw data for subsequent model training and testing.

[0059] This example uses the framework shown in Figure 4 to study a sleep stage classification method based on the MAX30102 sensor, distinguishing three different stages: supervised pre-training (steps S2 and S3), fine-tuning and testing (step S4), and comparison with traditional methods (to verify the effect).

[0060] Although step S1 yielded nearly 17,000 pairs of labeled data through experiments, this is insufficient to train a highly accurate deep learning model. Therefore, it is necessary to leverage publicly available sleep datasets. Among numerous public datasets, those utilizing the MAX30102 sensor channels are almost nonexistent. Therefore, this embodiment selects the MASS dataset, which has multiple channels including EEG and ECG and already has pre-defined classification labels, for supervised pre-training. The pre-trained model is an improvement upon the published DeepSleepNet model (the improved DeepSleepNet model, the basic model for sleep stage classification) to accommodate the 2-channel data input requirements of the MAX30102 sensor.

[0061] In the fine-tuning and testing phase of step S4, the aforementioned experimental dataset is divided into two parts proportionally: a training set and a test set. The former is used to train and select the model, while the latter is used to evaluate the performance of the selected model. Since the sampling rate of the experimental data differs from that of the MASS dataset, the improved DeepSleepNet model was further adjusted. For the model structure adjustment, random values ​​were assigned as initial parameter values, while the remaining parts were trained using pre-trained model parameter values ​​as initial values.

[0062] When comparing with traditional methods, the experimental data were filtered, feature extracted, outlier removed and feature selected in sequence. Then, the support vector machine (SVM) model was used to classify the sleep stage, and the results were finally compared to draw conclusions.

[0063] In the supervised pre-training phase of step S2, the pre-training dataset used is the MASS dataset. The MASS dataset includes PSG records of 200 subjects from different sleep laboratories. The PSG records include EEG, EOG, EMG, ECG, and respiratory signals, and the sampling frequency is 256Hz. The annotation of the MASS dataset was completed by sleep experts based on the AASM standard (subsets of SS1 and SS3) or the R&K standard (subsets of SS2, SS4, and SS5).

[0064] Figure 5 shows a comparison between the DeepSleepNet model and the improved DeepSleepNet model in this example. The DeepSleepNet model is an automatic sleep stage classification model based on the original single-channel EEG, completely independent of manual intervention. The overall framework of the model is shown in Figure 5(a). The DeepSleepNet model consists of two parts: the first part is representation learning, which is used for filtering to extract time-invariant features from the original single-channel EEG signal; the second part is sequence residual learning, which is used to train and encode temporal information, discovering sleep stage classification rules from the features automatically extracted from a sequence of EEG signals in the first part.

[0065] Specifically, the first part of the DeepSleepNet model uses two CNN structures: a smaller CNN structure to capture temporal information and a larger one to capture frequency domain information. Each CNN structure consists of four convolutional layers (conv) and two max-pooling layers. Each convolutional layer performs three operations in sequence: one-dimensional convolution, batch normalization, and the ReLU activation function. Each pooling layer uses max-pooling to downsample the input. In particular, the specification of the first convolutional layer in each structure depends on the sampling rate Fs of the EEG data. The second part of the DeepSleepNet model includes a bidirectional LSTM (Long-Short Term Memory) structure and a shortcut connection structure. The bidirectional LSTM extends the LSTM by processing the forward and backward input sequences separately using two LSTMs. The shortcut connection reconstructs this part into a residual function for computation, allowing the model to incorporate features extracted from the CNN in the first part—the temporal information previously learned from the input sequence—while minimizing the gradient vanishing problem during training.

[0066] Since the data acquired by the MAX30102 sensor has two channels, the single-channel DeepSleepNet model is not convenient for subsequent applications. This embodiment improves the DeepSleepNet model, as shown in Figure 5(b). The improvements are threefold: first, the CNN structure of the first part of the original DeepSleepNet model is expanded from a single channel to two channels; second, after convolution and pooling operations on the two-channel input signals, the resulting features are summed before being input into the second part; and third, the two-channel inputs use EEG and ECG signals from the same time period, respectively.

[0067] Table 1 shows the prediction results and performance metrics of 20-fold cross-validation on the MASS dataset. The loss function used is the cross-entropy loss function, where W, N1, N2, N3, and REM represent the wakefulness stage, light sleep stage 1, light sleep stage 2, deep sleep stage, and REM stage, respectively. In Table 1, the row for N1 indicates that when the actual label is N1, the number of records predicted as W, N1, N2, N3, and REM are 433, 2931, 735, 8, and 617, respectively. The other rows have similar meanings. From the performance metric (F1 score), N1 has the worst prediction performance, with an F1 score of only 62.2, while the metrics for other stages are significantly better, ranging between 80.9 and 90.1.

[0068]

[0069] The sampling rate of the MASS dataset is 256Hz, while the sampling rate of the experimental data is 32Hz. Therefore, in the fine-tuning stage, in addition to changing the 2-channel input to red light and infrared light, the structure of the first convolutional layer of the model also needs to be adjusted, as shown in Figure 6, to make it correspond to the sampling rate of the experimental data. Here, 30-s RED epoch represents the red light batch data, and 30-s IR epoch represents the infrared batch data. The improvement of the first convolutional layer is that the size of the two convolutional kernels is changed from 128 and 1024 to 16 and 128, respectively, and the stride is changed from 16 and 128 to 2 and 16, respectively, to adapt to the sampling rate of the experimental data.

[0070] The experimental dataset was roughly divided as follows: 10% of the data was used for testing, and 90% was used for training. Training employed 10-fold cross-validation, using the cross-entropy loss function. For the first convolutional layer in the model structure adjustment, random values ​​were assigned as initial parameters, while the remaining layers used pre-trained model parameter values ​​as initial values ​​for training.

[0071] After 200 rounds of training and testing, the results shown in Figure 7 were obtained. Figure 7(a) shows the change curve of the training loss function, and the average loss value eventually dropped to about 0.35. Figure 7(b) shows the change curve of the test accuracy, which can reach 86.4%.

[0072] The sleep stage classification model will be compared with traditional methods below.

[0073] The traditional method based on Support Vector Machine (SVM), as shown in the flowchart in Figure 8, can be summarized into five steps: filtering, feature extraction, outlier removal, feature selection, and SVM model training.

[0074] (1) Filtering

[0075] In wearable devices, the fit may not be very secure. During breathing or body movement, the sensor may experience slight displacement, or even occasionally become suspended, resulting in significant noise in the collected data. To reduce the impact of this noise, this embodiment processes the MAX30102 sensor data every 30 seconds using median filtering, mean filtering, wavelet decomposition and reconstruction, and FIR filtering sequentially. Figure 9 shows the sequential filtering process for a set of data. The median and mean filtering windows are both 9, the wavelet filtering uses coefficients "db7" for 3-level decomposition and reconstruction, and the FIR filter is a 30th-order bandpass filter.

[0076] (2) Feature extraction

[0077] Before calculating the feature values ​​of the MAX30102 sensor data within 30 seconds, it is necessary to determine the peak-to-peak points based on the aforementioned filtering. Figure 10 shows the peak points of the filtered data. The principle is to find the peaks by searching for local maxima in the sequence data, and then compare the distance between adjacent peaks with the minimum distance (set to 10 sampling times in this example). If the distance is less than the minimum distance, only the highest peak is retained.

[0078] Based on the determined peak points, the pulse interval sequence (PPI) can be calculated, which is the time difference between adjacent peak points. Based on the PPI, this embodiment extracts 20 feature values, as shown in Table 2, where vPPI represents the difference sequence between adjacent PPIs.

[0079]

[0080] (3) Outlier removal

[0081] The original data pairs, such as (sequence MAX30102 data in 30-second units, classification labels), were processed using the aforementioned feature extraction method to obtain feature data pairs, such as (20 feature values ​​in 30-second units, classification labels). These feature data pairs were then categorized into five classes according to their classification labels: wakefulness, light sleep stage 1, light sleep stage 2, deep sleep, and REM sleep. For each class, the Isolation Forest algorithm was used to quickly detect and remove outliers. A total of 1134 data pairs were removed across the five classes, leaving 15822 pairs.

[0082] (4) Feature selection

[0083] To identify the most important features from the extracted 20 features and avoid importing all features into the model for training, a recursive feature elimination (RFE) method is used to recursively reduce the number of features with lower weights until the number of features reaches a preset value. The specific steps are as follows: 1. Randomly shuffle the remaining 15822 data pairs; 2. Perform Z-score standardization on these data pairs; 3. Recursively select features using RFE, with the base model being a support vector machine. The preset number of features to select is 10, and the selection results are shown in Table 3. Thus, the dataset for training and validating the subsequent model consists of 15822 data pairs in the form of (10 feature values ​​per 30-second interval, classification label).

[0084]

[0085] (5) SVM model training

[0086] In this embodiment, 10 pairwise classification SVM models were trained. The training and testing accuracy are shown in Tables 4 and 5. It is easy to see that, except for two or three models that exceed 80%, the accuracy of the rest is generally not high. By comparing Table 5 and Figure 7(b), it can be concluded that although the improved DeepSleepNet model has higher computational complexity than SVM, the former has two main advantages: first, it automatically filters and extracts features without manual intervention; second, it has higher accuracy, exceeding the results of SVM by more than 11 percentage points.

[0087]

[0088]

[0089] In summary, the sleep stage classification method provided by this invention involves collecting sleep stage data from subjects and mapping it to classification labels to obtain an experimental dataset; constructing a basic sleep stage classification model based on the DeepSleepNet model; pre-training the basic sleep stage classification model using a public dataset to obtain a sleep stage classification pre-trained model; and fine-tuning and testing the sleep stage classification pre-trained model using the experimental dataset to obtain the sleep stage classification model. The significant contribution of this method is:

[0090] 1. By aligning the self-made auxiliary device with a professional polysomnography device, it is easy to collect sensor sequence data and accurate label pairs during the sleep stages of the subjects, thus providing a data foundation for subsequent supervised model training.

[0091] 2. An improved DeepSleepNet model was proposed to meet the requirements of a 2-channel sensor. At the same time, considering the limited amount of self-collected experimental data, it was proposed to pre-train the model using a large public sleep dataset and then fine-tune the model using a small experimental dataset. The resulting sleep stage classification accuracy reached 86.4%, which is more than 11 percentage points higher than the traditional SVM model.

[0092] 3. When applying the sleep stage classification model, less input data is required, the classification accuracy is high, it is easy to apply to wearable devices, and the user experience is good.

[0093] Based on the aforementioned protected sleep stage classification method, this embodiment provides a sleep stage classification system, which includes an experimental unit, a model building unit, a model pre-training unit, a model fine-tuning and testing unit, and a model application unit. The experimental unit, model building unit, model pre-training unit, model fine-tuning and testing unit, and model application unit are respectively used to execute steps S1 to S5 in the aforementioned protected sleep stage classification method.

[0094] Corresponding to the above method, the experimental unit here includes a self-made auxiliary device, a polysomnography device, a camera, and a data calibration device. The data calibration device completes the professional correction and label mapping in the data calibration process shown above.

[0095] Model building units, model pre-training units, model fine-tuning and testing units are intelligent devices, such as computers, that contain processors capable of performing model building, pre-training, model fine-tuning and testing.

[0096] The model application unit is an intelligent module, such as a microcontroller, capable of running a sleep stage classification model. The model application unit can be integrated into other intelligent modules, independent of the experiment unit, model building unit, model pre-training unit, model fine-tuning and testing unit.

[0097] The sleep stage classification wearable system provided in this embodiment is a specific application of the sleep stage classification method described above, and can achieve the same effect as described above.

[0098] This embodiment provides a wearable device for sleep stage classification, as shown in the exploded view of Figure 11. The device includes an inner layer 1, an outer layer 2, and a sensor assembly 3, a battery assembly 4, a motherboard assembly 5, a display and button assembly 6, and a magnetic charging port 7 embedded between the inner layer 1 and the outer layer 2. The battery assembly 4 is connected to the magnetic charging port 7, which is used to charge the battery assembly 4. Both the inner layer 1 and the outer layer 2 are made of skin-friendly flexible material (a flexible material whose size, shape, and other appearance features are adapted to the user's monitoring area; in this embodiment, sponge is used). After placing the wearable device in a suitable position on the user's head, the device is worn on the user's head by attaching the ends of the wearable device together (other fixing methods, such as clips, can also be used). The battery assembly 4 is electrically connected to the motherboard assembly 5 and the sensor assembly 3, providing them with power. Sensor component 3 and display and button component 6 are connected to motherboard component 5. Sensor component 3 sends the collected user data to motherboard component 5. Motherboard component 5 inputs the user data into a sleep stage classification model embedded in its own memory. The sleep stage classification model then sends the classification results for each stage to the display screen (OLED screen) in display and button component 6 for display. This display screen also shows the device's wearing time and remaining battery power. The buttons in display and button component 6 are used for powering on / off, operating and displaying historical data, etc.

[0099] Specifically, the sensor in sensor assembly 3 (such as the MAX30102 sensor) is located inside the inner layer 1 and protrudes slightly from the surface of the inner layer 1, so that the sensor can fit more closely to the user's forehead. The display and button assembly 6 is connected to the motherboard assembly 5 and is located outside the outer layer 2 for easy data display. The battery assembly 4 is located inside the left inner layer 1, and the magnetic charging port 7 is located on the left side of the outer layer 2. The inner layer 1 and the outer layer 2 are sealed with fabric.

[0100] The specific installation steps for this device are as follows:

[0101] (1) Fix the motherboard assembly 5 to the plastic shell with screws, and apply a small amount of environmentally friendly glue to fix it to the outer layer 2;

[0102] (2) Assemble the MAX30102 sensor in the plastic housing, and then fix the plastic housing to the inner layer 1;

[0103] (3) The display and button assembly 6 is attached to the outside of the plastic shell of the motherboard assembly 5 and reinforced by positioning posts;

[0104] (4) Fix the battery assembly 4 inside the plastic shell and apply a small amount of environmentally friendly glue to fix it to the outer layer 2;

[0105] (5) Apply a small amount of environmentally friendly adhesive to fix the magnetic charging port 7 to the outer layer 2;

[0106] (6) Sew the inner layer 1 and the outer layer 2 together and seal the edges with a fabric strip.

[0107] During charging, the charging chip of battery component 4 charges the lithium battery and simultaneously sends a charging signal to motherboard component 5 (MCU). The MCU obtains the power data from the coulomb counter and displays it on the OLED screen.

[0108] By pressing and holding the button for 2 seconds (pressing and holding again for 2 seconds to power off), the MCU acquires the detection signal and then obtains red and infrared light data from the sensor at a certain frequency. The MCU then classifies the sleep stages using the sleep stage classification model obtained above, displaying the two-channel data curves and corresponding classification results on the OLED screen. Simultaneously, the MCU also displays the coulomb meter readings on the OLED screen.

[0109] The operating instructions for this device are as follows:

[0110] (1) Align the concave area of ​​the device with the bridge of the nose and eyes, and fix it to the subject’s head using Velcro at both ends.

[0111] (2) Press and hold the button for 2 seconds to turn on the device. The screen will display the data curves of the two channels and the corresponding classification results in the most recent recording period (30 seconds), as well as the remaining power of the device.

[0112] (3) After the test is completed, press and hold the button for 2 seconds and then turn off the device.

[0113] (4) If the power display area flashes during the test, it needs to be charged in time. When charging, the provided magnetic charger must be connected, and the charging progress will be displayed on the screen.

[0114] The sleep stage classification wearable device provided in this embodiment is easy to wear, has a high classification accuracy, and provides a good user experience.

Claims

1. A sleep stage classification method, characterized by, Including the following steps: S1. By collecting sleep stage data from the subjects and mapping the data with classification labels, the experimental dataset was obtained. S2. Construct a basic model for sleep stage classification based on the DeepSleepNet model. The number of input channels of the basic model for sleep stage classification is equal to the number of data types in the experimental dataset. The improvements of the sleep stage classification model compared to the DeepSleepNet model are as follows: The CNN structure for representation learning of the DeepSleepNet model is expanded from a single channel to a multi-channel structure with the same number of channels as the sensor data. After passing the multi-channel input signals through convolution and pooling operations, the resulting features are summed and then input into the sequence residual learning of the DeepSleepNet model. The input signals of the multi-channel system each use multiple signals within the same time period; S3. The sleep stage classification base model is pre-trained using a public dataset to obtain a sleep stage classification pre-trained model. S4. Fine-tune and test the sleep stage classification pre-trained model using the experimental dataset to obtain the sleep stage classification model. S5. Real-time acquisition of user's sleep stage data is input into the sleep stage classification model, and the sleep stage classification model outputs the corresponding classification result.

2. The sleep stage classification method of claim 1, wherein, Step S1 specifically includes: The sensor was fixed to the subject, and the polysomnography system was connected to the corresponding part of the subject's body; Data was collected simultaneously from sensors and a polysomnography system during the subjects' sleep. Using the automatic sleep stage determination function of the polysomnography system, the data of the user is classified at preset time intervals. Correct the classification results output by the polysomnography system; The corrected classification results are mapped to the collected sensor data and used as the classification labels for the sensor data to obtain the experimental dataset.

3. The sleep stage classification method of claim 1, wherein: In step S4, before fine-tuning and testing the sleep stage classification pre-trained model using the experimental dataset, the structure of the first convolutional layer of each input channel of the sleep stage classification pre-trained model is modified to correspond to the sampling rate of the experimental dataset. During the fine-tuning process, the first convolutional layer of each input channel is randomly assigned as the initial value of the parameters, while the remaining parts are trained directly using the parameter values ​​of the pre-trained sleep stage classification pre-trained model as the initial values.

4. A sleep stage classification method according to any one of claims 1 to 3, characterized in that: In step S3, the loss function used to pre-train the sleep stage classification model is the cross-entropy loss function.

5. A sleep stage classification method according to any one of claims 1 to 3, characterized by: In step S4, the loss function used to fine-tune the sleep stage classification pre-training model is the cross-entropy loss function.

6. The sleep stage classification method of claim 2, wherein: The sensor is worn and fixed to the forehead of the subject or user. The sensor collects two data streams of red light and infrared light related to heart rate. In step S1, the mapped classification labels include wakefulness, light sleep stage 1, light sleep stage 2, deep sleep, and REM sleep.

7. A sleep stage classification system characterized by: It includes an experimental unit, a model building unit, a model pre-training unit, a model fine-tuning and testing unit, and a model application unit. The experimental unit, the model building unit, the model pre-training unit, the model fine-tuning and testing unit, and the model application unit are respectively used to perform steps S1 to S5 in the sleep stage classification method according to any one of claims 1 to 6.

8. A sleep stage classification system according to claim 7, characterized in that: The model building unit, the model pre-training unit, and the model fine-tuning and testing unit are intelligent devices that include processors capable of performing model building, pre-training, model fine-tuning, and testing respectively. The model application unit is an intelligent module capable of carrying and running the sleep stage classification model.

9. A sleep stage classification wearable device, comprising: The system includes an inner layer (1), an outer layer (2), and a sensor assembly (3), a motherboard assembly (5), and a display and button assembly (6) embedded between the inner layer (1) and the outer layer (2). The inner layer (1) and the outer layer (2) are both made of flexible materials adapted to the user's monitoring area. The sensor assembly (3) sends the collected user data to the motherboard assembly (5). The motherboard assembly (5) inputs the user data into a sleep stage classification model generated by a sleep stage classification method according to any one of claims 1 to 6, which is embedded in the motherboard assembly (5). The sleep stage classification model obtains the classification results of each stage and sends them to the display and button assembly (6) for display.