Cross-domain EEG emotion recognition method and system based on feature adversarial learning
Through the method of feature adversarial learning, using cosine distance to divide the feature differences of subjects and using cross-attention, the problems of insufficient stability and generalization ability of existing models in cross-subject recognition are solved, and the accuracy and consistency of EEG emotion recognition are improved.
Patent Information
- Application Number
- CN202411690428.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-25
AI Technical Summary
The existing Transformer-based EEG emotion recognition model lacks a refined division of individual differences among subjects, making it difficult to effectively utilize difference information, resulting in insufficient recognition stability and generalization ability in cross-subject tasks.
By calculating the cosine distance between subjects to divide the difference levels, using cross-attention to replace self-attention, and introducing the cross-entropy loss function, a cross-domain EEG emotion recognition system based on feature adversarial learning is constructed to enhance the model's adaptability and robustness to cross-subject features.
The classification accuracy and robustness of emotion recognition across subjects were improved, the generalization ability of the model across different subjects was enhanced, and higher recognition accuracy and consistency were achieved.
Smart Images

Figure CN119848617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to artificial intelligence, and in particular to a cross-domain EEG emotion recognition method and system based on feature adversarial learning. Background Art
[0002] Emotions are not only a reflection of human physiological states across a variety of sensations, thoughts, and behaviors, but also complex psychological and physiological responses to different external stimuli. In daily life and work, emotions significantly influence human decision-making, communication, and behavior. A deep understanding of the role of emotions is crucial in multiple fields. With the advancement of EEG signal acquisition and processing technology, EEG-based emotion recognition has gradually become a core research direction in the field of emotional computing. EEG emotion recognition can not only assist in the diagnosis and monitoring of mental health, such as the emotional assessment of depression and schizophrenia, but also provide a more authentic and personalized user experience in affective computing and intelligent human-computer interaction. Accurately identifying emotional information in EEG signals is expected to promote the development of fields such as intelligent healthcare, emotional computing, and human-computer interaction, and provide new technical means for understanding and managing human emotions.
[0003] Emotion recognition methods based on EEG signals generally involve two steps: emotion feature extraction and emotion classification. The three primary EEG signal features are the time domain, frequency domain, and spatial domain. Time domain features capture the waveform characteristics of the EEG signal over time, frequency domain features capture emotional information from the frequency perspective of the EEG signal, and spatial domain features capture the relative position of the EEG electrodes. Subsequently, a classification model is constructed to classify the extracted emotion features, thereby enabling the recognition of emotional states. In recent years, the Transformer architecture has gradually attracted attention in the field of EEG emotion recognition due to its outstanding performance in fields such as natural language processing and computer vision. The Transformer deep learning model relies on a self-attention mechanism, which can capture long-range dependencies and flexibly model complex features and data relationships. Compared with traditional methods, the Transformer can better process multi-dimensional and heterogeneous EEG signal data, providing new design ideas for deep learning models for emotion recognition.
[0004] Defects and shortcomings of existing technology:
[0005] With the widespread application of Transformers and technological advancements in EEG emotion recognition, current research has achieved significant recognition results in subject-dependent scenarios. However, cross-subject EEG emotion recognition still faces challenges and many drawbacks:
[0006] (1) The current Transformer deep learning model based on EEG emotion recognition lacks a detailed classification of inter-subject differences and cannot effectively utilize this difference information to optimize the training of the emotion recognition model. This may make it difficult for the model to show high stability in cross-subject tasks with significant data differences.
[0007] (2) Traditional Transformer-based EEG emotion recognition methods mostly use self-attention to model the relationship between data, but they cannot effectively utilize the difference information between different subjects and find it difficult to capture the correlation and contextual features between cross-subject data.
[0008] (3) In the field of Transformer-based EEG emotion recognition, the model is often easily affected by the individual characteristics of different subjects, resulting in poor generalization ability of the model to cross-subject data. This will cause the model to perform inconsistently across different subjects, thereby affecting the accuracy and reliability of classification. Summary of the Invention
[0009] The purpose of the present invention is to provide a cross-domain EEG emotion recognition method and system based on feature adversarial learning to solve the problems existing in the above-mentioned prior art.
[0010] The cross-domain EEG emotion recognition system based on feature adversarial learning described in the present invention is constructed by the following steps:
[0011] S1. Input the original EEG signal, extract the differential entropy features, and build a deep learning model based on the Transformer backbone network;
[0012] S2. Using cosine distance as the criterion for judging differences between different subjects, we set a threshold according to the degree of difference to divide the subject data and construct a new label.
[0013] S3, dividing the differential entropy features of different subjects according to the channel dimension, taking the channel as the input of the deep learning model, and generating channel cipai after block embedding processing;
[0014] S4. Replace the self-attention of the Transformer encoder module in the deep learning model with cross attention;
[0015] S5. Add a cross entropy loss function constraint to the newly created label to reduce the sensitivity of the deep learning model to different subject data.
[0016] The cross-domain EEG emotion recognition method based on feature adversarial learning described in the present invention utilizes the cross-domain EEG emotion recognition system to perform cross-domain EEG emotion recognition.
[0017] The cross-domain EEG emotion recognition method and system based on feature adversarial learning described in the present invention have the following advantages:
[0018] (1) The cosine distance is calculated based on the feature differences between subjects, and the subject set is divided according to the difference level and new labels are created to refine the difference information between subjects, so that the deep learning model can better adapt to the changes in cross-subject features during training and improve classification accuracy.
[0019] (2) Using cross-attention instead of self-attention enables the deep learning model to focus on and distinguish the feature differences of different subject sets and capture more delicate contextual information, thereby significantly improving the classification accuracy of cross-subject emotion recognition and the adaptability of the deep learning model.
[0020] (3) By introducing adversarial loss, the deep learning model’s dependence on individual features is suppressed, so that the deep learning model can focus on global information across subjects, thereby enhancing the robustness and generalization ability of emotion recognition across subjects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the framework structure of the deep learning model described in the present invention.
[0022] Figure 2 It is a flow chart of the cross-domain EEG emotion recognition method described in the present invention. DETAILED DESCRIPTION
[0023] Most existing cross-subject EEG emotion recognition methods lack a refined understanding of inter-subject differences and accurately capture the feature differences between different subjects. This makes them susceptible to the influence of individual characteristics, resulting in insufficient generalization. Therefore, the present invention addresses this issue by employing cross-subject EEG difference grouping, feature focusing, and adversarial learning.
[0024] like Figures 1 to 2 As shown in the figure, the cross-domain EEG emotion recognition system based on feature adversarial learning in the present invention divides the set based on the subject feature differences and creates new labels. It accurately captures the feature differences through cross-attention, improves the accuracy and adaptability of emotion recognition, reduces individual dependence through adversarial loss, makes the deep learning model pay more attention to global features, and enhances the robustness and generalization ability of cross-subject recognition. The construction steps are as follows:
[0025] S1. Input the original EEG signal and extract the differential entropy feature. Use the window cutting method to cut the differential entropy feature in the time domain dimension, and then get several data formats of N×T w ×C EEG signal, where N is the number of channels, T wis the time domain window size, and C is the number of frequency bands. A multi-fold cross-validation approach is used to construct training and test sets for different subject data. This involves selecting one subject's data as the test set each time, and the remaining subjects' data as the training set. This process is repeated until all subject data are used as the test set.
[0026] S2. Calculate the cosine distance between each pair of subject data features B and A to quantify the difference between them. The specific formula is as follows: After calculating the cosine distances between all subjects, the cosine distances between each subject and all other subjects are accumulated to evaluate the feature differences of each subject. Then, the accumulated results are sorted, and the data of different subjects are divided into several sets according to the calculation results by setting a threshold, and a new label is created for each set. Let Y = (y1, y2, ..., y N ) T represents the label vector, Represents the input features from different subjects.
[0027] S3. After the differential entropy features are input into the deep learning model by channel, there is no need to perform block segmentation in the block embedding stage. Instead, the channel data is directly processed using a 1×1 convolutional layer to expand the time domain and feature dimensions, and then the features are transformed through a linear layer. Finally, the GELU activation function is used to generate the channel word cards.
[0028] S4. Replace the self-attention in the deep learning model with cross-attention so that the deep learning model can more accurately capture, focus on, and distinguish the feature differences between different subjects. The calculation formula for cross-attention is as follows: Z A and Z B These represent the features of modality A and modality B, respectively, obtained through the cross-attention mechanism. A concatenation operation combines the features of modalities A and B and propagates them backward. This deep learning model captures more nuanced contextual information from the feature interactions between different subject sets, effectively distinguishing the feature distributions of different groups. The specific number of modalities and the number of cross-attention calculations are based on the number of newly created labels.
[0029] S5. Using cross entropy loss function To define the loss corresponding to the newly created feature label: In the loss function In this example, L is the number of samples, N is the number of categories, and y is a newly constructed label representing different levels of difference. is the value predicted by the deep learning model. Since the task of the feature adversarial learning module is to guide the deep learning model to reduce its reliance on individual information of different subjects and focus on learning global information between subjects, thereby narrowing the feature gap between different subjects, Negate, in this case, minimize That means maximization During the training and updating process of the deep learning model, the deep learning model can maintain stable performance in emotion recognition among different subjects, that is, the deep learning model can still provide consistent and efficient classification effects when dealing with data with large individual differences, thereby enhancing its generalization ability across subjects.
[0030] The cross-domain EEG emotion recognition method based on feature adversarial learning described in the present invention utilizes the cross-domain EEG emotion recognition system to perform cross-domain EEG emotion recognition.
[0031] Those skilled in the art can make various other corresponding changes and deformations based on the technical solutions and concepts described above, and all of these changes and deformations should fall within the scope of protection of the claims of the present invention.
Claims
1. A cross-domain EEG emotion recognition system based on feature adversarial learning, characterized by: It is constructed by the following steps: S1. Input the original EEG signal, extract the differential entropy features, and build a deep learning model based on the Transformer backbone network; S2. Using cosine distance as the criterion for judging differences between different subjects, we set a threshold based on the degree of difference to divide the subject data and construct new labels. Specifically: The cosine distance calculation is performed on each pair of test data features B and A to quantify the difference. The specific formula is as follows: After calculating the cosine distances between all pairs of subjects, the cosine distances between each subject and all other subjects are accumulated to assess the feature differences of each subject. Then, the accumulated results are sorted, and a threshold is set to divide the data of different subjects into several sets according to the calculated results, and a new label is created for each set. Let Y = (y1, y2, ..., y N ) T represents the label vector, Represents input features from different subjects; S3, dividing the differential entropy features of different subjects according to the channel dimension, taking the channel as the input of the deep learning model, and generating channel cipai after block embedding processing; S4. Replace the self-attention of the Transformer encoder module in the deep learning model with cross attention; specifically: The self-attention in the deep learning model is replaced by cross attention. The calculation formula of cross attention is as follows: Z A represents the features of subject A obtained through the cross attention mechanism, Z B Represents the features of subject B obtained through the cross-attention mechanism; the features of subjects A and B are combined through a series operation and transmitted backward; S5. Add a cross entropy loss function constraint to the newly created label to reduce the sensitivity of the deep learning model to different subject data.
2. The cross-domain EEG emotion recognition system based on feature adversarial learning according to claim 1 is characterized in that: The step S1 is specifically as follows: Input the original EEG signal, extract the differential entropy features, and cut the differential entropy features in the time domain dimension using the window cutting method, and then get several data formats of N×T w ×C EEG signal, where N is the number of channels, T w is the time domain window size, and C is the number of frequency bands.
3. The cross-domain EEG emotion recognition system based on feature adversarial learning according to claim 2 is characterized in that: For the data of different subjects, a multi-fold cross-validation method is used to construct the training set and test set: each time the data of one subject is selected as the test set, and the data of the remaining subjects are used as the training set, and the process is repeated until the data of each subject is used as the test set.
4. The cross-domain EEG emotion recognition system based on feature adversarial learning according to claim 3 is characterized in that: The step S3 is specifically as follows: After the differential entropy features are input into the deep learning model by channel, the block embedding stage directly processes the channel data using a 1×1 convolutional layer without performing block segmentation to expand the time domain and feature dimension; Then the features are transformed through the linear layer, and finally the GELU activation function is used to generate the channel word card.
5. The cross-domain EEG emotion recognition system based on feature adversarial learning according to claim 1 is characterized in that: The step S5 is specifically as follows: Using cross entropy loss function To define the loss corresponding to the newly created feature label: In the loss function In this example, L is the number of samples, N is the number of categories, and y is a newly constructed label representing different levels of difference. is the value predicted by the deep learning model.
6. A cross-domain EEG emotion recognition method based on feature adversarial learning, characterized by: Cross-domain EEG emotion recognition is performed using the cross-domain EEG emotion recognition system as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Clustering-based confrontation partial domain adaptive cross-subject EEG emotion recognition method
CN114239652A
Cross-subject electroencephalogram cognitive load assessment method based on cross attention network
CN117195038A