A stepwise evolutionary automatic sleep staging method
By employing semi-supervised learning and stepwise evolutionary methods, a sleep staging model is constructed using finite labeled and unlabeled data. This addresses the issues of insufficient model accuracy and generalization ability in existing technologies, and achieves an efficient sleep staging algorithm.
Patent Information
- Application Number
- CN202310690872.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-06-12
AI Technical Summary
In existing technologies, automatic sleep staging algorithms rely on models trained with a small amount of labeled data, which have insufficient accuracy and generalization ability in practical applications and are difficult to adapt to massive amounts of data. Furthermore, the complexity of medical data labeling leads to data scarcity.
A semi-supervised learning method is adopted, which utilizes limited labeled data and a large amount of unlabeled data to build a sleep staging model through a stepwise evolutionary approach. This includes feature extraction, model training, credibility evaluation, and sample selection, thereby gradually improving the model's classification accuracy and generalization ability.
By effectively utilizing unlabeled data to enrich the training set, the model's classification accuracy and generalization ability are improved, data costs are reduced, and it is applicable to the evolution of sleep staging models for various physiological signals and classifiers.
Smart Images

Figure CN116509335B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sleep monitoring technology, specifically to a progressively evolving automatic sleep staging method. Background Technology
[0002] Sleep, as an essential process for life, is a crucial link in the body's recovery, integration, and memory consolidation, and an indispensable component of health. Long-term poor sleep quality can affect people's mental state and health quality, and in severe cases, can even induce other physical illnesses. According to a survey by the World Health Organization, 27% of people have sleep problems, and sleep disorders have become a prominent issue threatening global public health. Sleep staging is of great significance for sleep quality analysis and the diagnosis of sleep disorders.
[0003] Clinically, polysomnography (PSG) and expert interpretation are considered the "gold standard" for sleep staging. PSG involves simultaneously collecting multiple physiological signals from various channels during sleep, including electrocardiogram (ECG), electroencephalogram (EEG), electrooculogram (EOG), electromyogram (EMG), and respiration. Clinicians divide nighttime sleep into 30-second increments: wakefulness, non-rapid eye movement (NREM) sleep, and rapid eye movement (REM) sleep. NREM sleep can be further divided into stages I, II, and III. However, PSG is expensive, requires patients to wear numerous sensors in a specialized sleep laboratory, and necessitates manual data analysis. These factors severely limit the widespread adoption of sleep monitoring.
[0004] In recent years, with the rise of the concept of "big health" and the widespread application of artificial intelligence technology, more and more researchers have begun to focus on the research and application of artificial intelligence technology in the field of sleep monitoring. Moreover, massive amounts of sleep data provide a research foundation for automatic sleep staging algorithms.
[0005] Semi-supervised learning (SSL) is a key research area in machine learning, combining supervised and unsupervised learning methods. It trains models using a small amount of labeled data and a large amount of unlabeled data; the abstract information from the unlabeled data can mitigate overfitting caused by the limited labeled data. Self-training is a common semi-supervised learning method. Its principle is to use the model's predictions as true labels to expand the training set and apply them to supervised learning. By iteratively increasing the training data, model performance is improved.
[0006] Automatic sleep staging algorithms often employ supervised training strategies to train classifiers, with classification accuracy positively correlated with the size of the training set. However, due to the unique nature of medical data and the complexity of manual labeling, available labeled data is extremely scarce. Moreover, staging models trained with a limited amount of labeled data struggle to guarantee classification accuracy and generalization ability. For example, Chinese Patent Invention 201710002025.9 discloses an automatic sleep staging method based on single-lead EEG, but this approach suffers from the drawback that model training relies solely on a small initial dataset, resulting in a model that cannot adapt to the massive amounts of data encountered in real-world applications, and its accuracy and generalization ability require further improvement. Summary of the Invention
[0007] In order to overcome the shortcomings of the prior art, the present invention aims to provide a stepwise evolutionary automatic sleep staging method, which aims to gradually improve the classification accuracy and generalization ability of the sleep staging model by utilizing limited labeled data and a large amount of unlabeled data.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0009] A progressively evolving automatic sleep staging method includes the following steps:
[0010] Step 1: Construct multiple sleep staging models based on various feature extraction methods;
[0011] Step 2: Train the sleep staging model on the labeled dataset and calculate the evaluation metrics of the sleep staging model on the validation set;
[0012] Step 3: The sleep staging model automatically labels the unlabeled dataset and selects reliable samples based on the reliability evaluation method;
[0013] Step 4: Combine the labeled data and the reliable samples selected in Step 3 to form a training set, and repeat Steps 2 and 3;
[0014] Step 5: Test the sleep staging model on the test set and calculate the model's stepwise evolution results.
[0015] The first step is as follows:
[0016] Choose either multimodal or single physiological signals as the raw data for the sleep staging task based on the actual application scenario;
[0017] When using multiple physiological signals, convolutional neural networks are used to automatically extract local features according to the characteristics of different physiological signals. One-dimensional data is extracted using a one-dimensional convolutional network, and two-dimensional data is extracted using a two-dimensional convolutional network, thus obtaining multiple sets of features.
[0018] When using a single physiological signal, since a single physiological signal has different characteristics in the time domain and frequency domain, it is possible to use a convolutional neural network to automatically extract features from the original signal, or to use a convolutional neural network to automatically extract features from the data converted from the original signal to the frequency domain, so as to ensure that the two sets of features in the time domain and frequency domain have discriminative power.
[0019] The obtained features were used to perform classification tasks using classifiers, thus completing the construction of multiple sleep staging models.
[0020] The second step is specifically as follows:
[0021] The dataset is divided into labeled datasets, unlabeled datasets, validation sets, and test sets according to the proportions. Among them, the unlabeled datasets account for more than 50% of the total datasets. The validation and test sets remain unchanged throughout the model evolution process and do not overlap with other datasets.
[0022] The labeled dataset and validation set are divided into data segments of fixed length, which are called sleep segments in the sleep staging task. Then, the sleep segments are input into the sleep staging model built in step one to train the model.
[0023] During training, a labeled dataset is used to fit the model, and a validation set is used to verify the model performance after each iteration. Evaluation metrics are calculated, including accuracy, average F1 score (MF1), and Cohen's Kappa coefficient. Hyperparameters, including learning rate, batch size, and maximum number of training iterations, are continuously adjusted. Finally, the model with the best evaluation metrics is selected as the optimal model.
[0024] Step three specifically refers to:
[0025] The optimal model obtained in step two is used to automatically label the unlabeled dataset, and reliable samples are selected based on the reliability evaluation method.
[0026] Depending on the target audience, credibility evaluation methods are divided into data credibility evaluation methods and model credibility evaluation methods. Data credibility evaluation methods refer to determining whether the original data is credible. For example, the credibility evaluation of EEG signal data determines whether the data was acquired due to electrode detachment causing signal acquisition failure or strong interference drowning out the real signal. Model credibility evaluation refers to determining whether the prediction results of the model are credible. For example, the credibility evaluation of sleep staging models refers to the evaluation of the output probability distribution of a single model and the evaluation of the classification consistency among multiple models.
[0027] The fourth step is specifically as follows:
[0028] The reliable samples obtained in step three are combined with the labeled data used in step two to form a training set. The sleep staging model is then trained. Steps two and three are repeated multiple times until the model evolution termination condition is met.
[0029] The termination condition for model evolution is determined by the amount of data in the credible samples and the evaluation metrics of the validation set. Typically, the evolution is terminated when the number of credible samples selected is very small, or the number of iterations is customized.
[0030] Step five specifically refers to:
[0031] By repeatedly screening reliable samples and updating the training set, the model performance is gradually improved, and the final classification accuracy of the model is tested using a test set.
[0032] Compared with the prior art, the advantages of the present invention are:
[0033] 1. This invention uses a semi-supervised training method, that is, the first training in step two only requires limited or even a small amount of manually labeled data, and the subsequent model evolution uses unlabeled data, which effectively alleviates the difficulties of medical data scarcity and labeled data complexity, and reduces the data cost of deep learning model development.
[0034] 2. During the model evolution process, i.e. in step three, a large amount of unlabeled data is used to continuously enrich the training set and increase data diversity, which is beneficial to improving the model's classification accuracy and generalization ability.
[0035] In summary, this invention proposes a stepwise evolutionary automatic sleep staging method, applicable to the evolution of sleep staging models using various physiological signals and classifiers. The feature extraction method, deep learning network, and reliability evaluation method can be determined based on the actual application scenario and specific physiological signals. Attached Figure Description
[0036] Figure 1 This is a flowchart of the automatic sleep staging method of the present invention.
[0037] Figure 2 This is a structural diagram of a sleep staging model according to an embodiment of the present invention, wherein, Figure 2 (A) in the model is the RAW-BiLSTM model. Figure 2 (B) in the model is the CWT-TCN model.
[0038] Figure 3 This is the model stepwise evolution framework of the present invention.
[0039] Figure 4 The model evolution results of this embodiment of the invention are shown below, where, Figure 4 In this context, A represents the stepwise evolution result of the RAW-BiLSTM model. Figure 4(B) is the result of the stepwise evolution of the CWT-TCN model. Detailed Implementation
[0040] The present invention will now be described in detail with reference to the accompanying drawings.
[0041] Reference Figure 1 A progressively evolving automatic sleep staging method includes the following steps:
[0042] Step 1: Construct multiple sleep staging models based on various feature extraction methods.
[0043] The first step is as follows:
[0044] Choose either multimodal or single physiological signals as the raw data for the sleep staging task based on the actual application scenario.
[0045] When using multiple physiological signals, local features are automatically extracted using convolutional neural networks according to the characteristics of different physiological signals. One-dimensional data is extracted using a one-dimensional deep convolutional neural network (1-DCNN), and two-dimensional data is extracted using a two-dimensional deep convolutional neural network (2-DCNN), thus obtaining multiple sets of features.
[0046] When using a single physiological signal, since the single physiological signal has different characteristics in the time domain and frequency domain, it is possible to use a convolutional neural network to automatically extract features from the original signal, or to use a convolutional neural network to automatically extract features from the data converted from the original signal to the frequency domain, so as to ensure that the two sets of features in the time domain and frequency domain have discriminative power.
[0047] For example, EEG has both time-domain and frequency-domain features. Therefore, on the one hand, 1-DCNN can be used directly to extract local features ∑f1 from the original EEG; on the other hand, continuous wavelet transform (CWT) can be used to perform time-frequency analysis on the original EEG beforehand, and then 2-DCNN can be used to extract local features ∑f2 from the wavelet graph.
[0048] Physiological signals are time-series signals, and their characteristics have certain temporal dependencies. Therefore, after the convolutional network automatically extracts local features, a temporal convolutional network is needed to further obtain global features. For example, feature ∑f1 can use a bidirectional long short-term memory (BiLSTM) network, which is suitable for capturing the temporal dependencies between EEG segments. Feature ∑f2 can use a temporal convolutional network (TCN), which is suitable for capturing long-term dependencies in time series.
[0049] The multiple sets of features obtained by the above method are used to perform classification tasks using classifiers. In deep learning, the softmax layer is generally used as the classifier, thus completing the construction of multiple sleep staging models.
[0050] Specifically: Based on the characteristics of EEG signals, two sleep staging models were constructed. (Refer to...) Figure 2 In (A), the RAW-BiLSTM model consists of a 1-DCNN module and a BiLSTM module. The 1-DCNN module is used to extract local features of the original EEG signal, and the BiLSTM module is used to extract the temporal dependencies between EEG segments. (See reference...) Figure 2 In (B), the CWT-TCN model consists of a 2-DCNN module and a TCN module. First, the original EEG signal is transformed by CWT to obtain a wavelet map. Then, the 2-DCNN module is used to extract local features, and the TCN module extracts the temporal dependencies between EEG segments.
[0051] Step 2: Train the sleep staging model on the labeled dataset and calculate the evaluation metrics of the sleep staging model on the validation set.
[0052] The dataset is divided into labeled datasets, unlabeled datasets, validation sets, and test sets according to the proportions. Among them, the unlabeled datasets account for more than 50% of the total datasets. The validation and test sets remain unchanged throughout the model evolution process and do not overlap with other datasets.
[0053] Typically, the data segments used for sleep staging have a fixed time length. Therefore, the labeled dataset and validation set are divided into data segments of a fixed length, referred to as sleep segments in the sleep staging task. These sleep segments are then input into the sleep staging model constructed in step one to train the model.
[0054] During training, a labeled dataset is used to fit the model, and a validation set is used to verify the model performance after each iteration. Evaluation metrics are calculated, including accuracy, average F1 score (MF1), and Cohen's Kappa coefficient. Hyperparameters, including learning rate, batch size, and maximum number of training iterations, are continuously adjusted. Finally, the model with the best evaluation metrics is selected as the optimal model.
[0055] Specifically, the dataset consists of C3 / A2 channel EEG signals from the Phase 1 database of the Sleep Heart Health Study (SHHS). The 5793 samples were divided into labeled, unlabeled, validation, and test sets in a 1:7:1:1 ratio. EEG signals were segmented into 30-second sleep segments. The labeled dataset was used to train a sleep staging model, and the validation set was used to verify model performance, calculating evaluation metrics such as accuracy, MF1, and Kappa coefficient.
[0056] Step 3: The two sleep staging models obtained in Step 2 are used to automatically label the unlabeled dataset. Then, a credibility evaluation method is used to perform credibility analysis on the labeled data.
[0057] Depending on the application, reliability evaluation methods are divided into data reliability evaluation methods and model reliability evaluation methods. Data reliability evaluation methods determine the reliability of the original data. For example, evaluating the reliability of EEG signal data involves assessing whether data acquisition failed due to electrode detachment or strong interference masking the true signal; such unreliable data can severely impact model training performance. Model reliability evaluation determines the reliability of the model's predictions. For example, evaluating the reliability of sleep staging models involves assessing the probability distribution of a single model's output and the consistency of classification among multiple models.
[0058] Data credibility evaluation involves thresholding the time-frequency characteristics of EEG signals to obtain low-interference or interference-free signals. Single model credibility evaluation uses prediction entropy to measure the probability distribution of the model's output. The lower the prediction entropy, the more reliable the model's classification result. Multiple model credibility evaluation uses the Kappa measure to measure the consistency of multiple outputs. The higher the Kappa measure, the higher the consistency of the classification results across multiple models. These three credibility evaluation methods are used to select reliable samples.
[0059] Step Four: Refer to Figure 3 Update the training set by combining trusted samples with labeled data to form a new training set and continue training the model. Repeat steps two and three until the model evolution termination condition is met. The model evolution termination condition is defined as either the number of trusted samples being less than 10 or the model's performance on the validation set no longer improving within three iterations.
[0060] Reference Figure 4 During the gradual evolution process, the accuracy, MF1, and Kappa coefficient gradually increased, indicating that the performance of the sleep staging model on the validation set gradually improved.
[0061] Step 5: Test the final sleep staging model using the test set and calculate the model's stepwise evolution results.
[0062] By repeatedly filtering reliable samples and updating the training set, the model performance was gradually improved. Finally, the final classification accuracy of the model was tested using a test set. The RAW-BiLSTM model achieved a 75.9% accuracy in five-class classification, 66.17 for MF1, and a Kappa coefficient of 0.67. The CWT-TCN model achieved an 80.28% accuracy in five-class classification, 69.01 for MF1, and a Kappa coefficient of 0.72.
Claims
1. A progressively evolving automatic sleep staging method, characterized in that, Includes the following steps: Step 1: Select multimodal physiological signals as the raw data for the sleep staging task based on the actual application scenario; When using multimodal physiological signals, convolutional neural networks are used to automatically extract local features according to the characteristics of different physiological signals. One-dimensional data is extracted using a one-dimensional convolutional network, and two-dimensional data is extracted using a two-dimensional convolutional network, thus obtaining multiple sets of features. The obtained features were used to perform classification tasks using classifiers, thus completing the construction of multiple sleep staging models; Based on the actual application scenario, a single physiological signal is selected as the raw data for the sleep staging task; When using a single physiological signal EEG, the RAW-BiLSTM model and the CWT-TCN model are used to extract two sets of features in the time domain and frequency domain, respectively. The RAW-BiLSTM model consists of a 1-DCNN module and a BiLSTM module, and the CWT-TCN model consists of a 2-DCNN module and a TCN module. The two sets of features are classified using classifiers to achieve classification tasks, thus completing the construction of two sleep staging models. Step 2: Train the sleep staging model on the labeled dataset and calculate the evaluation metrics of the sleep staging model on the validation set; Step 3: The sleep staging model automatically labels the unlabeled dataset and selects reliable samples based on the reliability evaluation method; Step 4: Combine the labeled data and the reliable samples selected in Step 3 to form a training set, and repeat Steps 2 and 3; Step 5: By repeatedly screening reliable samples and updating the training set, the model performance is gradually improved, and the final classification accuracy of the model is tested using the test set; The second step is specifically as follows: The dataset is divided into labeled datasets, unlabeled datasets, validation sets, and test sets according to the proportions. Among them, the unlabeled datasets account for more than 50% of the total datasets. The validation and test sets remain unchanged throughout the model evolution process and do not overlap with other datasets. The labeled dataset and validation set are divided into data segments of fixed length, which are called sleep segments in the sleep staging task. Then, the sleep segments are input into the sleep staging model built in step one to train the model. During training, a labeled dataset is used to fit the model, and a validation set is used to verify the model performance after each iteration. Evaluation metrics are calculated, including accuracy, average F1 score, and Cohen's Kappa coefficient. Hyperparameters, including learning rate, batch size, and maximum number of training iterations, are continuously adjusted. Finally, the model with the best evaluation metrics is selected as the optimal model. Step three specifically refers to: The optimal model obtained in step two is used to automatically label the unlabeled dataset, and reliable samples are selected based on the reliability evaluation method. Depending on the target audience, credibility evaluation methods can be divided into data credibility evaluation methods and model credibility evaluation methods. Data credibility evaluation methods refer to determining whether the original data is credible. For example, the credibility evaluation of EEG signal data determines whether the signal acquisition failed due to electrode detachment or whether the acquired data was overwhelmed by strong interference. Model credibility evaluation refers to determining whether the prediction results of the model are credible. For example, the credibility evaluation of sleep staging models refers to the evaluation of the output probability distribution of a single model and the evaluation of the classification consistency between different models.
2. The stepwise evolutionary automatic sleep staging method according to claim 1, characterized in that, The fourth step is specifically as follows: The reliable samples obtained in step three are combined with the labeled data used in step two to form a training set. The sleep staging model is then trained. Steps two and three are repeated multiple times until the model evolution termination condition is met. The termination condition for model evolution is determined by the amount of data in the credible samples and the evaluation index of the validation set. The evolution is terminated or the number of iterations is customized when the number of credible samples selected is very small.
Citation Information
Patent Citations
Automatic sleep staging method based on multiple electroencephalogram and electromyography characteristics
CN106709469A
Automatic sleep staging method based on ECG signals
CN112674779A
Automatic evaluation method for sleep signal staging credibility
CN113796830A
Sleep stage staging method based on time sequence signal convolution and multi-signal fusion
CN114662530A
Determining sleep stages
WO2018070935A1