An electroencephalogram signal analysis method based on smooth conditional domain adversarial training

By using smooth conditional domain adversarial training, the domain offset problem in EEG signal analysis was solved, the model's transfer and classification capabilities were improved, and efficient decoding across sessions was achieved.

CN118643403BActive Publication Date: 2026-11-20NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410740474.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-08
Publication Date
2026-11-20
Estimated Expiration
2044-06-08

AI Technical Summary

Technical Problem

Existing EEG signal analysis methods suffer from domain shift issues across individuals and sessions, and struggle to effectively extract robust and distinguishable features, leading to a decline in model performance.

Method used

We adopt a smooth conditional domain adversarial training method, which obtains domain-general and domain-specific features through filtering, generates pseudo-labels and removes outliers, calculates the generation adversarial loss and batch spectrum penalty loss, and uses minimax optimization to train the model to improve transfer and classification capabilities.

Benefits of technology

It improves the cross-session decoding capability and discriminative power of transfer features of the EEG signal analysis model, and significantly enhances the classification performance in the target domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643403B_ABST
    Figure CN118643403B_ABST
Patent Text Reader

Abstract

The application discloses an electroencephalogram signal analysis method based on smooth conditional domain adversarial training, ensures that features obtained by a model are high-quality information through a feature extractor, and guarantees the joint distribution of aligned features and categories through smooth conditional domain adversarial training, so that the migration ability and classification ability of the model are improved; finally, the model can autonomously learn the classification boundary on a target domain through iterative training. The performance of the framework proposed by the application on MI decoding is better than that of other traditional deep learning and migration learning methods, the discriminability of migrated features is improved while the effective features are migrated. The model has cross-session decoding ability, and has great potential for realizing online brain state inference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electroencephalogram (EEG) signal technology, specifically relating to an EEG signal analysis method based on smooth conditional domain adversarial training. Background Technology

[0002] Brain-computer interface (BCI) technology, based on the motor imagery (MI) paradigm, identifies human motor intentions by decoding electroencephalogram (EEG) signals, playing an increasingly important role in fields such as neurorehabilitation. However, EEG signals are non-static and vary significantly across different sessions and individuals, making it difficult to find an efficient cross-individual, cross-session MI decoding method. With the development of deep learning, many studies have proposed models such as recurrent neural networks, attempting to address these issues by learning robust features. However, these deep learning models are sensitive to training data and prone to overfitting on test data. Therefore, when applied to new individuals or sessions (called domains), model performance may degrade due to domain shift. In recent years, a growing number of studies have attempted to align the feature distribution of EEG signals using domain adaptation methods to address the domain shift problem in EEG signals. However, these methods still face two major challenges. First, EEG signals have a low signal-to-noise ratio, and the features extracted by most domain adaptation methods may contain a significant amount of noise. Secondly, most pre-adaptation methods only align feature distributions between different domains. While this ensures the transferability of features, it fails to guarantee that the transferred features have good discriminability. Summary of the Invention

[0003] To overcome the shortcomings of existing technologies, this invention provides an EEG signal analysis method based on smooth conditional domain adversarial training. The feature extractor ensures that the features obtained by the model are of high quality, while smooth conditional domain adversarial training guarantees the joint distribution of aligned features and categories, thereby improving the model's transfer and classification capabilities. Finally, iterative training enables the model to autonomously learn classification boundaries in the target domain. The framework proposed in this invention outperforms other traditional deep learning and transfer learning methods in MI decoding, improving the discriminative power of transferred features while transferring effective features. The model of this invention has cross-session decoding capabilities and has great potential for realizing online brain state reasoning.

[0004] The technical solution adopted by this invention to solve its technical problem is as follows:

[0005] Step 1: Filter the EEG signal to obtain domain-general features and domain-specific features;

[0006] The EEG signals from the source and target domains x s and x t Filtering is performed separately for the low-frequency and high-frequency bands; then the data from the two bands are summed after being passed through an interactive frequency convolution F with shared weights, and then passed through a temporal pooling layer to obtain domain-general features; finally, the data from the source and target domains are passed through a channel attention module A without shared weights to obtain domain-specific features f. s and f t ;

[0007] Step 2: Generate pseudo-labels and selectively remove outliers;

