An automatic sleep staging method and device, computer readable storage medium

CN116458900BActive Publication Date: 2026-09-15CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210028497.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-11
Publication Date
2026-09-15
Estimated Expiration
2042-01-11

AI Technical Summary

Technical Problem

将目前通用神经网络模型应用于睡眠分期的方式避免了手动提取特征的主观性,但还是存在一定的缺陷,如:对小规模的类别不均衡的睡眠数据存在局限性,分类精度尚有较大提升空间,泛化能力也比较弱

Benefits of technology

[0085] This invention discloses an automatic sleep staging method and apparatus, and a computer-readable storage medium. The method involves collecting electroencephalogram (EEG) signals from a target user at a preset time. Using the EEG signals as input, multiple features output from multiple sub-networks are processed in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time. The feature extraction and classification tasks of the multiple sub-networks are different. In this scheme, by fusing the features output from multiple sub-networks and processing the multiple features in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time, the features of the EEG signals are learned more comprehensively, improving the accuracy of sleep staging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116458900B_ABST
    Figure CN116458900B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an automatic sleep staging method and device, and a storage medium, brain electrical signals of a target user at a preset time are collected; the brain electrical signals are taken as input, multiple features output by multiple sub-networks are utilized, and a preset classification model is combined to process the multiple features, so as to determine a classification result corresponding to the brain electrical signals of the target user at the preset time; feature extraction tasks and classification tasks of the multiple sub-networks are different. In the above scheme, the features output by the multiple sub-networks are fused, and the multiple features are processed by combining the preset classification model, so as to determine the classification result corresponding to the brain electrical signals of the target user at the preset time. The features of the brain electrical signals are learned more richly, and the sleep staging precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an automatic sleep staging method and apparatus, and a computer-readable storage medium. Background Technology

[0002] Sleep is a vital physiological activity in life. Good sleep not only helps the body eliminate fatigue and restore physical strength, and promotes normal brain function, but also contributes to physical and mental health. Currently, many hospitals in my country have established sleep monitoring departments. The interpretation of sleep monitoring data is usually done by professional polysomnography technicians. However, the number of registered polysomnography technicians in my country is very small. This results in insufficient sleep monitoring services for users, and also places a heavy burden on the interpreters. Therefore, it is essential to achieve intelligent interpretation to improve the efficiency of sleep monitoring data interpretation.

[0003] With the development of computer and information technology, neural networks, machine learning, and deep learning technologies have been widely applied in the biomedical field. There are many intelligent sleep staging methods based on electroencephalogram (EEG) signals. For example, there are studies on automatic classification based on single-channel EEG signals. However, most studies on sleep staging using single-channel EEG signals rely on feature engineering, manually extracting time-domain or frequency-domain features from raw data and then classifying them using a specific classifier. These methods have certain limitations and rely on the prior knowledge of professional physicians. Applying currently used general neural network models to sleep staging avoids the subjectivity of manual feature extraction, but still has certain drawbacks, such as limitations in handling small-scale, class-imbalanced sleep data, significant room for improvement in classification accuracy, and relatively weak generalization ability. Summary of the Invention

[0004] This invention provides an automatic sleep staging method and apparatus, as well as a computer-readable storage medium, which enables richer learning of the characteristics of electroencephalogram (EEG) signals and improves the accuracy of sleep staging.

[0005] The technical solution of this invention is implemented as follows:

[0006] This invention provides a method for automatic sleep staging, the method comprising:

[0007] Collect the target user's electroencephalogram (EEG) signals at a preset time.

[0008] The EEG signal is used as input, and multiple features output from multiple sub-networks are used to process the multiple features in combination with a preset classification model to determine the classification result corresponding to the EEG signal of the target user at a preset time; the feature extraction task and classification task of the multiple sub-networks are different.

[0009] In the above scheme, the collection of the target user's electroencephalogram (EEG) signals over a preset time includes:

[0010] The multiple regions for the acquisition of the electroencephalogram (EEG) signals are determined; wherein, the multiple regions include the bilateral occipital regions, the left frontal region, the right frontal region, the left central region, and the right central region;

[0011] Based on the multiple regions, the EEG signals of the target user at preset times are collected; wherein, alpha rhythm EEG signals are collected in the bilateral occipital regions; and theta wave EEG signals are collected in the left frontal region, right frontal region, left central region, and right central region.

[0012] In the above scheme, before taking the EEG signal as input, utilizing multiple features output from multiple sub-networks, and processing the multiple features in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signal at a preset time, the method further includes:

[0013] Collect multiple segments of EEG signals from the user at a preset time;

[0014] By using multiple initial sub-networks, the multi-segment sample EEG signals are combined with randomly generated noise signals for feature processing to obtain multiple sample features corresponding to multiple preset classification categories and multiple predicted categories.

[0015] Using an initial classification model, the features of the multiple samples are classified and predicted to obtain multiple classification results corresponding to the multiple segments of the EEG signals.

[0016] The parameters of the multiple initial sub-networks and the initial classification model are adjusted by combining the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, until the training ends and the multiple sub-networks and the preset classification model are obtained.

[0017] In the above scheme, the plurality of sub-networks include a first sub-network, a second sub-network, and a third sub-network; the plurality of initial sub-networks include a first initial sub-network, a second initial sub-network, and a third initial sub-network.

[0018] The plurality of preset proposed classification categories include a first preset proposed classification category, a second preset proposed classification category, and a third preset proposed classification category;

[0019] The first preset classification category is alpha wave, beta wave, gamma wave, theta wave, and delta wave;

[0020] The second preset classification category is sleep period and wakefulness period;

[0021] The third preset classification category is N1, N2, N3 and Rem.

[0022] The multi-segment sample EEG signals include: a first sample EEG signal, a second sample EEG signal, and a third sample EEG signal;

[0023] The noise signal includes: a first noise signal, a second noise signal, and a third noise signal;

[0024] The multiple prediction categories include: a first prediction category, a second prediction category, a third prediction category, a fourth prediction category, a fifth prediction category, and a sixth prediction category.

[0025] In the above scheme, the use of multiple initial sub-networks to perform feature processing on the multiple sample EEG signals combined with randomly generated noise signals to obtain multiple sample features corresponding to multiple preset classification categories and multiple predicted categories includes:

[0026] Using the first initial sub-network, the first sample EEG signal is combined with a randomly generated first noise signal for feature processing to obtain the first sample feature corresponding to the first preset classification category; and the first sample feature is used as input to reconstruct the category using the first initial classifier in the first initial sub-network to determine the first predicted category.

[0027] Using the second initial sub-network, the second sample EEG signal is combined with a randomly generated second noise signal for feature processing to obtain the second sample feature corresponding to the second preset classification category; and the second sample feature is used as input to reconstruct the category using the second initial classifier in the second initial sub-network to determine the second predicted category.

[0028] Using the third initial sub-network, the third sample EEG signal is combined with a randomly generated third noise signal for feature processing to obtain the third sample feature corresponding to the third preset classification category; and the third sample feature is used as input to reconstruct the category using the third initial classifier in the third initial sub-network to determine the third predicted category.

[0029] The first sample feature, the second sample feature, and the third sample feature are fused to obtain the multi-sample feature.

[0030] In the above scheme, the step of using the first initial sub-network to perform feature processing on the first sample EEG signal combined with a randomly generated first noise signal to obtain the first sample features corresponding to the first preset classification category includes:

[0031] The first sample EEG signal, the first preset classification category corresponding to the first sample EEG signal, and the randomly generated first noise signal are used as inputs. The first initial generation network in the first initial sub-network is used for processing to determine the first waveform data corresponding to the first sample EEG signal. The first waveform data includes the first preset classification category and the corresponding first sample feature.

[0032] In the above scheme, the step of using the second initial sub-network to perform feature processing on the second sample EEG signal combined with a randomly generated second noise signal to obtain the second sample features corresponding to the second preset classification category includes:

[0033] The second sample EEG signal, the second preset classification category corresponding to the second sample EEG signal, and the randomly generated second noise signal are used as inputs. The second initial generation network in the second initial sub-network is used for processing to determine the second waveform data corresponding to the second sample EEG signal. The second waveform data includes the second preset classification category and the corresponding second sample features.

[0034] In the above scheme, the step of using the third initial sub-network to perform feature processing on the third sample EEG signal combined with the randomly generated third noise signal to obtain the third sample features corresponding to the third preset classification category includes:

[0035] The third sample EEG signal, the third preset classification category corresponding to the third sample EEG signal, and the randomly generated third noise signal are used as inputs. The third initial generation network in the third initial sub-network is used for processing to determine the third waveform data corresponding to the third sample EEG signal. The third waveform data includes the third preset classification category and the corresponding third sample features.

[0036] In the above scheme, the step of combining the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, to adjust the parameters of the multiple initial sub-networks and the initial classification model until the training is completed and the multiple sub-networks and the preset classification model are obtained, includes:

[0037] Determine the first loss between the first predicted category and the first preset classification category;

[0038] Determine the second loss for the second predicted category and the second preset classification category;

[0039] The third loss is determined by the third predicted category and the third preset classification category;

[0040] The fourth loss is used to determine the multiple classification results and the multiple preset categories corresponding to the multiple sample EEG signals;

[0041] Based on the first loss, the parameters of the first initial sub-network are adjusted to obtain the first sub-network after one training.

[0042] Based on the second loss, the parameters of the second initial sub-network are adjusted to obtain the second sub-network after one training.

[0043] Based on the third loss, the parameters of the third initial sub-network are adjusted to obtain the third sub-network after one training.

