A method for generating representation-similarity adversarial networks based on Wasserstein distance

Through the similar adversarial network based on Wasserstein distance, the problem of limited accuracy in EEG emotional recognition is solved. The difference in edge probability distribution is reduced through domain obfuscator and association reinforcement method, and the classification accuracy is improved, and the classification accuracy is achieved. Higher EEG emotional recognition effect.

CN113673347BActive Publication Date: 2025-01-17BEIJING ZHONGJIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110818889.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-20
Publication Date
2025-01-17
Estimated Expiration
2041-07-20

AI Technical Summary

Technical Problem

The existing deep transfer learning methods have limited accuracy in EEG emotion recognition, especially when dealing with individual differences and time period differences between different subjects, traditional domain adaptation methods have problems of gradient disappearance and accuracy fluctuations.

Method used

Using a similar adversarial network based on Wasserstein distance, map data to feature space through feature extractors, set gradient penalty for domain obfuscator, and use the correlation-enhanced classifier to calculate the similarity and probability of feature representations to reduce the source domain and purpose The edge probability distribution differences of the domain improves classification accuracy.

Benefits of technology

The accuracy of the deep migration method of EEG emotion recognition is improved, and the intrinsic connections of categories are enhanced by reducing the Wasserstein distance and the correlation reinforcement method, providing higher classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673347B_ABST
    Figure CN113673347B_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating a representation similarity adversarial network based on Wasserstein distance. The method first reduces the marginal probability distribution of source domain subjects and target domain subjects to the greatest extent by reducing the Wasserstein distance, and then reduces the conditional probability distribution by an association strengthening method, that is, strengthening the internal connection of categories. The method comprises the following steps: sampling, filtering noise, mapping, setting the Wasserstein distance of a domain obfuscator, setting the gradient penalty of the domain obfuscator, using an association strengthening classifier, calculating the similarity of feature representations from the source domain to the target domain, calculating the similarity of feature representations from the target domain to the source domain, obtaining the round-trip probability of features in the source domain and the target domain, calculating the source domain label probability, and calculating L using a cross entropy loss. zw and P sts loss, set the access probability, set the target domain label probability, and use the cross entropy loss to calculate L op and P v The loss, classifier loss, source domain prediction classification loss, and number of iterations N are set, and training stops when the number of iterations reaches the set number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of EEG emotion classification and deep transfer learning, and in particular to a method for generating a representation similarity adversarial network based on Wasserstein distance. Background Art

[0002] Compared with traditional transfer learning, deep transfer learning can directly process the original data and better extract features, thereby improving the accuracy of the results. It has been successfully applied in the field of brain-computer interface. Because there are great individual differences between different subjects, and the differences between the same individual in different time periods are also different, it is necessary to narrow the gap between the two fields by narrowing the marginal probability distribution and conditional probability distribution of the data of different subjects.

[0003] Traditional domain adaptation methods usually extract features from the source domain and the target domain first, then perform domain adaptation on the features of the two domains, and finally use traditional classifiers for classification. The above traditional algorithms have high computational efficiency, but limited accuracy, and require human intervention in the entire process. Previous metric-based deep domain adaptation methods are usually better than traditional algorithms in terms of accuracy, but still have many shortcomings in performance. For example, the domain adaptation method using MMD distance has large fluctuations in accuracy, and the method of second-order statistical feature alignment has limited effect on two domains with large differences.

[0004] For example, a paper published in foreign papers, "[Jinpeng Li, Shuang Qiu, Changde Du, Yixin Wang, and Huiguang He. Domain Adaptation for EEG Emotion Recognition Based on Latent Representation Similarity[J]. IEEE Transactions on Cognitive and Developmental Systems, 2019.]", proposed an EEG emotion model based on latent representation similarity. This model uses the method of reducing the cross entropy loss (a method of measuring the similarity between the true distribution of data and the predicted distribution of the model) to reduce the difference in marginal probability distributions of different subjects, and uses the method of association reinforcement to reduce the difference in conditional probability distributions. However, when the distribution of data points has no overlapping area with another distribution or the overlapping area can be ignored, the gradient disappears, so the cross entropy cannot reflect the true distance between the two distributions. Using Wasserstein distance as a distance metric can provide a stable gradient anywhere, that is, it reflects the true distance between the two distributions. Summary of the invention

[0005] To this end, an embodiment of the present invention provides a representation similarity adversarial network model based on Wasserstein distance, which can reflect the true distance between two distributions and provide a more accurate method for the deep migration method of EEG emotion recognition.

