Automatic sleep staging method and system based on ResCNN-BiGRU

Through the ResCNN-BiGRU model combined with data augmentation and feature extraction technology, the problems of data imbalance and gradient disappearance in sleep staging are solved, and more accurate sleep stage recognition and stronger model generalization capabilities are achieved. It is suitable for home sleep monitoring systems .

CN119073924APending Publication Date: 2024-12-06THE 940TH HOSPITAL OF THE CHINESE PEOPLES LIBERATION ARMY JOINT LOGISTICS SUPPORT FORCE
View PDF 0 Cites 9 Cited by

Patent Information

Application Number
CN202411380338.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing sleep staging methods have data imbalance, gradient disappearance and generalization, especially when processing sleep EEG signals, it is difficult to accurately identify few sample categories and extract deep timing features.

Method used

Using the automatic sleep staging method based on ResCNN-BiGRU, the time-frequency domain characteristics of sleep data are extracted through data filtering and noise reduction, adaptive synthesis sampling technology and convolutional neural network with residual blocks, combined with the bidirectional gating recurrent unit network. Timing information, data augmentation and model training.

Benefits of technology

It improves the accuracy and generalization ability of sleep staging, especially when identifying N1 phase, significantly improves classification performance, enhances the robustness and applicability of the model, and provides technical support for the home sleep monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119073924A_ABST
    Figure CN119073924A_ABST
Patent Text Reader

Abstract

The invention provides an automatic sleep staging method and system based on ResCNN-BiGRU, and the method comprises the steps: obtaining a data set, and obtaining sleep electroencephalogram data of a few-sample category; performing data filtering and noise reduction processing on the sleep electroencephalogram data of the few-sample category, and performing data enhancement through an improved self-adaptive synthetic sampling technical method; a convolutional neural network with a residual block is used for learning data feature representation, deep time sequence information is mined through a two-layer bidirectional gating circulation unit network, the correlation between sleep is determined, sleep data stage features are automatically learned, sleep cycles are extracted, and a sleep staging result is obtained. And training and testing to obtain the pre-trained automatic sleep staging model. After the model is trained and optimized by a basic network, the excellent performance of the model in the aspect of automatic sleep staging is proved, and meanwhile, certain method support can be provided for constructing a family sleep monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sleep research, and in particular to an automatic sleep staging method and system based on ResCNN-BiGRU. Background Art

[0002] Sleep is essential for human brain and body functions. About 1 / 3 of a person's life is spent sleeping. As an important physiological activity, high-quality sleep helps humans maintain normal cognitive and physical conditions, while long-term sleep deprivation or disorder can seriously affect physical and mental health. Studies have shown that certain diseases, such as Parkinson's disease and Alzheimer's disease, are closely related to sleep disorders or abnormalities. Sleep staging not only lays the foundation for studying the nature of sleep, but is also an important factor in sleep diagnosis and treatment. In clinical practice, sleep disorders such as obstructive sleep apnea and rare diseases such as narcolepsy are mostly diagnosed through potential neurophysiological processes such as sleep stage duration, sleep cycle, sleep latency, and wakefulness time after falling asleep. Healthy people will experience a cyclical cycle of several sleep stages during sleep, while patients with sleep problems have less obvious or more chaotic sleep structure. Therefore, accurate scoring of sleep stages is very important for improving sleep quality and preventing diseases caused by sleep disorders.

[0003] At present, sleep scoring is a common method for determining sleep quality and diagnosing sleep disorders. It is generally based on PSG (polysomnogram, PSG) and is considered the gold standard for evaluating human sleep. PSG, also known as sleep electroencephalogram, is a variety of bioelectric signals obtained through sensors in different parts of the body, including electroencephalogram (EEG), electrooculogram (EOG), electrocardiogram (ECG), electromyography (EMG), etc. Because sleep EEG signals contain a large amount of disease-related and physiological-related information of the human body. In clinical practice, sleep EEG signals can be used as a basis for the diagnosis of certain brain diseases (such as epilepsy). The early sleep stage standard was the R&K standard proposed and formulated by Rechtschaffen and Kales in the United States in 1968, which divided the sleep stages into wakefulness (Awake), non-rapid eye movement (NREM), and rapid eye movement (REM). Among them, the NREM stage is subdivided into four stages: S1, S2, S3, and S4. Subsequently, the American Academy of Sleep Medicine proposed the AASM standard on this basis, merging the S3 and S4 stages to divide the sleep stages into five stages: W, N1, N2, N3, and REM. The traditional sleep stage classification is achieved by sleep experts dividing PSG data into 30S segments, also known as epochs, observing the morphology of the time domain signal of each epoch, combining the information of adjacent time periods, and assigning each epoch to a sleep stage. This process is not only time-consuming, but the classification results are easily affected by the variability and subjectivity of experts. Therefore, some scholars have studied automatic sleep stage classification methods based on traditional machine learning. For example, Zaman et al. used time domain and frequency domain features, utilized a multi-level tree-based integrated model, adjusted by reward-based adaptive weight allocation, and used the filtering features of the feature engineering block to classify sleep stages, showing excellent performance with an accuracy of 86.3% and a Cohen kappa score of 0.807; Satapathy et al. fused frequency, time, and nonlinear statistical features, and used AdaBoost to classify Sleep-EDFx data into five categories with an accuracy of 96.40%. Existing studies have shown that automatic sleep scoring using machine learning methods with handcrafted features is effective. However, the results of machine learning methods strongly depend on the type of handcrafted features and data set dependency. Therefore, the performance and applicability of trained machine learning models may depend on the given data set, and there are disadvantages such as low efficiency and lack of generalization.