[0044] By combining the first sub-network, the second sub-network, and the third sub-network after one training iteration, and adjusting the initial classification model based on the fourth loss, a network adjustment is achieved until training ends, resulting in the multiple sub-networks and the preset classification model.

[0045] In the above scheme, adjusting the parameters of the first initial sub-network based on the first loss to obtain the first sub-network after one training cycle includes:

[0046] Using the first loss, the parameters of the first initial discriminant network in the first initial sub-network are adjusted to obtain the trained first discriminant network;

[0047] The first predicted category is used as a negative sample and the first proposed classification category is used as a positive sample. The second initial discriminant network in the first initial sub-network is used for processing to determine the fourth predicted category.

[0048] The fifth loss is determined by the second predicted category and the first preset classification category;

[0049] Using the fifth loss, the parameters of the second initial discriminant network are adjusted to obtain the trained second discriminant network;

[0050] Based on the first loss and the fifth loss, the parameters of the first initial generator network and the first initial classification network are adjusted to obtain the first sub-network after one training.

[0051] In the above scheme, adjusting the parameters of the first initial generator network and the first initial classification network based on the first loss and the fifth loss to obtain the first sub-network after one training cycle includes:

[0052] Clustering is performed on the first proposed classification category features extracted from the first fully connected layer to determine the mean value of each category in the first sample EEG signal; the first initial classification network includes the fully connected layer.

[0053] The first calculation result is determined by performing cosine operations on the mean values ​​of each category in the first sample EEG signal and the features of the first proposed classification category.

[0054] The first calculation result, the first loss, and the fifth loss are superimposed to determine the first superposition result;

[0055] Using the first superposition result, the parameters of the first initial generation network and the first initial classification network are adjusted to obtain the first sub-network after one training.

[0056] In the above scheme, adjusting the parameters of the second initial sub-network based on the second loss to obtain the second sub-network after one training step includes:

[0057] Using the second loss, the parameters of the third initial discriminant network in the second initial sub-network are adjusted to obtain the trained third discriminant network;

[0058] The second predicted category is used as a negative sample and the second proposed classification category is used as a positive sample. The fourth initial discriminant network in the second initial sub-network is used for processing to determine the fifth predicted category.

[0059] The sixth loss is determined by the fifth predicted category and the first preset classification category;

[0060] Using the sixth loss, the parameters of the fourth initial discriminant network are adjusted to obtain the trained fourth discriminant network;

[0061] Based on the second loss and the sixth loss, the parameters of the second initial generator network and the second initial classification network are adjusted to obtain the second sub-network after one training.

[0062] In the above scheme, adjusting the parameters of the second initial generator network and the second initial classification network based on the second loss and the sixth loss to obtain the second sub-network after one training cycle includes:

[0063] Clustering is performed on the second proposed classification category features extracted from the second fully connected layer to determine the mean value of each category in the EEG signal of the second sample; the second initial classification network includes the second fully connected layer.

[0064] The cosine operation is performed on the mean values ​​of each category in the second sample EEG signal and the features of the second proposed classification category to determine the second operation result;

[0065] The second calculation result, the second loss, and the sixth loss are superimposed to determine the second superposition result;

[0066] Using the second superposition result, the parameters of the second initial generator network and the second initial classification network are adjusted to obtain the second sub-network after one training.

[0067] In the above scheme, adjusting the parameters of the third initial sub-network based on the third loss to obtain the third sub-network after one training step includes:

[0068] Using the third loss, the parameters of the fifth initial discriminant network in the third initial sub-network are adjusted to obtain the trained fifth discriminant network;

[0069] The third predicted category is used as a negative sample and the third proposed classification category is used as a positive sample. The sixth initial discriminant network in the third initial sub-network is used for processing to determine the sixth predicted category.

[0070] The seventh loss is determined by the sixth predicted category and the third preset classification category;

[0071] Using the seventh loss, the parameters of the sixth initial discriminant network are adjusted to obtain the trained sixth discriminant network;

[0072] Based on the third loss and the seventh loss, the parameters of the third initial generator network and the third initial classification network are adjusted to obtain the third sub-network after one training.

[0073] In the above scheme, adjusting the parameters of the third initial generator network and the third initial classification network based on the third loss and the seventh loss to obtain the third sub-network after one training cycle includes:

[0074] The features of the third proposed classification category extracted from the third fully connected layer are clustered to determine the mean of each category in the EEG signal of the third sample; the third initial classification network includes the third fully connected layer.

[0075] The cosine operation is performed on the mean values ​​of each category in the third sample EEG signal and the features of the third proposed classification category to determine the third operation result;

[0076] The third calculation result, the third loss, and the seventh loss are superimposed to determine the third superposition result;

[0077] Using the third superposition result, the parameters of the third initial generator network and the third initial classification network are adjusted to obtain the third sub-network after one training.

[0078] This invention provides an automatic sleep staging device, which includes a data acquisition unit and a determination unit; wherein,

[0079] The acquisition unit is used to acquire the electroencephalogram (EEG) signals of the target user at a preset time.

[0080] The determining unit is used to take the EEG signal as input, utilize the multiple features output by multiple sub-networks, and process the multiple features in combination with a preset classification model to determine the classification result corresponding to the EEG signal of the target user at a preset time; the feature extraction tasks and classification tasks of the multiple sub-networks are different.

[0081] This invention provides an automatic sleep staging device, the automatic sleep staging device comprising:

[0082] Memory, used to store executable instructions;

[0083] The processor is used to execute executable instructions stored in the memory, and when the executable instructions are executed, the processor executes the automatic sleep staging method.

[0084] This invention provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the processors execute the automatic sleep staging method.

[0085] This invention discloses an automatic sleep staging method and apparatus, and a computer-readable storage medium. The method involves collecting electroencephalogram (EEG) signals from a target user at a preset time. Using the EEG signals as input, multiple features output from multiple sub-networks are processed in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time. The feature extraction and classification tasks of the multiple sub-networks are different. In this scheme, by fusing the features output from multiple sub-networks and processing the multiple features in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time, the features of the EEG signals are learned more comprehensively, improving the accuracy of sleep staging. Attached Figure Description

[0086] Figure 1 A flowchart illustrating an automatic sleep staging method provided in this embodiment of the invention. Figure 1 ;

[0087] Figure 2 This is a schematic diagram illustrating the effect of data preprocessing according to an embodiment of the present invention;

[0088] Figure 3 This is a schematic diagram illustrating the effect of head EEG signal acquisition location according to an embodiment of the present invention;

[0089] Figure 4This is a schematic diagram illustrating the effect of feature extraction and splitting across various dimensions, provided by an embodiment of the present invention.

[0090] Figure 5 This is a schematic diagram illustrating the effect of a sub-network structure provided in an embodiment of the present invention;

[0091] Figure 6 This invention provides an illustration of the effect of an optimized discriminant network in an embodiment of the invention. Figure 1 ;

[0092] Figure 7 This invention provides an illustration of the effect of an optimized discriminant network in an embodiment of the invention. Figure 2 ;

[0093] Figure 8 This is a schematic diagram illustrating the effect of optimizing the generator network and the classification network according to an embodiment of the present invention;

[0094] Figure 9 This is a schematic diagram illustrating the effect of an overall network structure provided in an embodiment of the present invention;

[0095] Figure 10 This is a schematic diagram of an automatic sleep staging device provided in an embodiment of the present invention;

[0096] Figure 11 This is a schematic diagram of another automatic sleep staging device provided in an embodiment of the present invention. Detailed Implementation

[0097] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0098] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 A flowchart illustrating an automatic sleep staging method provided in this embodiment of the invention. Figure 1 , will combine Figure 1 The steps shown are explained.

[0099] S101. Collect the target user's EEG signals at a preset time.

[0100] In an embodiment of the present invention, it is first necessary to collect the target user's electroencephalogram (EEG) signals for a certain period of time, and then perform subsequent processing.

[0101] In an embodiment of the present invention, the EEG signal over a certain period of time can be the EEG signal of the user throughout the entire night.

[0102] S102. Using EEG signals as input, multiple features output from multiple sub-networks are utilized, and combined with a preset classification model, the multiple features are processed to determine the classification result corresponding to the EEG signals of the target user at a preset time; the feature extraction and classification tasks of the multiple sub-networks are different.

[0103] In embodiments of the present invention, EEG signals are used as input, processed using a multi-subnetwork to output multiple features, and then a preset classification model is used to process the multiple features to determine the classification result corresponding to the EEG signal of the target user at a preset time. The feature extraction and classification tasks of each subnetwork are different.

[0104] In some embodiments of the present invention, after acquiring the electroencephalogram (EEG) signals, the data is preprocessed, and then processed using multiple sub-networks and a preset classification model. For example... Figure 2 As shown, Figure 2 This diagram illustrates the effect of data preprocessing according to an embodiment of the present invention. Noise in the EEG signal is filtered out using wavelet analysis; baseline drift and electromyographic interference in the EEG signal are filtered out using wavelet decomposition and reconstruction; and EEG rhythm signals are extracted using wavelet multi-resolution analysis. Wavelet transform can effectively filter out spikes in high-frequency noise and is excellent for analyzing and processing non-stationary signals. The db3 wavelet is used here, which has good regularity. The smoothing error introduced by this wavelet as a sparse basis is not easily detected, making the signal reconstruction process relatively smooth. Next, the signal is divided into 30-second frames, ultimately obtaining 30-second frame segments. That is, sleep stages are determined every 30 seconds. If multiple sleep stages exist simultaneously within a segment at a given time, the sleep stage with the largest proportion within that frame is taken as the final sleep stage result for that segment.

[0105] In an embodiment of the present invention, three sub-networks may be set up.