[0008] The target domain features f t After passing through two classifiers C1 and C2, two classification probabilities are obtained. If the highest class probability in both probabilities is greater than 0.8 and their corresponding classes belong to the same class, then that class is determined as a pseudo-label in the target domain. If the proportion of generated pseudo-labels is greater than 50% of the proportion of the original target domain samples, then they are used to calculate the classification loss in the target domain in the next iteration. Otherwise, a density-based spatial clustering algorithm is used on the original target domain samples to remove outliers in the signal and improve the signal quality.

[0009] The source domain features are also processed through two classifiers to obtain two classification probabilities. The cross-entropy is then calculated using the classification probabilities and their corresponding labels to obtain the classification loss. and The calculation formula is as follows:

[0010]

[0011]

[0012] Where, x s and x t These are the EEG signals from the source and target domains, p(y|x) s ) and p(y|x t ) is a given x s and x t The classification probability, P s and P t It refers to the distribution of the source and target domains. It sums the values ​​of all samples labeled k in the source domain. It involves summing all samples in the target domain with pseudo-label k.

[0013] The classifier is composed of a multilayer perceptron with activation functions, and the data in the source domain and the target domain share weights;

[0014] Step 3: Calculate the adversarial loss;

[0015] fs and f t The average classification probability obtained after passing through two classifiers is used as the predicted class probability g. s and g t Next, the joint distribution h of features and probabilities is obtained through multilinear mapping operations. s and h t The calculation formula is as follows:

[0016]

[0017] Where T is the multilinear mapping operation, f s and f t These are domain-specific features of the source and target domains, g s and g t h represents the predicted class probabilities of the source and target domains. s and h t It is the joint distribution of features and probabilities of the source and target domains;

[0018] h s and h t The data is fed into a domain discriminator D composed of a multilayer perceptron with activation functions to calculate the adversarial loss. The specific formula is as follows:

[0019]

[0020] Next, for f s and f t Singular value decomposition yields and Use and The batch spectrum penalty loss (BSP) is calculated using the following formula:

[0021]

[0022]

[0023]

[0024] Among them, U s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors of U; t It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; V s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors, V tIt is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; ∑s is The square root of the eigenvalue; ∑t is Root of eigenvalue; σ s,i and σ s,j Let be the i-th largest eigenvalue of ∑s and ∑t.

[0025] Step 4: Adversarial training in the smooth domain;

[0026] The objective function is optimized using sharp-perception minimization of SAM, and the task loss is calculated using the following formula:

[0027]

[0028] Where θ are the parameters of F, A, C1 and C2, and ρ≥0 is the hyperparameter defining the maximum norm ∈;

[0029] Finally, the model is trained using a minimax optimization method, which enables the model to classify the test data more effectively. The calculation formula is as follows:

[0030]

[0031] Here, Φ refers to the parameter of D.

[0032] Preferably, the low frequency band refers to 8-16Hz, and the high frequency band refers to 16-40Hz.

[0033] Preferably, the shared-weight interactive frequency convolution F includes 1-D point-wise spatial convolution and 1-D depth-wise temporal convolution.

[0034] The beneficial effects of this invention are as follows:

[0035] 1. This invention is of great significance for EEG signal analysis. The method of this invention can effectively solve the domain shift problem of EEG signals through adversarial training. More importantly, the model still has excellent classification ability on the transferred data, and can significantly improve cross-domain classification performance.

[0036] 2. EEG signal classification technology plays a crucial role in EEG analysis, brain-computer interface (BCI), and neuroscience. For BCI applications, extracting effective information from the signal and removing noise are essential. This invention can extract robust information from the signal and remove noise, thus showing great potential for realizing online brain state reasoning. Attached Figure Description

[0037] Figure 1This is a schematic diagram of the network structure of the method of the present invention.

[0038] Figure 2 This is a schematic diagram of the general feature extractor and the domain-specific feature extractor proposed in this invention. Detailed Implementation

[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0040] like Figure 1 As shown, an EEG signal analysis method based on smooth conditional domain adversarial training is presented, where modules of the same color represent shared weights between the source and target domains. The method includes the following steps:

[0041] Step 1: Filter the EEG signal to obtain domain-general features and domain-specific features;

