Cross-person emotion decoding method based on differential attention map convolution and mmd alignment

By using differential attention map convolution and MMD alignment, the individual differences and feature distribution offset problems in cross-population EEG signal emotion decoding are solved, and stable generalization of cross-population emotion decoding is achieved, which is applicable to brain-computer interaction and mental health screening.

CN123126801APending Publication Date: 2026-11-20CHONGQING UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611331099.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies suffer from strong individual variability and large feature distribution shifts in cross-population EEG signal emotion decoding, and traditional models have insufficient generalization ability. In particular, decoding performance is significantly degraded when performing cross-population transfer tasks between healthy individuals and clinically depressed individuals.

Method used

We employ a method of differential attention map convolution and MMD alignment, constructing a sequence rPSD map through two-level sliding window segmentation and power spectrum estimation. We then combine adaptive graph convolution and differential attention mechanism to extract multi-scale spatiotemporal features of EEG, and introduce MMD loss and conditional trigger pseudo-label loss for feature distribution alignment and model training.

Benefits of technology

While preserving the physical properties of EEG signals, the generalization performance of cross-group emotion decoding has been improved, achieving stable cross-group emotion decoding and adapting to practical application scenarios such as brain-computer interaction and mental health screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123126801A_ABST
    Figure CN123126801A_ABST
Patent Text Reader

Abstract

The application discloses a cross-person group emotion decoding method based on differential attention graph convolution and MMD alignment, and belongs to the technical field of electroencephalogram signal processing. The original EEG electroencephalogram signal is acquired, signal subsegments are obtained through two-stage sliding window segmentation, the relative power spectral density is calculated through power spectrum estimation, and a sequence rPSD graph is constructed. The sequence rPSD graph is input into an EmoDiPyraTrans network, and multi-scale electroencephalogram space-time features are mined by relying on adaptive graph convolution and differential attention mechanism. The development set is divided into source training flow and target verification flow, and model training is jointly completed by combining cross-entropy loss, MMD feature alignment loss and condition-triggered pseudo-label loss. In the reasoning stage, the same preprocessing is performed on the new subject electroencephalogram signal, and the cross-person group emotion decoding result is obtained by inputting the trained network. The method retains the physical semantics of the electroencephalogram, can alleviate the cross-person group feature distribution deviation problem, and is suitable for application scenarios such as brain-computer interaction and mental health assessment. The application is supported by Chongqing Natural Science Foundation projects (CSTB2025NSCQ-JM002, CSTB2025NSCQ- GPX0794 and CSTB2024NSCQ-MSX0118).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electroencephalogram (EEG) signal processing technology, and more specifically to a cross-population emotion decoding method based on differential attention map convolution and MMD alignment. Background Technology

[0002] Electroencephalography (EEG) can non-invasively record neural oscillation signals corresponding to emotional activity in the human brain, and has significant application value in brain-computer interfaces, mental health assessment, and human-computer interaction for emotion perception. In practical applications, emotion decoding models should not only achieve good results on known subjects, but also generalize to entirely new subjects who have not participated in training, and further adapt to cross-population transfer decoding between healthy individuals and those with clinical depression. However, EEG signals exhibit strong individual variability, influenced by anatomical structures, electrode contact conditions, and the psychological state of the subject; significant distributional shifts in EEG features exist between different populations, making traditional models prone to overfitting. Furthermore, many domain-adaptive decoding algorithms destroy the original channels and frequency bands of the EEG during feature alignment, sacrificing interpretability. How to improve the generalization decoding performance of models across subjects and populations while preserving the physical properties of the signals is a pressing technical challenge in the field of EEG emotion decoding.

[0003] In existing academic research, several technical approaches have emerged for EEG emotion decoding, including graph neural networks, Transformers, and domain adversarial adaptation. Representative studies include DGCNN (Dynamic Graph Convolutional Neural Network), BiDANN (Bihemispherical Domain Adversarial Neural Network), and RGNN (Regulated Graph Neural Network). DGCNN uses static graph convolution to model EEG channel associations, with a fixed graph adjacency matrix, which cannot adapt to the dynamically changing brain functional connectivity relationships of different subjects and populations, resulting in a significant decrease in generalization ability when facing cross-population tasks. BiDANN uses gradient inversion layers to implement domain adversarial training, relying on a domain discriminator to confuse the feature distributions of different subjects, thereby reducing inter-domain differences. However, the adversarial training process can easily erase the physical semantics of the channel-frequency band of the EEG signal itself, resulting in poor traceability of model representation. RGNN introduces regularization terms to constrain the graph structure, which alleviates overfitting to some extent. However, it lacks regularization design for dual data streams within the development set, does not combine MMD metrics to achieve explicit feature distribution alignment, and does not introduce a conditionally controllable pseudo-label learning mechanism. Most of the aforementioned academic methods can only achieve ordinary cross-subject decoding. When the task is upgraded to a cross-population transfer task with greater differences, such as health-depression, the feature distribution alignment effect is insufficient, and the model recognition performance is significantly degraded.

[0004] Among the publicly disclosed domestic patents related to EEG emotion recognition, publication number CN121502483A provides a domain-adaptive cross-subject EEG signal emotion recognition method. This scheme combines graph convolutional networks and domain adversarial modules to carry out cross-subject EEG emotion recognition. It relies on domain discriminator adversarial learning to eliminate feature distribution differences caused by different subjects, thereby improving the recognition effect on unseen subjects to a certain extent. However, this patented technology still has significant limitations: First, it uses an adversarial domain adaptive approach to achieve distribution alignment, rather than explicitly aligning the source training stream and target validation stream within the development set based on MMD loss. As the differences in feature distributions among different populations widen further, the distribution alignment effect will rapidly diminish. Second, this patent lacks a conditionally triggered pseudo-label screening mechanism. If all target domain pseudo-labels are used indiscriminately for training, a large number of low-confidence noise pseudo-labels will be introduced, causing training oscillations and unstable model convergence. Third, this patent does not have a dedicated training logic design for the inductive evaluation process of pre-isolating test participants in the development set. The target domain sample label processing logic is simple and cannot adapt to strict cross-population inductive decoding evaluation protocols. When facing complex scenarios such as clinical patients with depression, the overall decoding performance has a significant ceiling. Summary of the Invention

[0005] To address the aforementioned technical issues, this application discloses a cross-group emotion decoding method based on differential attention map convolution and MMD alignment, including:

[0006] The raw EEG signals of the subjects were acquired, and two-level sliding window segmentation was performed on the raw EEG signals to output EEG signal sub-segments.

[0007] Power spectrum estimation is performed on EEG signal sub-segments, the relative power spectral density of each EEG channel is calculated, and a sequence rPSD map that preserves channel identity, frequency band attributes, and temporal information is constructed.

[0008] The sequence rPSD map is input into the EmoDiPyraTrans emotion decoding network. The adaptive graph convolution is used to obtain the EEG channel correlation. The differential attention mechanism is used to suppress the shared redundant components in the features, extract multi-scale EEG spatiotemporal features and output emotion classification prediction.