[0106] As is understood, in the embodiments of the present invention, EEG signals of the target user are collected at a preset time. These EEG signals are then used as input, and multiple features output from multiple sub-networks are processed in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time. This method effectively improves the breadth of EEG signal feature extraction, enhances sleep staging accuracy, and achieves higher efficiency in interpreting and analyzing sleep monitoring data.

[0107] In some embodiments of the present invention, S101 can be implemented by S1011 to S1012, and specific steps will be described below.

[0108] S1011. Determine multiple regions for EEG signal acquisition; among which, multiple regions include bilateral occipital regions, left frontal region, right frontal region, left central region, and right central region.

[0109] In some embodiments of the present invention, when collecting the user's electroencephalogram (EEG) signals within a preset time period, multiple regions for EEG signal collection are first determined, including bilateral occipital regions, left frontal region, right frontal region, left central region, and right central region.

[0110] S1012. Based on multiple regions, collect the EEG signals of the target user at the preset time; among them, the EEG signals of alpha rhythm waves are collected in the bilateral occipital regions; the EEG signals of theta waves are collected in the left frontal region, right frontal region, left central region and right central region.

[0111] In some embodiments of the present invention, based on multiple defined regions, EEG signals of the target user are collected at preset times; wherein, EEG signals of alpha rhythm waves are collected in the bilateral occipital regions; and EEG signals of theta waves are collected in the left frontal region, right frontal region, left central region and right central region.

[0112] In some embodiments of the present invention, the method for acquiring electroencephalogram (EEG) signals involves attaching lead electrodes to corresponding positions, using conductive gel at the connection points to enhance conductivity, and collecting the subject's sleep data throughout the night. This method aims to collect 6-lead EEG signal data and segment the sleep process based on the different morphological characteristics of these signals. For example... Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the effect of head EEG signal acquisition positions according to an embodiment of the present invention. EEG signal acquisition includes data from six leads: O1, O2, C3, C4, F3, and F4. O1 and O2 are located in the bilateral occipital regions, which are the areas with the most prominent alpha rhythm physiological signals. These regions exhibit the highest alpha rhythm amplitude and best modulation, representing typical waveforms for monitoring the closed-eye state during sleep. F3 and F4 are located in the left and right frontal regions, respectively, while C3 and C4 are located in the left and right central regions. These regions can yield relatively prominent theta waves.

[0113] In some embodiments of the present invention, S201 is included before S102. S201 can be implemented by S2011 to S2014, and specific steps will be given for description.

[0114] S2011. Collect multiple sample EEG signals from the user within a preset time period.

[0115] In some embodiments of the present invention, multiple sample EEG signals preset by the user are acquired and then processed.

[0116] In some embodiments of the present invention, S2011 is similar to S1011 and S1012, and will not be described in detail here.

[0117] S2012. Using multiple initial sub-networks, feature processing is performed on multiple sample EEG signals combined with randomly generated noise signals to obtain multiple sample features corresponding to multiple preset classification categories and multiple predicted categories.

[0118] In some embodiments of the present invention, multiple sample brain signals are combined with randomly generated noise information as input, and multiple initial sub-networks are used for feature processing to obtain multiple sample features and multiple predicted categories corresponding to multiple preset classification categories.

[0119] In some embodiments of the present invention, after the EEG signal is acquired, the signal is divided into 30-second frames to obtain segment data of 30-second frames. That is, the sleep period is judged every 30 seconds. If multiple sleep periods exist at the same time in the segment, the sleep period with the largest proportion in the frame is taken as the final sleep stage result of the segment.

[0120] In some embodiments of the present invention, such as Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the effect of feature extraction and decomposition across various dimensions provided in an embodiment of the present invention. Each sub-network has the same structure, but the feature extraction and classification tasks differ. The final sleep staging task is designed and divided according to different category granularities. Each sub-network corresponds to a set of proposed classification category information. The specific division of the proposed classification category information corresponding to the three sets of sub-networks is as follows: Figure 4 As shown. In proposed category 1, gamma wave frequencies above 38 Hz correspond to brain waves of extreme excitement; beta wave frequencies of 14-38 Hz correspond to brain waves of relatively high excitement, a type of brain wave released by the brain under stress; alpha wave frequencies of 8-14 Hz correspond to brain waves of relaxation and meditation; theta wave frequencies of 4-7 Hz correspond to brain waves of a semi-sleep state, a brain wave between deep sleep and wakefulness; and delta wave frequencies of 0.5-3.5 Hz correspond to brain waves of deep sleep, indicating that the subject is in an unconscious, deep sleep state. Proposed category 2 only includes wakefulness and sleep stages, representing a classifier with less category information and classification tasks. Proposed category 3 includes stages N1, N2, N3, and Rem stages of sleep, which are the sleep stages most relevant to typical sleep staging tasks. Finally, features are extracted using sub-networks. Feature extraction network 1 (first sub-network) extracts features from the EEG signals input to this network, feature extraction network 2 (second sub-network) extracts features from the EEG signals input to this network, and feature extraction network 3 (third sub-network) extracts features from the EEG signals input to this network. The structure of each sub-network is as follows: Figure 5 As shown. Figure 5This is a schematic diagram illustrating the effect of a sub-network structure provided in an embodiment of the present invention. In this invention, each sub-network includes a generator network, a classification network, and two discriminator networks. Taking one sub-network (the first sub-network) as an example, this sub-network includes a generator network (first generator network), a classification network (first classification network), a discriminator network 1 (first discriminator network), and a discriminator network 2 (second discriminator network). The collected EEG signals are input to the generator network for processing. The generator network generates waveforms (first waveform data) based on the input. The obtained waveforms are then processed by the classification network to obtain the classified category (first predicted category). The classified category and the proposed discriminator category are then used as inputs and processed by the discriminator network 1 to determine the loss value. The original waveform signal (the first sample EEG signal) and the generated waveform are used as inputs and processed by discriminant network 2 to obtain the loss value. The fully connected layer of the classification network (the first fully connected layer) is extracted, and the features in the fully connected layer are clustered to obtain the clustering result. Using the two loss values ​​and the clustering result, the parameters of the generator network, classification network, discriminant network 1, and discriminant network 2 are adjusted. T / F represents the probability that the output value of the discriminant network belongs to the real data. Since the discriminant networks are all binary classification networks, that is, the discrimination result is usually 1 or 0, binary cross-entropy is used to implement the loss of these two networks. A more detailed introduction is as follows: Figure 8 As shown.

[0121] S2013. Using the initial classification model, classify and predict the features of multiple samples to obtain multiple classification results corresponding to the EEG signals of multiple samples.

[0122] In some embodiments of the present invention, after obtaining multiple sample features, the multiple sample features are classified and predicted using an initial classification model to obtain multiple classification results corresponding to multiple sample EEG signals.

[0123] S2014. Combine the losses of multiple predicted categories and multiple preset proposed classification categories, as well as the losses of multiple classification results and multiple preset proposed classification categories corresponding to multiple sample EEG signals, to adjust the parameters of multiple initial sub-networks and initial classification models until training ends and multiple sub-networks and the preset classification models are obtained.

[0124] In some embodiments of the present invention, the parameters of multiple initial sub-networks are adjusted using the losses of multiple predicted categories and multiple preset proposed classification categories, and the parameters of the initial classification model are adjusted using the losses of multiple classification results and multiple preset proposed classification categories corresponding to multiple sample EEG signals, until the training ends and multiple sub-networks and preset classification models are obtained.

[0125] It is understood that in some embodiments of the present invention, multiple sample EEG signals of the user at a preset time are obtained, and then processed using multiple initial sub-networks and an initial classification network. The parameters of the multiple initial sub-networks and the initial classification network are adjusted using the obtained multiple losses to obtain multiple trained sub-networks and classification models. Finally, the trained sub-networks and classification networks are used to make predictions, which can improve the accuracy of sleep staging and obtain higher efficiency in interpreting and analyzing sleep monitoring data.

[0126] In some embodiments of the present invention, in S2011-S2014, multiple subnetworks include a first subnetwork, a second subnetwork, and a third subnetwork; multiple initial subnetworks include a first initial subnetwork, a second initial subnetwork, and a third initial subnetwork; multiple preset proposed classification categories include a first preset proposed classification category, a second preset proposed classification category, and a third preset proposed classification category; the first preset proposed classification category is alpha wave, beta wave, gamma wave, theta wave, and delta wave; the second preset proposed classification category is sleep stage and wakefulness stage; the third preset proposed classification category is N1 stage, N2 stage, N3 stage, and Rem stage; multiple sample EEG signals include: a first sample EEG signal, a second sample EEG signal, and a third sample EEG signal; noise signals include: a first noise signal, a second noise signal, and a third noise signal; multiple predicted categories include: a first predicted category, a second predicted category, a third predicted category, a fourth predicted category, a fifth predicted category, and a sixth predicted category.

[0127] In some embodiments of the present invention, S2012 can be implemented by S20121 to S20124, and specific steps will be given for description.

[0128] S20121. Using the first initial sub-network, the first sample EEG signal is combined with the first randomly generated first noise signal for feature processing to obtain the first sample feature corresponding to the first preset classification category; and the first sample feature is used as input to reconstruct the category using the first initial classifier in the first initial sub-network to determine the first predicted category.

[0129] In some embodiments of the present invention, a first initial sub-network is used to perform feature processing on the first sample EEG signal combined with a randomly generated first noise signal to obtain the first sample feature corresponding to the first preset classification category; and the first sample feature is used as input to perform category reconstruction using the first initial classifier in the first initial sub-network to determine the first predicted category.