[0006] In order to achieve the above object, the embodiments of the present invention provide the following technical solutions:

[0007] A representation similarity adversarial network based on Wasserstein distance, characterized by comprising the following steps:

[0008] S1, the EEG signal was first downsampled at a sampling rate of 200 Hz, and the EEG signal was processed with a bandpass filter between 0.5 Hz and 70 Hz to filter out noise and artifacts. The EEG signal of one subject was randomly selected as the target domain, and the EEG signals of other subjects were used as the source domain;

[0009] S2, maps the data into a feature space through the feature extractor and sets the Wasserstein distance of the domain obfuscator;

[0010] S3, set the gradient penalty of the domain obfuscator and update the w parameter;

[0011] S4, using a classifier with association enhancement and calculating the similarity between the feature representation of the source domain and the target domain and the similarity between the feature representation of the target domain and the source domain;

[0012] S5, calculate the round-trip probability of the source domain and the destination domain and calculate the source domain label probability and use the cross entropy loss to calculate the loss;

[0013] S6, set the access probability and the target domain label probability and calculate the loss using the cross entropy loss;

[0014] S7. Set the classifier loss and the source domain prediction classification loss and calculate the model loss. Set the number of iterations N and stop training when the number of training reaches the number of iterations.

[0015] Preferably, in S1: filtering out noise and artifacts includes using a short-time Fourier transform of a 1s long non-overlapping Hanning window to calculate traditional DE features in five frequency bands (δ: 1-3 Hz, θ: 4-7 Hz, α: 8-13 Hz, β: 14-30 Hz, γ: 31-50 Hz), and introducing a linear dynamic system to filter irrelevant information, thereby improving information processing effects.

[0016] Preferably, in S2: the feature extractor is composed of a 310-128 fully connected layer. After the feature passes through the feature extractor, the dimension is reduced from 310 to 128, and then activated by RELU. The mapping relationship is as follows:

[0017] X ′s =f(X s ) X t ′ =f(X t ) (1)

[0018] Among them, X s is the original source domain feature, X t is the original target domain feature, f(x) is the feature extractor, X′ s and

[0019] X′ t Represents the 128-dimensional feature representation of the source domain and the target domain in the same feature space; Wasserstein distance can reduce the marginal probability distribution of the source domain and the target domain. The expression of Wasserstein distance is as follows:

[0020]

[0021] In the formula, p a represents the marginal probability distribution of a random position a in the feature space, p b represents the marginal probability distribution of another position b in the feature space, inf represents the infimum of the result, μ(p a ,p b ) is p a and p b The set of all joint probability distributions of the combination, ε is the joint probability distribution of the possible combination, ‖xy‖ is the distance between random samples x and y, E is the expected value of the random sample distance, W(p a ,p b ) is the minimum cost of the optimal path; in the formula, due to The result cannot be obtained directly, so according to the Kantorovich-Rubinstein duality theorem, equation (2) is transformed into the following form:

[0022]

[0023] In the formula, sup represents the supremum, Indicates that in the marginal probability distribution p a The expected value of the function f(x) for the next sample x, Indicates that in the marginal probability distribution p b The expected value of the function f(x) for the next sample x, ‖f‖ L represents the Lipschitz constant, which is defined as:

[0024] ‖f‖ L =sup|f(x1)-f(x2)| / |x1-x2| (4)

[0025] After the feature extractor, the source domain and target domain feature map is X′ s and X′ t , so formula (3) is changed to:

[0026]

[0027] The loss of the domain confuser can be maximized by adjusting the parameter w to approximate the Wasserstein distance, so formula (5) is changed to:

[0028]

[0029] In the formula, D represents the domain obfuscator, which is equivalent to f in formula (5) w (), represents the loss of the domain obfuscator,

[0030] X′ s represents the feature representation of the source domain features after the feature extractor, X′ t It represents the feature representation of the target domain features after passing through the feature extractor, Σ represents the sum, m represents the number of source domain features, and n represents the number of target domain features. It effectively reduces the loss of the obfuscator.

[0031] Preferably, in S3: setting the gradient penalty of the domain obfuscator includes: due to the existence of ‖f‖ in formula (3) L ≤1, so the gradient penalty is increased for w in the domain obfuscator The formula is as follows:

[0032]