[0009] The development dataset is internally split to obtain a labeled source training stream and a target validation stream. The cross-entropy loss of the source training stream is used as classification supervision, and the MMD loss is introduced to align the feature representations of the two data streams. The pseudo-label loss with condition triggering and confidence filtering is superimposed to form the total training loss. The real labels of the target validation stream do not participate in the calculation of MMD loss and pseudo-label loss, but are only used to select the optimal network parameters.

[0010] The EEG signals of new subjects to be identified are sequentially segmented into two levels of sliding windows, power spectrum estimation is performed, and relative power spectral density is calculated to obtain the sequence rPSD map. This map is then input into the trained EmoDiPyraTrans emotion decoding network, which outputs cross-population EEG emotion decoding results.

[0011] Preferably, the two-level sliding window segmentation process includes a first-level window splitting and a second-level window subdivision;

[0012] Use the first-level window length Step length The complete EEG trial is segmented to obtain fixed-length fragments, and the total number of fragments is... , This represents the total number of sampling points in the original EEG trials.

[0013] For each fixed-length segment, use the window length. Step length The second-level window further subdivides the signal, generating EEG signal sub-segments; the total number of sub-segments... .

[0014] Preferably, for each EEG signal sub-segment, the frequency band power of each preset frequency band is calculated channel by channel using the Welch method. ;

[0015] The relative power spectral density is calculated using the following formula:

[0016]

[0017] In the formula: This is the first-level fixed-length segment index. For sub-fragment indexing, For EEG channel indexing, Frequency band index; This represents the total number of preset frequency bands; Constants used to ensure numerical stability;

[0018] Using EEG electrodes as graph nodes, the node feature vectors are derived from the corresponding frequency bands of that channel. The sub-fragment rPSD diagram is constructed and obtained. Stack the rPSD images of the sub-fragments according to their chronological order, generating a dimension of... The sequence rPSD plot, This represents the total number of EEG channels.

[0019] Preferably, the EmoDiPyraTrans emotion decoding network includes: a single-branch adaptive graph convolutional recurrent network AGCRN, a two-branch adaptive graph convolutional recurrent network AGCRN, a DiAttGE differential attention graph enhancement module, a pyramid multi-scale fusion module, a differential Transformer encoder, and an MLP classification head;

[0020] The single-branch AGCRN received sequence rPSD graph outputs shallow spatiotemporal graph features; the dual-branch AGCRN received sequence rPSD graph outputs deep spatiotemporal graph features.

[0021] The AGCRN network is internally configured with learnable node embeddings, which generate an adaptive adjacency matrix.

[0022] Preferably, the DiAttGE differential attention map enhancement module includes a node enhancement stage and a node aggregation stage;

[0023] During the node enhancement phase, Multi-Head Differential Self-Attention (MHDSA) is configured. MHDSA performs the following attention operation:

[0024]

[0025] The MHDSA output is normalized by RMSNorm, and then residual connection operation is performed to output the enhanced features of the nodes.

[0026] The node aggregation stage is configured with multi-head differential cross attention (MHDCA). MHDCA introduces learnable query vectors to transform and aggregate channel-dimensional features into temporal-dimensional features. The DiAttGE module contains two instances, DiAttGE1 and DiAttGE2, which process shallow spatiotemporal graph features and deep spatiotemporal graph features, respectively.

[0027] Preferably, the pyramid multi-scale fusion module receives three sets of inputs: the first set of graph enhancement features output by DiAttGE1, the second set of graph enhancement features output by DiAttGE2, and the shallow linear projection features output by AGCRN;

[0028] The pyramid multi-scale fusion module performs element-wise addition on the three sets of inputs to obtain the fused temporal features;

[0029] The fused temporal features are fed into a differential Transformer encoder consisting of multiple stacked differential attention blocks; the output of the differential Transformer encoder is subjected to temporal average pooling, and the pooled features are fed into the MLP classification head.

[0030] Preferably, the development dataset partitioning is performed as follows: all test participants are pre-isolated in each external evaluation trade-off;

[0031] For participants retained in the development set, stratified sampling is performed within a single participant sample according to emotion category to divide the source training stream sample set and the target validation stream sample set;

[0032] The source training stream samples carry sentiment labels; the target validation stream samples retain their original labels. The label data of the target validation stream samples is not read during the calculation of MMD loss and pseudo-label loss.

[0033] Preferably, the total loss function for network training consists of labeled, smoothed cross-entropy loss. MMD loss Conditional pseudo-label loss The weighted sum is:

[0034]

[0035] in: Total network loss; For MMD loss weights; The weights are lost for pseudo-labels;

[0036] Labeled smooth cross-entropy loss: ,in The number of samples in the source training stream batch; The number of emotion categories; These are the one-hot labels of the source samples after label smoothing. The model outputs the probability for the category corresponding to the source sample; It is the natural logarithm; Negate the scalar;

[0037] MMD loss: ,in This represents the loss due to the maximum mean difference. The total number of mini-batch samples in the source training stream; The total number of samples in the target validation stream mini-batch; The index of samples within the source training stream batch; Validate the sample index within the target stream batch; , The source training streams are respectively the first , No. Each sample encoder outputs a feature vector; , The target verification flow is respectively , No. Each sample encoder outputs a feature vector; It is a positive definite kernel function;

[0038] Activation condition for pseudo-label loss setting: Source training mini-batch accuracy Only then is pseudo-label loss allowed; Pseudo-label loss expression: ,in For pseudo-label loss; Use the source to train the mini-batch classification accuracy; The preset accuracy trigger threshold; For indicator functions; For finding the maximum value operator; Filter the confidence level of the target sample using a mask; For the first The pseudo-labels of the target samples are predicted by the model; The model output probability is the category corresponding to the pseudo-label of the target sample.

[0039] Based on total loss Backpropagation updates all parameters of the EmoDiPyraTrans network.

[0040] Preferably, the input trained EmoDiPyraTrans sentiment decoding network outputs cross-group EEG sentiment decoding results, specifically as follows:

[0041] Acquire raw EEG signals from the new subjects to be identified; use window length. Step length The first-level window segments the raw EEG signal into fixed-length segments; then the window length is used... Step length The second level of window subdivision generates EEG signal sub-segments;

[0042] The power of each frequency band was calculated channel by channel using the Welch method for all EEG signal sub-segments, and then substituted into the relative power spectral density formula for calculation. Construct sub-fragment rPSD diagrams and stack them in chronological order to generate sequence rPSD diagrams;

[0043] The sequence rPSD image is fed into the EmoDiPyraTrans sentiment decoding network with fixed parameters, and AGCRN feature extraction, DiAttGE differential attention map enhancement, pyramid multi-scale fusion, and differential Transformer encoder temporal modeling are performed in sequence. The sentiment decoding classification result is output by the MLP classification head.

[0044] Compared with the prior art, the technical solution of this application has the following technical effects:

[0045] This invention constructs a sequence power spectrum structure adapted to EEG signals, fully preserving the physical information of the EEG signal channel frequency bands and temporal levels. During the input phase, the model maintains the original spatial and spectral correlations of the EEG signals, providing a reliable signal foundation for subsequent feature extraction and distribution alignment. The entire processing flow does not erase the inherent physical semantics of the EEG signals, ensuring that subsequent feature representations possess traceable physical meaning and supporting a stable feature learning process across different population groups.