[0130] S20122. Using the second initial sub-network, the second sample EEG signal is combined with the randomly generated second noise signal for feature processing to obtain the second sample features corresponding to the second preset classification category; and the second sample features are used as input to reconstruct the category using the second initial classifier in the second initial sub-network to determine the second predicted category.

[0131] In some embodiments of the present invention, a second initial sub-network is used to perform feature processing on the second sample EEG signal combined with a randomly generated second noise signal to obtain the second sample features corresponding to the second preset classification category; then, the first sample features are used as input, and the first initial classifier in the first initial sub-network is used to reconstruct the category to determine the first predicted category.

[0132] S20123. Using the third initial sub-network, the third sample EEG signal is combined with the randomly generated third noise signal for feature processing to obtain the third sample features corresponding to the third preset classification category; and the third sample features are used as input to reconstruct the category using the third initial classifier in the third initial sub-network to determine the third predicted category.

[0133] In some embodiments of the present invention, a third initial sub-network is used to perform feature processing on the third sample EEG signal combined with a randomly generated third noise signal to obtain the third sample feature corresponding to the third preset classification category; and the third sample feature is used as input to perform category reconstruction using the third initial classifier in the third initial sub-network to determine the third predicted category.

[0134] S20124. The first sample feature, the second sample feature and the third sample feature are fused to obtain multiple sample features.

[0135] In some embodiments of the present invention, the acquired first sample features, second sample features and third sample features are fused to obtain the final multiple sample features.

[0136] In some embodiments of the present invention, S20121 can be implemented by S201211, which will be described in conjunction with the steps.

[0137] S201211. The first sample EEG signal, the first preset classification category corresponding to the first sample EEG signal, and the randomly generated first noise signal are taken as inputs and processed by the first initial generation network in the first initial sub-network to determine the first waveform data corresponding to the first sample EEG signal; the first waveform data includes the first preset classification category and the corresponding first sample features.

[0138] In some embodiments of the present invention, the first sample EEG signal, the first preset classification category corresponding to the first sample EEG signal, and the randomly generated first noise signal are used as inputs, and processed by the first initial generation network in the first initial sub-network to determine the first waveform data corresponding to the first sample EEG signal; the first waveform data includes the first preset classification category and the corresponding first sample features.

[0139] In some embodiments of the present invention, a random noise signal mixed with the category label corresponding to the first sample computer signal is fed into the generator network. The generator network generates a waveform based on the category label. Typically, the generator network receives a noise signal composed of random numbers; however, in this invention, a noise signal containing the category to be determined is used instead of random noise as input to the generator network. Since the signal received by the generator network is the final category information to be determined, the waveform generated by the generator network can be considered to contain all features of the category to be determined. Unlike conditional generative adversarial networks (GANs), which use noise and labels together as input and add conditional constraints, this invention uses noise and all information of the category to be determined together as input, increasing the amount of input information. The input contains more information, making it easier for the generator network to generate waveforms, and the generated waveform contains features of the category information.

[0140] In some embodiments of the present invention, S20122 can be implemented by S201221, which will be described in conjunction with the steps.

[0141] S201221. The second sample EEG signal, the second preset classification category corresponding to the second sample EEG signal, and the randomly generated second noise signal are taken as inputs and processed by the second initial generation network in the second initial sub-network to determine the second waveform data corresponding to the second sample EEG signal; the second waveform data contains the second preset classification category and the corresponding second sample features.

[0142] In some embodiments of the present invention, the second sample EEG signal, the second preset classification category corresponding to the second sample EEG signal, and the randomly generated second noise signal are used as inputs, and processed by the second initial generation network in the second initial sub-network to determine the second waveform data corresponding to the second sample EEG signal; the second waveform data includes the second preset classification category and the corresponding second sample features. This process is similar to S201211 and will not be described in detail here.

[0143] In some embodiments of the present invention, S20123 can be implemented by S201231, which will be described in conjunction with the steps.

[0144] S201231. The third sample EEG signal, the third preset classification category corresponding to the third sample EEG signal, and the randomly generated third noise signal are taken as inputs and processed by the third initial generation network in the third initial sub-network to determine the third waveform data corresponding to the third sample EEG signal; the third waveform data contains the third preset classification category and the corresponding third sample features.

[0145] In some embodiments of the present invention, the third sample EEG signal, the third preset classification category corresponding to the third sample EEG signal, and the randomly generated third noise signal are used as inputs, and processed by the third initial generation network in the third initial sub-network to determine the third waveform data corresponding to the third sample EEG signal; the third waveform data includes the third preset classification category and the corresponding third sample features. This process is similar to S201211 and will not be described in detail here.

[0146] In some embodiments of the present invention, S2014 can be implemented by S301 to S308, which will be described in detail in conjunction with the following steps.

[0147] S301. Determine the first loss for the first predicted category and the first preset classification category.

[0148] In some embodiments of the present invention, a first loss is determined for a first predicted category and a first preset classification category.

[0149] In some embodiments of the present invention, a first loss of the corresponding loss function is determined based on a first predicted category and a first preset classification category.

[0150] S302, Determine the second loss for the second predicted category and the second preset classification category.

[0151] In some embodiments of the present invention, a second loss is determined for a second predicted category and a second preset classification category.

[0152] In some embodiments of the present invention, a second loss of the corresponding loss function is determined based on a second predicted category and a second preset classification category.

[0153] S303, Determine the third loss for the third predicted category and the third preset classification category.

[0154] In some embodiments of the present invention, a third loss is determined for a third predicted category and a third preset classification category.

[0155] In some embodiments of the present invention, a third loss of the corresponding loss function is determined based on a third predicted category and a third preset classification category.

[0156] S304. Determine the fourth loss for multiple classification results and multiple preset categories corresponding to multiple sample EEG signals.

[0157] In some embodiments of the present invention, a fourth loss of the corresponding loss function is determined based on multiple classification results and multiple preset proposed classification categories corresponding to multiple EEG signals.

[0158] S305. Based on the first loss, adjust the parameters of the first initial sub-network to obtain the first sub-network after one training.

[0159] In some embodiments of the present invention, the parameters of the first initial sub-network are adjusted based on the first loss to obtain the first sub-network after one training.

[0160] S306. Based on the second loss, adjust the parameters of the second initial sub-network to obtain the second sub-network after one training.

[0161] In some embodiments of the present invention, the parameters of the second initial sub-network are adjusted based on the second loss to obtain the second sub-network after one training.

[0162] S307. Based on the third loss, adjust the parameters of the third initial sub-network to obtain the third sub-network after one training.

[0163] In some embodiments of the present invention, the parameters of the third initial sub-network are adjusted based on the third loss to obtain the third sub-network after one training.

[0164] S308. Combine the first sub-network after one training session, the second sub-network after one training session, the third sub-network after one training session, and adjust the initial classification model based on the fourth loss to achieve one network adjustment, until the training ends, resulting in multiple sub-networks and a preset classification model.

[0165] In some embodiments of the present invention, a network adjustment is achieved by combining a first sub-network after one training session, a second sub-network after one training session, a third sub-network after one training session, and adjusting the initial classification model based on a fourth loss, until the training ends, resulting in multiple sub-networks and a preset classification model.

[0166] In some embodiments of the present invention, S305 can be implemented by S3051 to S3055, which will be described in detail in conjunction with the steps.

[0167] S3051. Using the first loss, adjust the parameters of the first initial discriminant network in the first initial sub-network to obtain the trained first discriminant network.

[0168] In some embodiments of the present invention, after obtaining the first loss, the parameters of the first discriminant network of the first initial sub-network are adjusted using the first loss to obtain the trained first discriminant network, such as... Figure 6 As shown, Figure 6 This invention provides an illustration of the effect of an optimized discriminant network in an embodiment of the invention. Figure 1The classification network uses the category reconstructed from the waveform as the negative sample and the category to be discriminated as the positive sample. Both the category to be discriminated and the category reconstructed from the generated waveform by the classification network include N1, N2, N3 and Rem periods. Discriminant network 1 is used to perform binary classification on the two input data and calculates the binary classification loss. The calculated loss value is used to backpropagate through gradient to update the weights of discriminant network 1.

[0169] S3052. Input the first predicted category as a negative sample and the first proposed classification category as a positive sample, and process them using the second initial discriminant network in the first initial sub-network to determine the fourth predicted category.

[0170] In some embodiments of the present invention, the first predicted category is input as a negative sample and the first proposed classification category is input as a positive sample. The second initial discriminant network in the first initial sub-network is used for processing to determine the fourth predicted category.

[0171] S3053, Determine the fifth loss for the second predicted category and the first preset classification category.

[0172] In some embodiments of the present invention, the loss of the corresponding loss function is determined based on the second predicted category and the first preset classification category.

[0173] S3054. Using the fifth loss, adjust the parameters of the second initial discriminant network to obtain the trained second discriminant network.

[0174] In some embodiments of the present invention, the parameters of the second initial discriminant network are adjusted using a fifth loss to obtain a trained second discriminant network. For example... Figure 7 As shown, Figure 7 This invention provides an illustration of the effect of an optimized discriminant network in an embodiment of the invention. Figure 2 Taking a subnetwork as an example, the raw EEG data, i.e., the sample EEG signals, are used as positive samples, such as... Figure 5 The waveform generated by the generator network is used as a negative sample as input. The discriminator network 2 is used to perform binary classification on the two input data and calculate the binary classification loss. The calculated loss value is then backpropagated through gradient to update the weights of the discriminator network 2.

[0175] S3055. Based on the first loss and the fifth loss, adjust the parameters of the first initial generator network and the first initial classification network to obtain the first sub-network after one training.

