Emotion recognition method based on electroencephalogram signals

By employing local meta-attention mechanisms and cross-domain feature alignment techniques, the problems of insufficient temporal modeling and inadequate cross-subject generalization ability in EEG emotion recognition were solved, resulting in more accurate and stable emotion state recognition.

CN122132907APending Publication Date: 2026-06-02HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
Filing Date
2026-02-05
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing emotion recognition technologies based on EEG signals suffer from several problems, including insufficient modeling of the continuous temporal evolution characteristics of EEG emotion signals, lack of cross-subject generalization ability, and failure to synergistically optimize local discriminative feature extraction and global temporal dynamic modeling.

Method used

We employ a local meta-attention mechanism to adaptively enhance key electrode channels and temporal segment features related to emotion. By combining global temporal modeling and cross-domain feature alignment under the meta-learning framework, and by introducing temporal convolution and adversarial training to reduce individual differences, we achieve accurate identification of emotional states.

Benefits of technology

It improves the accuracy and robustness of EEG emotion recognition, and enhances the model's ability to quickly adapt to new subjects and its cross-individual generalization stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122132907A_ABST
    Figure CN122132907A_ABST
Patent Text Reader

Abstract

This invention discloses an emotion recognition method based on electroencephalogram (EEG) signals, belonging to the field of emotion recognition technology. The method includes: processing raw EEG signals to obtain EEG feature representations; introducing a local feature attention mechanism into the EEG feature representations within a meta-learning framework, calculating attention weights in both the channel and time dimensions to adaptively model the contributions of different electrode channels and time segments in emotion recognition, generating weighted local feature representations; performing global temporal modeling on the weighted local feature representations to obtain global emotion features characterizing the overall emotional change trend; performing cross-domain feature alignment processing on the global emotion features within the meta-learning framework to reduce feature distribution differences among different subjects; and jointly representing the weighted local feature representations and global emotion features, inputting the combined representations into a classifier to output the corresponding emotion category results. This achieves more accurate and robust emotion state recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of emotion recognition technology, and in particular to a meta-learning EEG emotion recognition method based on local meta-attention and cross-domain feature alignment. Background Technology

[0002] Emotion recognition, a key technology in fields such as human-computer interaction, intelligent sensing, and cognitive computing, aims to accurately infer an individual's inner emotional state from objective physiological or behavioral signals. Among numerous signal sources, electroencephalogram (EEG) signals, due to their direct reflection of the electrical activity of the cerebral cortex and their advantages of strong objectivity, resistance to spoofing, and high timeliness, have become an important data foundation for emotion recognition research.

[0003] However, emotion recognition based on EEG signals still faces many challenges in practical applications: First, EEG signals themselves are characterized by non-stationarity, low signal-to-noise ratio, and high-dimensional redundancy, which poses challenges to the extraction of stable and discriminative features. More importantly, the generation and expression of emotion is a dynamic and continuous temporal process. The current emotional state is not only influenced by immediate stimuli but is also closely related to the accumulation and evolution of emotions over a previous period. Many existing methods treat EEG signals as independent time segments or perform simple averaging, failing to effectively model the long-term dependencies and continuous evolutionary patterns of emotions over time. This results in insufficient accuracy in capturing changes in emotional states, limiting the improvement of recognition performance.

[0004] Secondly, EEG signals exhibit significant individual variability. Due to factors such as physiological structure, cognitive habits, and electrode impedance, the feature distribution of EEG signals varies considerably among different subjects. This often results in a significant performance drop when an emotion recognition model trained on one subject's data is directly applied to a new subject, indicating insufficient cross-subject generalization ability. To address this issue, researchers have attempted methods such as domain adaptation and transfer learning. However, these methods typically require a certain amount of labeled data in the target domain for model adjustment, and the alignment process is computationally complex, making it difficult to achieve rapid and efficient adaptation to new subjects in real-world scenarios where labeled data is scarce.

[0005] Furthermore, at the feature level, existing methods either focus on mining spatial distribution features from multi-channel EEG signals or on modeling temporal relationships using recurrent neural networks, often failing to organically combine the fine-grained selection of local key features with the macroscopic characterization of global temporal dynamics. Meta-learning, as a framework aimed at "learning to learn," offers the possibility of rapidly adapting to new tasks from small samples; however, how to combine it with the unique spatiotemporal characteristics of EEG signals and the need for cross-domain distribution alignment to build a unified and efficient model remains a pressing problem to be solved in current technology.