[0033] In the formula is the feature representation, X ′ It represents the feature representation after the feature has passed through the feature extractor. Indicates X ′ Derivative, ‖…‖2 means to first find the square sum of the numbers and then take the square root; updating the w parameter includes subtracting the loss of the Wasserstein distance from the gradient penalty term, and then performing a gradient update on the w parameter, the formula is as follows:

[0034]

[0035] In the formula, γ is the confusion parameter, α1 is the learning rate, and w represents the weight of the domain obfuscator; when the number of iterations is less than the set number of iterations of the domain obfuscator, return to S2; otherwise, enter S4. Approximate data can be obtained.

[0036] Preferably, in S4: the classifier using association enhancement includes performing a dot product operation on the source domain and the target domain feature representation after the feature extractor, as shown in the following formula:

[0037] M st = <X′ s ,X′ t >

[0038] In the formula, X ′ s represents the source domain feature representation after the feature extractor, X t ′ represents the target domain representation after the feature extractor, M st Represents the dot product of the feature representation of the source domain and the target domain; finding the similarity of the feature representation from the source domain to the target domain includes M st Using the softmax method, X ′ s and X t ′ The similar probability is expressed by the following formula:

[0039]

[0040] In the formula, P st Represents the probability of similarity between source domain features and target domain features, M st represents the dot product of the feature representations of the source domain and the target domain, Σ t Represents the total number of features; Finding the similarity between the target domain and the source domain includes M st Transpose to get M ts , M ts Represents the dot product of the feature representation of the target domain and the source domain, and then repeats step 8 to obtain P ts , P ts Indicates the probability of similarity between source domain features and target domain features. Improves data relevance.

[0041] Preferably, in S5: obtaining the round-trip probability of the source domain and the destination domain includes multiplying P st , P ts , the formula is as follows:

[0042] P sts =P st P ts ;

[0043] In the formula, P sts Indicates P st and P ts Calculate the source domain label probability L zw Including recording a feature of the source domain as S a, the feature returned to the source domain after being mapped by the target domain is recorded as S b , if S a Category and S b The categories are equal, denoted as The formula is as follows:

[0044]

[0045] The loss calculated by cross entropy loss includes the following formula:

[0046] Wloss=H(L zw ,P sts )

[0047] In the formula, H represents the cross entropy loss, L zw represents the source domain label probability, P sts represents the round-trip probability of the feature in the source domain and the destination domain, and Wloss represents L zw and P sts The value after cross entropy loss is closer to the data.

[0048] As a preference, in S6: setting the access probability P v Including, ensuring that samples in each target domain can be associated, the formula is as follows:

[0049]

[0050] Represents the sum of the similarity probabilities of each source domain feature after passing through the feature extractor; Set the target domain label probability L op The formula included is as follows:

[0051]

[0052] In the formula, T a Represents the characteristics of the target domain; cross entropy loss is used to calculate L op and P v The loss includes the following formula:

[0053] Vloss=H(L op ,P v )

[0054] In the formula, Vloss represents L op and P v The value after cross entropy loss is closer to the data.

[0055] Preferably, in S7: setting the classifier loss The formula included is as follows:

[0056]

[0057] Set the source domain prediction classification loss The formula included is as follows:

[0058]

[0059] In the formula, y represents the true label of the target domain feature, Represents the target domain feature prediction label, the loss expression of the model The formulas include:

[0060] Efficiently obtain more effective data.

[0061] Preferably, in S3, the update w parameter includes that the confusion parameter γ can be set to 10, and the learning rate α1 can be set to 0.01 to improve the data processing effect.

[0062] Preferably, the back propagation description is:

[0063]

[0064] In the formula, ω1 represents the feature extractor weight. ω2 represents the classifier weight. α2 represents the learning rate of the classifier, α1 represents the learning rate of the domain confuser, and γ represents the coefficient. represents the source domain prediction classification loss, Represents the classifier loss represents the loss of the domain obfuscator, Represents the gradient penalty, the classifier's learning rate α2 can be set to 0.001, the domain confuser weight ω3 can be set to 0.01, and the coefficient γ can be set to 10. Improve the data processing effect.

[0065] The embodiments of the present invention have the following advantages:

[0066] The marginal probability distribution of source domain subjects and target domain subjects is minimized by reducing the Wasserstein distance, and the conditional probability distribution is reduced by association reinforcement, which strengthens the intrinsic connection between categories and provides a more accurate method for deep migration of EEG emotion recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0068] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0069] Figure 1 It is a logical flow diagram of the present invention. DETAILED DESCRIPTION