[0004] With the continuous development of deep learning technology, in order to improve classification efficiency, many researchers have used deep learning algorithms to develop automatic sleep staging models. Among them, convolutional neural networks (CNN) are used to extract short-term local time domain features, residual networks (ResNet) are used to eliminate the gradient vanishing and gradient explosion existing in deep models, long short term memory networks (LSTM), gated recurrent unit (GRU) and other recurrent neural networks (RNN) are used to extract temporal features, learn the transition rules between sleep stages, and the attention mechanism learns temporal context features. For example, Li used the convolutional neural network-unidirectional long short-term memory network (CNN-Uni-LSTM) and convolutional neural network-bidirectional long short-term memory network (CNN-Bi-LSTM) automatic sleep staging methods to obtain staging accuracy of 80.7% and 82.5%, respectively, and the staging accuracy of N1 stage was only 30.1% and 38.9%; Li used 1D-ResNet blocks to extract multi-level features from single-channel raw EEG signals, and the LSTM network captured the transition rules between sleep stages. The overall accuracy was 86.4%, and the weighted cross entropy loss function was used to solve the class imbalance problem, resulting in The performance of the N1 stage was significantly improved, with an accuracy of 59.1%; Liu combined multi-scale attention ResNet and bidirectional gated recurrent unit network (BiGRU) for sleep staging, with a classification accuracy of 84.24% on the Sleep-EDF dataset and a recall rate of 67.2% in the N1 stage; Jirakittayakorn used CNN models with different loss function weights for feature extraction and BiLSTM for sequence classification. Each component was trained separately using the Sleep-EDF dataset to achieve an overall accuracy of 87.02%, and the F1 score of the N1 stage was 54.23%.

[0005] Although the overall model based on deep learning has greatly improved the efficiency of sleep staging, there are still several prominent problems: 1) Due to the serious imbalance in the proportion of different sleep stages in the entire sleep process, there is an imbalance in the amount of sleep data in the existing sleep EEG dataset, among which the N2 stage accounts for 45-55% of the entire sleep time, the N3 stage accounts for 20%, the rapid eye movement (REM) stage accounts for 25%, and the N1 stage accounts for only 2-5%. This imbalance greatly affects the accuracy of sleep staging; 2) In order to improve the expressiveness and generalization ability of the model, many scholars can obtain more effective feature expression of the input signal by increasing the number of network layers, but neural networks with too many layers may cause gradient disappearance; 3) When performing sleep staging, many networks do not extract temporal features and specific features deeply enough. Summary of the invention

[0006] In view of the above-mentioned deficiencies, the present invention provides an automatic sleep staging method and system based on ResCNN-BiGRU. After training and optimizing the basic network, the model is proved to have superior performance in automatic sleep staging and can provide certain methodological support for building a home sleep monitoring system.

[0007] To achieve the above purpose, the present invention adopts the following technical means:

[0008] The first aspect of the present invention is to provide an automatic sleep staging method based on ResCNN-BiGRU, comprising:

[0009] Get sleep data for sleep staging;

[0010] Preprocess the sleep data;

[0011] The preprocessed sleep data is input into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; the training process of the pre-trained automatic sleep staging model includes:

[0012] Acquire a data set to obtain sleep EEG data of a small sample category; perform data filtering and noise reduction on the sleep EEG data of a small sample category, and then perform data enhancement through an improved adaptive synthetic sampling technology method; use a convolutional neural network with a residual block to learn data feature representation, and then use a two-layer bidirectional gated recurrent unit network to mine deep timing information, determine the correlation between sleep, automatically learn the stage features of sleep data and extract sleep cycles to obtain sleep staging results, and train and test to obtain the pre-trained automatic sleep staging model.

[0013] As a further improvement of the present invention, the data set adopts the Sleep-EDF data set, and each period recorded in the Sleep-EDF data set is manually labeled by clinicians as W, N1, N2, N3, N4, REM, movement and unknown stages according to the R&K rules; the PSG data includes dual-channel EEG, single-channel EOG, single-channel EMG and event markers.

[0014] As a further improvement of the present invention, the data filtering and noise reduction processing includes:

[0015] Use the single-channel EEG Fpz-Cz in the SC data set; merge the N3 and N4 periods into the N3 stage data according to the AASM judgment rule; exclude the MOVEMENT and UNKNOWN data; intercept the sleep EEG signals containing the preset time before and after sleep; use the Butterworth bandpass filter to filter the sleep EEG signals;

[0016] Then, the wavelet packet denoising technology is used to denoise the sleep EEG signal. The signal is decomposed into different frequency levels through wavelet transform, and then the wavelet coefficients of each level are thresholded to remove noise. Finally, the denoised signal is reconstructed through inverse transform. The Db4 wavelet basis function of the Dobesi wavelet function family is used to perform a denoising scheme based on the appropriate number of layers of data length and wavelet length as the default number of layers, and it is corrected by the soft threshold function.

[0017] After processing, the signal is sliced ​​into corresponding sleep stages at each time period to form a training data set for the corresponding stage;

[0018] The improved adaptive synthetic sampling technique method is used to perform data enhancement, including:

[0019] Adaptive synthetic sampling technology is used to enhance data with fewer samples, and the difficulty of learning different minority samples is distributed according to weights to synthesize more training data.

[0020] As a further improvement of the present invention, the data enhancement processing specifically includes:

[0021] Calculate the number of synthesized samples Gs,m s 、m l are the number of minority class samples and the number of majority class samples, respectively, s ≤m l ,m s +m l =m;β∈(0,1);

[0022] G s =(m l -m s )β(1)

[0023] For each minority class sample, K neighbors are calculated by Euclidean distance and r i represents the proportion of majority class samples contained in the current neighborhood, where K represents the number of current neighbors and k represents the majority class samples in the current neighborhood;

[0024] r i = k / K(2)

[0025] According to G, the number of samples required to be synthesized for each minority sample is calculated, and the samples are synthesized according to formula (4), and X zi Represents X i A random minority sample from the k neighbors of , λ∈(0,1);

[0026] g=G×r i (3)

[0027] Z i =X i +(X zi -X i )×λ(4)

[0028] Among them, g represents the number to be synthesized, Z i represents the synthesized new sample, X i Represents the current minority sample.

[0029] As a further improvement of the present invention, the convolutional neural network with residual blocks adds a residual network to the network architecture; the convolutional neural network mainly uses a 1×50 large convolution kernel layer, a 1×8 maximum pooling layer, 3 1×8 small convolution kernel layers and a 1×4 maximum pooling, and introduces random inactivation technology and gradient clipping technology.