[0176] In some embodiments of the present invention, based on the first loss and the fifth loss, the parameters of the first initial generator network and the first initial classification network are adjusted to obtain a first sub-network after one training iteration. The training process of the sub-network is as follows: Figure 8 As shown, Figure 8This is a schematic diagram illustrating the effect of optimizing the generator network and the classification network according to an embodiment of the present invention. The specific process is as follows: Figure 8 As shown, in this invention, each sub-network comprises a generator network, a classification network, and two discriminator networks. Taking one sub-network (the first sub-network) as an example, this sub-network includes a generator network (first generator network), a classification network (first classification network), a discriminator network 1 (first discriminator network), and a discriminator network 2 (second discriminator network). Data category information (first sample EEG signal and corresponding intended classification category) and random noise (first random noise) are input into the generator network for processing. The generator network generates EEG waveform signals (first waveform data) based on the input. The obtained EEG signals are then reconstructed using the classification network to generate a waveform reconstruction category (first predicted category). The classification network uses the generated waveform reconstruction category as a negative sample and the intended classification category (first intended classification category) as a positive sample. Discriminator network 1 performs binary classification on the two input data and calculates the binary classification loss to determine loss1 (first loss). The original EEG signal data (first sample EEG signal) is used as the positive sample, and the waveform data generated by the generator network is used as the negative sample as the input. Discriminant network 2 is used to perform binary classification on the two input data, and a binary classification loss is calculated to determine loss2 (second loss). The fully connected layer of the classification network (first fully connected layer) is extracted, and unsupervised clustering is performed on the features of this layer. The cosine of the clustering result and the features is calculated to obtain the cos(x,y) calculation result (first calculation result). Finally, loss1 is used to optimize the parameters of discriminant network 1 through gradient backpropagation, and loss2 is used to optimize the parameters of discriminant network 2 through gradient backpropagation. Loss1, loss2, and the calculation results are used together to optimize the parameters of the generator network and the classification network. After one training cycle, the first sub-network after one training cycle is obtained.

[0177] In some embodiments of the present invention, S3055 can be implemented by S30551 to S30554, which will be described in detail in conjunction with the steps.

[0178] S30551. Cluster the first pseudo-classification category features extracted from the first fully connected layer to determine the mean value of each category in the EEG signal of the first sample; the first initial classification network includes the fully connected layer.

[0179] In some embodiments of the present invention, the first pseudo-classification category features extracted from the first fully connected layer in the first initial classification network are clustered to determine the mean value of each category in the first sample EEG signal.

[0180] In some embodiments of the present invention, the fully connected layer of the initial classification network is extracted. At this time, it can be considered that the fully connected layer has the category features extracted by the network. Unsupervised clustering is performed on the features to determine the mean of each category after clustering.

[0181] S30552. Perform cosine operations on the mean values ​​of each category and the features of the first proposed classification category in the first sample EEG signal to determine the first operation result.

[0182] In some embodiments of the present invention, the mean values ​​of each category in the first sample EEG signal and the first proposed classification category features are subjected to cosine operation to determine the first operation result.

[0183] S30553. The first calculation result, the first loss, and the fifth loss are superimposed to determine the first superposition result.

[0184] In some embodiments of the present invention, the first calculation result, the first loss, and the fifth loss are superimposed to determine the first superposition result.

[0185] S30554. Using the first superposition result, adjust the parameters of the first initial generator network and the first initial classification network to obtain the first sub-network after one training.

[0186] In some embodiments of the present invention, the parameters of the first initial generator network and the first initial classification network are adjusted using the first superposition result to obtain the first sub-network after one training.

[0187] In some embodiments of the present invention, gradient backpropagation is performed using the results of loss1 and loss2 to update the weights of the generator network and the classification network. Simultaneously, the fully connected layer of the classification network is extracted. This fully connected layer is considered to possess the category features extracted by the network. Unsupervised clustering is performed on the features, and the mean of each clustered category is used to calculate the cosine of the features. The cosine calculation result is then optimized together with the loss.

[0188] In some embodiments of the present invention, S306 can be implemented by S3061 to S3065, which will be described in detail in conjunction with the steps.

[0189] S3061. Using the second loss, adjust the parameters of the third initial discriminant network in the second initial network to obtain the trained third discriminant network.

[0190] In some embodiments of the present invention, the parameters of the third initial discriminant network in the second initial network are adjusted using the second loss to obtain the trained third discriminant network.

[0191] S3062. Input the second predicted category as a negative sample and the second proposed classification category as a positive sample, and process it using the fourth initial discriminant network in the second initial network to determine the fifth predicted category.

[0192] In some embodiments of the present invention, the second predicted category is input as a negative sample and the second proposed classification category is input as a positive sample, and the fourth initial discriminant network in the second initial network is used for processing to determine the fifth predicted category.

[0193] S3063. Determine the sixth loss of the fifth predicted category and the first preset classification category.

[0194] In some embodiments of the present invention, the loss of the corresponding loss function is determined based on the fifth predicted category and the first preset classification category.

[0195] S3064. Using the sixth loss, adjust the parameters of the fourth initial discriminant network to obtain the trained fourth discriminant network.

[0196] In some embodiments of the present invention, the parameters of the fourth initial discriminant network are adjusted using the sixth loss to obtain the trained fourth discriminant network.

[0197] S3065. Based on the second loss and the sixth loss, adjust the parameters of the second initial generator network and the second initial classification network to obtain the second sub-network after one training.

[0198] In some embodiments of the present invention, the parameters of the second initial generator network and the second initial classification network are adjusted based on the second loss and the sixth loss to obtain the second sub-network after one training.

[0199] In some embodiments of the present invention, S3065 can be implemented by S30651 to S30654, which will be described in detail in conjunction with the following steps.

[0200] S30651. Cluster the second pseudo-classification category features extracted from the second fully connected layer to determine the mean of each category in the EEG signal of the second sample; the second initial classification network includes the second fully connected layer.

[0201] In some embodiments of the present invention, the second pseudo-classification category features of the second fully connected layer in the second initial classification network are extracted for clustering to determine the mean value of each category in the second sample EEG signal.

[0202] S30652. Perform cosine operations on the mean values ​​of each category in the second sample EEG signal and the features of the second proposed classification category to determine the second operation result.

[0203] In some embodiments of the present invention, the mean values ​​of each category in the second sample EEG signal and the features of the second proposed classification category are subjected to cosine operation to determine the second operation result.

[0204] S30653. Superimpose the second calculation result, the second loss, and the sixth loss to determine the second superposition result.

[0205] In some embodiments of the present invention, the second calculation result, the second loss, and the sixth loss are superimposed to determine the second superposition result.

[0206] S30654. Using the second superposition result, adjust the parameters of the second initial generator network and the second initial classification network to obtain the second sub-network after one training.

[0207] In some embodiments of the present invention, the parameters of the second initial generator network and the second initial classification network are adjusted using the second superposition result to obtain the second sub-network after one training.

[0208] In some embodiments of the present invention, S307 can be implemented by S3071 to S3075, which will be described in detail in conjunction with the following steps.

[0209] S3071. Using the third loss, adjust the parameters of the fifth initial discriminant network in the third initial network to obtain the trained fifth discriminant network.

[0210] In some embodiments of the present invention, the parameters of the fifth initial discriminant network in the third initial network are adjusted using the third loss to obtain the trained fifth discriminant network.

[0211] S3072. Input the third predicted category as a negative sample and the third proposed classification category as a positive sample, and process it using the sixth initial discriminant network in the third initial network to determine the sixth predicted category.

[0212] In some embodiments of the present invention, the third predicted category is input as a negative sample and the third proposed classification category is input as a positive sample, and the sixth initial discriminant network in the third initial network is used for processing to determine the sixth predicted category.

[0213] S3073, Determine the seventh loss for the sixth predicted category and the third preset classification category.

[0214] In some embodiments of the present invention, the loss of the corresponding loss function is determined based on the sixth predicted category and the third preset classification category.

[0215] S3074. Using the seventh loss, adjust the parameters of the sixth initial discriminant network to obtain the trained sixth discriminant network.

[0216] In some embodiments of the present invention, the parameters of the sixth initial discriminant network are adjusted using the seventh loss to obtain the trained sixth discriminant network.

[0217] S3075. Based on the third loss and the seventh loss, adjust the parameters of the third initial generator network and the third initial classification network to obtain the third sub-network after one training.

[0218] In some embodiments of the present invention, the parameters of the third initial generator network and the third initial classification network are adjusted based on the third loss and the seventh loss to obtain the third sub-network after one training.

[0219] In some embodiments of the present invention, S3075 can be implemented by S30751 to S30754, which will be described in detail in conjunction with the following steps.

[0220] S30751. Cluster the features of the third classifier extracted from the third fully connected layer to determine the mean of each class in the EEG signal of the third sample; the third initial classification network includes the third fully connected layer.

[0221] In some embodiments of the present invention, the third pseudo-classification category features extracted from the third fully connected layer of the third initial classification network are clustered to determine the mean value of each category in the third sample EEG signal.

[0222] S30752. Perform cosine operations on the mean values ​​of each category in the third sample EEG signal and the features of the third proposed classification category to determine the third operation result.

[0223] In some embodiments of the present invention, the mean values ​​of each category in the third sample EEG signal and the features of the third proposed classification category are subjected to cosine operation to determine the third operation result.

[0224] S30753. Superimpose the third calculation result, the third loss, and the seventh loss to determine the third superposition result.

[0225] In some embodiments of the present invention, the third calculation result, the third loss, and the seventh loss are superimposed to determine the third superposition result.

[0226] S30754. Using the third superposition result, adjust the parameters of the third initial generator network and the third initial classification network to obtain the third sub-network after one training.