[0042] like Figure 1 Module a and Figure 2 As shown, Figure 2 The blue border represents the composition of the general feature extractor, and the purple border represents the composition of the domain-specific feature extractor. The EEG signals (x, y, z) from the source and target domains are then compared. s and x t The data is filtered for low-frequency bands (8-16Hz) and high-frequency bands (16-40Hz) respectively. The data from both bands are then passed through weighted interactive frequency convolutions F (i.e., 1-D point-wise spatial convolution and 1-D depth-wise temporal convolution), summed, and then passed through a temporal pooling layer to obtain domain-general features. Finally, the source and target domain data are passed through a non-weighted channel attention module A to obtain domain-specific features (f). s and f t ).

[0043] Step 2: Generate pseudo-labels and selectively remove outliers;

[0044] like Figure 1 As shown in module c, a pseudo-label module and a selective outlier removal module were designed. The target domain features f... t After passing through two classifiers C1 and C2, two classification probabilities are obtained. If the highest class probability in both probabilities is greater than 0.8 and their corresponding classes belong to the same category, then that category is determined as a pseudo-label in the target domain. If the proportion of generated pseudo-labels is greater than 50% of the original target domain samples, they are used to calculate the classification loss in the target domain in the next iteration. Otherwise, a density-based spatial clustering algorithm is used on the original target domain samples to remove outliers and improve signal quality.

[0045] The source domain features are also processed through two classifiers to obtain two classification probabilities. The cross-entropy is then calculated using the classification probabilities and their corresponding labels to obtain the classification loss. and The calculation formula is as follows:

[0046]

[0047]

[0048] Where, x s and x t These are the EEG signals from the source and target domains, p(y|x) s ) and p(y|x t ) is a given x s and x t The classification probability, P s and P t It refers to the distribution of the source and target domains. It sums the values ​​of all samples labeled k in the source domain. It sums up all samples with pseudo-label k in the target domain.

[0049] The classifier consists of a multilayer perceptron with activation functions, and the data from the source and target domains share weights.

[0050] Step 3: Calculate the adversarial loss;

[0051] like Figure 1 As shown in module b, this module calculates the adversarial loss based on conditions. (The text then abruptly shifts to a different topic: "f...") s and f t The average classification probability obtained after passing through two classifiers is used as the predicted class probability g. s and g t Next, the joint distribution h of features and probabilities is obtained through multilinear mapping. s and h t The calculation formula is as follows:

[0052]

[0053]

[0054] Where T is the multilinear mapping operation, f s and f t These are domain-specific features of the source and target domains, g s and g t h represents the predicted class probabilities of the source and target domains. s and h t It is the joint distribution of features and probabilities of the source and target domains.

[0055] h s and h t The data is fed into a domain discriminator D composed of a multilayer perceptron with activation functions to calculate the adversarial loss. The specific formula is as follows:

[0056]

[0057] Among them, h s and h t It is the joint distribution of features and probabilities of the source and target domains, P s and P t It is the distribution of the source and target domains.

[0058] Next, for f s and f t Singular value decomposition yields and Use and Calculate the batch spectral penalty (BSP). The calculation formula is as follows:

[0059]

[0060]

[0061]

[0062] Among them, U s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors of U; t It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; V s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors, V t It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; ∑s is The square root of the eigenvalue; ∑t is Root of eigenvalue; σ s,i and σ s,j Let be the i-th largest eigenvalue of ∑s and ∑t.

[0063] Step 4: Adversarial training in the smooth domain;

[0064] To improve the model's generalization ability in the target domain, sharp aware minimization (SAM) is used to optimize the objective function. However, smoothing the adversarial loss leads to suboptimal results; therefore, we only smooth the task loss (excluding the adversarial loss) to achieve effective generalization in the target domain. The formula for calculating the task loss is as follows:

[0065]

[0066] Where θ refers to the parameters of F, A, C1 and C2, and ρ≥0 is the hyperparameter defining the maximum norm ∈.

[0067] Finally, the model is trained using a min-max optimization approach, enabling it to classify the test data more effectively. The calculation formula is as follows:

[0068]

[0069] Where θ refers to the parameters of F, A, C1 and C2, Φ refers to the parameters of D, λ1 = 1, λ2 = 2e-6, λ3 = 1.

[0070] Example:

[0071] 1. Filter the EEG signal to obtain domain-general features and domain-specific features;