[0030] As a further improvement of the present invention, the bidirectional gated recurrent unit network is composed of two unidirectional GRUs in opposite directions, and a back-propagation mechanism is added. The output at time t is generated by the forward hidden layer. and the backward layer state information The weighted summation yields:

[0031]

[0032]

[0033] In the formula, x t is the state information at time t, and are the forward and backward state features retained at time t-1, w t and v t The forward hidden layer and the backward hidden state information The corresponding weight, b is the bias term; the BiGRU structure includes two layers of bidirectional GRU, which learn sequence dependency information from the front and back respectively, and a dropout regularization layer is added to each layer of BiGRU.

[0034] As a further improvement of the present invention, the training and testing obtain the pre-trained automatic sleep staging model, and use the Fpz-Cz channel of the EEG signal for training and testing; during training, an adaptive gradient method with weight decay is used to update and optimize the network weight value, and an adaptive scheduling learning rate is set to dynamically adjust the learning rate during the model training process, so that it converges quickly in the early stage of training, and maintains a smaller learning rate in the later stage of training to finely adjust the model parameters.

[0035] The second aspect of the present invention is to provide an automatic sleep staging method system based on ResCNN-BiGRU, comprising:

[0036] An acquisition module, used to acquire sleep data for sleep staging;

[0037] A preprocessing module, used for preprocessing sleep data;

[0038] The staging module is used to input the pre-processed sleep data into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; the training process of the pre-trained automatic sleep staging model includes:

[0039] Acquire a data set to obtain sleep EEG data of a small sample category; perform data filtering and noise reduction on the sleep EEG data of a small sample category, and then perform data enhancement through an improved adaptive synthetic sampling technology method; use a convolutional neural network with a residual block to learn data feature representation, and then use a two-layer bidirectional gated recurrent unit network to mine deep timing information, determine the correlation between sleep, automatically learn the stage features of sleep data and extract sleep cycles to obtain sleep staging results, and train and test to obtain the pre-trained automatic sleep staging model.

[0040] The third aspect of the present invention is to provide an electronic device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the automatic sleep staging method based on ResCNN-BiGRU is implemented.

[0041] A fourth aspect of the present invention is to provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the automatic sleep staging method based on ResCNN-BiGRU.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The present invention proposes an automatic sleep staging model based on sleep EEG signal data enhancement. The model uses Butterworth bandpass filtering technology, wavelet packet noise reduction technology and improved ADASYN technology to pre-process EEG data, uses CNN with residual network to extract time-frequency domain features between data, and combines BiGRU to extract the information features of the correlation between the previous and next time series between data, so as to fully extract the EEG signal features used for sleep staging. After the model is trained and optimized through the basic network, it proves that the model of the present invention has superior performance in automatic sleep staging and can provide certain method support for building a home sleep monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 This is the schematic diagram of the automatic sleep staging model;

[0045] Figure 2 The original data and the EEG signal after filtering and noise reduction; (a) original signal; (b) filtered signal; (c) noise reduction signal;

[0046] Figure 3 As the basic CNN network and residual block structure;

[0047] Figure 4 Schematic diagram of the bidirectional gated recurrent unit network structure; (a) Manual staging results of clinical experts; (b) Automatic staging results of the model;

[0048] Figure 5 Comparison of manual staging by experts and automatic staging by the model. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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 creative work should fall within the scope of protection of the present invention.

[0050] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or elements is not necessarily limited to those steps or elements explicitly listed but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.

[0051] Terminology explanation:

[0052] Adaptive Synthetic Sampling Technology (ADASYN);

[0053] American Academy of Sleep Medicine (AASM).

[0054] The present invention provides an automatic sleep staging method based on ResCNN-BiGRU, comprising the following steps:

[0055] Get sleep data for sleep staging;

[0056] Preprocess the sleep data;

[0057] The preprocessed sleep data is input into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; the training process of the pre-trained automatic sleep staging model includes:

[0058] Acquire a data set to obtain sleep EEG data of a small sample category; perform data filtering and noise reduction on the sleep EEG data of a small sample category, and then perform data enhancement through an improved adaptive synthetic sampling technology method; use a convolutional neural network with a residual block to learn data feature representation, and then use a two-layer bidirectional gated recurrent unit network to mine deep timing information, determine the correlation between sleep, automatically learn the stage features of sleep data and extract sleep cycles to obtain sleep staging results, and train and test to obtain the pre-trained automatic sleep staging model.

[0059] The automatic sleep staging method based on ResCNN-BiGRU (residual convolutional neural network combined with bidirectional gated recurrent unit) proposed in this invention aims to automatically and accurately analyze sleep data through deep learning technology to achieve automatic division of sleep stages. This method not only utilizes the advantages of convolutional neural network (CNN) in feature extraction, but also combines the powerful ability of bidirectional gated recurrent unit (BiGRU) in processing time series data, and is particularly suitable for processing complex sleep EEG signals.

[0060] Among them, to obtain sleep data, it is necessary to collect raw sleep data for sleep staging, which usually include multiple physiological signals such as electroencephalogram (EEG), electrooculogram (EOG), electromyography (EMG) in polysomnography (PSG).

[0061] Data preprocessing is the preprocessing of the collected sleep data, including noise removal, filtering, signal segmentation (such as segmentation by 30 seconds or 1 minute), etc., to improve the efficiency and accuracy of subsequent model processing.

[0062] Data augmentation is aimed at the problem of small number of sleep data samples in certain categories. Improved adaptive synthetic sampling technology (such as variants of SMOTE, ADASYN and other methods) is used for data augmentation to increase the amount of data in these categories, thereby alleviating the problem of category imbalance in the model training process.