[0070] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0071] like Figure 1 As shown, the present invention provides a representation similarity adversarial network based on Wasserstein distance, characterized in that it includes the following steps:

[0072] S1, the EEG signal was first downsampled at a sampling rate of 200 Hz, and the EEG signal was processed with a bandpass filter between 0.5 Hz and 70 Hz to filter out noise and artifacts. The EEG signal of one subject was randomly selected as the target domain, and the EEG signals of other subjects were used as the source domain;

[0073] S2, maps the data into a feature space through the feature extractor and sets the Wasserstein distance of the domain obfuscator;

[0074] S3, set the gradient penalty of the domain obfuscator and update the w parameter;

[0075] S4, using a classifier with association enhancement and calculating the similarity between the feature representation of the source domain and the target domain and the similarity between the feature representation of the target domain and the source domain;

[0076] S5, calculate the round-trip probability of the source domain and the destination domain and calculate the source domain label probability and use the cross entropy loss to calculate the loss;

[0077] S6, set the access probability and the target domain label probability and calculate the loss using the cross entropy loss;

[0078] S7. Set the classifier loss and the source domain prediction classification loss and calculate the model loss. Set the number of iterations N and stop training when the number of training reaches the number of iterations.

[0079] In the S1: filtering out noise and artifacts includes calculating traditional DE features in 5 frequency bands (δ: 1-3 Hz, θ: 4-7 Hz, α: 8-13 Hz, β: 14-30 Hz, γ: 31-50 Hz) using short-time Fourier transform of a 1 s long non-overlapping Hanning window, and introducing a linear dynamic system to filter out irrelevant information.

[0080] In S2, the feature extractor is composed of a 310-128 fully connected layer. After the feature passes through the feature extractor, the dimension is reduced from 310 to 128, and then activated by RELU. The mapping relationship is as follows:

[0081] X′ s =f(X s ) X′ t =f(X t ) (1)

[0082] Among them, X s is the original source domain feature, X t is the original target domain feature, f(x) is the feature extractor, X′ s and X′ t Represents the 128-dimensional feature representation of the source domain and the target domain in the same feature space; Wasserstein distance can reduce the marginal probability distribution of the source domain and the target domain. The expression of Wasserstein distance is as follows:

[0083]

[0084] In the formula, p a represents the marginal probability distribution of a random position a in the feature space, p b represents the marginal probability distribution of another position b in the feature space, inf represents the infimum of the result, μ(p a ,p b ) is p a and p b The set of all joint probability distributions of the combination, ε is the joint probability distribution of the possible combination, ‖xy‖ is the distance between random samples x and y, E is the expected value of the random sample distance, W(p a ,p b ) is the minimum cost of the optimal path; in the formula, due to The result cannot be obtained directly, so according to the Kantorovich-Rubinstein duality theorem, equation (2) is transformed into the following form:

[0085]

[0086] In the formula, sup represents the supremum, Indicates that in the marginal probability distribution p a The expected value of the function f(x) for the next sample x, Indicates that in the marginal probability distribution p b The expected value of the function f(x) for the next sample x, ‖f‖ L represents the Lipschitz constant, which is defined as:

[0087] ‖f‖ L =sup|f(x1)-f(x2)| / |x1-x2| (4)

[0088] After the feature extractor, the source domain and target domain feature map is X′ s and X′ t , so formula (3) is changed to:

[0089]

[0090] The loss of the domain confuser can be maximized by adjusting the parameter w to approximate the Wasserstein distance, so formula (5) is changed to:

[0091]

[0092] In the formula, D represents the domain obfuscator, which is equivalent to f in formula (5) w (), represents the loss of the domain obfuscator,

[0093] X′ s represents the feature representation of the source domain features after the feature extractor, X′ t It represents the feature representation of the target domain features after passing through the feature extractor, Σ represents the sum, m represents the number of source domain features, and n represents the number of target domain features.

[0094] In S3: Setting the gradient penalty of the domain confuser includes ‖f‖ due to the formula (3) L ≤1, so the gradient penalty is increased for w in the domain obfuscator The formula is as follows:

[0095]

[0096] In the formula is the feature representation, X ′ It represents the feature representation after the feature has passed through the feature extractor. Indicates X ′Derivative, ‖…‖2 means to first find the square sum of the numbers and then take the square root; updating the w parameter includes subtracting the loss of the Wasserstein distance from the gradient penalty term, and then performing a gradient update on the w parameter, the formula is as follows:

[0097]

[0098] In the formula, γ is the confusion parameter, α1 is the learning rate, and w represents the weight of the domain obfuscator. When the number of iterations is less than the set number of iterations of the domain obfuscator, return to S2; otherwise, enter S4.

[0099] In S4: the classifier using association enhancement includes performing a dot product operation on the source domain and the target domain feature representation after the feature extractor, as shown in the following formula:

[0100] M st = <X ′ s ,X t ′ >

[0101] In the formula, X ′ s represents the source domain feature representation after the feature extractor, X t ′ represents the target domain representation after the feature extractor, M st Represents the dot product of the feature representation of the source domain and the target domain; finding the similarity of the feature representation from the source domain to the target domain includes M st Using the softmax method, X ′ s and X t ′ The similar probability is expressed by the following formula:

[0102]

[0103] In the formula, P st Represents the probability of similarity between source domain features and target domain features, M st represents the dot product of the feature representations of the source domain and the target domain, Σ t Represents the total number of features; Finding the similarity between the target domain and the source domain includes M st Transpose to get M ts , M ts Represents the dot product of the feature representation of the target domain and the source domain, and then repeats step 8 to obtain P ts , P ts It represents the probability of similarity between source domain features and target domain features.

[0104] In S5: the round-trip probability of the source domain and the destination domain is obtained by multiplying Pst , P ts , the formula is as follows:

[0105] P sts =P st P ts ;

[0106] In the formula, P sts Indicates P st and P ts Calculate the source domain label probability L zw Including recording a feature of the source domain as S a , the feature returned to the source domain after being mapped by the target domain is recorded as S b , if S a Category and S b The categories are equal, denoted as The formula is as follows:

[0107]

[0108] The loss calculated by cross entropy loss includes the following formula:

[0109] Wloss=H(L zw ,P sts )

[0110] In the formula, H represents the cross entropy loss, L zw represents the source domain label probability, P sts represents the round-trip probability of the feature in the source domain and the destination domain, and Wloss represents L zw and P sts The value after cross entropy loss;

[0111] In S6: setting the access probability P v Including, ensuring that samples in each target domain can be associated, the formula is as follows:

[0112]

[0113] Represents the sum of the similarity probabilities of each source domain feature after passing through the feature extractor; Set the target domain label probability L op The formula included is as follows:

[0114]

[0115] In the formula, T a Represents the characteristics of the target domain; cross entropy loss is used to calculate L op and P v The loss includes the following formula:

[0116] Vloss=H(Lop ,P v )

[0117] In the formula, Vloss represents L op and P v The value after cross entropy loss;

[0118] In S7: Setting the classifier loss The formula included is as follows:

[0119]

[0120] Set the source domain prediction classification loss The formula included is as follows:

[0121]

[0122] In the formula, y represents the true label of the target domain feature, Represents the target domain feature prediction label, the loss expression of the model The formulas include:

[0123]

[0124] In S3, the updated w parameters include the confusion parameter γ which can be set to 10, and the learning rate α1 which can be set to 0.01.

[0125] The back propagation description is:

[0126]

[0127] In the formula, ω1 represents the feature extractor weight. ω2 represents the classifier weight. α2 represents the learning rate of the classifier, α1 represents the learning rate of the domain confuser, and γ represents the coefficient. represents the source domain prediction classification loss, Represents the classifier loss represents the loss of the domain obfuscator, represents the gradient penalty, the learning rate α2 of the classifier can be set to 0.001, the domain confuser weight ω3 can be set to 0.01, and the coefficient γ can be set to 10.

[0128] When the present invention is used, one subject in one group of experiments is selected as the target domain, and 14 subjects other than the subject in the target domain in the remaining two groups of experiments are taken as the source domain. That is, the three groups of experiments are recorded as a, b, and c respectively. The 15 subjects in the a group experiment are recorded as a1, a2...a15; the 15 subjects in the b group experiment are recorded as b1, b2...b15; the 15 subjects in the c group experiment are recorded as c1, c2...c15. Assuming that a1 is taken as the target domain, then b2, b3...b15, c2, c3...c15 are taken as the source domain, and finally the data is put into the network as input to run to obtain the accuracy of each subject. Similarly, experiments are conducted on the 15 subjects in each group, and finally the average of the 15 subjects in each group is taken to obtain the average accuracy of each group.