[0046] This invention employs a differential attention map convolution module to mine spatiotemporal features of electroencephalograms (EEGs), enabling the capture of dynamically changing brain functional connectivity relationships under different population conditions. The module adaptively generates graph association weights based on a differential attention mechanism, adjusting the association strength between channels according to the emotional state of the samples. The model can fully mine spatiotemporal EEG association patterns corresponding to emotional activities, obtaining deep feature representations suitable for both source and target domain samples, providing high-quality feature input for subsequent distribution alignment.

[0047] This invention combines maximum mean difference loss and conditionally triggered pseudo-label loss to participate in model regularization training, thereby adjusting the feature distribution between the source training stream and the target validation stream. By relying on the mutual cooperation of the two losses to constrain the feature space, the model is guided to learn emotional features with domain invariant properties. The conditional triggering mechanism can control the working timing of the pseudo-label module, filter out poor-quality target domain samples to participate in parameter updates, maintain the stable state of the network training process, and ensure that the model parameter iteration process is stable and controllable.

[0048] After the model training is completed, this invention can perform emotion decoding and reasoning for unseen subjects and samples from different population groups. The model can directly output emotion category judgment results from input EEG signals, adapt to inductive cross-population assessment scenarios, can be embedded in the back-end processing link of EEG acquisition devices, and complete emotion decoding tasks for practical application scenarios such as brain-computer interface mental health screening, and has good engineering implementation and adaptability.

[0049] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.

[0050] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0052] Based on the description of the figures and their corresponding technical content in the document, the titles of the figures are as follows:

[0053] Figure 1 This is a flowchart illustrating the overall process of the cross-group emotion decoding method based on differential attention map convolution and MMD alignment according to an embodiment of the present invention.

[0054] Figure 2 This is a complete schematic diagram of the EmoDiPyraTrans network architecture, module internal structure, and timing diagram construction in an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.

[0056] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0057] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.

[0058] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" in this article describes another type of relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the related objects before and after it are in an "or" relationship.

[0059] In this article, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0060] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.

[0061] Example 1 describes a cross-group emotion decoding method based on differential attention map convolution and MMD alignment, such as... Figure 1 As shown, it includes:

[0062] The raw EEG signals of the subjects were acquired, and two-level sliding window segmentation was performed on the raw EEG signals to output EEG signal sub-segments.

[0063] Power spectrum estimation is performed on EEG signal sub-segments, the relative power spectral density of each EEG channel is calculated, and a sequence rPSD map that preserves channel identity, frequency band attributes, and temporal information is constructed.

[0064] The sequence rPSD map is input into the EmoDiPyraTrans emotion decoding network. The adaptive graph convolution is used to obtain the EEG channel correlation. The differential attention mechanism is used to suppress the shared redundant components in the features, extract multi-scale EEG spatiotemporal features and output emotion classification prediction.

[0065] The development dataset is internally split to obtain a labeled source training stream and a target validation stream. The cross-entropy loss of the source training stream is used as classification supervision, and the MMD loss is introduced to align the feature representations of the two data streams. The pseudo-label loss with condition triggering and confidence filtering is superimposed to form the total training loss. The real labels of the target validation stream do not participate in the calculation of MMD loss and pseudo-label loss, but are only used to select the optimal network parameters.

[0066] The EEG signals of new subjects to be identified are sequentially segmented into two levels of sliding windows, power spectrum estimation is performed, and relative power spectral density is calculated to obtain the sequence rPSD map. This map is then input into the trained EmoDiPyraTrans emotion decoding network, which outputs cross-population EEG emotion decoding results.

[0067] like Figure 2 As shown, the raw EEG time-series signal is input to the preprocessing unit, which outputs short-time EEG signal segments; these segments are then fed into the power spectrum estimation unit to generate a sequence rPSD map; the sequence rPSD map is used as an input tensor and fed into the EmoDiPyraTrans network; the network completes dual-stream regularized iterative training using the development dataset, saving the optimal model parameters; during the inference phase, the EEG signals of new subjects undergo the same preprocessing process, and the network completes training with frozen input parameters, outputting a classification tensor for emotion decoding.

[0068] Raw EEG signals from subjects were acquired, and a two-stage sliding window segmentation preprocessing was performed on the raw EEG signals to output EEG signal sub-segments. Complete EEG samples acquired from multiple scalp electrodes were expressed as tensors. For samples containing... One brainwave channel, The complete EEG trials at each time sampling point are recorded as follows: The original EEG trial signal is denoted as... The first dimension of this tensor corresponds to the EEG channel number, and the second dimension corresponds to the time sampling point. Each element inside the tensor represents the EEG voltage sampling value collected by the corresponding channel at the corresponding time.

[0069] Perform the first-level sliding window split and configure the window length. Step length The sliding window moves along the time sampling dimension, truncating bits one by one on the original EEG tensor. Each truncation operation outputs a fixed-length segment, denoted as . The total number of segments is calculated using the following formula:

[0070]

[0071] In the formula, This is the first-level fixed-length segment index. This is the floor operator. The first-level window performs coarse-grained segmentation of long trials, breaking down a long continuous EEG trial into multiple segments of appropriate time scale.

[0072] For each fixed-length segment that has been obtained Perform the second-level sliding window subdivision operation; configure the window length. Step length The second-level window continues to slide and extract segments within each fixed-length segment along the time dimension, obtaining EEG signal sub-segments. Total number of sub-fragments:

[0073]

[0074] In the formula, For sub-fragment indexing.

[0075] The complete execution process of segmented processing using a two-level sliding window is as follows: Figure 2 As shown in (f); Figure 2 (f) The left side visualizes the original multi-channel EEG time-series waveform, which is then processed through the first and second level windows to further break down the coarse-grained fixed-length segments into short-time sub-segments. All output EEG signal sub-segments retain the channel dimension unchanged, and only the time dimension is segmented. All subsequent power spectrum calculations are carried out within the time window of this sub-segment.

[0076] Power spectrum estimation is performed on each EEG signal sub-segment, the relative power spectral density corresponding to each EEG channel is calculated, and a sequence rPSD map is constructed that simultaneously preserves channel identity, frequency band attributes, and temporal information.

[0077] Take each EEG signal fragment Welch power spectrum estimation is performed independently on the short-time sequence signal of each channel, on a single-channel basis. The power spectrum estimation outputs the power spectral density function of that channel at different frequency points. .

[0078] Pre-defined physiological frequency band division rules are established, and the frequency band set includes delta (1–4Hz), theta (4–8Hz), alpha (8–12Hz), low beta (12–16Hz), beta (16–20Hz), high beta (20–28Hz), and gamma (30–45Hz); the frequency band set is denoted as... , Represents the total number of frequency bands, each This represents the frequency range corresponding to the frequency band.

[0079] Channel Index Frequency band index By integrating the power spectral density function over the corresponding frequency band, the frequency band power of that channel in that frequency band under that sub-segment can be obtained:

[0080]

[0081] In the formula, It represents a frequency variable, and the integration interval is limited to the frequency range corresponding to the current frequency band.

[0082] To eliminate the differences caused by the absolute magnitude of amplitudes from different channels, the frequency band power is normalized, and the relative power spectral density is calculated.