[0063] The present invention focuses on the model construction and training, wherein the model architecture uses a convolutional neural network (ResCNN) with residual blocks as the feature extraction layer, and uses residual connections to solve the gradient vanishing or exploding problem in deep network training, effectively extracting the spatial features of sleep data. Subsequently, through a two-layer bidirectional gated recurrent unit (BiGRU) network, the temporal characteristics of the data, especially the conversion and correlation between sleep stages, are mined. In the training process, the preprocessed and enhanced data are input into the ResCNN-BiGRU model, and the model parameters are continuously adjusted through optimization methods such as back propagation algorithm and gradient descent to minimize the error between the predicted results and the actual sleep staging. At the same time, the model performance is evaluated by methods such as cross-validation to ensure the generalization ability of the model. Automatic sleep staging is to input the preprocessed new sleep data into the trained ResCNN-BiGRU model, and the model will automatically output the sleep staging results of each time period, such as wakefulness, non-rapid eye movement (N1, N2, N3) and rapid eye movement (REM).

[0064] Therefore, the present invention combines ResCNN and BiGRU, making full use of the high efficiency of convolutional neural networks in feature extraction and the advantages of bidirectional gated recurrent units in processing time series data, to achieve effective analysis and accurate staging of complex sleep signals. In view of the problem of few sample categories, improved data enhancement technology is used to improve the robustness and generalization ability of the model. The entire process from data acquisition, preprocessing, model training to automatic staging is highly automated, reducing manual intervention and improving work efficiency and accuracy.

[0065] As a preferred solution, the data filtering and noise reduction process includes:

[0066] Use the single-channel EEG Fpz-Cz in the SC data set; merge the N3 and N4 periods into the N3 stage data according to the AASM judgment rule; exclude the MOVEMENT and UNKNOWN data; intercept the sleep EEG signals containing the preset time before and after sleep; use the Butterworth bandpass filter to filter the sleep EEG signals;

[0067] Then, the wavelet packet denoising technology is used to denoise the sleep EEG signal. The signal is decomposed into different frequency levels through wavelet transform, and then the wavelet coefficients of each level are thresholded to remove noise. Finally, the denoised signal is reconstructed through inverse transform. The Db4 wavelet basis function of the Dobesi wavelet function family is used to perform a denoising scheme based on the appropriate number of layers of data length and wavelet length as the default number of layers, and it is corrected by the soft threshold function.

[0068] After processing, the signal is sliced ​​into corresponding sleep stages at each time period to form a training data set for the corresponding stage;

[0069] The improved adaptive synthetic sampling technique method is used to perform data enhancement, including:

[0070] Adaptive synthetic sampling technology is used to enhance data with fewer samples, and the difficulty of learning different minority samples is distributed according to weights to synthesize more training data.

[0071] As an example, the single-channel EEG Fpz-Cz in the SC dataset is used for targeted selection of EEG channels. This channel usually contains more significant sleep-related features, which is helpful for subsequent feature extraction and classification.

[0072] According to the judgment rules of AASM (American Academy of Sleep Medicine), the N3 and N4 periods were merged into the N3 stage data. This step standardized the definition of sleep stages and improved the consistency and comparability of the data. Data cleaning excluded MOVEMENT and UNKNOWN data, which may contain a lot of noise due to motion artifacts or other unknown factors. Excluding them helps improve data quality.

[0073] The sleep EEG signals containing preset time before and after sleep are intercepted to ensure the integrity and continuity of the data, while removing unnecessary non-sleep parts. The Butterworth bandpass filter is used for preliminary filtering, and then combined with wavelet packet noise reduction technology for fine noise reduction. Wavelet packet noise reduction technology can more effectively decompose the signal into different frequency levels and remove noise through threshold processing. Especially for non-stationary and nonlinear signals, its noise reduction effect is better than traditional methods. The use of Db4 wavelet basis function and appropriate number of decomposition layers, combined with soft threshold function, can further optimize the noise reduction effect while retaining the important features of the signal.

[0074] The present invention adopts more sophisticated and effective methods in data preprocessing and data enhancement, which not only improves the quality and consistency of the data, but also improves the recognition and generalization capabilities of the model by targeted enhancement of minority category samples, providing a more solid data foundation for subsequent automatic sleep staging.

[0075] The present invention is described in detail below with reference to specific embodiments:

[0076] The present invention proposes a sleep signal staging model based on sleep EEG signal data enhancement. The overall principle block diagram of the present invention is as follows: Figure 1 shown.

[0077] ① Use the ADASYN algorithm to enhance the original data, expand the amount of data of small categories, and balance the data;

[0078] ② Using a deep convolutional neural network with residual blocks to extract time-invariant features can avoid the gradient vanishing problem caused by a too deep network structure;

[0079] ③ Use a bidirectional gated recurrent unit network that can capture more information-rich long-term dependencies to extract temporal features and specific features, and pay equal attention to sleep stages where specific features and key features do not appear.

[0080] 1 Dataset and Experimental Setup

[0081] 1.1 Dataset

[0082] The Sleep-EDF dataset consists of two subsets: sleep-cassette (SC) contains 78 healthy Caucasians aged between 25 and 101 years old who did not take sleep-related medications during sleep, and sleep-telemetry (ST) contains 22 Caucasians who were treated with temazepam. Each participant recorded two subsequent night PSG data, except for subject 13, subject 36, and subject 52 from the SC subset, who only had one night record. Each recorded period was manually labeled by a clinician as W, N1, N2, N3, N4, REM, movement, and unknown stages according to the R&K rules. The PSG data includes dual-channel EEG (Fpz-Cz and Pz-Oz), single-channel EOG, single-channel EMG, and event markers (sampled at 1Hz). The sampling frequency of EEG, EOG, and EMG is 100Hz. However, the actual sleep situation of an individual varies from person to person and is affected by many factors such as age, psychological condition, and physical condition. The overall category data distribution is shown in Table 1.

[0083] Table 1 Distribution of the number of manually classified label categories

[0084]

[0085] 1.2 Data Preprocessing

[0086] 1.2.1 Data filtering and noise reduction

[0087] In order to ensure the consistency of research data and eliminate the impact of sleep difficulties on the research, in this experiment, the present invention uses a total of 153 sets of data from 78 people in the single-channel EEG Fpz-Cz lead in the SC data set for experimental analysis (from SC4001 to SC4822, excluding discontinuous and missing data sets). According to the AASM judgment rule, the N3 and N4 periods are merged into the N3 stage data; the MOVEMENT and UNKNOWN data are excluded; the sleep EEG signals containing 30 minutes before and after sleep are intercepted; in order to eliminate unnecessary eye movements and fair interference, a 4th-order Butterworth bandpass filter with a frequency band of 0.5-35Hz is used to filter the sleep EEG signals. For example, SC4001 has 841 samples, each sample has 3000 time points, and the signals before and after filtering of the first sample of SC4001 are as follows. Figure 2 As shown in (a) and (b).

