An automatic sleep staging method based on hybrid neural network
Through a hybrid neural network-based method, the sleep stage N1 and REM are merged and features are extracted using stacked convolution and LSTM networks, the data imbalance and feature similarity problems are solved, and the accuracy and real-time nature of sleep stages are improved.
Patent Information
- Application Number
- CN202210275390.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-03-21
AI Technical Summary
The prior art has problems of data imbalance, stage correlation and feature similarity in sleep staging, which is difficult to meet the daily sleep monitoring needs, and the traditional methods are computationally large, affecting real-time.
Using a hybrid neural network-based approach, by combining two sleep stages with the smallest and most similar data volumes (N1 and REM), features are extracted using stacked convolution and long and short-term memory networks, combining random oversampling and feature fusion, four-classification and binary classification cascade are performed to reduce manual intervention.
It improves the accuracy and efficiency of sleep staging, reduces the equipment requirements, adapts to daily sleep monitoring needs, reduces the amount of calculations, and enhances the adaptability of the model.
Smart Images

Figure CN114676768B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sleep quality assessment, and in particular to an automatic sleep staging method based on a hybrid neural network. Background Art
[0002] Sleep quality is closely linked to a range of health issues, from common psychological problems like anxiety to common functional issues like attention deficit disorder and endocrine disorders. Its importance cannot be underestimated. A growing number of researchers are using machine learning algorithms for sleep classification, easing the workload of sleep experts and promoting the widespread use of sleep monitoring. Based on the classification algorithm, EEG sleep staging can be divided into two categories: those based on traditional machine learning algorithms and those based on deep learning algorithms. In the early stages of applying machine learning to sleep staging, much research focused on developing automated sleep stage classification methods. These methods typically involve four steps: data preprocessing, feature extraction, feature screening, and classification prediction. To achieve higher classification accuracy, researchers must continuously experiment and rigorously screen features. However, due to the difficulty of exhausting features and the diverse evaluation criteria, this undoubtedly adds additional workload to the sleep staging task. In contrast, deep learning algorithms can automatically learn features without requiring any prior knowledge, alleviating the quality constraints and difficulty of manually extracted features.
[0003] The quality of features determines the upper limit of machine learning capabilities. In traditional machine learning algorithms, in order to achieve higher staging accuracy, researchers must constantly try and strictly screen features. However, because features are difficult to exhaust and the evaluation criteria are diverse, this undoubtedly brings additional workload to the sleep staging task and makes it difficult to simulate the problem of many features used for classification and judgment in sleep manuals. Relatively speaking, deep learning algorithms can automatically learn features without any prior knowledge, reducing the difficulty of manually extracting feature quality limitations and screening. In the sleep staging task, both manual staging methods and machine learning algorithms have some problems, which are summarized as follows:
[0004] (1) Data imbalance problem. That is, there is an extreme distribution of category data in the training samples, which causes the machine learning algorithm to over-focus on a large number of samples and cause overfitting.
[0005] (2) It is difficult to meet the needs of daily sleep monitoring. Although multimodal and multichannel data can significantly improve the effect of sleep staging, it also means that the subjects wear more sensors, which places high demands on the equipment and affects sleep itself, and often cannot meet the daily needs of modern people for sleep monitoring.
[0006] (3) Stage correlation problem. Since sleep data is a continuous collection of events in a time series, the data often has transitional characteristics, that is, the data of the previous and next periods have a certain auxiliary effect on the current classification task. Therefore, most methods in this field still need to increase the amount of input data, which increases the amount of data for model calculation and has some impact on real-time sleep monitoring.
[0007] (4) Stage feature similarity. Stage similarity refers to the fact that the features of each category have a certain degree of overlap and similarity in manual review, and there is no clear boundary between the stages. In the sleep evaluation manual, there are many different criteria for evaluating categorical data. However, in the current issue of stage feature similarity, researchers have conducted extensive research on the correlation between the various stages, but have ignored the similarity of features within each stage.
[0008] Therefore, it is urgent to design an automatic sleep staging method based on hybrid neural networks. Summary of the Invention
[0009] The purpose of the present invention is to provide an automatic sleep staging method based on a hybrid neural network to solve the problems raised in the above background technology.
[0010] To achieve the above object, the present invention provides the following technical solution: an automatic sleep staging method based on a hybrid neural network, comprising the following steps:
[0011] (1) Four categories (Part 1)
[0012] S1: First, the two categories (N1 and REM) with the smallest and most similar data volume in the five-category data are merged, and four-category classification is performed in the three key modules of the first part: bottom-up, top-down and feature fusion;
[0013] S2: In the bottom-up module, stacked convolution operations are used to learn frequency information, and long short-term memory neural network units are used to extract the temporal information of frequency features at each layer;
[0014] S3: In the top-down module, an upsampling method is used to pad the data with zeros on the left and right to enhance the underlying information.
[0015] S4: In the feature fusion module, combined with the idea of the convolutional block attention mechanism, high-level semantic features that are helpful for classification and shallow features that are helpful for positioning are fused, and adaptive weights can be generated from different levels without manual specification.
[0016] (2) Binary classification part (Part 2)
[0017] S1: In the second part, considering the similarity and data imbalance between N1 and REM, a new balanced dataset is constructed using random oversampling method for the data classified as N1-REM stage in the first part, and the balanced dataset is used to train Model 2;
[0018] S2: Connect the models in series to divide the sleep stages into five categories.
[0019] Furthermore, in the above-mentioned automatic sleep staging method based on hybrid neural network, the feature extraction process of Model 1 is shown in Formula 2 and Formula 3: Assume that there are N segments of 30-second single-channel EEG signals; use multiple stacked CNN and LSTM blocks to extract and fuse time-frequency features:
[0020] x i =f(x i-1 )
[0021] h i =p(g(x i )||k(h i+1 ))
[0022] Furthermore, in the above automatic sleep staging method based on hybrid neural network, f(x) in the above formula transforms Xt into a feature matrix X through convolution operation. t+1 , p(x) represents the convolutional block attention module, which can automatically learn the importance of information extracted at different levels. g(x) represents the operation of extracting temporal information from the spatial features of each layer through the long short-term memory neural network. k(x) represents the upsampling process of the upper layer features by padding the left and right zeros. || is a connection operation that splices and fuses the features extracted from different layers.
[0023] Furthermore, in the above-mentioned automatic sleep staging method based on hybrid neural network, the method consists of two cascade parts of first performing four-classification and then performing two-classification.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] 1. This invention can demonstrate the viewpoint of similarity overlap of features of each category from both practical and theoretical aspects, and provide a new perspective for the sleep staging task.
[0026] 2. The present invention combines the two categories with the greatest similarity and the least amount of data for cascade classification, and proposes an automatic sleep staging method based on a hybrid neural network to improve the overall performance of sleep staging. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 This is a schematic diagram of the basic model structure of the present invention;
[0029] Figure 2 This is a flowchart of text similarity calculation in the present invention;
[0030] Figure 3 Schematic diagram of the structure of the automatic sleep staging model based on hybrid neural network of the present invention; DETAILED DESCRIPTION
[0031] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0032] The present invention provides a technical solution: an automatic sleep staging method based on a hybrid neural network, comprising the following steps:
[0033] (1) Four categories (Part 1)
[0034] S1: First, the two categories (N1 and REM) with the smallest and most similar data volume in the five-category data are merged, and four-category classification is performed in the three key modules of the first part: bottom-up, top-down and feature fusion;
[0035] S2: In the bottom-up module, stacked convolution operations are used to learn frequency information, and long short-term memory neural network units are used to extract the temporal information of frequency features at each layer;
[0036] S3: In the top-down module, an upsampling method is used to pad the data with zeros on the left and right to enhance the underlying information.
[0037] S4: In the feature fusion module, combined with the idea of the convolutional block attention mechanism, high-level semantic features that are helpful for classification and shallow features that are helpful for positioning are fused, and adaptive weights can be generated from different levels without manual specification.
[0038] (2) Binary classification part (Part 2)
[0039] S1: In the second part, considering the similarity and data imbalance between N1 and REM, a new balanced dataset is constructed using random oversampling method for the data classified as N1-REM stage in the first part, and the balanced dataset is used to train Model 2;
[0040] The feature extraction process of Model 1 is shown in Equations 2 and 3: Assume that there are N segments of 30-second single-channel EEG signals; multiple stacked CNN and LSTM blocks are used to extract and fuse time-frequency features:
[0041] x i =f(x i-1 )
[0042] h i =p(g(x i )||k(h i+1 ))
[0043] In the above formula, f(x) transforms Xt into the feature matrix X through convolution operation t+1 , p(x) represents the convolutional block attention module, which can automatically learn the importance of information extracted at different levels. g(x) represents the operation of extracting temporal information from the spatial features of each layer through the long short-term memory neural network. k(x) represents the upsampling process of the upper layer features by padding the left and right zeros. || is a connection operation that splices and fuses the features extracted from different layers.
[0044] S2: Connect the models in series to divide the sleep stages into five categories.
[0045] The method consists of two cascade parts: first performing four-class classification and then performing two-class classification.
[0046] This study analyzes the experimental results based on a simple baseline model and the manual sleep staging system, and concludes that one of the reasons for the low performance of N1 stage classification is the high similarity and overlap of the classification rules of each stage, which promotes the study of the similarity of internal features of each sleep stage. In order to eliminate the influence of various network structures on the results, a simple convolutional network is used as the basic model, such as Figure 1 As shown, it is composed of several stacked convolutional layers and pooling layers.
[0047] Table 1 shows the N1 classification results and the distribution of data across categories in the original data. For the minority class N1, 30.50% of the data were correctly classified, 29.24% were biased toward REM, and 23.68% were biased toward N2. REM is the second-smallest class after N1, and N2 has the largest data volume. The N1 misclassification suggests that, in addition to data imbalance, the EEG sleep staging task may also involve similarity and overlap in feature evaluation rules.
[0048] Table 1. Data volume and classification results in the N1 stage
[0049]
[0050] To more intuitively verify this concept, this solution extracts classification rules for each category from the AASM manual and uses the simtext library to calculate the Jaccard coefficient based on word sets. A larger value indicates greater similarity. The Jaccard coefficient is calculated by dividing the intersection of two documents by the union of the two documents, as shown in the following formula. Here, DSi is now the set of words found in document i, and the norm (|S|) gives the number of elements in the set.
[0051]
[0052] Before calculating the Jaccard coefficient, it is necessary to extract the General Staging Rules (general classification rules) in the manual of artificial sleep staging to organize the classification descriptions of the five stages, and calculate their similarity by pairwise combination. After each paragraph of text is segmented, capitalized (to unify different forms of the same word), special characters are removed, and stop words are removed, the similarity of the word sets between the two is calculated, such as Figure 2 In the removal of special characters and stop words, some words were appropriately deleted and added. For example, the letter k represents a special waveform in the sleep staging rules and has a clear meaning (a special waveform k complex wave), so it was chosen to be retained.
[0053] Based on the above research and analysis, since REM is the stage with the least amount of data after N1, the present invention merges the two stages N1 and REM with the highest similarity and the smallest amount of data in order to achieve the purpose of improving the sleep staging effect.
[0054] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0055] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to better understand and utilize the present invention. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. An automatic sleep staging method based on hybrid neural network, characterized in that: The following steps are involved: (1) Four categories (Part 1) S1: First, the two categories (N1 and REM) with the smallest and most similar data volume in the five-category data are merged, and four-category classification is performed in the three key modules of the first part: bottom-up, top-down and feature fusion; S2: In the bottom-up module, stacked convolution operations are used to learn frequency information, and long short-term memory neural network units are used to extract the temporal information of frequency features at each layer; S3: In the top-down module, an upsampling method is used to pad the data with zeros on the left and right to enhance the underlying information. S4: In the feature fusion module, the idea of the convolutional block attention mechanism is combined to fuse high-level semantic features that are helpful for classification and shallow features that are helpful for localization. Adaptive weights can be generated from different levels without manual specification. (2) Binary classification part (Part 2) S1: In the second part, considering the similarity and data imbalance between N1 and REM, a new balanced dataset is constructed using random oversampling method for the data classified as N1-REM stage in the first part, and the balanced dataset is used to train Model 2; S2: Connect the models in series to divide the sleep stages into five categories.
2. The automatic sleep staging method based on hybrid neural network according to claim 1, characterized in that: The feature extraction process of Model 1 is shown in Equations 2 and 3: Assume that there are N segments of 30-second single-channel EEG signals; multiple stacked CNN and LSTM blocks are used to extract and fuse time-frequency features: x i =f(x i-1 ) h i =p(g(x i )||k(h i+1 )) 。 3. The automatic sleep staging method based on hybrid neural network according to claim 2, characterized in that: In the above formula, f(x) transforms Xt into the feature matrix X through convolution operation t+1 , p(x) represents the convolutional block attention module, which can automatically learn the importance of information extracted at different levels. g(x) represents the operation of extracting temporal information from the spatial features of each layer through the long short-term memory neural network. k(x) represents the upsampling process of the upper layer features by padding the left and right zeros. || is a connection operation that splices and fuses the features extracted from different layers.
4. The automatic sleep staging method based on hybrid neural network according to claim 1, characterized in that: The method consists of two cascade parts: first performing four-class classification and then performing two-class classification.
Citation Information
Patent Citations
Sleep staging method based on residual learning and multi-granularity feature fusion
CN113158964A
Automatic sleep staging method based on time sequence multi-scale mixed attention model
CN114129138A