[0083]

[0084] In the formula, This is the first-level fragment index. For sub-fragment indexing, For EEG channel indexing, Frequency band index; Small constants are used to ensure numerical stability and prevent the denominator from being zero; For summation operators.

[0085] Define the EEG scalp electrode set as a graph node set. Each node in the set One-to-one correspondence with a scalp sampling electrode; sub-segment Lower passage All 7 frequency bands splicing, as nodes The node feature vectors are used to construct the sub-fragment rPSD graph. : ;

[0086] The graph data structure consists of two parts: a node set and node features. The node set is bound to the electrode identity, and the node features store the relative power spectrum information of each frequency band.

[0087] The rPSD diagrams of all sub-fragments generated within the same first-level fragment are strictly arranged according to the sub-fragments. The sequence is arranged chronologically, and tensors are stacked along the time dimension to obtain the sequence rPSD graph:

[0088]

[0089] Sequence rPSD diagram It is a three-dimensional tensor with dimensions of channel number, sub-segment time number, and frequency band number, respectively. This tensor fully preserves three types of information: electrode node identity, frequency band characteristics, and sub-segment time sequence.

[0090] The entire processing chain from the original EEG waveform to the generation of the sequence rPSD image is as follows: Figure 2 As shown in (f), Figure 2 (f) The right side shows the process of stacking and generating a time series tensor after the power spectrum calculation is completed; this three-dimensional tensor serves as the input data for the EmoDiPyraTrans network.

[0091] The sequence rPSD map is input into the EmoDiPyraTrans emotion decoding network. The EEG channel correlation is obtained by adaptive graph convolution. The shared redundant components in the features are suppressed by differential attention mechanism. Multi-scale EEG spatiotemporal features are extracted and emotion classification prediction is output.

[0092] The overall architecture of the EmoDiPyraTrans emotion decoding network is as follows: Figure 2 As shown in (a). The network receives input tensors as a sequence rPSD graph. , For the number of channels, The number of time segments. The number of frequency bands is specified. The network module consists of: a single-branch adaptive graph convolutional recurrent network (AGCRN), a two-branch adaptive graph convolutional recurrent network (AGCRN), a DiAttGE differential attention map enhancement module, a linear projection LP branch, a pyramid multi-scale fusion module, a differential Transformer encoder, and an MLP classification head.

[0093] The input tensor is fed into two AGCRN branches and an independent linear projection LP branch simultaneously.

[0094] The internal structure of the AGCRN module is as follows: Figure 2 (c) AGCRN is composed of AGCRNCell temporal recursive units and NAPL-GCN graph convolutional units. The NAPL-GCN unit has a learnable node embedding matrix inside, and an adaptive adjacency matrix is ​​calculated based on the node embedding matrix. This adjacency matrix is ​​used to describe the connection weights between each EEG graph node, without the need for a fixed topology to be given in advance.

[0095] Single-branch AGCRN receives the input sequence rPSD graph and outputs a shallow spatiotemporal graph feature tensor. The dual-branch AGCRN receives identical input sequences of rPSD graphs and outputs deep spatiotemporal graph feature tensors. ;in This represents the feature embedding dimension of the network settings. Meanwhile, the input sequence rPSD image is fed into the linear projection LP branch, and after linear weight matrix mapping operations, the shallow projection features are output. .

[0096] The DiAttGE differential attention map enhancement module contains two identical instances, DiAttGE1 and DiAttGE2; DiAttGE1 receives shallow spatiotemporal graph features. DiAttGE2 receives deep spatiotemporal map features Each DiAttGE instance is divided into two sequentially executed processing phases: a node enhancement phase and a node aggregation phase.

[0097] Node enhancement stage: The input feature tensor first undergoes RMSnorm normalization, and the normalized features are then fed into the Multi-Head Differential Self-Attention (MHDSA) module; the internal structure of the MHDSA module is as follows: Figure 2 (d) MHDSA internally constructs two independent sets of query, key-value projection branches, with the following calculation formula:

[0098]

[0099] In the formula, For querying the matrix, This is the first set of bond matrices. This is the second set of bond matrices. It is the matrix transpose operator; These are the difference coefficients; The activation function is used. The MHDSA output tensor is added to the original input tensor of the module using a residual operation, resulting in the output feature tensor after node enhancement. .

[0100] Node aggregation phase: enhancing the output of nodes RMSNorm normalization is performed again, and the normalization result is fed into Multi-Head Differential Cross-Attention (MHDCA); the MHDCA module structure is as follows: Figure 2 (e) MHDCA introduces a set of learnable query vectors. Relying on this set of learnable query vectors, the original... Channel-time features of dimension, aggregated and mapped to The temporal dimension; the MHDCA output is superimposed with one projection residual branch to obtain the features after node aggregation. .

[0101] DiAttGE2 follows the exact same node enhancement and aggregation operation process as DiAttGE1 for deep spatiotemporal graph features. Process and output feature tensors .

[0102] The pyramid multi-scale fusion module receives three input tensors: DiAttGE1 and outputs... DiAttGE2 output LP branch output shallow projection features The three input tensors maintain the same dimension. Internally, the module performs element-wise addition of tensors, fusing multi-scale feature information obtained from shallow, deep, and linear projections into a single-path temporal feature tensor. .

[0103] The fused temporal features The signal is fed into a differential Transformer encoder. The differential Transformer encoder consists of multiple stacked DiAttBlock differential attention blocks. Each DiAttBlock block contains an RMSnorm normalization layer, an MHDSA multi-head differential self-attention layer, a feedforward fully connected layer, and is configured with residual connections to model long-range dependencies in the temporal dimension.

[0104] The output tensor of the differential Transformer encoder undergoes global average pooling along the time dimension to eliminate the time dimension, resulting in aggregated global features. The global feature input is aggregated into a two-level concatenated MLP classification head, which undergoes multiple linear transformations and activation operations to output a sentiment classification prediction tensor. .

[0105] The EmoDiPyraTrans sentiment decoding network was trained using a development dataset with two-stream distribution regularization; the overall training process is as follows: Figure 2 As shown in (b).

[0106] In each set of external evaluation compromises, the samples of all test participants are isolated in advance and do not participate in model training; the remaining samples in the dataset excluding the test participants constitute the development dataset.

[0107] For the samples within the development dataset, taking a single subject as a unit, within all samples of that subject, stratified sampling is performed according to the emotion category label to split it into a source training stream sample set and a target validation stream sample set.

[0108] The source training stream samples carry complete real sentiment labels; the target validation stream samples retain their original real labels, but these labels are not fed into the calculation chain of MMD loss and pseudo-label loss. They are only read during the model validation stage to calculate validation metrics and select and save the optimal network parameters. Figure 2 (b) The upper half of the data flow corresponds to the source training flow, and the lower half corresponds to the target validation flow. The source training flow and the target validation flow only represent the role division of the data in the training iteration. This division is not related to the population to which the subjects belong.

[0109] In each training iteration, the network shares the encoder weights. Receive mini-batch sample sets from the source training stream respectively Mini-batch sample set with target validation stream The encoder performs a forward operation on the input sequence rPSD map, outputting high-level feature vectors of the source samples respectively. High-level feature vectors of target samples Classifier It receives high-level features and outputs the softmax class probability distribution of the corresponding samples.