[0006] In summary, the main shortcomings of existing emotion recognition technologies based on EEG signals are: 1) insufficient modeling of the continuous temporal evolution characteristics of EEG emotion signals, especially long-term dependencies; 2) lack of efficient mechanisms to effectively mitigate individual differences and achieve rapid generalization across subjects; and 3) failure to coordinate the optimization of local discriminative feature extraction and global temporal dynamic modeling to comprehensively improve the robustness and accuracy of the model.

[0007] Therefore, there is an urgent need for a new technological solution to overcome the above-mentioned problems simultaneously. Summary of the Invention

[0008] To address the aforementioned technical problems, this invention provides an emotion recognition method based on electroencephalogram (EEG) signals, comprising the following steps: S1. The raw EEG signal is decomposed into frequency bands, differential entropy features are extracted and normalized to obtain the EEG feature representation; where the single-trial EEG signal of each subject is represented as follows: ,in This represents the number of electrode channels. For time frames, Number of frequency bands; S2. Under the meta-learning framework, a local feature attention mechanism is introduced into the EEG feature representation. By calculating attention weights in the channel dimension and time dimension respectively, the contribution of different electrode channels and different time segments in emotion recognition is adaptively modeled to generate a weighted local feature representation. S3. Perform global temporal modeling on the weighted local feature representation to characterize the continuous evolution of emotional state in the time dimension and obtain global emotional features that represent the overall emotional change trend. S4. Under the meta-learning framework, cross-domain feature alignment processing is performed on the global sentiment features to reduce the feature distribution differences among different subjects. S5. The weighted local feature representation and the global sentiment feature are jointly represented and input into the classifier to output the corresponding sentiment category result.

[0009] Furthermore, in S3, the global temporal modeling includes: Extracting long-term sentiment change trends through temporal convolution; Bidirectional temporal modeling is performed to obtain forward temporal features and backward temporal features; Based on the joint representation of the forward temporal features and the backward temporal features, the importance weight of each time segment is calculated, and the forward temporal features and the backward temporal features are weighted and fused using the importance weight to obtain the global sentiment features.

[0010] Furthermore, the temporal convolution employs a convolutional structure with causal constraints and extended intervals to extract long-term sentiment change trends across multiple time segments.

[0011] Furthermore, the importance weight calculation formulas for the forward temporal features and the backward temporal features are as follows:

[0012]

[0013] In the formula, This represents the importance weight of the forward temporal features; This indicates the importance weight of the backward temporal features; It is a lower triangular mask matrix; It is an upper triangular mask matrix; Indicates time step Feature importance scoring is achieved by evaluating forward temporal features. With backward time series characteristics After splicing, the scalar value is input into the preset scoring layer for calculation. Indicates the first The sentiment feature importance score at each time step is a scalar value generated by concatenating the forward and backward temporal features and then passing it through a mapping layer. Indicates the current moment; This indicates the total length of the time frame of the EEG signal in a single test; This represents the time step index variable.

[0014] Furthermore, the global sentiment feature satisfies the expression:

[0015] In the formula, Use the Sigmoid activation function; and These are learnable parameters; Indicates feature concatenation operation; and These represent the forward aggregation features respectively. and backward aggregation features They respectively satisfy the expressions: In the formula, and They represent the first The forward temporal features and the backward temporal features corresponding to each time frame; This indicates element-wise multiplication; This represents the global sentiment feature representation after fusion.

[0016] Furthermore, in step S4, the cross-domain feature alignment process includes: A feature alignment constraint based on the consistency of emotion categories is introduced to make features from different subjects but belonging to the same emotion category tend to be consistent in the feature space; By introducing domain discriminative constraints, adversarial training is used to guide the model to generate affective feature representations that are insensitive to differences among subjects.

[0017] Furthermore: The feature alignment constraint based on sentiment category consistency is achieved through meta-contrast loss. This meta-contrast loss constrains features from different subjects but with the same sentiment category to tend towards consistency in the feature space, satisfying the function:

[0018] In the formula, Indicates the characteristics of the source subjects; This indicates that the target subjects share the same emotional category. Indicates the first in the batch Feature representation extracted from each sample; This indicates the sample number currently being used as the anchor point in the calculation; Indicates the numbers of the remaining samples used for comparison with the anchor sample; Represents the total number of feature samples contained in the current meta-learning task batch; For similarity functions; Temperature coefficient; The domain discriminant constraint determines the subject source of a feature by constructing a domain discriminator, and uses adversarial training to guide the model to generate sentiment feature representations that are insensitive to subject differences, satisfying the function:

[0019] In the formula, D( ) represents the source domain probability output by the domain discriminator.

[0020] Furthermore, in S4, when faced with a new subject, the parameters involved in the cross-domain feature alignment process are quickly adjusted using a small amount of experimental data from the new subject.

[0021] Furthermore, in S2, the local feature attention mechanism includes channel-level attention and temporal frame-level attention; wherein: The channel-level attention is used to model the importance of different electrode channels in emotion recognition and generate channel attention weights; The time-frame level attention is used to model the importance of different time segments in emotion recognition and generate time attention weights.

[0022] Furthermore, both the channel-level attention and the temporal frame-level attention are updated adaptively with parameters through a meta-learning mechanism, enabling the model to learn shared attention modeling strategies from multiple subject tasks.

[0023] Furthermore, S5 specifically includes: The weighted local feature representations are aggregated along the time dimension to obtain aggregated local features; The aggregated local features are concatenated with the global sentiment features to form a fused feature; The fused features are input into the classifier to obtain the emotion category result.

[0024] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention introduces a local meta-attention mechanism to adaptively enhance key electrode channels and temporal segment features related to emotion, combines global temporal modeling to accurately characterize the continuous evolution trend of emotion, and utilizes cross-domain feature alignment under the meta-learning framework to effectively reduce the feature distribution differences among different subjects. Thus, while improving the temporal modeling accuracy of EEG emotion recognition, it also enhances the model's rapid adaptability to new subjects and cross-individual generalization stability, ultimately achieving more accurate and robust emotion state recognition. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of the meta-learning EEG emotion recognition method based on local meta-attention and cross-domain feature alignment disclosed in this invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] Please see Figure 1 This invention aims to provide a meta-learning EEG emotion recognition method based on local meta-attention and cross-domain feature alignment, mainly including the following steps: S1. The raw EEG signal is decomposed into frequency bands, differential entropy features are extracted and normalized to obtain the EEG feature representation; where the single-trial EEG signal of each subject is represented as follows: ,in This represents the number of electrode channels. For time frames, This represents the number of frequency bands.

[0029] In practice, firstly, the raw EEG signals of a subject are collected and represented by channel. Let the EEG signal characteristics of this subject be represented as follows: ,in It refers to the number of brainwave signal channels. Indicates the first EEG feature vectors corresponding to each channel; It is a one-dimensional feature vector with a length of . ,in Sampling time (in seconds). This refers to the sampling frequency of the electroencephalogram (EEG) signal.

[0030] Then, the EEG signals were processed according to... The time window is segmented (seconds) to obtain segmented EEG features. ,in Indicates the first The feature vectors of each channel within a unit time window have a length of .

[0031] Finally, for the EEG signals within each time window, differential entropy features were calculated in five typical frequency bands: Delta, Theta, Alpha, Beta, and Gamma. The obtained features were then standardized to obtain the final dimension. The EEG feature tensor, in which Represents the frequency band feature dimension; in a specific embodiment, .

[0032] S2. Under the meta-learning framework, a local feature attention mechanism is introduced into the EEG feature representation. By calculating attention weights in the channel dimension and time dimension respectively, the contribution of different electrode channels and different time segments in emotion recognition is adaptively modeled to generate a weighted local feature representation.

[0033] In this scheme, the EEG characteristics obtained in step S1 Based on this, a local feature attention mechanism is introduced to adaptively model the contributions of different electrode channels and different time frames in emotion recognition, so as to generate weighted local feature representations.

[0034] In a further proposed approach, the local feature attention mechanism includes channel-level attention and temporal frame-level attention. Channel-level attention models the importance of different electrode channels in emotion recognition and generates channel attention weights; temporal frame-level attention models the importance of different time segments in emotion recognition and generates temporal attention weights. Both channel-level and temporal frame-level attention use a meta-learning mechanism for adaptive parameter updates, enabling the model to learn shared attention modeling strategies from multiple subject tasks.

[0035] In practice, firstly, the EEG features are modeled in the channel dimension. The EEG features of each electrode channel are aggregated in the time dimension and frequency band dimension to obtain the corresponding channel-level feature representation.

[0036] Then, the channel-level features are input into the channel attention calculation module to generate the corresponding channel attention weight vector. ,in The dimension is consistent with the number of electrode channels. The channel attention calculation module is a learnable feature mapping structure, and its output, after normalization, is used to characterize the relative importance of each electrode channel in the current emotion recognition task.