[0088] Then, the sleep EEG signal is denoised using wavelet packet denoising technology. Compared with the traditional wavelet transform, this algorithm is more sophisticated and can analyze the signal more precisely, providing a higher quality denoising effect. Wavelet packet denoising (Wavelet Denoising) is an effective signal or image denoising method. It decomposes the signal into different frequency levels through wavelet transform, and then performs threshold processing on the wavelet coefficients of each level to remove noise. Finally, the denoised signal is reconstructed through inverse transform to eliminate the influence of noise. In this way, the time-frequency resolution of the signal can be improved. The present invention uses the Db4 wavelet basis function of the Daubechies (Db) wavelet function family to perform a denoising scheme based on the appropriate number of layers of data length and wavelet length as the default number of layers, and corrects it through a soft thresholding function to improve the accuracy of denoising. The EEG signal after denoising is as follows Figure 2 As shown in (c).

[0089] After data preprocessing, the signal is sliced ​​into the corresponding sleep stage every 30 seconds to form a training data set of the corresponding stage for training.

[0090] 1.2.2 Data Enhancement Processing

[0091] In order to solve the problem of sample class imbalance in the data set, according to the AASM criterion, as shown in Table 1, the sample size of the N1 stage is much larger than that of other stages. In order to better improve the accuracy of sleep staging, the traditional SMOTE algorithm generates new synthetic samples by interpolating minority class samples. There are problems of high noise and similarity between samples in the synthetic samples. Therefore, the present invention adopts adaptive synthetic sampling (ADASYN technology) to enhance the data with fewer samples. The ADASYN method distributes the difficulty of learning different minority samples according to weights, and synthesizes more training data for the minority samples that are more difficult to learn. ADASYN supports binary and multi-classification, which can not only reduce the learning bias caused by the original unbalanced data distribution, but also adaptively offset the decision boundary to focus on the samples that are more difficult to learn. The biggest advantage of ADASYN is that it automatically determines the number and distribution of synthetic samples of minority samples according to the sample distribution of the entire data set. The specific method is as follows:

[0092] (1) Calculate the number of synthesized samples Gs,m s 、m l are the number of minority class samples and the number of majority class samples, respectively, s ≤m l ,m s +m l =m;β∈(0,1).

[0093] G s =(m l -m s )β(1)

[0094] (2) For each minority class sample, calculate K neighbors by Euclidean distance, and use r i represents the proportion of majority class samples contained in the current neighborhood, where K represents the number of current neighbors and k represents the majority class samples in the current neighborhood.

[0095] r i = k / K(2)

[0096] (3) According to G, the number of samples to be synthesized for each minority sample is calculated. According to formula (4), the synthesized samples can be expressed as: where g represents the number to be synthesized, and Z i represents the synthesized new sample, X i represents the current minority sample, and X zi Represents X i A random minority sample from the k neighbors of , λ∈(0,1).

[0097] g=G×r i (3)

[0098] Z i =X i +(X zi -X i )×λ(4)

[0099] By expanding the minority samples, the model can better learn and understand the characteristics of minority samples, reduce the dominant influence of majority samples, and enhance the model's understanding and training of minority classes. Although the use of the ADASYN method will increase the amount of calculation to a certain extent, because it is necessary to calculate the density estimate of each sample in each iteration and generate new synthetic samples based on these density values, this accounts for a small proportion of the entire training process and can effectively improve the performance of the model. When dealing with unbalanced data sets, minority attacks are often extremely harmful, and accurate identification is crucial to improving the robustness of the protected model. Therefore, in practical applications, by using the ADASYN method to expand minority samples, we can better deal with such attacks and improve the overall classification performance of the model. At the same time, a weighted loss function is also used to alleviate the degree of misclassification in the N1 stage.

[0100] 1.3 Experimental environment and settings: In the process of neural network training, the training speed will affect its training performance, especially for deep learning, the more parameters, the more time consumption will be, the more matrix operations will be, and the GPU has strong matrix computing capabilities, so it is applied to this experiment. All experiments in this invention are based on the computer programming language Python 3.9.18 (Python Software Foundation) and the deep learning framework PyTorch2.1.2, and NVIDIA graphics cards (GeForce RTX 4090, NVIDIA Cor) are used for model training.

[0101] 2 Sleep stage model

[0102] 2.1 Residual Block Convolutional Neural Network (ResCNN): The convolutional neural network (CNN) model based on deep learning technology generally constructs multiple Conv with different sizes of kernels in the first part of the network as feature extraction modules. The more convolutional layers, the larger the receptive field of the network and the better the features extracted. However, practice has shown that the deepening of the network structure will increase the risk of gradient explosion and gradient disappearance. In order to extract more effective features and avoid the risk of gradient disappearance, the present invention adds a residual network to the network architecture. The convolutional neural network mainly uses a 1×50 large convolution kernel layer, a 1×8 maximum pooling layer, 3 1×8 small convolution kernel layers and a 1×4 maximum pooling. At the same time, in order to prevent the model from overfitting, the present invention introduces random inactivation (dropout) and gradient clipping technology. Randomly deleting neurons in the network with a certain probability helps to improve the generalization ability of the model. It also uses L2 regularization technology to reduce the model complexity by reducing the weight value in the loss function to prevent problems such as gradient instability and grid degradation that may occur in the model. The basic network structure diagram of the convolutional neural network with residual blocks is shown in the figure below. Figure 3 As shown in the figure, the input of the residual network is x, the result of the convolution operation is F(x), and the output of the residual block is H(x). If the dimensions of x and F(x) match, then H(x) = f(F(x) + x); if the dimensions of x and F(x) do not match, then a downsampling layer is added to the jump structure to change the data input dimension so that the output of the jump structure is adapted to the dimension of F(x).