[0110] Construct a labeled, smoothed cross-entropy loss function for classification supervision of the source training stream:

[0111]

[0112] In the formula: The number of samples in the source training stream batch; The number of categories representing emotion classification; These are the one-hot labels of the source samples after label smoothing. The model output probability represents each category of the source sample; Represents the natural logarithm operation.

[0113] Construct the MMD loss function and use a positive definite kernel function to measure the distribution difference between the two sets of high-level features in the source training stream and the target validation stream:

[0114] In the formula: The number of samples in the target validation stream batch; For the source training stream batch sample index; Target validation stream batch sample index; The encoder outputs features for the source samples; The encoder outputs features for the target sample; It is a positive definite kernel function.

[0115] Define source training mini-batch classification accuracy Set activation conditions; only when The pseudo-label loss is only included in the total loss calculation when the following condition is met; the pseudo-label loss expression is:

[0116]

[0117] In the formula, For indicator functions; The preset accuracy trigger threshold; For finding the maximum value operator; Use a confidence filter mask for the target sample, with a value of 0 or 1; The model is the first The pseudo-labels predicted from each target sample; This represents the model output probability corresponding to the pseudo-label category.

[0118] The overall training objective function is a weighted sum of three loss terms:

[0119]

[0120] In the formula, Represents the MMD loss weight; This represents the weight of the pseudo-label loss.

[0121] by As the loss value, backpropagation is performed, and gradient backpropagation updates all weight parameters of all modules in the EmoDiPyraTrans network. At the end of each iteration, the true labels of the target validation stream are read to calculate the validation metric. The iteration continues, and the complete set of network weight parameters corresponding to the round with the optimal validation metric is saved.

[0122] The EEG signals of new subjects to be identified are sequentially segmented into two levels of sliding windows, power spectrum estimation is performed, and relative power spectral density is calculated to obtain the sequence rPSD map. This map is then input into the trained EmoDiPyraTrans emotion decoding network, which outputs cross-population EEG emotion decoding results.

[0123] The original multi-channel EEG signals of the new subject to be identified are acquired to obtain the original EEG tensor. The two-level sliding window segmentation logic of the first step is fully reused to obtain EEG signal sub-segments. The entire processing of the second step is reused to perform Welch power spectrum estimation on the sub-segments, calculate the frequency band power, calculate the relative power spectral density, complete the graph construction and time stacking, and generate the sequence rPSD graph tensor corresponding to the subject to be identified.

[0124] The sequence rPSD image is fed into the EmoDiPyraTrans sentiment decoding network, which has been trained and all network weights and parameters are fixed and frozen. The forward computation chain is fully reproduced within the network: AGCRN branch feature extraction, DiAttGE module node enhancement-node aggregation operation, pyramid multi-scale feature tensor element-wise addition and fusion, differential Transformer encoder long-term modeling, time-dimensional average pooling, and finally fed into the MLP classification head to complete the forward computation. The tensor output by the MLP classification head is the cross-population EEG sentiment decoding classification result of the subject to be identified.

[0125] This embodiment constructs a sequence rPSD map through two-level sliding window preprocessing, mines EEG spatiotemporal features using adaptive graph convolution and differential attention, and conducts dual-stream training by combining MMD alignment and conditionally triggered pseudo-label loss. This scheme fully preserves the physical semantics of EEG, effectively mitigates cross-population feature distribution shifts, and has a controllable and stable training constraint mechanism. It can achieve cross-population emotion decoding without seeing the subjects, and is suitable for brain-computer interface related application scenarios.

[0126] This embodiment selects publicly available EEG emotion datasets and clinical DEP-EEG datasets. Preprocessing is performed according to the two-level sliding window segmentation, Welch power spectrum estimation, and relative power spectrum density normalization process described in this invention to construct sequence rPSD graphs. An EmoDiPyraTrans emotion decoding network is built, and the development dataset is divided into source training streams and target validation streams according to the rule of pre-isolating test participants in the external evaluation fold. Dual-stream distribution regularization training is performed using a total loss function including cross-entropy loss, MMD loss, and conditionally triggered pseudo-label loss. Experiments are then conducted sequentially, including cross-subject emotion decoding experiments on publicly available datasets, emotion decoding experiments within and across clinical populations, component and training scheme ablation experiments, and hyperparameter sensitivity analysis experiments on the SEED dataset.

[0127] Evaluations were conducted on five publicly available EEG emotion benchmark datasets and the clinical DEP-EEG dataset, with all tasks being binary classification tasks across participants. For each external evaluation layer, participants were first identified, and then the remaining data were used for model development and partitioning. The publicly available datasets were used for emotion valence decoding; DEP-EEG was used to evaluate intra-population positive-neutral emotion decoding, transfer from healthy controls to depressed participants, and generalization ability to a mixed population excluding depressed participants; SEED was used for both spatial and spectral interpretation. SEED contained EEG recordings of 15 participants watching 15 Chinese film clips that evoked positive, negative, and neutral emotions, using 62 EEG channels at a sampling rate of 200 Hz. Neutral trials were excluded in the binary classification valence task, and positive and negative samples were labeled as category 1 and category 0, respectively. FACED data includes EEG recordings of 123 participants watching 28 emotionally evoked video clips, using 32 channels and a sampling rate of 250Hz. Preprocessed EEG and emotion scores were derived from publicly available data and corresponding annotation files. Valence scores greater than 3.0 were defined as high-valence categories, and scores less than or equal to 3.0 were defined as low-valence categories. MAHNOB-HCI data selected data from 27 participants, including 32 EEG channels and a sampling rate of 128Hz. Non-EEG channels were removed, and a mean reference was used. Each recording was cropped by 30 seconds at both ends, and bandpass filtering (0.3-45Hz) and notch filtering (50Hz) were applied. Binary classification used a valence score of 1-9, with a threshold of 5. Samples equal to the threshold were discarded. Scores higher than and lower than 5 were defined as high-valence and low-valence categories, respectively. DEAP uses official preprocessed files from 32 participants, containing 32 EEG channels at a sampling rate of 128Hz. The first 3 seconds of baseline are removed. A valence score greater than 5.0 is defined as a high valence category, and less than or equal to 5.0 is defined as a low valence category. The original signal in this dataset has already been filtered from 4 to 45Hz, and the rPSD construction no longer includes the delta band. DREAMER contains EEG records from 23 participants. Each participant completed 18 audiovisual emotion-evoked trials, using 14 channels at a sampling rate of 128Hz. The last 60 seconds of data from each trial are retained. A valence score greater than 3.0 is defined as a high valence category, and less than or equal to 3.0 is defined as a low valence category. DEP-EEG includes labeled EEG data from 40 healthy controls and 20 depressed participants. Each participant watched four neutral videos and four positive videos, presented in a randomized order. Each video showed a 60-second EEG segment, from which 50 seconds were retained. The EEG was recorded through 30 scalp channels at a sampling rate of 250 Hz. The online reference electrode was the right mastoid A2. The exposed signals underwent common averaging rereference, 0.01 Hz high-pass filtering, and power line noise suppression. Positive and neutral segments were converted into sequential rPSD maps as two emotion categories.