[0227] In some embodiments of the present invention, the parameters of the third initial generator network and the third initial classification network are adjusted using the third superposition result to obtain the third sub-network after one training.

[0228] In some embodiments of the present invention, the overall network structure is as follows: Figure 9As shown, there are three sub-networks and one classification network. Each sub-network has the same structure, but the feature extraction and classification tasks are different. After the EEG signal is acquired, it is divided into multiple segments and input into the sub-network corresponding to the category. The features extracted by feature extraction network 1 (first sub-network) (first sample features), feature extraction network 2 (second sub-network) (second sample features), and feature extraction network 3 (third sub-network) (third sample features) are fused using the concat method. The fused features are then fed into the classification network for classification. The final sleep stage results are N1, N2, N3, Rem, and W stages.

[0229] It is understood that, in some embodiments of the present invention, the EEG signals of the target user at a preset time are collected; the EEG signals are used as input, and multiple features output by multiple sub-networks are used, and the multiple features are processed in combination with a preset classification model to determine the classification result corresponding to the EEG signals of the target user at the preset time. This method can effectively improve the feature extraction breadth of EEG signals, improve the accuracy of sleep staging, and obtain higher efficiency in interpreting and analyzing sleep monitoring data.

[0230] This invention provides an automatic sleep staging method, the specific steps of which are shown below.

[0231] S1. Acquire the noise-reduced EEG signal, divide the EEG signal into multiple segments, and determine the category of each segment.

[0232] S2. The acquired EEG signals from multiple segments, the labels of the multiple EEG signals from multiple segments, and randomly generated noise are input into three preset sub-networks.

[0233] In some embodiments of the present invention, each sub-network includes a generator network, a classification network, and a discriminator network. The training process for the three sub-networks is the same. Taking one of the sub-networks as an example, S2 can be implemented through the following steps:

[0234] S21. The acquired EEG signals from multiple segments, the labels of the multiple EEG signals, and randomly generated noise are used as inputs and processed by a generative network. The generative network will generate waveform data based on the category labels.

[0235] S22. The waveform generated by the generator network is fed into the classifier, and the classifier reconstructs the category information of the original signal based on the generated waveform.

[0236] S23. The class information reconstructed by the classifier and the class information corresponding to the EEG signal are simultaneously fed into the discriminant network 1. During training, the class information samples reconstructed by the classification network are set as negative samples, and the class information corresponding to the EEG signal is set as positive samples. The binary classification loss of the discriminant network is calculated, and the weights of the discriminant network 1 are updated by gradient backpropagation.

[0237] S24. The waveform generated by the generator network and the EEG waveform signal are fed into the discriminator network 2. The EEG signal is used as a positive sample and the waveform generated by the generator network is used as a negative sample to calculate the loss of the binary classifier. The weights of the discriminator network 2 are updated by gradient backpropagation.

[0238] S25. Extract the fully connected layer of the classification network. At this point, it can be assumed that the fully connected layer has the category features extracted by the network. Perform unsupervised clustering on the features and calculate the cosine of the mean of each cluster and the features. Update the weights of the classification network and the generator network with the cosine calculation result and the loss.

[0239] S3. After the three sub-networks output their corresponding features simultaneously, the three features are fused in chronological order to train the initial classification model. Once a classification model that meets the requirements is obtained, it can be used to predict sleep stages in EEG data. The final classification targets are N1 stage, N2 stage, N3 stage, Rem stage, and wakefulness stage.

[0240] It is understood that, in the embodiments of the present invention, the overall framework consists of three sub-networks and one classification network. The sub-networks include a generation network, a classification network, and a discriminator network. After the generation network generates a waveform, in addition to inputting the generated waveform into the discriminator network for discrimination, a classification network is added to classify the generated waveform, reconstruct its category, and then another discriminator network determines the similarity between the reconstructed category information and the intended category. Each of the two discriminator networks calculates a loss, which is then fed back to the generation network, classification network, and discriminator network via gradient backpropagation. The generation network receives feedback from both branches, making the optimization direction clearer, and the network as a whole possesses richer information, resulting in faster and better optimization.

[0241] This invention provides a schematic diagram of an automatic sleep staging device, as shown in the embodiment. Figure 10 The above, Figure 10 This is a schematic diagram of an automatic sleep staging device provided in an embodiment of the present invention. The automatic sleep staging device includes: a data acquisition unit 1001 and a determination unit 1002; wherein,

[0242] The acquisition unit 1001 is used to acquire the electroencephalogram (EEG) signals of the target user at a preset time.

[0243] The determining unit 1002 is used to take the EEG signal as input, utilize the multiple features output by multiple sub-networks, and process the multiple features in combination with a preset classification model to determine the classification result corresponding to the EEG signal of the target user at a preset time; the feature extraction tasks and classification tasks of the multiple sub-networks are different.

[0244] In some embodiments of the present invention, the acquisition unit 1001 is further configured to determine multiple regions for EEG signal acquisition; wherein the multiple regions include bilateral occipital regions, left frontal region, right frontal region, left central region, and right central region; and based on the multiple regions, acquire the EEG signals of the target user corresponding to a preset time; wherein, the bilateral occipital regions acquire alpha rhythm EEG signals; and the left frontal region, right frontal region, left central region, and right central region acquire theta wave EEG signals.

[0245] In some embodiments of the present invention, the acquisition unit 1001 is also used to acquire multiple sample EEG signals of the user over a preset time period.

[0246] In some embodiments of the present invention, the determining unit 1002 is further configured to: utilize multiple initial sub-networks to perform feature processing on the multiple sample EEG signals combined with randomly generated noise signals to obtain multiple preset proposed classification categories corresponding to multiple sample features and multiple predicted categories; utilize an initial classification model to perform classification prediction on the multiple sample features to obtain multiple classification results corresponding to the multiple sample EEG signals; and combine the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, to adjust the parameters of the multiple initial sub-networks and the initial classification model until the training ends and the multiple sub-networks and the preset classification model are obtained.

[0247] In some embodiments of the present invention, the plurality of subnetworks include a first subnetwork, a second subnetwork, and a third subnetwork; the plurality of initial subnetworks include a first initial subnetwork, a second initial subnetwork, and a third initial subnetwork; the plurality of preset proposed classification categories include a first preset proposed classification category, a second preset proposed classification category, and a third preset proposed classification category; the first preset proposed classification category is alpha wave, beta wave, gamma wave, theta wave, and delta wave; the second preset proposed classification category is sleep stage and wakefulness stage; the third preset proposed classification category is N1 stage, N2 stage, N3 stage, and Rem stage; the plurality of sample EEG signals include: a first sample EEG signal, a second sample EEG signal, and a third sample EEG signal; the noise signal includes: a first noise signal, a second noise signal, and a third noise signal; the plurality of predicted categories include: a first predicted category, a second predicted category, a third predicted category, a fourth predicted category, a fifth predicted category, and a sixth predicted category.

[0248] In some embodiments of the present invention, the determining unit 1002 is further configured to: utilize the first initial sub-network to perform feature processing on the first sample EEG signal combined with a randomly generated first noise signal to obtain a first sample feature corresponding to a first preset classification category; and use the first sample feature as input to perform category reconstruction using a first initial classifier in the first initial sub-network to determine the first predicted category; and utilize the second initial sub-network to perform feature processing on the second sample EEG signal combined with a randomly generated second noise signal to obtain a second sample feature corresponding to a second preset classification category; and use the second sample feature as input to perform category reconstruction using a second initial classifier in the second initial sub-network to determine the second predicted category; and utilize the third initial sub-network to perform feature processing on the third sample EEG signal combined with a randomly generated third noise signal to obtain a third sample feature corresponding to a third preset classification category; and use the third sample feature as input to perform category reconstruction using a third initial classifier in the third initial sub-network to determine the third predicted category; and fuse the first sample feature, the second sample feature, and the third sample feature to obtain the multiple sample features.

[0249] In some embodiments of the present invention, the determining unit 1002 is further configured to take the first sample EEG signal, the first preset classification category corresponding to the first sample EEG signal, and the randomly generated first noise signal as input, and process them using the first initial generation network in the first initial sub-network to determine the first waveform data corresponding to the first sample EEG signal; the first waveform data includes the first preset classification category and the corresponding first sample feature.

[0250] In some embodiments of the present invention, the determining unit 1002 is further configured to take the second sample EEG signal, the second preset proposed classification category corresponding to the second sample EEG signal, and the randomly generated second noise signal as input, and process them using the second initial generation network in the second initial sub-network to determine the second waveform data corresponding to the second sample EEG signal; the second waveform data includes the second preset proposed classification category and the corresponding second sample feature.

[0251] In some embodiments of the present invention, the determining unit 1002 is further configured to take the third sample EEG signal, the third preset classification category corresponding to the third sample EEG signal, and the randomly generated third noise signal as input, and process them using the third initial generation network in the third initial sub-network to determine the third waveform data corresponding to the third sample EEG signal; the third waveform data includes the third preset classification category and the corresponding third sample feature.

[0252] In some embodiments of the present invention, the determining unit 1002 is further configured to: determine the first loss of the first predicted category and the first preset proposed classification category; determine the second loss of the second predicted category and the second preset proposed classification category; determine the third loss of the third predicted category and the third preset proposed classification category; determine the fourth loss of the plurality of classification results and the plurality of preset proposed classification categories corresponding to the plurality of sample EEG signals; adjust the parameters of the first initial sub-network based on the first loss to obtain the first sub-network after one training; adjust the parameters of the second initial sub-network based on the second loss to obtain the second sub-network after one training; adjust the parameters of the third initial sub-network based on the third loss to obtain the third sub-network after one training; and combine the first sub-network after one training, the second sub-network after one training, the third sub-network after one training, and the fourth loss to adjust the initial classification model to achieve one network adjustment, until the training ends, to obtain the plurality of sub-networks and the preset classification model.