[0129] To prove the feasibility of the above method, the SEED dataset is used to test the algorithm.

[0130] The data extraction method is as follows: First, 15 movie clips are selected as stimulus sources, of which 5 movie clips are positive, 5 movie clips are neutral, and 5 movie clips are negative. There are 15 Chinese subjects in total, and each subject needs to watch all 15 movie clips, so each subject needs to do 15 experiments in one set of experiments. The same experiment is repeated in three groups, with one week between each group.

[0131] The dataset was first downsampled to 200 Hz. A 0-75 Hz bandpass frequency filter was applied to extract EEG segments corresponding to the duration of each movie, and then the DE features of the EEG signals were extracted and smoothed using traditional moving average and linear dynamic system (LDS) methods.

[0132] Several deep transfer learning methods commonly used in EEG emotion recognition are selected below for comparison.

[0133] TCA: A marginal distribution adaptation method, which is a classic method for data distribution adaptation in transfer learning. It can also be applied to transfer learning of EEG models.

[0134] SVM: A classic classifier in machine learning with good mathematical theoretical support.

[0135] DAN: Also known as Deep Adaptation Network. It has good classification effect in deep transfer learning.

[0136] JDAN: Also known as Joint Probability Distribution Network, it combines marginal probability distribution and conditional probability distribution for transfer learning.

[0137]

[0138] It can be seen from the above results that the present invention provides a method with higher accuracy for the deep migration method of EEG emotion recognition.

[0139] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A method for generating a representation similarity adversarial network based on Wasserstein distance, characterized in that: The steps include: S1, the EEG signal was first downsampled at a sampling rate of 200 Hz, and the EEG signal was processed with a bandpass filter between 0.5 Hz and 70 Hz to filter out noise and artifacts. The EEG signal of one subject was randomly selected as the target domain, and the EEG signals of other subjects were used as the source domain; S2, maps the data into a feature space through the feature extractor and sets the Wasserstein distance of the domain obfuscator; S3, set the gradient penalty of the domain obfuscator and update the w parameter; S4, using a classifier with association enhancement and calculating the similarity between the feature representation of the source domain and the target domain and the similarity between the feature representation of the target domain and the source domain; S5, calculate the round-trip probability of the source domain and the destination domain and calculate the source domain label probability and use the cross entropy loss to calculate the loss; S6, set the access probability and the target domain label probability and calculate the loss using the cross entropy loss; S7. Set the classifier loss and the source domain prediction classification loss and calculate the model loss. Set the number of iterations N and stop training when the number of training reaches the number of iterations.

2. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S1: filtering out noise and artifacts includes calculating traditional DE features in 5 frequency bands using short-time Fourier transform of 1 s long non-overlapping Hanning windows, and introducing a linear dynamic system to filter out irrelevant information.

3. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S2, the feature extractor is composed of a 310-128 fully connected layer. After the feature passes through the feature extractor, the dimension is reduced from 310 to 128, and then activated by RELU. The mapping relationship is as follows: X′ s =f(X s ) X′ t =f(X t ) (1) Among them, X s is the original source domain feature, X t is the original target domain feature, f(x) is the feature extractor, X′ s and X′ t Represents the 128-dimensional feature representation of the source domain and the target domain in the same feature space; Wasserstein distance reduces the marginal probability distribution of the source domain and the target domain. The expression of Wasserstein distance is as follows: In the formula, p a represents the marginal probability distribution of a random position a in the feature space, p b represents the marginal probability distribution of another position b in the feature space, inf represents the infimum of the result, μ(p a , p b ) is p a and p b The set of all joint probability distributions of the combination, ε is the joint probability distribution of the possible combination, ||xy|| is the distance between random samples x and y, E is the expected value of the random sample distance, W(p a , p b ) is the minimum cost of the optimal path. In the formula, due to The result cannot be obtained directly, so according to the Kantorovich-Rubinstein duality theorem, equation (2) is transformed into the following form: In the formula, sup represents the supremum, Indicates that in the marginal probability distribution p a The expected value of the function f(x) for the next sample x, Indicates that in the marginal probability distribution p b The expected value of the function f(x) for the next sample x, ||f|| L represents the Lipschitz constant, which is defined as: ||f|| L =sup|f(x1)-f(x2)| / |x1-x2| (4) After the feature extractor, the source domain and target domain feature map is X′ s and X′ t , so formula (3) is changed to: By adjusting the parameter w to maximize the loss of the domain confuser, the Wasserstein distance can be approximated, so formula (5) is changed to: In the formula, D represents the domain obfuscator, which is equivalent to f in formula (5) w (), represents the loss of the domain obfuscator, X′ s represents the feature representation of the source domain features after the feature extractor, X′ t It represents the feature representation of the target domain features after passing through the feature extractor, ∑ represents the sum, m represents the number of source domain features, and n represents the number of target domain features.

4. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S3: Setting the gradient penalty of the domain confuser includes ||f|| L ≤1, so the gradient penalty is increased for w in the domain obfuscator The formula is as follows: In the formula is the feature representation, X′ represents the feature representation after the feature has passed through the feature extractor, represents the derivative of X′, ||...||2 represents the square sum of the numbers therein and then the square root; updating the w parameter includes subtracting the loss of the Wasserstein distance from the gradient penalty term, and then performing a gradient update on the w parameter, the formula is as follows: In the formula, γ is the confusion parameter, α1 is the learning rate, and w represents the weight of the domain obfuscator. When the number of iterations is less than the set number of iterations of the domain obfuscator, return to S2; otherwise, enter S4.

5. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S4: the classifier using association enhancement includes performing a dot product operation on the source domain and the target domain feature representation after the feature extractor, as shown in the following formula: M st =<X′ s ,X′ t > In the formula, X′ s represents the source domain feature representation after the feature extractor, X′ t represents the target domain representation after the feature extractor, M st Represents the dot product of the feature representation of the source domain and the target domain; finding the similarity of the feature representation from the source domain to the target domain includes M st Using the softmax method, X′ s and X′ t The similar probability is expressed by the following formula: In the formula, P st Represents the probability of similarity between source domain features and target domain features, M st represents the dot product of the feature representations of the source domain and the target domain, ∑ t Represents the total number of features; Finding the similarity between the target domain and the source domain includes M st Transpose to get M ts , M ts Represents the dot product of the feature representation of the target domain and the source domain, and then repeats step 8 to obtain P ts , P ts It represents the probability of similarity between source domain features and target domain features.

6. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S5: the round-trip probability of the source domain and the destination domain is obtained by multiplying P st , P ts , the formula is as follows: P sts =P st P ts ; In the formula, P sts Indicates P st and P ts Calculate the source domain label probability L zw Including recording a feature of the source domain as S a , the feature returned to the source domain after being mapped by the target domain is recorded as S b , if S a The category and S b The categories are equal, denoted as The formula is as follows: The loss calculated by cross entropy loss includes the following formula: Wloss=H(L zw ,P sts ) In the formula, H represents the cross entropy loss, L zw represents the source domain label probability, P sts represents the round-trip probability of the feature in the source domain and the destination domain, and Wloss represents L zw and P sts The value after cross entropy loss.

7. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S6: setting the access probability P v Including, ensuring that samples in each target domain can be associated, the formula is as follows: Represents the sum of the similarity probabilities of each source domain feature after passing through the feature extractor; Set the target domain label probability L op The formula included is as follows: In the formula, T a Represents the characteristics of the target domain; cross entropy loss is used to calculate L op and P v The loss includes the following formula: Vloss=H(L op ,P v ) In the formula, Vloss represents L op and P v The value after cross entropy loss.

8. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S7: Setting the classifier loss The formula included is as follows: Set the source domain prediction classification loss The formula included is as follows: In the formula, y represents the true label of the target domain feature, represents the target domain feature prediction label, The loss expression of the model is The formulas include:

9. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: In S3, updating the w parameter includes setting the confusion parameter γ to 10 and the learning rate α1 to 0.

01.

10. The method for generating a representation similarity adversarial network based on Wasserstein distance according to claim 1, characterized in that: The back propagation description is: In the formula, ω1 represents the feature extractor weight, ω2 represents the classifier weight, α2 represents the learning rate of the classifier, α1 represents the learning rate of the domain confuser, and γ represents the coefficient. represents the source domain prediction classification loss, represents the classifier loss, represents the loss of the domain obfuscator, represents the gradient penalty, the learning rate α2 of the classifier is set to 0.001, the domain confuser weight ω3 is set to 0.01, and γ is set to 10.

Citation Information

Patent Citations

  • Unsupervised domain adaptation method based on adversarial learning loss function

    CN110837850A

  • Electroencephalogram signal generation network and method and storage medium

    CN111428648A