[0128] All trials were uniformly converted into sequence rPSD graphs, segmented using a 20-s window with an 80% overlap rate, corresponding to a 4-s step size. Each segment was further subdivided with a 75% overlap rate. The SEED and DREAMER sub-segments were set to a length of 2s, while the FACED, MAHNOB-HCI, DEAP, and DEP-EEG sub-segments were set to a length of 4s. SEED, FACED, MAHNOB-HCI, DREAMER, and DEP-EEG used seven frequency bands: delta, theta, alpha, low beta, beta, high beta, and gamma. The delta band was omitted for DEAP. The final input was... , For the number of channels, The number of time segments. This represents the number of frequency bands.

[0129] All experiments employed inductive evaluation. SEED, MAHNOB-HCI, DEAP, and DREAMER used leave-one-out cross-validation, while FACED used an external fold evaluation with 12 participants. For each fold, external test participants were first isolated, and then a development data pool was constructed and partitioned, retaining the model parameters corresponding to the optimal validation accuracy. For SEED, MAHNOB-HCI, DEAP, and DREAMER, one participant was left out in each fold, and the remaining participants were stratified according to emotion category, with the source training stream and target validation stream divided at an 8:2 ratio. For FACED, 10 external folds were set up, with 12 participants left out in each of the first nine folds and 15 participants left out in the last fold, with the remaining samples divided at a 9:1 ratio. DEP-EEG employs four evaluation protocols. HC-LOSO leaves one participant in the healthy control group, with the remaining samples stratified 8:2. DEP-LOSO leaves one participant in the depressed participant group. The HC→DEP protocol uses all healthy control participants for model development and tests directly on all depressed participant samples. The mixed-population HC+DEP→DEPLOSO protocol consists of 20 external folds. Each fold isolates all segments from one depressed participant. The remaining segments, including those from both healthy and depressed subjects, are jointly stratified according to population and emotion category, with an 8:2 split between training and validation subsets to generate the source training stream and target validation stream. During model training, the target validation stream data is used to calculate MMD terms and screen for pseudo-label loss based on confidence levels. The true labels are only used to calculate validation metrics and select optimal parameters. For each test participant, accuracy and positive class F1 scores were calculated based on sample predictions. Category 1 represents positive emotion in SEED and DEP-EEG, and high valence in other datasets; Category 0 represents negative emotion in SEED, neutral emotion in DEP-EEG, and low valence in other datasets. F1 was assigned a value of 0 when no positive class prediction samples were available. Reported metrics were unweighted averages at the participant level, with standard deviation used to reflect differences in data among participants. The HC→DEP protocol used the same set of model parameters for all 20 depressed subjects, and the average participant metrics were taken. Comparison methods included recurrent networks, convolutional networks, graph networks, adaptive distributions, Transformers, and various spatiotemporal EEG networks. Results from each method were obtained using publicly reported or reproduced participant average metrics under the same protocol.

[0130] The experimental hardware and software environment consisted of an Ubuntu 22.04 operating system, implemented using PyTorch 2.1.1, CUDA 11.8, and Python 3.7. A single NVIDIA GeForce RTX 4080 graphics card was used, and the global random seed was fixed at 2022. Network hyperparameters were configured as follows: graph hiding dimension 32, AGCRN node embedding dimension 10; one AGCRN layer was a 1-layer recurrent graph convolution, and the other AGCRN layer was a 2-layer recurrent graph convolution; graph convolution propagation order K=4; number of attention heads set to 8; the DREAMER dataset differential Transformer encoder was set to 4 layers, and the encoders for the other datasets were set to 8 layers. Initial differencing coefficients for MHDSA and MHDCA were used. MHDCA temperature coefficient 0.5; RMS Norm constant ; Encoder No. Layer difference coefficients according to Initialization. The MLP classification head uses a two-layer perceptron (32→16→2 layers) with ReLU activation function and batch normalization configured. Training configuration: batchsize=128; optimizer AdamW; initial learning rate. Dropout coefficient 0.25; label smoothing coefficient 0.1; maximum training epochs of 100 epochs for the SEED dataset, and 50 epochs for other datasets; early stopping tolerance set to 10 epochs. MMD loss uses a multi-Gaussian radial basis kernel with 5 Gaussian kernels, a multiplier of 2.0, and bandwidth adaptively determined based on pairwise feature distances; source batch accuracy is greater than... When using pseudo-label loss, only target samples with a softmax confidence score greater than 0.9 are included in the pseudo-label calculation; the weights for MMD loss and pseudo-label loss are both set to 0. Hyperparameters used in SEED mask correlation analysis are: sparsity weight 5.0, entropy weight 0.1, KL divergence weight 1.0, and sparse target activation rate. .

[0131] Leave-one-out cross-validation results from SEED, MAHNOB-HCI, DEAP, and DREAMER, along with existing cross-subject results from FACED, show that EmoDiPyraTrans ranks first in both participant-average accuracy and positive class F1 across all datasets (see Table 1).

[0132] On SEED, EmoDiPyraTrans achieved an accuracy of 0.928 ± 0.055 and an F1 score of 0.928 ± 0.054. Compared to MSGM, the strongest performing method in both metrics, it improved accuracy and F1 by 9.4 and 7.8 percentage points, respectively, and also had a lower standard deviation (accuracy 0.114, F1 0.091). On FACED, it achieved an accuracy of 0.645 ± 0.048, 1.1 percentage points higher than BiDANN; and an F1 score of 0.768 ± 0.050, 0.8 percentage points higher than MSGM.

[0133] On MAHNOB-HCI, the model achieved an accuracy of 0.714±0.079 and an F1 score of 0.611±0.154, representing improvements of 12.7 and 21.5 percentage points, respectively, over the best baseline. On DEAP, accuracy improved by 7.0 percentage points to 0.617±0.073, and F1 score improved by 0.3 percentage points to 0.679±0.110. On DREAMER, accuracy and F1 score reached 0.671±0.066 and 0.328±0.273, respectively, representing improvements of 5.7 and 6.5 percentage points. Therefore, the largest performance improvements occurred on SEED and MAHNOB-HCI, while the other datasets further validated the model's leading ranking under different collection and label conditions.

[0134] Table 1. Cross-subject emotion classification on five public EEG datasets

[0135] Baseline results for SEED and FACED were taken from publicly available comparison reports. Baselines for MAHNOB-HCI, DEAP, and DREAMER were obtained by rerunning under the corresponding protocols. Participant-specific metrics are reported as unweighted mean ± standard deviation. Acc represents accuracy. F1 represents the positive class F1 (positive sentiment in SEED, high valence in the other datasets), set to 0 when no samples are predicted as positive. A long dash indicates that the value is unavailable; bold indicates the highest value in the column.

[0136] On DEP-EEG, the positive-neutral emotion decoding results under four protocols—HC-LOSO, DEP-LOSO, healthy controls transferred to depressed participants, and mixed populations—were compared (see Table 2).