[0253] In some embodiments of the present invention, the determining unit 1002 is further configured to: adjust the parameters of the first initial discriminant network in the first initial sub-network using the first loss to obtain the trained first discriminant network; input the first predicted category as a negative sample and the first intended classification category as a positive sample, process them using the second initial discriminant network in the first initial sub-network, and determine the fourth predicted category; determine the fifth loss of the second predicted category and the first preset intended classification category; adjust the parameters of the second initial discriminant network using the fifth loss to obtain the trained second discriminant network; and adjust the parameters of the first initial generator network and the first initial classification network based on the first loss and the fifth loss to obtain the first sub-network after one training.

[0254] In some embodiments of the present invention, the determining unit 1002 is further configured to cluster the first proposed classification category features extracted from the first fully connected layer to determine the mean of each category in the first sample EEG signal; the first initial classification network includes the fully connected layer; and perform cosine operations on the mean of each category in the first sample EEG signal and the first proposed classification category features respectively to determine the first operation result; and superimpose the first operation result, the first loss and the fifth loss to determine the first superposition result; and use the first superposition result to adjust the parameters of the first initial generation network and the first initial classification network to obtain the first sub-network after one training.

[0255] In some embodiments of the present invention, the determining unit 1002 is further configured to: adjust the parameters of the third initial discriminant network in the second initial sub-network using the second loss to obtain the trained third discriminant network; input the second predicted category as a negative sample and the second proposed classification category as a positive sample, process them using the fourth initial discriminant network in the second initial sub-network, and determine the fifth predicted category; determine the sixth loss of the fifth predicted category and the first preset proposed classification category; adjust the parameters of the fourth initial discriminant network using the sixth loss to obtain the trained fourth discriminant network; and adjust the parameters of the second initial generator network and the second initial classification network based on the second loss and the sixth loss to obtain the second sub-network after one training.

[0256] In some embodiments of the present invention, the determining unit 1002 is further configured to cluster the second pseudo-classification category features extracted from the second fully connected layer to determine the mean of each category in the second sample EEG signal; the second initial classification network includes the second fully connected layer; and perform cosine operations on the mean of each category in the second sample EEG signal and the second pseudo-classification category features respectively to determine the second operation result; and superimpose the second operation result, the second loss and the sixth loss to determine the second superposition result; and use the second superposition result to adjust the parameters of the second initial generation network and the second initial classification network to obtain the second sub-network after one training.

[0257] In some embodiments of the present invention, the determining unit 1002 is further configured to: adjust the parameters of the fifth initial discriminant network in the third initial sub-network using the third loss to obtain the trained fifth discriminant network; input the third predicted category as a negative sample and the third proposed classification category as a positive sample, process them using the sixth initial discriminant network in the third initial sub-network, and determine the sixth predicted category; determine the seventh loss of the sixth predicted category and the third preset proposed classification category; adjust the parameters of the sixth initial discriminant network using the seventh loss to obtain the trained sixth discriminant network; and adjust the parameters of the third initial generator network and the third initial classification network based on the third loss and the seventh loss to obtain the third sub-network after one training.

[0258] In some embodiments of the present invention, the determining unit 1002 is further configured to cluster the third pseudo-classification features extracted from the third fully connected layer to determine the mean of each category in the third sample EEG signal; the third initial classification network includes the third fully connected layer; and perform cosine operations on the mean of each category in the third sample EEG signal and the third pseudo-classification features respectively to determine the third operation result; and superimpose the third operation result, the third loss and the seventh loss to determine the third superposition result; and use the third superposition result to adjust the parameters of the third initial generation network and the third initial classification network to obtain the third sub-network after one training.

[0259] Understandably, in the above-described device implementation, the target user's electroencephalogram (EEG) signals are collected at a preset time. Using the EEG signals as input, multiple features output from multiple sub-networks are processed in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signals at the preset time. The feature extraction and classification tasks of the multiple sub-networks differ. This approach effectively enables richer learning of EEG signal features, improving the accuracy of sleep staging.

[0260] Based on the methods described in the above embodiments, this invention also provides a schematic diagram of an automatic sleep staging device, as shown below. Figure 11 As shown, Figure 11 This is a schematic diagram of another automatic sleep staging device provided in an embodiment of the present invention. The automatic sleep staging device includes a processor 1101 and a memory 1102. The memory 1102 stores one or more programs executable by the processor 1101. When one or more programs are executed, the processor 1101 executes any of the automatic sleep staging methods described in the previous embodiments.

[0261] This invention provides a computer-readable storage medium storing one or more programs, which can be executed by one or more processors. When the programs are executed by the processors, they implement the automatic sleep staging method as described in this invention.

[0262] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0263] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0264] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0265] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0266] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.

Claims

1. An automatic sleep staging method, characterized in that, include: Collect the target user's electroencephalogram (EEG) signals at a preset time. The EEG signal, the corresponding category label of the EEG signal, and the randomly generated noise signal are used as inputs. Multiple features output by multiple sub-networks are used and combined with a preset classification model to process the multiple features to determine the classification result corresponding to the EEG signal of the target user at a preset time. The feature extraction tasks and classification tasks of the multiple sub-networks are different. The method further includes, before taking the EEG signal, the corresponding category label of the EEG signal, and the randomly generated noise signal as input, utilizing multiple features output from multiple sub-networks, and processing the multiple features in conjunction with a preset classification model to determine the classification result corresponding to the target user's EEG signal at a preset time, the method further includes: Collect multiple segments of EEG signals from the user at a preset time; Using multiple initial sub-networks, feature processing is performed on the multiple sample EEG signals combined with the randomly generated noise signals to obtain multiple sample features corresponding to multiple preset classification categories and multiple predicted categories; wherein, each initial sub-network includes an initial generation network and an initial classification network. Using an initial classification model, the features of the multiple samples are classified and predicted to obtain multiple classification results corresponding to the multiple segments of the EEG signals. The parameters of the multiple initial sub-networks and the initial classification model are adjusted by combining the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, until the training ends and the multiple sub-networks and the preset classification model are obtained. The process involves using multiple initial sub-networks to perform feature processing on the multiple sample EEG signals combined with the randomly generated noise signals to obtain multiple sample features corresponding to multiple preset classification categories and multiple predicted categories, including: Using the initial generation network, the proposed classification categories of the multi-segment EEG signals are combined with randomly generated noise signals for feature processing to obtain waveform data corresponding to the preset proposed classification categories. The waveform data includes the preset proposed classification categories and corresponding sample features. The sample features are used as input, and the initial classification network is used to reconstruct the categories to determine the predicted categories. The multiple sample features of the multiple initial sub-networks are fused to obtain the multiple sample features.

2. The method according to claim 1, characterized in that, The collection of EEG signals from the target user at a preset time includes: The multiple regions for the acquisition of the electroencephalogram (EEG) signals are determined; wherein, the multiple regions include the bilateral occipital regions, the left frontal region, the right frontal region, the left central region, and the right central region; Based on the aforementioned multiple regions, the electroencephalogram (EEG) signals of the target user are collected at preset times; wherein, the bilateral occipital regions are collected. The EEG signals of the rhythmic waves; collected from the left frontal, right frontal, left central, and right central regions. Electroencephalogram (EEG) signals of waves.

3. The method according to claim 1, characterized in that, The plurality of sub-networks includes a first sub-network, a second sub-network, and a third sub-network; the plurality of initial sub-networks includes a first initial sub-network, a second initial sub-network, and a third initial sub-network; the first initial sub-network includes a first initial generation network, a first initial classification network, a first initial discrimination network, and a second initial discrimination network; the second initial sub-network includes a second initial generation network, a second initial classification network, a third initial discrimination network, and a fourth initial discrimination network; the third initial sub-network includes a third initial generation network, a third initial classification network, a fifth initial discrimination network, and a sixth initial discrimination network; The plurality of preset proposed classification categories include a first preset proposed classification category, a second preset proposed classification category, and a third preset proposed classification category; The first preset classification category is alpha wave, beta wave, gamma wave, theta wave, and delta wave; The second preset classification category is sleep period and wakefulness period; The third preset classification category is N1, N2, N3 and Rem. The multi-segment sample EEG signals include: a first sample EEG signal, a second sample EEG signal, and a third sample EEG signal; The noise signal includes: a first noise signal, a second noise signal, and a third noise signal; The multiple prediction categories include: a first prediction category, a second prediction category, a third prediction category, a fourth prediction category, a fifth prediction category, and a sixth prediction category.

4. The method according to claim 3, characterized in that, The process utilizes multiple initial sub-networks to perform feature processing on the multiple sample EEG signals combined with the randomly generated noise signals, obtaining multiple sample features corresponding to multiple preset classification categories and multiple predicted categories, including: Using the first initial sub-network, the first proposed classification category of the first sample EEG signal is combined with a randomly generated first noise signal for feature processing to obtain the first sample feature corresponding to the first preset proposed classification category; and the first sample feature is used as input to reconstruct the category using the first initial classification network in the first initial sub-network to determine the first predicted category. Using the second initial sub-network, the second sample EEG signal is combined with a randomly generated second noise signal for feature processing to obtain the second sample feature corresponding to the second preset classification category; and the second sample feature is used as input to reconstruct the category using the second initial classification network in the second initial sub-network to determine the second predicted category. Using the third initial sub-network, the third proposed classification category of the third sample EEG signal is combined with a randomly generated third noise signal for feature processing to obtain the third sample feature corresponding to the third preset proposed classification category; and the third sample feature is used as input to reconstruct the category using the third initial classification network in the third initial sub-network to determine the third predicted category. The first sample feature, the second sample feature, and the third sample feature are fused to obtain the multi-sample feature.