[0103] 2.2 Bidirectional Gated Recurrent Unit Network (BiGRU): The introduction of recurrent neural networks (RNN) enables neural networks to have the ability to remember the features before and after time series information, but the memory of long time series signal feature information is insufficient. The gated recurrent unit (GRU) can solve the common gradient vanishing problem in RNN. It consists of a reset gate and an update gate. The update gate is used to control the degree of combination of the current state information with the state information of the previous moment. The output of the update gate is proportional to the state information brought in at the previous moment. The reset gate controls the state information of the previous moment to be written to the current candidate set. The output of the reset gate is proportional to the state information written at the previous moment.

[0104] The Bidirectional Gated Recurrent Unit (BiGRU) network is composed of two unidirectional GRUs in opposite directions. By adding a back-propagation mechanism, the feedback and correction of the model based on the time series EEG data of the sleep stage can be considered, and the signal features can be extracted more accurately and the intrinsic correlation between the previous and next sleep stages can be explored. The output of the BiGRU at time t is generated by the forward hidden layer. and the backward layer state information The weighted summation yields:

[0105]

[0106] In the formula, x t is the state information at time t, and are the forward and backward state features retained at time t-1, w t and v t The forward hidden layer and the backward hidden state information The corresponding weight, b is the bias term. The structure of BiGRU is as follows Figure 4 As shown. BiGRU can process the sleep information of the front and back ends from two directions through two completely independent GRUs, and can better mine the information in the bidirectional time structure. The BiGRU structure of the present invention includes two layers of bidirectional GRU, which learn sequence dependency information from the front and back respectively, and each layer of BiGRU is added with a dropout regularization layer to further reduce the overfitting phenomenon.

[0107] 2.3 Loss Function: Loss function is a measure of the difference between the model's predicted value and the true value; it is usually used to guide the optimization of model parameters, find the model parameters that minimize the loss, so as to better fit the training data and generalize to the test data. Focal loss is an improvement on the cross entropy loss function. It can improve the classification effect when the categories are unbalanced by weight distribution. The main purpose is to make the model pay more attention to the difficult-to-classify samples when there are a large number of easy-to-classify samples (ie, negative samples) and a small number of difficult-to-classify samples (ie, positive samples). The formula is:

[0108] FL(p t )=-α t (1-p t ) γ log(p t )(8)

[0109] in:

[0110] ·p t is the model's predicted probability for positive samples.

[0111] α t It is the balance coefficient for positive and negative samples, generally the weight of positive samples and the weight of negative samples 1-α t .

[0112] γ is a tuning factor that controls the degree of loss reduction for easy-to-classify samples.

[0113] 3 Experimental results and analysis

[0114] 3.1 Evaluation indicators: In order to comprehensively evaluate the performance of the model, the present invention evaluates the overall and each category of indicators. The precision rate (PR), recall rate (RE) and F1 score (F1) of each category are used to evaluate the classification performance of each sleep stage; the accuracy (Acc), Cohen's Kappa (k) coefficient and macro-averaged F1 value (MF1) are used to intuitively understand the performance of the model on the entire dataset. The calculation formulas for various indicators are as follows:

[0115] Precision represents the proportion of positive samples among the samples predicted to be of the sleep stage type.

[0116]

[0117] Recall indicates the proportion of samples predicted to be of this sleep stage type to the total number of sleep stage s samples.

[0118]

[0119] F1-score represents a harmonic average of Recall and Precision.

[0120]

[0121] Accuracy indicates the proportion of samples with the correct sleep stage type predicted to the total number of samples.

[0122]

[0123] The effectiveness of the classifier can also be evaluated by calculating the Cohen's skappa coefficient of the model to measure the quality of the classification model. The kappa coefficient is generally used to evaluate multi-classification models.

[0124]

[0125] Where: P o is the ratio of correctly classified samples to the total sample size in each case, P e is the probability that the expected result is consistent with the actual result.

[0126]

[0127] Among them: TP means that both the predicted output and the actual output are true, that is, the number of correctly predicted positive samples; FP means that the predicted output is true and the actual output is false, that is, the number of incorrectly predicted negative samples; TN means that both the predicted output and the actual output are false, that is, the number of correctly predicted negative samples; FN means that the predicted output is false and the actual output is true, that is, the number of incorrectly predicted positive samples. n means the number of classes, and the experiment of the present invention sets n=5.

[0128] 3.2 Model evaluation and experimental analysis

[0129] 3.2.1 Training design: The dataset of the present invention comes from a public website. The sample data is divided into 80% training set and 20% test set. Then the 80% dataset is divided into 8:2 training set and validation set. There are 5 categories of output in total. Table 2 shows the parameter settings of the experimental model.

[0130] Table 2 Experimental model parameters

[0131]

[0132]

[0133] The constructed model was trained and tested using the Fpz-Cz channel of the EEG signal in the dataset. During model training, it was found through comparison that using the adaptive gradient method with weight decay (Adam with WeightDecay Fix, AdamW) to update and optimize the network weight values ​​helps to avoid the unnecessary impact of weight decay on the bias parameters. At the same time, the adaptive scheduling learning rate (ReduceLROnPlateau) is set to dynamically adjust the learning rate during model training, so that it converges quickly in the early stage of training and maintains a small learning rate in the later stage of training to fine-tune the model parameters. Through a reasonable learning rate scheduling strategy, the model can be prevented from falling into a local optimum or failing to converge, and the performance and stability of the model can be improved, and the training effect of the model can be improved.

[0134] 3.3 Experimental Results

[0135] 3.3.1 Confusion matrix: The model of the present invention uses the Fpz-Cz channel in Sleep-EDF-78. The confusion matrix covers the statistical results obtained by comparing the automatic sleep staging results with the known manual labels; in the table, the rows represent the known manual labels, the columns are the prediction results obtained by the model, and the bold numbers on the diagonal are the number of samples that are consistent with the judgments of the two; Table 3 shows the confusion matrix obtained based on the CNN-BiGRU automatic sleep model for the original sleep EEG data on the original data set; Table 5 is the confusion matrix obtained based on the ResCNN-BiGRU automatic sleep model for the class-balanced data after data enhancement processing.