[0137] Within the healthy control group, EmoDiPyraTrans achieved an accuracy of 0.802±0.130 and an F1 score of 0.797±0.171, which were 11.5 and 15.3 percentage points higher than DGCNN, respectively. Within the depressed participants, the accuracy and F1 score reached 0.704±0.094 and 0.709±0.109, respectively, which were 5.2 and 10.2 percentage points higher than TCN, respectively. In the protocol for transferring from healthy controls to depressed participants, the participants achieved the highest mean accuracy and F1 score of 0.591 and 0.598, respectively; compared to TCN, the accuracy improved by 2.1 percentage points and the F1 score improved by 13.8 percentage points. The mixed population DEP-LOSO exhibited different indicator characteristics. EmoDiPyraTrans achieved an accuracy of 0.581±0.114 and the highest mean positive class F1 score among participants (0.498±0.211). TCN achieved the highest accuracy at 0.600±0.100, 1.9 percentage points higher than EmT; while EmoDiPyraTrans's F1 score was 1.6 percentage points higher than EmT's. Combining the four protocols, the model achieved the highest values ​​for both in-population decoding and health-to-depression transfer, and the highest F1 score in mixed-population development.

[0138] Table 2 Cross-subjects positive-neutral classification on DEP-EEG.

[0139] HC healthy controls; DEP patients with depression; LOSO, one participant left; Acc accuracy. Indicators are calculated per participant. Values ​​are mean ± standard deviation; HC→DEP is the unweighted mean of 20 patients with depression. F1 is the positive emotion F1, equal to 0 when no sample is predicted to be positive. Bold indicates the highest value in each protocol-indicator column.

[0140] Ablation experiments were conducted on the components of EmoDiPyraTrans using five public datasets and under the HC-LOSO and DEP-LOSO protocols, as shown in Table 3. The cross-dataset results distinguish between components with stable returns and those with dataset or metric dependencies.

[0141] Table 3: Ablation Results of EmoDiPyraTrans Components and Training Scheme

[0142] Acc represents accuracy; w / o represents removal; Full represents the complete model; DA represents differential attention; NE represents node augmentation; NA represents node aggregation; MMD represents distribution alignment based on the maximum mean difference; PL represents pseudo-label learning; HC represents healthy controls; DEP represents depressed participants; LOSO represents one-out-of-five participants. DEP-EEG includes in-population HC-LOSO and DEP-LOSO. Participant-specific metrics are reported as unweighted mean ± standard deviation. F1 represents positive sentiment F1 in SEED and DEP-EEG, and high valence F1 in other datasets; F1 is 0 when no sample is predicted as positive. Bold text indicates the maximum value in the metric row for each dataset; if there are ties for maximum values, all values ​​are bolded.

[0143] Differential attention (DA) is a component that, when removed from all seven protocols, simultaneously reduces two metrics. On SEED, replacing DA with traditional multi-head attention decreased accuracy from 0.928±0.055 to 0.842±0.129, and F1 from 0.928±0.054 to 0.830±0.206. On HC-LOSO, accuracy and F1 decreased from 0.802 and 0.797 to 0.668 and 0.583, respectively; on DEP-LOSO, the corresponding metrics decreased from 0.704 and 0.709 to 0.575 and 0.537. Across all protocols, accuracy decreased by 1.7–13.4 percentage points, and F1 decreased by 0.4–31.0 percentage points.

[0144] After removing MMD, accuracy decreased across all protocols, ranging from 0.6 percentage points for FACED to 10.9 percentage points for SEED. The impact of MMD on F1 accuracy was dataset-dependent: F1 accuracy decreased in SEED, MAHNOB-HCI, and both DEP-EEGLOSO protocols; it improved in DEAP from 0.679 to 0.686; and it remained unchanged in DREAMER for three decimal places. Therefore, MMD can consistently improve accuracy, but its impact on the precision-recall tradeoff is inconsistent.

[0145] Node augmentation (NE) and node aggregation (NA) exhibit significant dataset dependencies. On SEED, removing NE or NA reduces accuracy to 0.891 and 0.921, respectively. Conversely, removing NA in DEP-LOSO improves F1 accuracy from 0.709 to 0.737, and removing NE in DREAMER improves accuracy from 0.671 to 0.685. In HC-LOSO, accuracy improves from 0.802 to 0.811 regardless of whether NA is removed alone or both NE and NA are removed simultaneously. These inverse changes suggest that graph structure refinement is sensitive to channel configuration and queue composition.

[0146] Pseudo-label learning (PL) also exhibits conditionality, acting on confidence filtering predictions in the target validation stream. Removing PL decreases both the accuracy and F1 score of SEED from 0.928 to 0.925, but improves F1 across five protocols, including DREAMER (0.328→0.377), FACED (0.768→0.778), and MAHNOB-HCI (0.611→0.616). On SEED, removing only MMD results in an accuracy of 0.819, while removing both MMD and PL increases the accuracy to 0.844. This interactive result suggests that the contribution of PL depends on the feature representation shaped by distribution regularization.

[0147] The combined ablation results show that DA is the structural component with the most stable returns, while MMD is the regularization mechanism with the most stable accuracy. The effects of NE, NA, and PL are dataset-dependent, thus the complete model achieves a relatively balanced configuration across different datasets and evaluation metrics. For the setting where DA is removed, the standard multi-head mechanism is used to replace the differential self-attention and differential cross-attention in DiAttGE1 and DiAttGE2, and also to replace the differential self-attention in DiAttBlocks.

[0148] Sensitivity analysis was performed on SEED by changing the graph hidden dimension, differencing Transformer depth, and graph convolution order, while keeping other settings unchanged. The main configuration used a 32-dimensional hidden representation, 8 Transformer layers, and K=4. Increasing the hidden dimension from 8 to 16 and 32 improved the accuracy from 0.841±0.143 to 0.901±0.080 and 0.928±0.055, respectively. When the dimension was 64, the mean accuracy remained at 0.928 (standard deviation 0.073), but the number of parameters increased from 841962 to 3215610.

[0149] The accuracy of the 2–8 layer model is 0.925–0.928. The highest accuracy (0.936 ± 0.054) is achieved with 10 layers, while the accuracy for 12–16 layers is 0.921–0.930. The 8-layer setting in the master configuration is less than 0.8 percentage points away from the highest accuracy. Regarding graph propagation, the accuracy is 0.928 ± 0.055 with K=4, while it is 0.923 ± 0.077 and 0.916 with K=2 and K=8, respectively. Therefore, the master configuration operates in a stable high-accuracy region, while limiting model depth and size.

[0150] This embodiment conducts comprehensive comparisons, ablation, and sensitivity verification on multiple publicly available and clinical EEG datasets, confirming that differential attention is the core gain component of this model. This embodiment verifies the decoding advantages of this method across subjects and across healthy-depressed populations, with the functions of each module experimentally validated. It can provide feasible technical references for practical scenarios such as clinical mental health screening.

[0151] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments within the spirit and principles of the present invention, without departing from the principles and spirit of the present invention, through conventional substitutions or to achieve the same function, fall within the scope of protection of the present invention.

Claims