[0072] like Figure 1 Module a and Figure 2 As shown, Figure 2 The blue border represents the composition of the general feature extractor, and the purple border represents the composition of the domain-specific feature extractor. The EEG signals (x, y, z) from the source and target domains are then compared. s and x t The data is filtered for low-frequency bands (8-16Hz) and high-frequency bands (16-40Hz) respectively. The data from both bands are then passed through weighted interactive frequency convolutions F (i.e., 1-D point-wise spatial convolution and 1-D depth-wise temporal convolution), summed, and then passed through a temporal pooling layer to obtain domain-general features. Finally, the source and target domain data are passed through a non-weighted channel attention module A to obtain domain-specific features (f). s and f t ).

[0073] 2. Generate pseudo-tags and selectively remove outliers;

[0074] like Figure 1 As shown in module c, a pseudo-label module and a selective outlier removal module were designed. The target domain features f...t After passing through two classifiers C1 and C2, two classification probabilities are obtained. If the highest class probability in both probabilities is greater than 0.8 and their corresponding classes belong to the same category, then that category is determined as a pseudo-label in the target domain. If the proportion of generated pseudo-labels is greater than 50% of the original target domain samples, they are used to calculate the classification loss in the target domain in the next iteration. Otherwise, a density-based spatial clustering algorithm is used on the original target domain samples to remove outliers and improve signal quality.

[0075] The source domain features are also processed through two classifiers to obtain two classification probabilities. The cross-entropy is then calculated using the classification probabilities and their corresponding labels to obtain the classification loss. and The calculation formula is as follows:

[0076]

[0077]

[0078] Where, x s and x t These are the EEG signals from the source and target domains, p(y|x) s ) and p(y|x t ) is a given x s and x t The classification probability, P s and P t It refers to the distribution of the source and target domains. It sums the values ​​of all samples labeled k in the source domain. It sums up all samples with pseudo-label k in the target domain.

[0079] The classifier consists of a multilayer perceptron with activation functions, and the data from the source and target domains share weights.

[0080] 3. Calculate the generated adversarial loss;

[0081] like Figure 1 As shown in module b, this module calculates the adversarial loss based on conditions. (The text then abruptly shifts to a different topic: "f...") s and f t The average classification probability obtained after passing through two classifiers is used as the predicted class probability g. s and g t Next, the joint distribution h of features and probabilities is obtained through multilinear mapping. s and h t The calculation formula is as follows:

[0082]

[0083]

[0084] Where T is the multilinear mapping operation, F s and f t These are domain-specific features of the source and target domains, g s and g t It represents the predicted class probabilities of the source and target domains, g. s and h t It is the joint distribution of features and probabilities of the source and target domains.

[0085] h s and h t The data is fed into a domain discriminator D composed of a multilayer perceptron with activation functions to calculate the adversarial loss. The specific formula is as follows:

[0086]

[0087] Among them, h s and h t It is the joint distribution of features and probabilities of the source and target domains, P s and P t It is the distribution of the source and target domains.

[0088] Next, for f s and f t Singular value decomposition yields and Use and Calculate the batch spectral penalty (BSP). The calculation formula is as follows:

[0089]

[0090]

[0091]

[0092] Among them, U s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors of U; t It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; V s It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors, V t It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; ∑s is The square root of the eigenvalue; ∑t is Root of eigenvalue; σ s,i and σ s,j Let be the i-th largest eigenvalue of ∑s and ∑t.

[0093] 4. Smooth domain adversarial training;

[0094] To improve the model's generalization ability in the target domain, sharp aware minimization (SAM) is used to optimize the objective function. However, smoothing the adversarial loss leads to suboptimal results; therefore, we only smooth the task loss (excluding the adversarial loss) to achieve effective generalization in the target domain. The formula for calculating the task loss is as follows:

[0095]

[0096] Where θ are the parameters of F, A, C1 and C2, and ρ≥0 is the hyperparameter defining the maximum norm ∈.

[0097] Finally, the model is trained using a min-max optimization approach, enabling it to classify the test data more effectively. The calculation formula is as follows:

[0098]

[0099] Where Φ refers to the parameters of D, λ1=1, λ2=2e-6, λ3=1.

[0100] 4. Testing Phase