[0136] Table 3 Confusion matrix of CNN-BiGRU model under original dataset

[0137]

[0138] Comparing Table 1 and Table 2, it can be observed that the automatic sleep staging model proposed in the present invention has achieved relatively good overall classification performance, with a classification accuracy of 82.56% on the original Sleep-EDF-20 dataset and 85.70% on the Sleep-EDF-78 dataset, which is an improvement over the CNN-BiGRU model, and the Kappa coefficient has also increased. In the original sleep EEG dataset, the number of samples of N1 belonging to the sleep transition stage accounts for a very small proportion. After class balancing, the classification performance of N1 has been significantly improved.

[0139] Table 4 Confusion matrix of ResCNN-BiGRU model after class balancing

[0140]

[0141] It can be seen from the above classification results that the ResCNN-BiGRU model is significantly better than the commonly used CNN-BiGRU model, and in Table 4, the precision and recall of the N1 stage are increased by 78.3% and 78.1% respectively, and the F1 index also reaches 78.2%, reflecting the necessity and effectiveness of class balance processing. At the same time, the discrimination effects of other sleep stages are improved to varying degrees. It can be seen from the above classification results that the ResCNN-BiGRU model is significantly better than the commonly used CNN-GRU model, reflecting that the improvements made in the model structure of the present invention can effectively improve the classification effect of the model on different sleep stages.

[0142] 3.3.2 Sleep phase sequence diagram: The purpose of constructing automatic sleep staging is to provide an efficient auxiliary discrimination tool for clinical diagnosis. The phase sequence diagram can clearly show the results of sleep state changes over time. In order to more intuitively show the prediction effect of the model of the present invention, the present invention selects the data of the first subject's sleep for a whole night in the Sleep-EDF-78 data set to list the results of expert prediction and the results of the model prediction proposed by the present invention. Figure 5As shown in (a) and (b), the horizontal axis represents time, and the vertical axis represents different sleep stages from bottom to top. Since the sleep process is a continuous process, the characteristics between adjacent sleep states are relatively similar. It can be observed from (b) that the model has a good discrimination effect on the continuous wakefulness state, and can also make relatively accurate predictions on the short-term awakening phenomenon that occurs during sleep. The model has some confusion in some adjacent states N2 and N3, N1 and N2, and REM. Overall, the change trend of the sleep state obtained by the model is generally consistent with the manual label, which can provide effective auxiliary discrimination for clinical diagnosis.

[0143] 3.3.3 Method comparison: To further verify the effectiveness of the model combining ResCNN and BiGRU, Table 5 shows the comparison of automatic sleep staging results in some literature under the same dataset and the same EEG signal channel. Compared with other automatic sleep staging networks, the overall accuracy has been improved by about 2% to 4%, and the kappa coefficient has been improved by about 6%.

[0144] Table 5 Comparison of the automatic sleep staging model based on ResCNN-BiGRU and other classification methods

[0145]

[0146] In order to improve the classification accuracy of the automatic sleep model for small samples, the present invention proposes an automatic sleep staging model based on sleep EEG signal data enhancement. The model uses Butterworth bandpass filtering technology, wavelet packet noise reduction technology and improved ADASYN technology to pre-process EEG data, uses CNN with residual network to extract time-frequency domain features between data, and combines BiGRU to extract the information features of the correlation between the previous and next time series of data, so as to fully extract the EEG signal features used for sleep staging. After the model is trained and optimized through the basic network, it proves the superior performance of the model of the present invention in automatic sleep staging and can also provide certain method support for building a home sleep monitoring system.

[0147] However, the model still has certain defects. It cannot classify the transition stages of sleep very well, especially in terms of data enhancement technology. It cannot generate samples of the same type completely correctly, and there will be certain deviations in classification. At the same time, the network only uses EEG signals for research. In the future, it can consider multi-modal and multi-channel signals such as electromyography, electrocardiography and electrooculography that exist in the sleep process. This also points out the direction for further development.

[0148] The present invention also provides an automatic sleep staging method system based on ResCNN-BiGRU, comprising:

[0149] An acquisition module, used to acquire sleep data for sleep staging;

[0150] A preprocessing module, used for preprocessing sleep data;

[0151] The staging module is used to input the pre-processed sleep data into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; the training process of the pre-trained automatic sleep staging model includes:

[0152] Acquire a data set to obtain sleep EEG data of a small sample category; perform data filtering and noise reduction on the sleep EEG data of a small sample category, and then perform data enhancement through an improved adaptive synthetic sampling technology method; use a convolutional neural network with a residual block to learn data feature representation, and then use a two-layer bidirectional gated recurrent unit network to mine deep timing information, determine the correlation between sleep, automatically learn the stage features of sleep data and extract sleep cycles to obtain sleep staging results, and train and test to obtain the pre-trained automatic sleep staging model.

[0153] The present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the automatic sleep staging method based on ResCNN-BiGRU is implemented.

[0154] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the automatic sleep staging method based on ResCNN-BiGRU is implemented.

[0155] In summary, the present invention aims at the class imbalance problem in sleep EEG data and the gradient vanishing or exploding problem in extracting more features from various deep networks. After data enhancement, the sleep EEG data of a few sample categories is subjected to data enhancement by an improved adaptive synthetic sampling technology (ADASYN) method, and then a convolutional neural network with a residual block is used to learn the data feature representation. Then, the deep timing information is mined through a two-layer bidirectional gated recurrent unit network to determine the correlation between sleep, thereby realizing automatic learning of sleep data stage features and extraction of sleep cycles, and realizing the classification of sleep stages. Experiments show that according to the American Academy of Sleep Medicine (AASM) sleep staging criteria, the classification accuracy and Cohen's Kappa coefficient scores of this method on the original Sleep-EDFx dataset are 85.79% and 0.80, respectively, which are 0.09% and 0.20 higher than those of traditional networks, respectively. Compared with some related studies, the recognition accuracy is significantly improved. After data class balancing, the overall accuracy is 86.29%, especially for stage N1, the accuracy is improved by 18.1%, which verifies the effectiveness and generalization ability of this method.