1. A cross-group emotion decoding method based on differential attention map convolution and MMD alignment, characterized in that, include: The raw EEG signals of the subjects were acquired, and two-level sliding window segmentation was performed on the raw EEG signals to output EEG signal sub-segments. Power spectrum estimation is performed on EEG signal sub-segments, the relative power spectral density of each EEG channel is calculated, and a sequence rPSD map that preserves channel identity, frequency band attributes, and temporal information is constructed. The sequence rPSD map is input into the EmoDiPyraTrans emotion decoding network. The adaptive graph convolution is used to obtain the EEG channel correlation. The differential attention mechanism is used to suppress the shared redundant components in the features, extract multi-scale EEG spatiotemporal features and output emotion classification prediction. The development dataset is internally split to obtain a labeled source training stream and a target validation stream. The cross-entropy loss of the source training stream is used as classification supervision, and the MMD loss is introduced to align the feature representations of the two data streams. The pseudo-label loss with condition triggering and confidence filtering is superimposed to form the total training loss. The real labels of the target validation stream do not participate in the calculation of MMD loss and pseudo-label loss, but are only used to select the optimal network parameters. The EEG signals of new subjects to be identified are sequentially segmented into two levels of sliding windows, power spectrum estimation is performed, and relative power spectral density is calculated to obtain the sequence rPSD map. This map is then input into the trained EmoDiPyraTrans emotion decoding network, which outputs cross-population EEG emotion decoding results.

2. The method according to claim 1, characterized in that, The two-level sliding window segmentation process includes first-level window segmentation and second-level window subdivision. Use the first-level window length Step length The complete EEG trial is segmented to obtain fixed-length fragments, and the total number of fragments is... , This represents the total number of sampling points in the original EEG trials. For each fixed-length segment, use the window length. Step length The second-level window further subdivides the signal, generating EEG signal sub-segments; the total number of sub-segments... .

3. The method according to claim 2, characterized in that, For each EEG signal sub-segment, the frequency band power of each preset frequency band is calculated channel by channel using the Welch method. ; The relative power spectral density is calculated using the following formula: In the formula: This is the first-level fixed-length segment index. For sub-fragment indexing, For EEG channel indexing, Frequency band index; This represents the total number of preset frequency bands; Constants used to ensure numerical stability; Using EEG electrodes as graph nodes, the node feature vectors are derived from the corresponding frequency bands of that channel. The sub-fragment rPSD diagram is constructed and obtained. Stack the rPSD images of the sub-fragments according to their chronological order, generating a dimension of... The sequence rPSD plot, This represents the total number of EEG channels.

4. The method according to claim 3, characterized in that, The EmoDiPyraTrans emotion decoding network includes: a single-branch adaptive graph convolutional recurrent network (AGCRN), a two-branch adaptive graph convolutional recurrent network (AGCRN), a DiAttGE differential attention graph enhancement module, a pyramid multi-scale fusion module, a differential Transformer encoder, and an MLP classification head. The single-branch AGCRN received sequence rPSD graph outputs shallow spatiotemporal graph features; the dual-branch AGCRN received sequence rPSD graph outputs deep spatiotemporal graph features. The AGCRN network is internally configured with learnable node embeddings, which generate an adaptive adjacency matrix.

5. The method according to claim 4, characterized in that, The DiAttGE differential attention map enhancement module includes a node enhancement stage and a node aggregation stage. During the node enhancement phase, Multi-Head Differential Self-Attention (MHDSA) is configured. MHDSA performs the following attention operation: The MHDSA output is normalized by RMSNorm, and then residual connection operation is performed to output the enhanced features of the nodes. In the node aggregation stage, multi-head differential cross attention (MHDCA) is configured. MHDCA introduces learnable query vectors to transform and aggregate channel-dimensional features into time-series-dimensional features. The DiAttGE module contains two instances, DiAttGE1 and DiAttGE2, which process shallow spatiotemporal graph features and deep spatiotemporal graph features, respectively.

6. The method according to claim 5, characterized in that, The pyramid multi-scale fusion module receives three sets of inputs: the first set of graph enhancement features output by DiAttGE1, the second set of graph enhancement features output by DiAttGE2, and the shallow linear projection features output by AGCRN. The pyramid multi-scale fusion module performs element-wise addition on the three sets of inputs to obtain the fused temporal features; The fused temporal features are fed into a differential Transformer encoder consisting of multiple stacked differential attention blocks; the output of the differential Transformer encoder is subjected to temporal average pooling, and the pooled features are fed into the MLP classification head.

7. The method according to claim 6, characterized in that, The dataset partitioning process involves pre-isolating all test participants in each external evaluation trade-off. For participants retained in the development set, stratified sampling is performed within a single participant sample according to emotion category to divide the source training stream sample set and the target validation stream sample set; The source training stream samples carry sentiment labels; The target validation stream samples retain their original labels, and the label data of the target validation stream samples is not read during the calculation of MMD loss and pseudo-label loss.

8. The method according to claim 7, characterized in that, The total loss function for network training consists of labeled, smoothed cross-entropy loss. MMD loss Conditional pseudo-label loss The weighted sum is: in: Total network loss; For MMD loss weights; The weights are lost for pseudo-labels; Labeled smoothing of cross-entropy loss: ,in The number of samples in the source training stream batch; The number of emotion categories; The source samples are one-hot labels after label smoothing. The model outputs the probability for the category corresponding to the source sample; It is the natural logarithm; Negate the scalar; MMD loss: ,in This represents the loss due to the maximum mean difference. The total number of mini-batch samples in the source training stream; The total number of samples in the target validation stream; The sample index within the source training stream batch; Validate the sample index within the target stream batch; , The source training streams are respectively the first , No. Each sample encoder outputs a feature vector; , The target verification flow is respectively , No. Each sample encoder outputs a feature vector; It is a positive definite kernel function; Activation condition for pseudo-label loss setting: Source training mini-batch accuracy Only then is pseudo-label loss allowed; Pseudo-label loss expression: ,in For pseudo-label loss; Use the source to train the mini-batch classification accuracy; The preset accuracy trigger threshold; For indicator functions; For finding the maximum value operator; Filter the confidence level of the target sample using a mask; For the first The pseudo-labels of the target samples are predicted by the model; The model output probability is the category corresponding to the pseudo-label of the target sample. Based on total loss Backpropagation updates all parameters of the EmoDiPyraTrans network.

9. The method according to claim 8, characterized in that, The input trained EmoDiPyraTrans sentiment decoding network outputs cross-group EEG sentiment decoding results, specifically: Acquire raw EEG signals from the new subjects to be identified; use window length. Step length The first-level window segments the raw EEG signal into fixed-length segments; then the window length is used... Step length The second level of window subdivision generates EEG signal sub-segments; The power of each frequency band was calculated channel by channel using the Welch method for all EEG signal sub-segments, and then substituted into the relative power spectral density formula for calculation. Construct sub-fragment rPSD diagrams and stack them in chronological order to generate sequence rPSD diagrams; The sequence rPSD image is fed into the EmoDiPyraTrans sentiment decoding network with fixed parameters, and AGCRN feature extraction, DiAttGE differential attention map enhancement, pyramid multi-scale fusion, and differential Transformer encoder temporal modeling are performed in sequence. The sentiment decoding classification result is output by the MLP classification head.

Citation Information

Patent Citations

  • Domain-adaptive cross-subject electroencephalogram signal emotion recognition method

    CN121502483A