5. The method according to claim 4, characterized in that, The step of using the first initial sub-network to perform feature processing on the first sample EEG signal, combining the first presumed classification category with a randomly generated first noise signal, to obtain the first sample features corresponding to the first presumed classification category includes: The first sample EEG signal, the first preset classification category corresponding to the first sample EEG signal, and the randomly generated first noise signal are used as inputs. The first initial generation network in the first initial sub-network is used for processing to determine the first waveform data corresponding to the first sample EEG signal. The first waveform data includes the first preset classification category and the corresponding first sample feature.

6. The method according to claim 4, characterized in that, The step of using the second initial sub-network to perform feature processing on the second sample EEG signal's second proposed classification category combined with a randomly generated second noise signal to obtain the second sample features corresponding to the second preset proposed classification category includes: The second sample EEG signal, the second preset classification category corresponding to the second sample EEG signal, and the randomly generated second noise signal are used as inputs. The second initial generation network in the second initial sub-network is used for processing to determine the second waveform data corresponding to the second sample EEG signal. The second waveform data includes the second preset classification category and the corresponding second sample features.

7. The method according to claim 4, characterized in that, The step of using the third initial sub-network to perform feature processing on the third sample EEG signal, combining the third presumed classification category with a randomly generated third noise signal, to obtain the third sample features corresponding to the third presumed classification category includes: The third sample EEG signal, the third preset classification category corresponding to the third sample EEG signal, and the randomly generated third noise signal are used as inputs. The third initial generation network in the third initial sub-network is used for processing to determine the third waveform data corresponding to the third sample EEG signal. The third waveform data includes the third preset classification category and the corresponding third sample features.

8. The method according to claim 4, characterized in that, The method of adjusting the parameters of the multiple initial sub-networks and the initial classification model by combining the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, until the training is completed and the multiple sub-networks and the preset classification model are obtained, includes: Determine the first loss between the first predicted category and the first preset classification category; The second loss is determined by the second predicted category and the second preset classification category; Determine the third loss for the third predicted category and the third preset classification category; A fourth loss is used to determine the multiple classification results and the multiple preset categories corresponding to the multiple sample EEG signals; Based on the first loss, the parameters of the first initial sub-network are adjusted to obtain the first sub-network after one training. Based on the second loss, the parameters of the second initial sub-network are adjusted to obtain the second sub-network after one training. Based on the third loss, the parameters of the third initial sub-network are adjusted to obtain the third sub-network after one training. By combining the first sub-network, the second sub-network, and the third sub-network after one training iteration, and adjusting the initial classification model based on the fourth loss, a network adjustment is achieved until training ends, resulting in the multiple sub-networks and the preset classification model.

9. The method according to claim 8, characterized in that, The step of adjusting the parameters of the first initial sub-network based on the first loss to obtain the first sub-network after one training cycle includes: Using the first loss, the parameters of the first initial discriminant network in the first initial sub-network are adjusted to obtain the trained first discriminant network; The first initial generation network in the first initial sub-network is used for processing to determine the first waveform data corresponding to the first sample EEG signal. The first waveform data is used as a negative sample and the first sample EEG signal is used as a positive sample for input. The second initial discrimination network in the first initial sub-network is used for processing to determine the fifth loss. Using the fifth loss, the parameters of the second initial discriminant network are adjusted to obtain the trained second discriminant network; Based on the first loss and the fifth loss, the parameters of the first initial generator network and the first initial classification network are adjusted to obtain the first sub-network after one training.

10. The method according to claim 9, characterized in that, The step of adjusting the parameters of the first initial generator network and the first initial classification network based on the first loss and the fifth loss to obtain the first sub-network after one training cycle includes: Clustering is performed on the first proposed classification category features extracted from the first fully connected layer to determine the mean value of each category in the first sample EEG signal; the first initial classification network includes the first fully connected layer. The first calculation result is determined by performing cosine operations on the mean values ​​of each category in the first sample EEG signal and the features of the first proposed classification category. The first calculation result, the first loss, and the fifth loss are superimposed to determine the first superposition result; Using the first superposition result, the parameters of the first initial generation network and the first initial classification network are adjusted to obtain the first sub-network after one training.

11. The method according to claim 8, characterized in that, The step of adjusting the parameters of the second initial sub-network based on the second loss to obtain the second sub-network after one training cycle includes: The second initial generation network in the second initial sub-network is used for processing to determine the second waveform data corresponding to the second sample EEG signal. The second waveform data is used as a negative sample and the second sample EEG signal is used as a positive sample for input. The fourth initial discrimination network in the second initial sub-network is used for processing to determine the sixth loss. Using the sixth loss, the parameters of the fourth initial discriminant network are adjusted to obtain the trained fourth discriminant network; Based on the second loss and the sixth loss, the parameters of the second initial generator network and the second initial classification network are adjusted to obtain the second sub-network after one training.

12. The method according to claim 11, characterized in that, The step of adjusting the parameters of the second initial generator network and the second initial classification network based on the second loss and the sixth loss to obtain the second sub-network after one training cycle includes: Clustering is performed on the second pseudo-classification category features extracted from the second fully connected layer to determine the mean value of each category in the EEG signal of the second sample; the second initial classification network includes the second fully connected layer. The cosine operation is performed on the mean values ​​of each category in the second sample EEG signal and the features of the second proposed classification category to determine the second operation result; The second calculation result, the second loss, and the sixth loss are superimposed to determine the second superposition result; Using the second superposition result, the parameters of the second initial generator network and the second initial classification network are adjusted to obtain the second sub-network after one training.

13. The method according to claim 8, characterized in that, The step of adjusting the parameters of the third initial sub-network based on the third loss to obtain the third sub-network after one training cycle includes: Using the third loss, the parameters of the fifth initial discriminant network are adjusted to obtain the trained fifth discriminant network; The third initial generation network in the third initial sub-network is used for processing to determine the third waveform data corresponding to the third sample EEG signal. The third waveform data is used as a negative sample and the third sample EEG signal is used as a positive sample for input. The sixth initial discrimination network in the third initial sub-network is used for processing to determine the seventh loss. Using the seventh loss, the parameters of the sixth initial discriminant network are adjusted to obtain the trained sixth discriminant network; Based on the third loss and the seventh loss, the parameters of the third initial generator network and the third initial classification network are adjusted to obtain the third sub-network after one training.

14. The method according to claim 13, characterized in that, The step of adjusting the parameters of the third initial generator network and the third initial classification network based on the third loss and the seventh loss to obtain the third sub-network after one training includes: Clustering is performed on the third pseudo-classification category features extracted from the third fully connected layer to determine the mean value of each category in the EEG signal of the third sample; the third initial classification network includes the third fully connected layer. The cosine operation is performed on the mean values ​​of each category in the third sample EEG signal and the features of the third proposed classification category to determine the third operation result; The third calculation result, the third loss, and the seventh loss are superimposed to determine the third superposition result; Using the third superposition result, the parameters of the third initial generator network and the third initial classification network are adjusted to obtain the third sub-network after one training.

15. An automatic sleep staging device, characterized in that, The automatic sleep staging device includes a data acquisition unit and a determination unit; wherein... The acquisition unit is used to acquire the target user's electroencephalogram (EEG) signals for a preset time, the category labels corresponding to the EEG signals, and randomly generated noise signals; The determining unit is used to take the EEG signal as input, utilize the multiple features output by multiple sub-networks, and process the multiple features in combination with a preset classification model to determine the classification result corresponding to the EEG signal of the target user at a preset time; the feature extraction tasks and classification tasks of the multiple sub-networks are different; wherein, each initial sub-network includes an initial generation network and an initial classification network. The acquisition unit is further configured to acquire multiple segments of sample EEG signals from the user over a preset time period; the determination unit is further configured to utilize multiple initial sub-networks to perform feature processing on the multiple sample EEG signals combined with the randomly generated noise signal, thereby obtaining multiple sample features corresponding to multiple preset proposed classification categories and multiple predicted categories; using an initial classification model, classifying and predicting the multiple sample features to obtain multiple classification results corresponding to the multiple sample EEG signals; and adjusting the parameters of the multiple initial sub-networks and the initial classification model by combining the losses of the multiple predicted categories and the multiple preset proposed classification categories, as well as the losses of the multiple classification results and the multiple preset proposed classification categories corresponding to the multiple sample EEG signals, until training is completed and the multiple sub-networks and the preset classification model are obtained. The determining unit is further configured to use the initial generation network to perform feature processing on the proposed classification category of the multi-segment sample EEG signals combined with randomly generated noise signals to obtain waveform data corresponding to the preset proposed classification category. The waveform data includes the preset proposed classification category and the corresponding sample features. The sample features are used as input to reconstruct the category using the initial classification network to determine the predicted category. The multiple sample features of the multiple initial sub-networks are fused to obtain the multiple sample features.

16. An automatic sleep staging device, characterized in that, The automatic sleep staging device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the automatic sleep staging method according to any one of claims 1-14.

17. A computer-readable storage medium, characterized in that, It stores executable instructions for causing the processor to execute, thereby implementing the automatic sleep staging method according to any one of claims 1-14.

Citation Information

Patent Citations

  • Sleep period dividing method and device

    CN108143409A

  • Automatic sleep staging method, device, computer equipment and computer storage medium

    CN110141226A