Sleep staging system based on self-supervised learning and multi-view learning
The sleep staging system, which utilizes self-supervised learning and multi-view learning, leverages Siamese networks and multi-view feature extraction to address the issues of low efficiency in manual assessment and reliance on labeled data in deep learning, thereby achieving efficient and accurate automatic sleep staging.
Patent Information
- Application Number
- CN202310332820.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-03-31
AI Technical Summary
In existing technologies, manual assessment of sleep staging is inefficient, costly, and subject to subjective differences, while deep learning methods are not accurate enough with small amounts of data and cannot effectively perform sleep staging.
A sleep staging system based on self-supervised learning and multi-view learning is adopted. A Siamese network is constructed for self-supervised pre-training, sleep EEG features are extracted using time view and time-frequency view, and the model is pre-trained on unlabeled data. Positive and negative samples are constructed by combining the TopK algorithm, and contrastive loss is used for network training. Finally, the feature information is fused to predict sleep stages.
It improves the accuracy of sleep staging, reduces reliance on tag data, saves manpower and time costs, and achieves automated and efficient sleep staging.
Smart Images

Figure CN116439663B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of sleep staging, and in particular to a sleep staging system based on self-supervised learning and multi-view learning. Background Technology
[0002] Sleep staging is the division of the stages a person experiences during sleep according to certain standards. As a fundamental aspect of sleep research, sleep staging is an important research direction in brain disease science, as most sleep disorders can be observed through the state of sleep during the sleep process.
[0003] The assessment of sleep staging primarily relies on polysomnography, which includes physiological signals such as electroencephalogram (EEG), electromyography (EMG), electrooculogram (EOG), and electrocardiogram (ECG). EEG is the most commonly used signal for sleep stage scoring. Manual sleep staging is achieved through assessment by clinical experts, who divide the signals into 30-second intervals for observation and label each interval as a corresponding sleep stage based on the characteristics of each signal described in sleep manuals. This manual assessment method is inefficient, requires significant manpower and time, and is susceptible to subjective differences, potentially leading to inconsistent sleep staging results.
[0004] Traditional automated sleep staging methods first extract handcrafted features from EEG signals, then use machine learning to classify these features. This approach is highly demanding in feature extraction, requiring extensive prior knowledge, and suffers from poor robustness and low accuracy. In recent years, deep learning methods have been applied to sleep staging tasks, using various neural network structures and deepening network layers to improve classification accuracy. While these methods have achieved some accuracy improvements, they suffer from dependence on labeled data. In practical applications with limited sleep EEG data, they fail to achieve ideal sleep staging results. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and propose a sleep staging system based on self-supervised learning and multi-view learning. It fully explores the features of sleep EEG from two views: time view and time-frequency view. Furthermore, a self-supervised pre-training module is introduced to pre-train the multi-view sleep staging model, thereby improving the accuracy of sleep stage classification while reducing the dependence on label data.
[0006] To achieve the above objectives, the technical solution provided by this invention is: a sleep staging system based on self-supervised learning and multi-view learning, comprising:
[0007] The data loading module is used to load sleep EEG signals and construct training and testing sets. Then, the sleep EEG signals are preprocessed and enhanced to obtain time series and time-frequency map samples after two different enhancement transformations.
[0008] The self-supervised pre-training module is used to build a Siamese network based on multi-view learning. It uses two different augmented time series and time-frequency map samples as input, and constructs positive and negative sample sets with the TopK algorithm. Then, it uses contrastive loss to pre-train the network. No label information of sleep EEG signals is required during the pre-training period.
[0009] The supervised training module uses a neural network based on multi-view learning to obtain feature information of the time view and time-frequency view, namely time feature information and time-frequency feature information. Then, the time feature information and time-frequency feature information are fused together, and then labeled sleep EEG signals are used for training to finally obtain the optimal sleep staging model.
[0010] The sleep stage prediction module uses the optimal sleep stage model to predict sleep stages, and then analyzes and evaluates sleep quality.
[0011] Furthermore, the data loading module includes a dataset construction module, a data preprocessing module, and a data augmentation module, wherein:
[0012] The dataset construction module reads sleep EEG signals and constructs a training sample set, including an unlabeled dataset and a labeled dataset. The unlabeled dataset contains unlabeled sleep EEG signals, and the labeled dataset contains labeled sleep EEG signals.
[0013] The data preprocessing module segments the sleep EEG signal into N training samples with a time length of δ, thus obtaining a sample set X = {x1, x2, ..., x...} i ,…x N The corresponding sleep stage label set is Y = {y1, y2, ..., y}. i ,…y N}, where x i Let y represent the i-th sample. i Let x represent the i-th sample. i Sleep stage labels;
[0014] The data augmentation module enhances the sleep EEG signals in the segmented dataset. For the sleep EEG signals in the unlabeled dataset, two time-series augmentation methods are used to obtain two augmented samples. Then, the time-frequency map corresponding to the augmented samples is obtained through short-time Fourier transform. Therefore, for a single sleep EEG sample x, the unlabeled dataset contains four types of augmented samples: the first augmented time sample... Second Enhanced Time Sample First Enhanced Time-Frequency Sample Second enhanced time-frequency sample For sleep EEG signals from a labeled dataset, performing only a short-time Fourier transform, then for a single sleep EEG sample x, the unlabeled dataset contains: time sample x t Time-frequency sample x s And the corresponding sleep stage label y.
[0015] Furthermore, the self-supervised pre-training module takes the unlabeled dataset as input, builds a Siamese network based on multi-view learning, and performs self-supervised pre-training on the network, including the following steps:
[0016] 1) Construct a twin neural network, including a first neural network and a second neural network. The first neural network consists of a time view encoder, a time-frequency view encoder, a time view projector, and a time-frequency view projector. The second neural network has the same network structure as the first neural network and shares parameters.
[0017] 2) The unlabeled dataset includes two types of augmented samples, with the first augmented time sample being... and the first enhanced time-frequency sample As input to the first neural network, the first time-varying feature vector is obtained. and the first time-frequency eigenvector The second enhanced time sample and the second enhanced time-frequency sample As input to the second neural network, the second time feature vector is obtained. Second time-frequency eigenvector
[0018] 3) Construct positive and negative sample pairs based on the first time feature vector and the first time-frequency feature vector:
[0019] First, the similarity between the first feature vector and all second feature vectors of different views is calculated using cosine vector similarity:
[0020]
[0021]
[0022] ω i =μω i,t +(1-μ)ω i,s
[0023] In the formula, ω i,t Let be the similarity of the time vector corresponding to the i-th sample in the dataset, and let represent the first time feature vector of the i-th sample. The second time feature vector of all samples in the sample set The similarity is given by ω, where j represents the time period of the sample and takes a value from 1 to the total number of samples N. i,s Let be the time-frequency vector similarity corresponding to the i-th sample, and let represent the first time-frequency feature vector of the i-th sample. The second time-frequency feature vector of all samples in the sample set Similarity; ω i Let be the total similarity corresponding to the i-th sample, and μ be the weight value that balances the similarity between the two views, with a value ranging from 0 to 1;
[0024] Then, the TopK algorithm is used to select positive and negative samples:
[0025]
[0026]
[0027] In the formula, Pos i Let k be the set of positive samples corresponding to the i-th sample. + The total similarity ω obtained by the TopK algorithm represents the total similarity. i The k with the highest similarity + indivual, and They represent the corresponding k + The second enhanced time sample and the second enhanced time-frequency sample, Neg i Let k be the set of negative samples corresponding to the i-th sample. - The total similarity ω obtained by the TopK algorithm represents the total similarity. i The k with the lowest similarity - indivual, and They represent the corresponding k - A second enhanced time sample and a second enhanced time-frequency sample;
[0028] 4) Input the first time feature vector, the first time-frequency feature vector, the positive sample set, and the negative sample set into a preset loss function to obtain the self-supervised pre-training loss:
[0029]
[0030] In the formula, L SSL This represents the loss from self-supervised pre-training, z. p For those belonging to the positive sample set Pos i eigenvectors, z n For those belonging to the negative sample set Neg i The feature vector is denoted by exp, where exp is an exponential function and i represents the i-th element in the sample set, with values ranging from 1 to the total number of samples N in the training set. Let be the feature vector corresponding to the i-th sample, t represent the time view, s represent the time-frequency view, and v represent a pointer to either the time view t or the time-frequency view s. When v = t, This represents the first-time feature vector corresponding to the i-th sample, when v = s. This represents the first time-frequency feature vector corresponding to the i-th sample;
[0031] 5) Based on the self-supervised pre-training loss, backpropagation is used to train the model and update the parameters of the first and second neural networks.
[0032] Furthermore, the supervised training module includes a feature representation module, a sequence representation module, and a feature fusion module, wherein:
[0033] The feature representation module takes a labeled dataset as input and the first neural network trained by the self-supervised pre-training module as the initial model, utilizing the temporal view encoder. t and time-frequency view encoder s Feature extraction is performed on the samples to obtain feature vectors for different views:
[0034] h t =Encoder t (x t )
[0035] h s =Encoder s (x s )
[0036] In the formula, h t and h s These are the time feature vector and the time-frequency feature vector, respectively. t x represents time samples in a labeled dataset. s For time-frequency samples in a labeled dataset, the time-view encoder... t The time-frequency view encoder is composed of multiple layers of one-dimensional convolutional neural networks. s It consists of multiple layers of two-dimensional convolutional neural networks;
[0037] The sequence representation module is used to extract time-dimensional features from the feature vectors, including a time-view sequence encoder and a time-frequency view sequence encoder, which are used to train the sequence relationship information of the time-view feature vectors and the time-frequency view vectors, respectively.
[0038] g t =SeqNet t (h t )
[0039] gs =SeqNet s (h s )
[0040] In the formula, g t and g s These are the time series feature vector and the time-frequency series feature vector, respectively, h t h is the time feature vector. s These are time-frequency feature vectors; SeqNet t and SeqNet s These are time-view sequence encoders and time-frequency view sequence encoders, both of which consist of long short-term memory neural networks and dropout layers;
[0041] The feature fusion module will integrate the time series feature vector g t and time-frequency sequence eigenvector g s The features are fused to obtain a mixed sequence feature vector, which is then input into a linear classifier for classification, ultimately yielding the supervised loss.
[0042]
[0043]
[0044] In the formula, The predicted label is obtained through a linear classifier, representing the sleep stage predicted based on sleep EEG samples. `Linear` is the linear classifier, and `g` is the predicted label. f Let L be the mixed sequence feature vector, L be the supervised loss function, loss(·) be the classification loss function, and y be the true sleep stage label.
[0045] The network model is trained by backpropagation based on supervised loss to obtain the optimal sleep staging model.
[0046] Furthermore, the sleep stage prediction module includes the following steps:
[0047] 1) Use the data preprocessing module of the data loading module to preprocess the sleep EEG signals;
[0048] 2) Input the sleep EEG signal processed in step 1) into the optimal sleep stage model trained by the supervised training module to obtain the sleep stage prediction results and to assess the quality of the subject's entire sleep process.
[0049] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0050] 1. Compared with manually labeled sleep stages, this system builds a neural network model based on the sleep stage task, which automatically completes the sleep stage task, saving manpower and time costs and improving the efficiency of the sleep stage task.
[0051] 2. By using multi-view learning, complementary features of sleep EEG signals are extracted from both time-view and time-frequency-view perspectives, improving the accuracy of the sleep staging system.
[0052] 3. A self-supervised pre-training module was introduced, which can improve the classification accuracy of the sleep staging system without increasing the need for label information, and reduce the dependence on label data. Attached Figure Description
[0053] Figure 1 This is a schematic diagram showing the relationship between the various modules of the system of the present invention.
[0054] Figure 2 This is a schematic diagram of the structure of a self-supervised pre-training module.
[0055] Figure 3 This is a schematic diagram of the supervised training module. Detailed Implementation
[0056] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0057] This embodiment discloses a sleep staging system based on self-supervised learning and multi-view learning. It is a sleep staging system developed using Python and can run on Windows devices. The relationships between the system modules are as follows: Figure 1 As shown, it includes:
[0058] The data loading module is used to load sleep EEG signals and construct training and testing sets. Then, the sleep EEG signals are preprocessed and enhanced to obtain time series and time-frequency map samples after two different enhancement transformations.
[0059] The self-supervised pre-training module is used to construct a Siamese network based on multi-view learning. It uses two different augmented time-series and time-frequency map samples as input, and constructs positive and negative sample sets using the TopK algorithm. Then, it uses contrastive loss for network pre-training. No labeling information from sleep EEG signals is required during pre-training. Its structure is as follows: Figure 2 As shown;
[0060] The supervised training module uses a multi-view learning-based neural network to obtain feature information from the time view and time-frequency view, i.e., time feature information and time-frequency feature information. This time and time-frequency feature information is then fused, and labeled sleep EEG signals are used for training to finally obtain the optimal sleep staging model. Its structure is as follows: Figure 3 As shown;
[0061] The sleep stage prediction module uses the optimal sleep stage model to predict sleep stages, and then analyzes and evaluates sleep quality.
[0062] Specifically, the data loading module includes a dataset construction module, a data preprocessing module, and a data augmentation module, wherein:
[0063] The dataset construction module reads sleep EEG signals and constructs a training sample set, including an unlabeled dataset and a labeled dataset. The unlabeled dataset contains unlabeled sleep EEG signals, and the labeled dataset contains labeled sleep EEG signals.
[0064] The data preprocessing module segments the sleep EEG signal into N training samples with a time length of δ, thus obtaining a sample set X = {x1, x2, ..., x...} i ,…x N The corresponding sleep stage label set is Y = {y1, y2, ..., y}. i ,…y N}, where x i Let y represent the i-th sample. i Let x represent the i-th sample. i Sleep stage labels;
[0065] The data augmentation module enhances the sleep EEG signals in the segmented dataset. For the sleep EEG signals in the unlabeled dataset, two time-series augmentation methods are used to obtain two augmented samples. Then, the corresponding time-frequency maps are obtained through short-time Fourier transform. For a single sleep EEG sample x, the unlabeled dataset contains four types of augmented samples: the first augmented time sample... Second Enhanced Time Sample First Enhanced Time-Frequency Sample Second enhanced time-frequency sample For sleep EEG signals from labeled datasets, only short-time Fourier transform is performed. For a single sleep EEG sample x, the unlabeled dataset includes: time sample x. t Time-frequency sample x s And the corresponding sleep stage label y.
[0066] Specifically, the self-supervised pre-training module takes the unlabeled dataset as input, builds a Siamese network based on multi-view learning, and performs self-supervised pre-training on the network, including the following steps:
[0067] 1) Construct a twin neural network, including a first neural network and a second neural network. The first neural network consists of a time view encoder, a time-frequency view encoder, a time view projector, and a time-frequency view projector. The second neural network has the same network structure as the first neural network and shares parameters.
[0068] 2) The unlabeled dataset includes two types of augmented samples, with the first augmented time sample being... and the first enhanced time-frequency sample As input to the first neural network, the first time-varying feature vector is obtained. and the first time-frequency eigenvector The second enhanced time sample and the second enhanced time-frequency sample As input to the second neural network, the second time feature vector is obtained. Second time-frequency eigenvector
[0069] 3) Construct positive and negative sample pairs based on the first time feature vector and the first time-frequency feature vector:
[0070] First, the similarity between the first feature vector and all second feature vectors of different views is calculated using cosine vector similarity:
[0071]
[0072]
[0073] ω i =μω i,t +(1-μ)ω i,s
[0074] In the formula, ω i,t Let be the similarity of the time vector corresponding to the i-th sample in the dataset, and let represent the first time feature vector of the i-th sample. The second time feature vector of all samples in the sample set The similarity is given by ω, where j represents the time period of the sample and takes a value from 1 to the total number of samples N. i,s Let be the time-frequency vector similarity corresponding to the i-th sample, and let represent the first time-frequency feature vector of the i-th sample. The second time-frequency feature vector of all samples in the sample set Similarity; ω i Let be the total similarity corresponding to the i-th sample, and μ be the weight value that balances the similarity between the two views, with a value ranging from 0 to 1;
[0075] Then, the TopK algorithm is used to select positive and negative samples:
[0076]
[0077]
[0078] In the formula, Pos iLet k be the set of positive samples corresponding to the i-th sample. + The total similarity ω obtained by the TopK algorithm represents the total similarity. i The k with the highest similarity + indivual, and They represent the corresponding k + The second enhanced time sample and the second enhanced time-frequency sample, Neg i Let k be the set of negative samples corresponding to the i-th sample. - The total similarity ω obtained by the TopK algorithm represents the total similarity. i The k with the lowest similarity - indivual, and They represent the corresponding k - A second enhanced time sample and a second enhanced time-frequency sample;
[0079] 4) Input the first time feature vector, the first time-frequency feature vector, the positive sample set, and the negative sample set into a preset loss function to obtain the self-supervised pre-training loss:
[0080]
[0081] In the formula, L SSL This represents the loss from self-supervised pre-training, z. p For those belonging to the positive sample set Pos i eigenvectors, z n For those belonging to the negative sample set Neg i The feature vector is denoted by exp, where exp is an exponential function and i represents the i-th element in the sample set, with values ranging from 1 to the total number of samples N in the training set. Let be the feature vector corresponding to the i-th sample, t represent the time view, s represent the time-frequency view, and v represent a pointer to either the time view t or the time-frequency view s. When v = t, This represents the first-time feature vector corresponding to the i-th sample, when v = s. This represents the first time-frequency feature vector corresponding to the i-th sample;
[0082] 5) Based on the self-supervised pre-training loss, backpropagation is used to train the model and update the parameters of the first and second neural networks.
[0083] Specifically, the supervised training module includes a feature representation module, a sequence representation module, and a feature fusion module, wherein:
[0084] The feature representation module takes a labeled dataset as input and the first neural network trained by the self-supervised pre-training module as the initial model, utilizing the temporal view encoder. tand time-frequency view encoder s Feature extraction is performed on the samples to obtain feature vectors for different views:
[0085] h t =Encoder t (x t )
[0086] h s =Encoder s (x s )
[0087] Among them, h t and h s These are the time feature vector and the time-frequency feature vector, respectively. t x represents time samples in a labeled dataset. s For time-frequency samples in a labeled dataset, the time-view encoder... t The time-frequency view encoder is composed of multiple layers of one-dimensional convolutional neural networks. s It consists of multiple layers of two-dimensional convolutional neural networks;
[0088] The sequence representation module is used to extract time-dimensional features from the feature vectors, including a time-view sequence encoder and a time-frequency view sequence encoder, which are used to train the sequence relationship information of the time-view feature vectors and the time-frequency view vectors, respectively.
[0089] g t =SeqNet t (h t )
[0090] g s =SeqNet s (h s )
[0091] Among them, g t and g s These are the time series feature vector and the time-frequency series feature vector, respectively, h t h is the time feature vector. s These are time-frequency feature vectors; SeqNet t and SeqNet s These are time-view sequence encoders and time-frequency view sequence encoders, both of which consist of long short-term memory neural networks and dropout layers;
[0092] The feature fusion module will integrate the time series feature vector g t and time-frequency sequence eigenvector g s The features are fused to obtain a mixed sequence feature vector, which is then input into a linear classifier for classification, ultimately yielding the supervised loss.
[0093]
[0094]
[0095] in, The predicted label is obtained through a linear classifier, representing the sleep stage predicted based on sleep EEG samples. `Linear` is the linear classifier, and `g` is the predicted label. f Let L be the mixed sequence feature vector, L be the supervised loss function, loss(·) be the classification loss function, and y be the true sleep stage label.
[0096] The network model is trained by backpropagation based on supervised loss to obtain the optimal sleep staging model.
[0097] Specifically, the sleep stage prediction module includes the following steps:
[0098] 1) Use the data preprocessing module of the data loading module to preprocess the sleep EEG signals;
[0099] 2) Input the sleep EEG signal processed in step 1) into the optimal sleep stage model trained by the supervised training module to obtain the sleep stage prediction results and to assess the quality of the subject's entire sleep process.
[0100] The above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Therefore, any changes made in accordance with the shape and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A sleep staging system based on self-supervised learning and multi-view learning, characterized in that, The method comprises the following steps: A data loading module is used to load sleep electroencephalogram signals, build a training set and a test set, and then preprocess and enhance the sleep electroencephalogram signals to obtain time series and time-frequency pattern samples after two different enhancement transformations; A self-supervised pre-training module is used to build a twin network based on multi-view learning, use the time series and time-frequency pattern samples after two different enhancement transformations as input, cooperate with a TopK algorithm to construct a positive and negative sample set, and then use a contrast loss to pre-train the network without any label information of the sleep electroencephalogram signals during the pre-training; A supervised training module is used to obtain time view and time-frequency view feature information, i.e. time feature information and time-frequency feature information, by using a neural network based on multi-view learning, fuse the time feature information and the time-frequency feature information, and then train the sleep electroencephalogram signals with labels to finally obtain an optimal sleep staging model; A sleep stage prediction module is used to predict the sleep stage by using the optimal sleep staging model, and then analyze and evaluate the sleep quality. The data loading module comprises a data set building module, a data preprocessing module and a data enhancement module, wherein: The data set building module reads sleep electroencephalogram signals, builds a training sample set, and the training sample set comprises an unannotated data set and an annotated data set, wherein the unannotated data set contains sleep electroencephalogram signals without labels, and the annotated data set contains sleep electroencephalogram signals with labels; The data preprocessing module segments the sleep EEG signal into N training samples with a time length of δ, thus obtaining a sample set X = {x1, x2, ..., x...} i ,…x N The corresponding sleep stage label set is Y = {y1, y2, ..., y}. i ,…y N }, where x i Let y represent the i-th sample. i Let x represent the i-th sample. i Sleep stage labels; The data enhancement module performs enhancement processing on the divided sleep electroencephalogram signals in the data set; for sleep electroencephalogram signals in the unlabeled data set, two enhanced samples are obtained using two time sequence enhancement methods, and then the time-frequency diagram corresponding to the enhanced samples is obtained through short-time Fourier transform; for a single sleep electroencephalogram sample x, the unlabeled data set contains four enhanced samples: a first enhanced time sample a second enhanced time sample a first enhanced time-frequency sample and a second enhanced time-frequency sample For sleep electroencephalogram signals in the labeled data set, only short-time Fourier transform is performed; for a single sleep electroencephalogram sample x, the unlabeled data set contains: a time sample x t , a time-frequency sample x s , and a corresponding sleep stage label y; The self-supervised pre-training module takes the unannotated data set as input, pre-trains the network by building a twin network based on multi-view learning, and comprises the following steps: 1) A twin neural network is built, comprising a first neural network and a second neural network, the first neural network is composed of a time view encoder, a time-frequency view encoder, a time view projector and a time-frequency view projector, the second neural network has the same network structure as the first neural network and shares parameters with the first neural network; 2) the unlabeled data set includes two enhanced samples, the first enhanced time sample and the first enhanced time-frequency sample are input into the first neural network to obtain a first time feature vector and a first time-frequency feature vector the second enhanced time sample and the second enhanced time-frequency sample are input into the second neural network to obtain a second time feature vector and a second time-frequency feature vector 3) A positive and negative sample pair is built according to the first time feature vector and the first time-frequency feature vector: Firstly, the similarity between the first feature vector of different views and all second feature vectors is calculated by using a cosine vector similarity: ω i = μω i,t + (1 - μ)ω i,s ωi,j i,t is the time vector similarity of the ith sample in the data set, and represents the similarity of the ith first time feature vector to the second time feature vector of all samples in the sample set , where j is used to represent the time at which the sample is located, and takes a value of 1 to the total number of samples N; ωi,j i,s is the time-frequency vector similarity of the ith sample, and represents the similarity of the ith first time-frequency feature vector to the second time-frequency feature vector of all samples in the sample set ; ωi i is the total similarity of the ith sample, and μ is the weight value for balancing the similarity of the two views, taking a value of 0 to 1; Then, the TopK algorithm is used to select positive and negative samples: In the formula, Pos i is the positive sample set corresponding to the i th sample, k + represents the total similarity ω i of the k + highest in the formula, and respectively represent the corresponding k + second enhanced time samples and second enhanced time-frequency samples, Neg i is the negative sample set corresponding to the i th sample, k - represents the total similarity ω i of the k - lowest in the formula, and respectively represent the corresponding k - second enhanced time samples and second enhanced time-frequency samples; 4) The first time feature vector, the first time-frequency feature vector, the positive sample set and the negative sample set are input into a preset loss function to obtain a self-supervised pre-training loss: wherein L SSL denotes the self-supervised pre-training loss, z p is a feature vector belonging to the positive sample set Pos i is a feature vector belonging to the negative sample set Neg n is a feature vector belonging to the negative sample set Neg i is a feature vector belonging to the negative sample set Neg, exp is an exponential function, i denotes the i-th sample in the sample set, and takes a value from 1 to the total number of training set samples N, is a feature vector corresponding to the i-th sample, t denotes a time view, s denotes a time-frequency view, and v denotes a direction to the time view t or the time-frequency view s, when v = t, denotes a first time feature vector corresponding to the i-th sample, when v = s, denotes a first time-frequency feature vector corresponding to the i-th sample; 5) Based on the self-supervised pre-training loss, the model is trained by using back propagation to update the parameters of the first neural network and the second neural network.
2. The sleep staging system based on self-supervised learning and multi-view learning of claim 1, wherein, The supervised training module comprises a feature representation module, a sequence representation module and a feature fusion module, wherein: The feature representation module takes a labeled data set as input, and takes the first neural network trained by the self-supervised pre-training module as an initial model, and uses a time view encoder Encoder t and a time-frequency view encoder Encoder s to perform feature extraction on the sample to obtain feature vectors of different views: h t = Encoder t (x t ) h s = Encoder s (x s ) where h t and h s are the time feature vector and the time-frequency feature vector, respectively, x t is the time sample in the labeled dataset, x s is the time-frequency sample in the labeled dataset, the time view encoder Encoder t is composed of a multi-layer one-dimensional convolutional neural network, and the time-frequency view encoder Encoder s is composed of a multi-layer two-dimensional convolutional neural network. The sequence representation module is used to extract the sequence relationship information of the time view feature vector and the time-frequency view vector by using a time view sequence encoder and a time-frequency view sequence encoder: g t = SeqNet t (h t ) g s = SeqNet s (h s ) where g t and g s are the time series feature vector and the time-frequency series feature vector, respectively, h t is the time feature vector, h s is the time-frequency feature vector; SeqNet t and SeqNet s are the time view sequence encoder and the time-frequency view sequence encoder, respectively, both of which are composed of long short-term memory neural networks and dropout layers. The feature fusion module fuses the time sequence feature vector g t and the time-frequency sequence feature vector g s to obtain a mixed sequence feature vector, and inputs the mixed sequence feature vector into a linear classifier for classification, and finally obtains a supervised loss: In the formula, is a predicted label obtained through a linear classifier, represents a sleep stage predicted based on a sleep electroencephalogram sample, Linear is a linear classifier, g f is a mixed sequence feature vector, L is a supervised loss function, loss(·) is a classification loss function, and y is a true sleep stage label. The network model is trained by back propagation based on the supervised loss to obtain the optimal sleep staging model.
3. The sleep staging system based on self-supervised learning and multi-view learning of claim 2, wherein, The sleep stage prediction module comprises the following steps: 1) The sleep electroencephalogram signals are preprocessed by using the data preprocessing module of the data loading module; 2) input the sleep EEG signal processed in step 1) into the optimal sleep staging model trained by the supervised training module to obtain sleep stage prediction results and perform quality assessment on the whole sleep process of the subject.
Citation Information
Patent Citations
Transform model and comparative learning-based sleep staging method and system
CN114881105A
Sleep staging method and system based on multi-modal physiological signal fusion
CN115349821A