Unsupervised transfer learning sleep staging method and device
By introducing ADSBN and DSAN modules into the sleep staging model, combined with pseudo-tagged self-supervised training, the problem of insufficient generalization ability of existing models when training across data sets is solved, and the extraction of domain-invariant features and the accuracy of sleep staging is improved.
Patent Information
- Application Number
- CN202411972962.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The existing sleep staging model lacks generalization ability when training across data sets and cannot extract subject domain invariant features, resulting in poor classification results, especially in the scenario of unlabeled data sets.
Using the unsupervised transfer learning method, by adding ADSBN modules to each layer of the neural network of the TS-AGCM model and connecting the deep subdomain to adapt to the network DSAN, a global loss function is constructed for model training, and self-supervised training is used to achieve the extraction of domain-invariant features.
The generalization performance of the sleep staging model is improved, so that it can effectively perform sleep staging on the label-free data set, solve the problem of field offsets, and achieve a good knowledge transfer effect.
Smart Images

Figure CN119896449A_ABST
Abstract
Description
Technical Field
[0001] The present invention proposes an unsupervised transfer learning sleep staging method and device, which belongs to the intersection of sleep health monitoring and information technology. Background Art
[0002] Sleep occupies one-third of life, and there is a great need to monitor sleep quality. Studies have shown that good sleep quality is beneficial to physical and mental health. Sleep disorders such as insomnia and sleep apnea will lead to poor sleep quality, which in turn induces physical health problems. In order to assist in the diagnosis of sleep disorders, polysomnography (PSG) is often used to support sleep stage monitoring, including physiological information such as electroencephalogram (EEG), electrooculogram (EOG), electromyogram (EMG) and electrocardiogram (ECG). According to the standards of the American Academy of Sleep Medicine (AASM), PSG signals are segmented into 30-second EEG signal segments and divided into five sleep stages, including wakefulness (W), rapid eye movement (REM) and three non-rapid eye movement (NREM: N1, N2 and N3). The traditional sleep staging method is manual interpretation based on several physiological characteristics. This method is very time-consuming, labor-intensive and subjective. Therefore, many studies have proposed an automatic sleep staging system to avoid subjective sleep assessment and improve the accuracy of sleep staging.
[0003] Currently, many studies have applied various machine learning methods to the field of sleep staging. Among them, traditional machine learning methods such as support vector machines (SVM) and random forests (RF) usually require manual feature extraction and rely more on prior knowledge of sleep and feature quality; in recent years, deep learning methods such as convolutional neural networks (CNN) and recurrent neural networks (RNN) have achieved good applications in sleep staging due to their advantages of automatically learning useful features from raw data. For example, Tsinalis et al. designed a convolutional neural network with a fully connected layer and used a single-channel EEG to classify sleep stages with an accuracy of about 82%; Supratak et al. proposed a model called DeepSleepNet, which uses a convolutional neural network to extract time-invariant features of a single-channel EEG, and uses a bidirectional long short-term memory network (Bi-LSTM) to learn the transition rules between different sleep stages from EEG signals with an accuracy of about 86.2%. In addition, Chen et al. used graph convolutional networks (GCN) and self-attention mechanisms to propose a concurrent sleep staging network called TS-AGCM, which took into account the spatial connection characteristics of multi-channel EEG and further improved classification accuracy, F1 score and other indicators.
[0004] Although there have been many research and attempts in the academic field for deep learning-assisted sleep staging, especially models such as GraphSleepNet based on graph convolution methods have achieved good classification results. However, since most studies are limited to the common characteristics of sleep data, considering the differences in age, gender, race and physiological state of different subjects, they all affect the classification effect and hinder the generalization performance of the classifier; therefore, the performance requirements of sleep staging models in actual use scenarios need to further consider the above differences. For such differences, transfer learning is an effective method. Transfer learning aims to transfer the knowledge learned in one dataset (source domain) to a related but not completely identical dataset (target domain) to achieve data distribution alignment between the source domain and the target domain. The migration scheme ideas include fine-tuning operations and unsupervised learning. Among them, the former requires a large-scale source domain dataset to enhance its generalization ability, and a labeled target domain dataset is required to fine-tune the model. In the practice of sleep staging, although sleep experts can classify and annotate PSG signals in hospitals and related research institutions, it is too costly to obtain sleep staging labels in the scenario where individuals use portable devices to collect PSG signals in daily life, that is, the migration idea based on fine-tuning is difficult to implement. Unsupervised domain adaptation (UDA) can use labeled source domain data and unlabeled target domain data to train models, which is suitable for sleep staging.
[0005] In the field of unsupervised learning, the model "migration" is mainly achieved by aligning features from different domains. There are two existing ideas: difference-based and adversarial-based. Difference-based ideas such as maximum mean difference (MMD) and correlation alignment (CORAL) are centered on minimizing the distance metric between the source domain and the target domain distribution. In practice, Tang et al. proposed an end-to-end deep domain adaptation framework, using an MMD-based domain alignment layer to extract domain-invariant features, and introduced a multi-classification Focal Loss loss function to solve the problem of imbalanced number of sleep stages; Chambon et al. used optimal transfer domain adaptation to enhance the feature transferability between the source domain and the target domain. The core of the adversarial-based idea is to imitate the adversarial training in the generative adversarial network (GAN). In practice, Zhao et al. integrated the conditional and collaborative adversarial domain adaptation modules, deploying a domain classifier in each feature extraction block at different scales to help the network reduce the distribution distance between different domains; Nasiri et al. introduced adversarial domain adaptation to promote model adaptation on different data sets due to differences between subjects, acquisition equipment, and other factors.
[0006] The above background research and literature review provide useful references for the development of a new unsupervised transfer learning sleep staging model. At the same time, two shortcomings can be summarized that need to be addressed. First, most of the above methods rely on a fully shared model when extracting features in the source and target domain data, that is, the model has the same architecture and the same weights. This approach may lead to the loss of domain-specific features in the source and target domains, which may have a negative impact on the classification performance on the target domain. Second, these methods mainly focus on adjusting the overall distribution between the source and target domains, without solving the problem of mismatched fine-grained category distributions between domains. Therefore, target samples belonging to a specific category may be misaligned with different categories in the source domain, resulting in misclassification. Summary of the invention
[0007] In view of this, the present invention provides an unsupervised transfer learning sleep staging method and device, which can enable the sleep staging model to have domain-invariant feature extraction capabilities, thereby achieving accurate sleep staging.
[0008] The technical solution for implementing the present invention is as follows:
[0009] In the first aspect, the present invention provides an unsupervised transfer learning sleep staging method, the specific process is:
[0010] Constructing a neural network architecture: adding an ADSBN module between each layer of the TS-AGCM model, and connecting the output end of the TS-AGCM model to the deep subdomain adaptation network DSAN;
[0011] Determine the global loss function: including the classification loss function based on pseudo labels Depends on the source domain sleep label y s The source domain classification loss function And the DSAN loss function L LMMD ;
[0012] Training the neural network: First, the source domain data is used to train the model for r iterations to obtain a supervised model; second, the supervised model is used to predict the unlabeled data, and the prediction results that meet the requirements are selected and assigned pseudo labels; third, the pseudo-labeled data is combined with the source domain data for the next model training, and the pseudo-labels generated in the previous iteration will be used in the next iteration. The above process is repeated until all data have labels or the maximum number of iterations is reached; finally, the final neural network model for prediction is obtained;
[0013] Sleep staging: using the trained neural network model to perform sleep staging.
[0014] Optionally, the ADSBN module of the present invention includes a domain-specific batch normalization (DSBN) operation and a dynamic batch normalization (ABN) operation; wherein,
[0015] The dynamic batch normalization (ABN) operation is used to fuse the source domain and target domain data distributions and calculate the cross-domain moment estimation value as the moment estimation of the target domain in the DSBN operation.
[0016] Optionally, the data distribution of the source domain and the target domain are recorded as P s (·) and P t (·), the source domain and target domain data distribution are fused into P ts ;
[0017] P ts =qP t (·)+(1-q)P s (·)
[0018] Among them, q is the fusion factor that controls the contribution of the source domain and the target domain weights;
[0019] The cross-domain moment estimate is calculated by the following formula;
[0020] μ ts =qμ t +(1-q)μ s
[0021] (σ ts ) 2 =q((σ t ) 2 +(μ t -μ ts ) 2 )+(1-q)((σ s ) 2 +(μ s -μ ts ) 2 )
[0022] Among them, μ t and μ s are the global first-order moments of the current batch of data in the target domain and the source domain respectively, (σ t ) 2 and (σ s ) 2 are the second-order moment estimates of the current batch of data in the target domain and the source domain, respectively.
[0023] Optionally, the fusion factor q of the dynamic batch normalization (ABN) operation of the present invention is used as one of the model parameters according to the global loss function L all Optimize
[0024] Assume that there is a parameter set q = {q1, q2, ..., q n}where q irepresents the fusion factor of the i-th ADSBN layer, which is updated with the learning rate lr through back-propagation and gradient descent;
[0025]
[0026] Optionally, during the training phase of the model, the present invention selects prediction results that meet the probability threshold or K-Best standard and assigns pseudo labels.
[0027] Optionally, the present invention determines a global loss function: a classification loss function based on pseudo labels Depends on the source domain sleep label y s The source domain classification loss function And the DSAN loss function L LMMD , determine the global loss function L all for:
[0028]
[0029] Among them, α1 and α2 are set weights.
[0030] Optionally, the DSAN loss function L of the present invention is LMMD for:
[0031]
[0032] in, To balance the hyperparameters of the classification loss function and the domain adaptation loss function, is on the Hilbert space H, about two distributions P s (·) and P t (·), where l represents the lth layer of the deep network.
[0033] Optionally, the present invention uses a classification loss function based on pseudo labels in the target domain: The definition is as follows
[0034]
[0035] Among them, l [·] Represents the indicator function, when the condition is met When it is 1, otherwise it is 0. It indicates the probability that the model predicts the target domain data as the Cth category, Represents the distribution of the target domain P t (·) The expectation of the computational results for all input data.
[0036] Optionally, the present invention is based on the sleep label y in the source domain. s The source domain classification loss function The formalization is as follows:
[0037]
[0038] Among them, l [·] Represents the indicator function, when the condition is met When it is 1, otherwise it is 0. It indicates the probability that the model predicts the source domain data as the Cth category, Denotes the pair that obeys the source pre-domain distribution P s (·) The expectation of the computational results for all input data.
[0039] In a second aspect, the present invention provides an unsupervised transfer learning sleep staging device, which is trained using the above sleep staging method, and includes a TS-AGCM model and a DSAN model with an ADSBN module added; wherein,
[0040] The TS-AGCM model is used to extract and fuse the temporal and spatial information features of the input multi-channel sleep signal and output the fusion features of a specific domain;
[0041] The DSAN model is used to minimize the local maximum mean difference of the fused features, and finally output the result of sleep staging.
[0042] Beneficial effects:
[0043] First, the present invention integrates the original spatiotemporal graph convolutional model and transfer learning method into a unified framework based on a new difference-based unsupervised learning sleep staging neural network architecture (TS-AGCM-DA), aiming to extract domain-invariant features across subjects and improve the generalization performance of the model. The model can be applied to sleep staging prediction across data sets and can adapt to sleep staging scenarios in unlabeled data sets.
[0044] Second, the TS-AGCM-DA of the present invention contains three key designs: iterative self-training, deep sub-domain adaptation network (DSAN) and dynamic domain-specific batch normalization (ADSBN). The cross-validation method is used to experiment the classification accuracy of the model. The training set is used as the source domain data and the test set is used as the target domain data. The unlabeled test set sleep signal is added to the model training process, so that the sleep staging model has the ability to extract domain-invariant features.
[0045] Third, the present invention is applicable to sleep staging of multi-channel sleep signals, thereby supporting the diagnosis of diseases related to sleep disorders. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0048] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0049] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.
[0050] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0051] In order to overcome the problem that the existing sleep staging model lacks generalization ability when training across data sets and cannot extract domain-invariant features of the subject, this embodiment proposes a set of unsupervised transfer learning sleep staging methods based on feature differences. The technical flow chart of the present invention is as follows: Figure 1 The detailed process is as follows:
[0052] Constructing a neural network architecture: adding an ADSBN module between each layer of the TS-AGCM model, and connecting the output end of the TS-AGCM model to the deep subdomain adaptation network DSAN;
[0053] Determine the global loss function: including the classification loss function based on pseudo labels Depends on the source domain sleep label y s The source domain classification loss function And the DSAN loss function L LMMD ;
[0054] Training the neural network: First, use the source domain data to train the model for r iterations to obtain a supervised model; second, use the model to predict the unlabeled data, and select the prediction results that meet the requirements and assign pseudo labels; third, merge the pseudo-label data with the source domain data for the next model training, and the pseudo labels generated in the previous iteration will be used in the next iteration. Repeat the above process until all data have labels or the maximum number of iterations is reached; finally, the final neural network model for prediction is obtained;
[0055] Sleep staging: using the trained neural network model to perform sleep staging.
[0056] In the construction of the neural network, this embodiment is based on the TS-AGCM model (Sleep staging model based on temporal self-attention and dynamic graph convolution (202310356676.3) and further adds an ADSBN module between each layer of the neural network of the TS-AGCM model. The ADSBN module contains two branches, which are used for processing the source domain and the target domain respectively. The TS-AGCM module of this embodiment uses temporal information processing and dynamic graph convolution based on the self-attention mechanism to obtain fusion features containing rich spatiotemporal information. This module is a shared feature extraction module, which inputs the PSG signal data of the source domain and the target domain, and outputs the fusion features of the source domain and the fusion features of the target domain. The ADSBN module is further added to obtain unique statistical information in the source domain and the target domain to help better classify the target domain data. At the same time, during training, this embodiment uses the predicted label of the unlabeled target domain data as the pseudo label of the target domain data for the next model training, thereby solving the problem of mismatch in fine-grained category distribution between different fields.
[0057] Furthermore, the ADSBN module described in this embodiment includes a domain-specific batch normalization (DSBN) operation and a dynamic batch normalization (ABN) operation; the dynamic batch normalization (ABN) operation is used to fuse the source domain and target domain data distributions, and the cross-domain moment estimation value is calculated as the moment estimation of the target domain in the DSBN operation.
[0058] This embodiment is based on the dynamic domain specific batch normalization (ADSBN) module and relies on the batch normalization (BN) operation. It has two branches, which are applied to the source domain and the target domain respectively, so as to obtain the unique statistical information in the two domains. Among them, DSAN is a conditional distribution adaptation based on differences. Its core function can make the distribution of each category data in the source domain data and the target domain data similar, rather than simply making the overall distribution between different domains similar. The two operations are described in detail below:
[0059] Domain-Specific Batch Normalization (DSBN) operation: This is implemented using existing techniques. The core idea is to use separate BN modules for the source domain and the target domain. Given an F-dimensional input in the source domain or the target domain Where dom∈{s,t}. The BN layer first performs Normalize each scalar feature so that its mean is 0 and its variance is 1.
[0060]
[0061] in, is the space-time information, is the mean of spatiotemporal information, Variance of spatiotemporal information;
[0062] After normalization, since the operation changes the information expression of the original data and affects the learning characteristics of the neural network, the linear inverse transformation form is further considered to restore the expressive power of the data itself. The final DSBN layer can be written as
[0063]
[0064] Among them, γ dom and β dom is a trainable parameter that can restore the model's representation ability. In this way, no matter what the mean and variance of the input of this layer are, after the BN operation, its mean and variance become β and γ to be learned respectively. and When , an equivalent transformation can be achieved, and the original input feature distribution information can also be retained.
[0065] The use of the model is divided into two stages: training and testing (prediction). In the testing stage (for example, inputting a piece of data to predict the sleep stage of the data), when normalizing according to formula (1), since E[x] and Var[x] cannot be calculated as in the training stage, it is necessary to provide an additional mean and variance for it to call formula (1) for calculation. This additional mean and variance is the "global first-order moment and second-order moment estimate" calculated according to formulas (3) and (4) in the training stage.
[0066] In summary, in the testing phase, the model will directly use a fixed mean and variance to participate in the BN operation (generally using the global moment estimation on the domain). Therefore, in the training phase of the model, DSBN also needs to independently calculate the global mean and variance of feature activations in each domain through the exponential moving average (EMA) with a pre-given parameter τ (τ is generally set to 0.9-0.999).
[0067]
[0068] Among them, μ dom and (σdom ) 2 That is, the global first-order moment and second-order moment estimates on the domain dom.
[0069] In the DSBN testing phase, the estimated mean and variance of each domain obtained by the above two formulas are used to normalize the samples in the corresponding domain.
[0070] Dynamic Batch Normalization (ABN) operation: In DSBN, it can be noticed that only the local moments of the target domain data are used when processing the target domain. However, considering that the target domain data is usually small, moment estimation based only on the target domain data is prone to noise and inaccuracy. Therefore, the moment estimation results from a larger source domain dataset can be used to potentially improve the robustness of statistical estimation.
[0071] The specific operation of dynamic batch normalization (ABN) is to introduce cross-domain statistics to show the degree of statistical alignment. The data distribution of the source domain and the target domain are P s (·) and P t (·), the two distributions can be merged.
[0072] P ts =qP t (·)+(1-q)P s (·) (5)
[0073] Among them, q∈[0,1] is the fusion factor that controls the contribution of the source domain and target domain weights.
[0074] The cross-domain moment estimate can be calculated by the following formula.
[0075] μ ts =qμ t +(1-q)μ s (6)
[0076] (σ ts ) 2 =q((σ t ) 2 +(μ t -μ ts ) 2 )+(1-q)((σ s ) 2 +(μ s -μ ts ) 2 ) (7) Among them, μ t , μ s are the global first-order moments (means) of the current batch of data in the target domain and the source domain, (σ t ) 2 、(σ s )2 They are the second-order moment estimates (variance) of the current batch of data in the target domain and the source domain, respectively.
[0077] The cross-domain moment estimates are used as the moment estimates of the target domain in the DSBN layer.
[0078] Furthermore, during the training process, the dynamic domain specific batch normalization (ADSBN) module described in this embodiment also sets a fusion factor to fuse the statistical information obtained in the source domain into the batch normalization (BN) of the target domain, thereby reducing the uncertainty of the target domain moment estimation to help better classify the target domain data.
[0079] In this embodiment, during the training phase, the fusion factor q of the dynamic batch normalization (ABN) layer is used as one of the model parameters according to the global loss function L all During training, there is a parameter set q = {q1, q2, ..., q n}, where q i represents the fusion factor of the i-th ADSBN layer, which is updated with the learning rate lr through back-propagation and gradient descent.
[0080]
[0081] Furthermore, this embodiment determines the global loss function: the classification loss function based on pseudo labels Depends on the source domain sleep label y s The source domain classification loss function And the DSAN loss function L LMMD , determine the global loss function L all for:
[0082]
[0083] Among them, the source domain classification part is used as a basic module with a weight of 1, and the values of two hyperparameters α1 and α2 are adjusted to control the contribution of DSAN and target domain classification loss functions. The three loss functions are integrated together to guide the shared feature network module to generate global domain invariant features, while also better reducing the distribution differences between different subdomains of the same category.
[0084] Furthermore, the embodiment of the present application is to adapt the loss function L to the depth subdomain. LMMD Detailed introduction:
[0085] First, the network output is used to assign pseudo labels to the target domain data. The source domain dataset is divided into and target domain dataset Divided into C subdomains and Where c∈{1,2,…,C} represents the category label, and their distribution is represented by P s c (·) and P t c (·). Based on the concept of local maximum mean difference (LMMD), for a network with L layers, the sub-domain adaptive loss function of the lth layer can be expressed as
[0086]
[0087] in, To balance the hyperparameters of the classification loss function and the domain adaptation loss function, is on the Hilbert space H, about two distributions P s (·) and P t (·) is a measure of the difference between them; l represents the lth layer of the deep network.
[0088] The right term is further expanded to
[0089]
[0090] in, With characteristic core The Reproducing Hilbert Space (RKHS) of z l is the activation feature output of the lth layer, kernel The inner product operation is φ(·) represents a certain mapping relationship of features. and Respectively and The weight belonging to category c is shown in formula (11).
[0091]
[0092] For samples in the source domain, use their true sleep labels Calculate the weight of each sample as a one-hot vector For samples in the target domain, use the probability distribution output by the network Calculate sample weights At this point, we can calculate L LMMD result.
[0093] Furthermore, in this embodiment, in the target domain, the classification loss function based on the pseudo label is The definition is as follows
[0094]
[0095] Among them, l [·]Represents the indicator function, when the condition is met That is, it is 1 when the target domain label is C, and 0 in other cases. Represents the probability that the model predicts the target domain data as the Cth category. Represents the distribution of the target domain P t (·) The expectation of the computational results for all input data.
[0096] Similarly, depending on the source domain sleep label y s The source domain classification loss function The formalization is as follows:
[0097]
[0098] in, Denotes the pair that obeys the source pre-domain distribution P t The expectation of the result of the computation for all input data.
[0099] In a second aspect, the present invention provides an unsupervised transfer learning sleep staging device, which is trained using the above sleep staging method, and includes a TS-AGCM model and a DSAN model with an ADSBN module added; wherein,
[0100] The TS-AGCM model is used to extract and fuse the temporal and spatial information features of the input multi-channel sleep signal and output the fusion features of a specific domain;
[0101] The DSAN model is used to minimize the local maximum mean difference of the fused features, reduce the difference between the relevant subdomain distributions of the activated features in the L layer, thereby solving the domain adaptation problem in transfer learning and finally outputting the results of sleep staging.
[0102] The embodiment of the present application distinguishes the data set into a source domain and a target domain, extracts their respective spatiotemporal information through a shared feature module based on the TS-AGCM model, and inputs it into the ADSBN module as a fusion feature. At this time, the feature also contains domain-specific information. The features and labels of the two domains are then input into the DSAN module, which will optimize the model parameters according to the set loss function. At the same time, the DSAN module will be combined with the iterative self-training module to generate prediction labels for the source domain and the target domain. After iteration, the final model as a whole can improve the classification performance on the source domain data set while also being able to classify the sleep signals on the target domain data set, solving the problem of domain offset and achieving better knowledge transfer effects.
[0103] Examples:
[0104] This embodiment has been verified on the MASS-SS3 dataset and the ISRC-S3 dataset. The two datasets were compared with a total of 12 different baseline methods (including machine learning, deep learning, and graph convolution), and the present invention achieved the best performance (as shown in Table 1 and Table 2). In summary, the unsupervised transfer learning framework based on feature differences demonstrated by the present invention can be used as a supplementary tool for sleep staging, which helps to improve the ability to diagnose sleep disorder events and has potential value and application prospects in portable wearable sleep health monitoring.
[0105] Table 1. Performance comparison of TS-AGCM-DA and baseline models on the MASS-SS3 dataset.
[0106]
[0107]
[0108] Table 2. Performance comparison of TS-AGCM-DA and baseline models on the ISRC-S3 dataset.
[0109]
[0110] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An unsupervised transfer learning sleep staging method, characterized in that: The specific process is: Constructing a neural network architecture: adding an ADSBN module between each layer of the TS-AGCM model, and connecting the output end of the TS-AGCM model to the deep subdomain adaptation network DSAN model; Determine the global loss function: including the classification loss function L based on pseudo labels t cls , depends on the source domain sleep label y s The source domain classification loss function L s cls And the DSAN loss function L LMMD ; Training the neural network: First, the model is trained r times using the source domain data to obtain a supervised model; second, the supervised model is used to predict the unlabeled data, and the prediction results that meet the requirements are selected and assigned pseudo labels; Again, the pseudo-labeled data is merged with the source domain data for the next model training. The pseudo-labels generated in the previous iteration are used in the next iteration. The above process is repeated until all data have labels or the maximum number of iterations is reached. Finally, the final neural network model for prediction is obtained. Sleep staging: using the trained neural network model to perform sleep staging.
2. The unsupervised transfer learning sleep staging method according to claim 1, characterized in that: The ADSBN module includes a domain-specific batch normalization DSBN operation and a dynamic batch normalization ABN operation; wherein, The dynamic batch normalization (ABN) operation is used to fuse the source domain and target domain data distributions and calculate the cross-domain moment estimation value as the moment estimation of the target domain in the DSBN operation.
3. The unsupervised transfer learning sleep staging method according to claim 2, characterized in that: The data distribution of source domain and target domain are P s (·) and P t (·), the source domain and target domain data distribution are fused into P ts ; P ts =qP t (·)+(1-q)P s (·) Among them, q is the fusion factor that controls the contribution of the source domain and the target domain weights; The cross-domain moment estimate is calculated by the following formula; m ts =qμ t +(1-q)μ s (s ts ) 2 =q((σ t ) 2 +(m t -m ts ) 2 )+(1-q)((σ s ) 2 +(m s -m ts ) 2 ) Among them, μ t and μ s are the global first-order moments of the current batch of data in the target domain and the source domain respectively, (σ t ) 2 and (σ s ) 2 are the second-order moment estimates of the current batch of data in the target domain and the source domain, respectively.
4. The unsupervised transfer learning sleep staging method according to claim 3, characterized in that: The fusion factor q of the dynamic batch normalization ABN operation is used as one of the model parameters according to the global loss function L all Optimize Assume that there is a parameter set q = {q1, q2, ..., q n }, where q i represents the fusion factor of the i-th ADSBN layer, which is updated with the learning rate lr through back-propagation and gradient descent; 5. The unsupervised transfer learning sleep staging method according to claim 1, characterized in that: During the neural network training phase, prediction results that meet the probability threshold or K-Best standard are selected and assigned pseudo labels.
6. The unsupervised transfer learning sleep staging method according to claim 1, characterized in that: Classification loss function based on pseudo-labels Depends on the source domain sleep label y s The source domain classification loss function And the DSAN loss function L LMMD , determine the global loss function L all for: Among them, α1 and α2 are set weights.
7. The unsupervised transfer learning sleep staging method according to claim 6, characterized in that: The DSAN loss function L LMMD for: in, To balance the hyperparameters of the classification loss function and the domain adaptation loss function, is on the Hilbert space H, about two distributions P s (·) and P t (·), where l represents the lth layer of the deep network.
8. The unsupervised transfer learning sleep staging method according to claim 6, characterized in that: In the target domain, the classification loss function based on pseudo labels is The definition is as follows Among them, l [·] Represents the indicator function, when the condition is met When it is 1, otherwise it is 0. Indicates that the model predicts the target domain data as C The probability of the categories, Indicates that the distribution of The expectation of the result of the computation for all input data.
9. The unsupervised transfer learning sleep staging method according to claim 6, characterized in that: In the source domain, based on the sleep label y s The source domain classification loss function The formalization is as follows: Among them, l [·] Represents the indicator function, when the condition is met When it is 1, otherwise it is 0. It indicates the probability that the model predicts the source domain data as the Cth category, Denotes the pair that obeys the source pre-domain distribution P s (·) The expectation of the computational results for all input data.
10. An unsupervised transfer learning sleep staging device, trained using the sleep staging method of any one of claims 1 to 9, comprising a TS-AGCM model and a DSAN model with an ADSBN module added; wherein: The TS-AGCM model is used to extract and fuse the temporal and spatial information features of the input multi-channel sleep signal and output the fusion features of a specific domain; The DSAN model is used to minimize the local maximum mean difference of the fused features, and finally output the result of sleep staging.
Citation Information
Patent Citations
A Sleep Staging Analysis System and Method Based on Temporal Self-Attention and Dynamic Graph Convolution
CN116072265B
Single-channel electroencephalogram sleep staging method based on semi-supervised learning
CN114841219A
Sleep staging analysis system and method based on time self-attention and dynamic graph convolution
CN116072265A
Cross-domain recommendation method and device, equipment, storage medium and program product
CN118861380A