[0037] Next, time-frame-level attention modeling is performed in the time dimension. Temporal features are extracted from the weighted features along the time dimension, and the time attention weights corresponding to each time frame are generated through the time attention calculation module. ,in The dimension is consistent with the number of time frames. Channel attention weights are used. With time attention weight The EEG features were weighted in both the channel and time dimensions to obtain the weighted local feature representations. Local feature representation is used to characterize local spatial-temporal features in EEG signals that are highly correlated with emotional states, and serves as one of the inputs for subsequent global temporal modeling and emotion classification.

[0038] Finally, during the meta-learning training process, the emotion recognition tasks corresponding to different subjects are constructed into multiple meta-learning tasks. In the inner loop phase of meta-training, for a single subject task, the parameters of the channel attention calculation module and the temporal attention calculation module are rapidly updated using a small number of samples; in the outer loop phase, the shared parameters of the attention modules are updated across multiple subject tasks, thereby enabling the local feature attention mechanism to adapt to the feature differences between different subjects and improving the generalization ability of subject emotion recognition.

[0039] S3. Perform global temporal modeling on the weighted local feature representation to characterize the continuous evolution of emotional state in the time dimension and obtain global emotional features that represent the overall emotional change trend.

[0040] Those skilled in the art will understand that, after the temporal convolution and channel attention processing in step S2, the EEG features are mapped to... ,in, This represents the number of effective channels after filtering by the channel attention mechanism. In a specific embodiment, The number of channels is reduced from the original number to approximately 20–30 to decrease the interference of redundant channels on emotion discrimination. Step S3 involves performing global temporal modeling on the EEG features processed in step S2 to extract the continuous evolution characteristics of emotional states in the time dimension.

[0041] Specifically, firstly, temporal convolution processing is performed on EEG features along the time dimension. This temporal convolution employs a causal constraint approach, ensuring that features at the current time position depend only on previous historical time information, thus avoiding interference from future information in modeling the current emotional state. Simultaneously, by setting different time expansion intervals in different convolutional layers, the convolutional perception range gradually expands with each layer, covering multiple consecutive time segments to extract global temporal features reflecting long-term emotional trends. In one specific embodiment, the temporal convolution includes a multi-layered cascaded temporal convolutional structure, with the time expansion interval of each layer increasing sequentially. Expansion factors, for example, can be 1, 2, and 4, resulting in a final temporal perception range covering approximately 60 time frames. Furthermore, the kernel sizes of each layer are set from large to small, for example, 8, 5, and 3, to capture global emotional trends while also considering local temporal details.

[0042] Next, after obtaining the aforementioned global temporal features, bidirectional temporal modeling is performed on them to simultaneously characterize the dynamic evolution of emotional states from the past to the present, as well as the inverse mapping relationship between the overall trend and the current emotional state. Specifically, sequence modeling is performed on the global temporal features along both the forward and reverse time directions to obtain the forward temporal features. and backward time series features In one specific embodiment, sequence modeling can be implemented using a recurrent neural network structure, such as a Long Short-Term Memory (LSTM) network, but is not limited to this. To highlight key time segments that contribute significantly to emotion recognition, forward temporal features are... With backward time series characteristics By concatenating the features along the feature dimension, a joint temporal feature representation is obtained. Based on joint temporal features, an attention scoring network is used to evaluate the importance of each time segment, resulting in an importance score for each time step.

[0043] in, Indicates the first The importance of each time segment to the emotion recognition task.

[0044] Considering the unidirectional cumulative nature of emotional states over time, a directional constraint is imposed on importance scores, and forward temporal attention weights and backward temporal attention weights are calculated separately. The forward temporal attention weight... With backward temporal attention weights The calculation formulas are as follows:

[0045]