[0156] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0158] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An automatic sleep staging method based on ResCNN-BiGRU, characterized in that: include: Get sleep data for sleep staging; Preprocess the sleep data; Inputting the preprocessed sleep data into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; The training process of the pre-trained automatic sleep staging model includes: Obtain the data set and obtain the sleep EEG data of a few sample categories; The sleep EEG data of the few sample categories are subjected to data filtering and denoising, and then the data is enhanced by an improved adaptive synthetic sampling technology method; a convolutional neural network with a residual block is used to learn data feature representation, and then a two-layer bidirectional gated recurrent unit network is used to mine deep timing information to determine the correlation between sleep, and the sleep data stage features are automatically learned and the sleep cycle is extracted to obtain the sleep staging results, and the pre-trained automatic sleep staging model is obtained by training and testing.

2. The method according to claim 1, characterized in that The dataset adopts the Sleep-EDF dataset, and each period recorded in the Sleep-EDF dataset is manually labeled by clinicians as W, N1, N2, N3, N4, REM, movement and unknown stages according to the R&K rules; the PSG data includes dual-channel EEG, single-channel EOG, single-channel EMG and event markers.

3. The method according to claim 1, characterized in that The data filtering and noise reduction processing comprises: Use the single-channel EEG Fpz-Cz in the SC data set; merge the N3 and N4 periods into the N3 stage data according to the AASM judgment rule; exclude the MOVEMENT and UNKNOWN data; intercept the sleep EEG signals containing the preset time before and after sleep; use the Butterworth bandpass filter to filter the sleep EEG signals; Then, the wavelet packet denoising technology is used to denoise the sleep EEG signal. The signal is decomposed into different frequency levels through wavelet transform, and then the wavelet coefficients of each level are thresholded to remove noise. Finally, the denoised signal is reconstructed through inverse transform. The Db4 wavelet basis function of the Dobesi wavelet function family is used to perform a denoising scheme based on the appropriate number of layers of data length and wavelet length as the default number of layers, and it is corrected by the soft threshold function. After processing, the signal is sliced ​​into corresponding sleep stages at each time period to form a training data set for the corresponding stage; The improved adaptive synthetic sampling technique method is used to perform data enhancement, including: Adaptive synthetic sampling technology is used to enhance data with fewer samples, and the difficulty of learning different minority samples is distributed according to weights to synthesize more training data.

4. The method according to claim 1, characterized in that: The data enhancement processing specifically includes: Calculate the number of synthesized samples Gs,m s 、m l are the number of minority class samples and the number of majority class samples, respectively, s ≤m l ,m s +m l =m;β∈(0,1); G s =(m l -m s )b (1) For each minority class sample, K neighbors are calculated by Euclidean distance, and r i represents the proportion of majority class samples contained in the current neighborhood, where K represents the number of current neighbors and k represents the majority class samples in the current neighborhood; r i =k / K (2) According to G, the number of samples required to be synthesized for each minority sample is calculated, and the samples are synthesized according to formula (4), and X zi Represents X i A random minority sample from the k neighbors of , λ∈(0,1); g=G×r i (3) Z i =X i +(X zi -X i )×λ (4) Among them, g represents the number to be synthesized, Z i represents the synthesized new sample, X i Represents the current minority sample.

5. The method according to claim 1, characterized in that The convolutional neural network with residual blocks adds a residual network to the network architecture; the convolutional neural network mainly uses a 1×50 large convolution kernel layer, a 1×8 maximum pooling layer, three 1×8 small convolution kernel layers and a 1×4 maximum pooling, and introduces random inactivation technology and gradient clipping technology.

6. The method according to claim 1, characterized in that The bidirectional gated recurrent unit network consists of two unidirectional GRUs in opposite directions. A back-propagation mechanism is added, and the output at time t is generated by the forward hidden layer. and the backward layer state information The weighted summation yields: In the formula, x t is the state information at time t, and are the forward and backward state features retained at time t-1, w t and v t The forward hidden layer and the backward hidden state information The corresponding weight, b is the bias term; the BiGRU structure includes two layers of bidirectional GRU, which learn sequence dependency information from the front and back respectively, and a dropout regularization layer is added to each layer of BiGRU.

7. The method according to claim 1, characterized in that The training and testing obtain the pre-trained automatic sleep staging model, and use the Fpz-Cz channel of the EEG signal for training and testing; during training, an adaptive gradient method with weight decay is used to update and optimize the network weight value, and an adaptive scheduling learning rate is set to dynamically adjust the learning rate during the model training process, so that it converges quickly in the early stage of training, and maintains a smaller learning rate in the later stage of training to finely adjust the model parameters.

8. An automatic sleep staging method system based on ResCNN-BiGRU, characterized in that: include: An acquisition module, used to acquire sleep data for sleep staging; A preprocessing module, used for preprocessing sleep data; A staging module, used to input the preprocessed sleep data into a pre-trained automatic sleep staging model to obtain an automatic sleep staging result; The training process of the pre-trained automatic sleep staging model includes: Obtain the data set and obtain the sleep EEG data of a few sample categories; The sleep EEG data of the few sample categories are subjected to data filtering and denoising, and then the data is enhanced by an improved adaptive synthetic sampling technology method; a convolutional neural network with a residual block is used to learn data feature representation, and then a two-layer bidirectional gated recurrent unit network is used to mine deep timing information to determine the correlation between sleep, and the sleep data stage features are automatically learned and the sleep cycle is extracted to obtain the sleep staging results, and the pre-trained automatic sleep staging model is obtained by training and testing.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the automatic sleep staging method based on ResCNN-BiGRU according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the automatic sleep staging method based on ResCNN-BiGRU according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Sleep state monitoring method based on GM-GP algorithm

    CN119377900A

  • Network security situation assessment method based on ACDAE-ResBiGRU

    CN119484159A

  • Lightweight two-layer nested sleep staging method based on deep learning and wearable device

    CN120093216A

  • Lightweight two-layer nested sleep staging method based on deep learning, Wearable device

    CN120093216B

  • Sleep stage classification method based on multi-scale feature contrast learning

    CN120154301A