[0101] The dataset is processed through steps 1, 2, 3, and 4 to obtain the final trained model. This model is then used to classify the test data, and the class corresponding to the highest probability value output by the classifier is the final classification result. The model's performance is evaluated using two publicly available EEG datasets: BCI Competition IV 2a (four-class cross-session task) and BCI Competition IV 2b (two-class cross-session task). The model achieves excellent classification results on each individual in the 2a dataset (average accuracy of 80.34%) and also achieves excellent classification results on the 2a dataset (average accuracy of 85.49%). The test performance of various classification methods is statistically analyzed. Compared with state-of-the-art traditional machine learning models, deep learning models, and transfer learning models, this invention outperforms these advanced models, demonstrating the effectiveness of the proposed method. Furthermore, ablation experiments and visualization experiments are conducted to demonstrate that the smooth conditional domain adversarial training method can improve the model's classification ability in the target domain while transferring effective features.

Claims

1. A method for analyzing electroencephalogram (EEG) signals based on adversarial training in a smooth conditional domain, characterized in that, Includes the following steps: Step 1: Filter the EEG signal to obtain domain-general features and domain-specific features; EEG signals from the source and target domains and Filtering is performed separately for the low-frequency and high-frequency bands; then the data from the two bands are processed through interactive frequency convolution with shared weights. The features are then added together and then passed through a temporal pooling layer to obtain the domain-general features. Then, the data from the source and target domains are passed through channel attention modules that do not share weights. Obtain domain-specific features and ; Step 2: Generate pseudo-labels and selectively remove outliers; target domain features After two classifiers and Two classification probabilities are then obtained. If the highest class probability in both probabilities is greater than 0.8 and their corresponding classes belong to the same class, then that class is determined as a pseudo-label in the target domain. If the proportion of generated pseudo-labels is greater than 50% of the proportion of the original target domain samples, then they are used to calculate the classification loss in the target domain in the next iteration. Otherwise, a density-based spatial clustering algorithm is used on the original target domain samples to remove outliers in the signal and improve the signal quality. The source domain features are also processed through two classifiers to obtain two classification probabilities. The cross-entropy is then calculated using the classification probabilities and their corresponding labels to obtain the classification loss. and The calculation formula is as follows: in, and These are EEG signals from the source and target domains. and It is given and The classification probability at that time, and It refers to the distribution of the source and target domains. It involves summing all samples with label k in the source domain. It involves summing all samples in the target domain with pseudo-label k. The classifier is composed of a multilayer perceptron with activation functions, and the data in the source domain and the target domain share weights; Step 3: Calculate the adversarial loss; Will and The average of the classification probabilities obtained after passing through two classifiers is used as the predicted class probability. and Next, the joint distribution of features and probabilities is obtained through multilinear mapping operations. and The calculation formula is as follows: in, It is a multilinear mapping operation. and These are domain-specific characteristics of the source and target domains. and These are the predicted class probabilities for the source and target domains. and It is the joint distribution of features and probabilities of the source and target domains; Will and The data is fed into a domain discriminator composed of a multilayer perceptron with activation functions. Calculate the countermeasure loss The specific formula is as follows: Next, regarding and Singular value decomposition yields and and use and The batch spectrum penalty loss (BSP) is calculated using the following formula: in, It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors, It is an orthogonal matrix, and each column vector of this matrix is... eigenvectors; yes Take the square root of the eigenvalue; yes Take the square root of the eigenvalue; and for and No. The largest eigenvalue; Step 4: Adversarial training in the smooth domain; The objective function is optimized using sharp-perception minimization of SAM, and the task loss is calculated using the following formula: in, yes , , and The parameters, It is the definition of the maximum norm. hyperparameters; Finally, the model is trained using a minimax optimization method, which enables the model to classify the test data more effectively. The calculation formula is as follows: ; in, It means The parameters.

2. The EEG signal analysis method based on smooth conditional domain adversarial training according to claim 1, characterized in that, The low-frequency band refers to 8-16Hz, and the high-frequency band refers to 16-40Hz.

3. The EEG signal analysis method based on smooth conditional domain adversarial training according to claim 1, characterized in that, The shared-weight interactive frequency convolution This includes 1-D point-wise spatial convolution and 1-D depth-wise temporal convolution.