[0046] In the formula, The lower triangular mask matrix ( like (otherwise it is 0); The upper triangular mask matrix ( like (otherwise it is 0); Indicates time step Feature importance scoring is achieved by evaluating forward temporal features. With backward time series characteristics After splicing, the scalar value is input into the preset scoring layer for calculation. Indicates the first The importance score of sentiment features at each time step is specifically calculated as a scalar value by concatenating forward and backward temporal features and then passing them through a mapping layer. The current time; T represents the total length of the time frame of the EEG signal in a single test; This is the time step index variable.

[0047] The above method enables differentiated weighting of different time segments in forward and backward time series modeling.

[0048] Finally, the weighted forward temporal features and backward temporal features are fused to obtain global emotional features that characterize the overall emotional evolution trend of EEG signals. These global emotional features are then used as input for subsequent emotional state recognition. In a specific embodiment, the specific process of fusing the weighted forward temporal features and backward temporal features is as follows: Based on the attention weights of the forward and backward temporal features, the corresponding temporal features are weighted and summed to obtain the forward aggregated features. and backward aggregation features :

[0049]

[0050] In the formula, and They represent the first Forward and backward temporal features corresponding to each time frame and These represent the corresponding forward temporal feature attention weights and backward temporal feature attention weights, respectively.

[0051] In a further proposed solution, a temporal gating fusion mechanism is introduced to adaptively fuse forward and backward aggregated features to obtain global sentiment features.

[0052] in, It is the Sigmoid activation function. and For learnable parameters, This indicates a feature concatenation operation. This indicates element-wise multiplication. This represents the global sentiment feature representation after fusion.

[0053] S4. Under the meta-learning framework, cross-domain feature alignment is performed on global sentiment features to reduce the differences in feature distribution among different subjects.

[0054] Those skilled in the art will understand that, in order to reduce the differences in feature distribution among different subjects, under the meta-learning framework, the global sentiment features obtained in step S3 are subjected to cross-domain feature alignment processing, so that the model can learn a general sentiment feature representation that is insensitive to subject differences.

[0055] Specifically, by jointly introducing a meta-contrast loss based on sentiment category consistency and a domain discrimination loss, alignment of feature distributions from different participants is achieved. The meta-contrast loss constrains features from different participants but with the same sentiment category to tend towards consistency in the feature space; its loss form is as follows:

[0056] In the formula, Indicates the characteristics of the source subjects; This indicates that the target subjects share the same emotional category. Indicates the first in the batch Feature representation extracted from each sample; This indicates the sample number currently being used as the anchor point in the calculation; Indicates the numbers of the remaining samples used for comparison with the anchor sample; Represents the total number of feature samples contained in the current meta-learning task batch; For similarity functions; This is the temperature coefficient.

[0057] Further, a domain discriminant constraint is introduced. By constructing a domain discriminator, the subject source to which a feature belongs is determined. An adversarial training approach is used to guide the feature extraction module to generate sentiment feature representations that are insensitive to subject differences. The domain discriminant loss is:

[0058] In the formula, D( ) represents the "source domain probability" output by the domain discriminator.

[0059] Those skilled in the art will understand that, in the meta-training stage, the shared parameters of the cross-domain feature alignment module are updated by jointly optimizing the emotion classification loss, meta-contrast loss, and domain discrimination loss; in the meta-adaptation stage, for new subject samples, the parameters of the cross-domain alignment module are quickly adjusted using only a small amount of experimental data, so that the new subject features can be mapped to the general feature space formed in the meta-training stage, thereby reducing the adaptation cost of cross-subject emotion recognition.

[0060] S5. Jointly represent the weighted local feature representation with the global sentiment feature, and input the result into the classifier to output the corresponding sentiment category.

[0061] Specifically, in the classification stage, the aforementioned local features are first aggregated along the time dimension to obtain a feature representation that reflects the overall distribution of local temporal information. Then, these local features are concatenated with the previously extracted global sentiment features to form a fused sentiment feature vector. This fused feature serves as the input to the classifier, undergoing non-linear mapping through a multi-layer fully connected network. Finally, the predicted probability for each sentiment category is obtained through a normalized output layer. The category with the highest probability is the identified sentiment state, thus achieving the discrimination of EEG sentiment states.

[0062] During model training, to simultaneously consider classification performance, feature discriminativeness, and cross-subject generalization ability, a joint optimization objective composed of multiple loss terms was constructed. Specifically, the classification loss constrains the model's accuracy in classifying emotion categories; the meta-contrast loss enhances the discriminative power between feature representations under different emotion states, improving the model's ability to model emotion evolution patterns; and the domain discriminative loss suppresses the impact of inter-subject differences on model training, thereby improving the model's robustness in cross-individual scenarios. By weighting and combining these loss terms, the overall model performance is synergistically optimized.

[0063] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. An emotion recognition method based on electroencephalogram (EEG) signals, characterized in that, Includes the following steps: S1. Perform frequency band decomposition on the original EEG signal, extract differential entropy features and normalize them to obtain EEG feature representation; The single-trial EEG signal for each subject is represented as follows: ,in This represents the number of electrode channels. For time frames, Number of frequency bands; S2. Under the meta-learning framework, a local feature attention mechanism is introduced into the EEG feature representation. By calculating attention weights in the channel dimension and time dimension respectively, the contribution of different electrode channels and different time segments in emotion recognition is adaptively modeled to generate a weighted local feature representation. S3. Perform global temporal modeling on the weighted local feature representation to characterize the continuous evolution of emotional state in the time dimension and obtain global emotional features that represent the overall emotional change trend. S4. Under the meta-learning framework, cross-domain feature alignment processing is performed on the global sentiment features to reduce the feature distribution differences among different subjects. S5. The weighted local feature representation and the global sentiment feature are jointly represented and input into the classifier to output the corresponding sentiment category result.

2. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, In S3, the global time series modeling includes: Extracting long-term sentiment change trends through temporal convolution; Bidirectional temporal modeling is performed to obtain forward temporal features and backward temporal features; Based on the joint representation of the forward temporal features and the backward temporal features, the importance weight of each time segment is calculated, and the forward temporal features and the backward temporal features are weighted and fused using the importance weight to obtain the global sentiment features.

3. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 2, characterized in that, The temporal convolution employs a convolutional structure with causal constraints and extended intervals to extract long-term sentiment change trends across multiple time segments.

4. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 2, characterized in that, The importance weight calculation formulas for the forward temporal features and the backward temporal features are as follows: In the formula, This represents the importance weight of the forward temporal features; This indicates the importance weight of the backward temporal features; It is a lower triangular mask matrix; It is an upper triangular mask matrix; Indicates time step Feature importance scoring is achieved by evaluating forward temporal features. With backward time series characteristics After splicing, the scalar value is input into the preset scoring layer for calculation. Indicates the first The sentiment feature importance score at each time step is a scalar value generated by concatenating the forward and backward temporal features and then passing it through a mapping layer. Indicates the current moment; This indicates the total length of the time frame of the EEG signal in a single test; This represents the time step index variable.

5. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 4, characterized in that, The global sentiment feature satisfies the expression: In the formula, Use the Sigmoid activation function; and These are learnable parameters; Indicates feature concatenation operation; and These represent the forward aggregation features respectively. and backward aggregation features They respectively satisfy the expressions: In the formula, and They represent the first The forward temporal features and the backward temporal features corresponding to each time frame; This indicates element-wise multiplication; This represents the global sentiment feature representation after fusion.

6. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, In step S4, the cross-domain feature alignment process includes: A feature alignment constraint based on the consistency of emotion categories is introduced to make features from different subjects but belonging to the same emotion category tend to be consistent in the feature space; By introducing domain discriminative constraints, adversarial training is used to guide the model to generate affective feature representations that are insensitive to differences among subjects.

7. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 6, characterized in that: The feature alignment constraint based on sentiment category consistency is achieved through meta-contrast loss. This meta-contrast loss constrains features from different subjects but with the same sentiment category to tend towards consistency in the feature space, satisfying the function: In the formula, Indicates the characteristics of the source subjects; This indicates that the target subjects share the same emotional category. Indicates the first in the batch Feature representation extracted from each sample; This indicates the sample number currently being used as the anchor point in the calculation; Indicates the numbers of the remaining samples used for comparison with the anchor sample; Represents the total number of feature samples contained in the current meta-learning task batch; For similarity functions; Temperature coefficient; The domain discriminant constraint determines the subject source of a feature by constructing a domain discriminator, and uses adversarial training to guide the model to generate sentiment feature representations that are insensitive to subject differences, satisfying the function: In the formula, D( ) represents the source domain probability output by the domain discriminator.

8. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, In S4, when faced with a new subject, the parameters involved in the cross-domain feature alignment process are quickly adjusted using a small amount of experimental data from the new subject.

9. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, In S2, the local feature attention mechanism includes channel-level attention and temporal frame-level attention; wherein: The channel-level attention is used to model the importance of different electrode channels in emotion recognition and generate channel attention weights; The time-frame level attention is used to model the importance of different time segments in emotion recognition and generate time attention weights.

10. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 9, characterized in that, Both the channel-level attention and the time-frame-level attention are updated adaptively with parameters through a meta-learning mechanism, enabling the model to learn shared attention modeling strategies from multiple subject tasks.

11. The emotion recognition method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, S5 specifically includes: The weighted local feature representations are aggregated along the time dimension to obtain aggregated local features; The aggregated local features are concatenated with the global sentiment features to form a fused feature; The fused features are input into the classifier to obtain the emotion category result.