An electroencephalogram emotion recognition method and system fusing directed topology and block-wise temporal attention
By combining asymmetric directed topological networks and multi-branch graph convolution with block-based temporal attention, the problems of insufficient representation of brain region directional connectivity and information loss in time series processing in EEG emotion recognition are solved, achieving more efficient EEG emotion recognition results.
Patent Information
- Application Number
- CN202611257472.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-20
AI Technical Summary
Existing EEG emotion recognition methods are difficult to effectively characterize the directional connectivity between brain regions. Single graph convolution is difficult to simultaneously extract spatial and temporal features, and local temporal information is easily lost during long-term sequence processing.
Asymmetric directed topological networks and multi-branch graph convolutions are employed to extract directional connectivity features of brain regions through the directed graph convolution mechanism, and spatial topological features of continuous time locations are recovered through a block-sequential attention mechanism to generate spatiotemporal integrated feature vectors.
It improves the accuracy and stability of EEG emotion recognition, and can more accurately characterize the directional connectivity and information transmission characteristics between brain regions, thereby enhancing classification accuracy and consistency.
Smart Images

Figure CN123126798A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to electroencephalogram (EEG) signal processing and emotion recognition methods, and particularly to an EEG emotion recognition method and system that integrates directed topology and segmented temporal attention. Background Technology
[0002] Electroencephalography (EEG) signals can reflect brain neural activity in a non-invasive manner and are of great value in applications such as emotion state recognition, psychological health assessment, human-computer interaction, and emotional brain-computer interfaces. EEG signals are typically acquired simultaneously by multiple electrode channels distributed at different locations on the scalp. They are characterized by a large number of channels, rapid temporal changes, strong non-stationarity, and significant individual differences. Therefore, it is necessary to consider both the spatial relationships between EEG channels and the dynamic relationship of brain activity over time.
[0003] In existing EEG emotion recognition methods, spatial modeling based on graph neural networks typically employs symmetric adjacency matrices, treating the bidirectional propagation weights between connected EEG channels as identical. While this approach can characterize co-activation or correlations between channels, it struggles to distinguish between the sender and receiver of information and cannot adequately represent the asymmetric directional dependencies that may exist between different brain regions. Furthermore, directly constructing fully connected graphs introduces numerous weak and spurious connections, increasing computational overhead and reducing the reliability of spatial features. Moreover, single-depth graph convolutions struggle to capture the details of the original channels, local interactions between adjacent brain regions, and higher-order dependencies across brain regions. Shallow graph networks have limited receptive fields, while deep graph networks may exhibit oversmoothing. Therefore, how to control model complexity while jointly extracting directional spatial relationships between EEG channels, spatial features at different scales, and local and global temporal dynamics is a key technical challenge that needs to be addressed in EEG emotion recognition.
[0004] Furthermore, it's important to note that some researchers also use EEG as a time series and input it into standard Transformers for sentiment analysis. However, these methods typically model long EEG sequences using a single time step as the basic input unit. Time-step processing can easily fragment adjacent sampling points or feature windows, making it difficult to preserve the continuous structure within a local time window. Simultaneously, long sequences increase the computational cost of self-attention and make the model more susceptible to local high-frequency noise.
[0005] Furthermore, existing spatial and temporal feature extraction methods are typically treated as relatively independent processing stages. The brain region connectivity information obtained from the spatial module is often treated as a regular feature sequence when entering the subsequent temporal model, failing to fully preserve the continuous evolution of brain region connectivity states at different time locations. Therefore, how to perform local-global temporal modeling of the spatial topological states corresponding to continuous time locations based on the extraction of brain region orientation and multi-scale spatial relationships is a technical problem that needs further resolution in EEG emotion recognition. Summary of the Invention
[0006] This invention proposes an EEG emotion recognition method and system that integrates topological and block-based temporal attention, aiming to solve the problems of insufficient representation of brain region directional connectivity, insufficient extraction of spatial features at a single graph convolution scale, and easy loss of local temporal information during long-term sequence processing in existing EEG emotion recognition methods.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: Firstly, a brainwave-based emotion recognition method integrating directed topology and block-based temporal attention includes the following steps: S1. Acquire and preprocess EEG signals to obtain multi-channel EEG data; S2. Extract the relative power spectral density features of multi-channel EEG data; construct an asymmetric directed adjacency matrix using EEG channels as graph nodes; S3. Based on the sparse directed adjacency matrix and relative power spectral density features, feature aggregation and adaptive fusion are performed along the inbound and outbound directions by a multi-branch directed graph convolutional network, and then multi-branch parallel encoding and multi-view adaptive fusion are used to obtain comprehensive spatial topological features. S4. Based on the comprehensive spatial topological features, a spatiotemporal comprehensive feature vector is generated by non-overlapping segmentation of the time series and segmented temporal self-attention processing. S5. Based on the spatiotemporal integrated feature vector, the emotion recognition result is output by classifying the feature vector.
[0008] Preferably, S2 includes: For each time location, a learnable weight matrix is initialized. The elements in the weight matrix are asymmetric to distinguish the differences in connection strength between brain regions in the direction of information transmission and information reception. The elements of the weight matrix are nonnegated by applying the modified linear unit activation function, and the negative elements are set to zero to obtain a nonnegative directed adjacency matrix. For each row of a non-negative directed adjacency matrix, only a predetermined number of elements with the largest absolute weight are retained, and the remaining elements are set to zero to obtain a row-sparsed directed adjacency matrix. The sparse directed adjacency matrix is obtained by adding the row-sparsed directed adjacency matrix to the identity matrix.
[0009] Preferably, S4 includes: Based on the sparse directed adjacency matrix, construct the graph Laplacian matrix for the incoming edge direction and the graph Laplacian matrix for the outgoing edge direction respectively, and perform symmetric normalization processing on them respectively. Based on the normalized Laplacian matrix of the incoming edge direction graph and the Laplacian matrix of the outgoing edge direction graph, Chebyshev polynomial recursion is used to perform graph convolution operations of a preset order to aggregate the features of neighboring nodes in the corresponding directions. The incoming edge direction and the outgoing edge direction share the filter weights, and the corresponding aggregated features of the incoming edge direction and the aggregated features of the outgoing edge direction are obtained. The learnable balance coefficients are mapped by the Sigmoid function to obtain the orientation-adaptive weights. The inbound and outbound direction aggregation features are then weighted and fused according to the orientation-adaptive weights to obtain the single-layer directed graph convolution output.
[0010] Preferably, S3 also includes constructing three parallel processing branches: The residual mapping branch performs dimension mapping on the output of a single-layer directed graph convolution through linear projection to obtain residual mapping features; the shallow directed graph encoder branch performs shallow encoding on the output of a single-layer directed graph convolution to obtain shallow spatial encoding features; and the deep directed graph encoder branch performs deep encoding on the output of a single-layer directed graph convolution to obtain deep spatial encoding features. The residual mapping features, shallow spatial coding features, and deep spatial coding features are flattened and labeled to obtain the sequence labels corresponding to each branch. Based on the sequence labels corresponding to each branch, a channel attention weight is generated for each branch through a two-layer multilayer perceptron. The features of each branch are weighted according to the channel attention weight to obtain the weighted features of each branch. Based on the weighted features of each branch, an attention evaluation network is constructed through a two-layer multilayer perceptron and normalized using Softmax to generate the view attention weight of each branch. The weighted features of each branch are weighted and summed according to the view attention weight to obtain the fused comprehensive spatial topology features.
[0011] Preferably, in S4, the time series is divided into non-overlapping blocks and processed by block-based temporal self-attention to generate a spatiotemporal comprehensive feature vector, including: The comprehensive spatial topological features are restored to a sequence tensor with a continuous time dimension; Based on the preset block length, the sequence tensor is processed into non-overlapping blocks in the time dimension. The tail segments with a time dimension length less than one block length are truncated to obtain multiple block feature tensors. Each block feature tensor is dimensionality-reduced through a linear projection layer and superimposed with a learnable absolute position encoding to obtain block-level embedded features; the block-level embedded features are then processed by a multi-layer Transformer encoder for temporal self-attention to obtain encoded temporal features. The encoded temporal features are subjected to layer normalization and global average pooling operations in sequence to obtain a fixed-dimensional one-dimensional spatiotemporal feature vector.
[0012] Preferably, in S4, temporal self-attention processing is performed using a multi-layer Transformer encoder, wherein the processing steps of each Transformer encoder layer include: Based on the input features of the current layer, the query matrix, key matrix, and value matrix are generated through linear transformation, and then the attention output is calculated through a multi-head scaling dot product attention mechanism. Based on the residual connection between the attention output and the input features of the current layer, the attention intermediate features are obtained after layer normalization. The attention intermediate features are then processed by a feedforward network. Based on the residual connection between the output of the feedforward network and the attention intermediate features, the output features of the current layer are obtained after layer normalization.
[0013] As a preferred embodiment, in S3, a sparse directed adjacency matrix is constructed separately for each time position, so that different time positions have different topological connection structures, in order to capture the dynamic time-varying characteristics of the EEG topology.
[0014] As a preferred embodiment, in S1, bandpass filtering is used to eliminate baseline drift and high-frequency noise; by extracting the relative power spectral density of each channel in multiple frequency bands, a four-dimensional tensor containing channel dimension, frequency band dimension, time dimension and batch dimension is constructed. After merging the time dimension and batch dimension in the four-dimensional tensor into a single dimension, the node feature matrix corresponding to each time position is obtained.
[0015] As a preferred option, the classifier in S5 is the Softmax classifier; During the model training phase, the cross-entropy loss function is used as the optimization objective to train and update the various learnable parameters of the model. The learnable parameters include the parameters of the asymmetric directed adjacency matrix, the parameters of the multi-branch directed graph convolutional network, and the parameters in the block-based temporal attention mechanism.
[0016] Secondly, a brainwave emotion recognition system integrating directed topology and segmented temporal attention is provided to implement the brainwave emotion recognition method and steps integrating directed topology and segmented temporal attention as described in the first aspect, including: The signal acquisition and preprocessing module is used to acquire and preprocess EEG signals to obtain multi-channel EEG data. An asymmetric directed topology network construction module is used to extract the relative power spectral density features of multi-channel EEG data; an asymmetric directed adjacency matrix is constructed by using EEG channels as graph nodes. The multi-branch directed graph convolution module is used to perform feature aggregation and adaptive fusion along the inbound and outbound directions of the multi-branch directed graph convolution network based on the sparse directed adjacency matrix and relative power spectral density features. After multi-branch parallel encoding and multi-view adaptive fusion, the comprehensive spatial topological features are obtained. The block-based temporal attention module is used to generate a spatiotemporal comprehensive feature vector by dividing the time series into non-overlapping blocks and processing them with block-based temporal self-attention based on comprehensive spatial topological features. The emotion classification module is used to classify emotions based on spatiotemporal integrated feature vectors using a classifier and output emotion recognition results.
[0017] Compared with the prior art, the present invention has the following beneficial effects: Unlike traditional methods that use symmetric adjacency matrices to describe the undirected connections between EEG channels, this invention constructs an asymmetric directed topological network and extracts information transmission and reception features between different EEG channels through a directed graph convolution mechanism. This more accurately represents the directional connectivity and information transmission features between brain regions during emotion processing. Compared to traditional single-graph convolution, this invention employs a multi-branch graph convolution structure, extracting original channel features, local directed topological features, and higher-order directed topological features through residual mapping branches, shallow graph convolution branches, and deep graph convolution branches. The spatial features of different branches are adaptively fused into a comprehensive spatial topological feature, thereby achieving complementary representation of EEG topological information under different spatial receptive fields. Furthermore, this invention designs a block-based temporal attention mechanism to further restore the comprehensive spatial topological features into a continuous sequence according to the original temporal order. It also combines spatial topological features from multiple consecutive time positions into local temporal data blocks, modeling the dependencies between different temporal data blocks through the block-based temporal attention mechanism, thereby further improving the accuracy and stability of EEG emotion recognition.
[0018] This invention obtains directional connectivity information between EEG channels through an asymmetric directed topological network, and further extracts original channel features, local directional connectivity features, and higher-order directed topological features through multi-branch directed graph convolution. These are then adaptively fused to form comprehensive spatial topological features corresponding to each time location. Based on this, the comprehensive spatial topological features of consecutive time locations are organized chronologically, and spatial features of adjacent time locations are combined into local temporal data blocks. Cross-block attention is then used to further model the long-range dependencies between different local data blocks. Therefore, directed topology, multi-branch graph convolution, and block-based temporal attention form a cascaded relationship in the feature processing, achieving continuous processing from brain region directional connectivity modeling, multi-scale spatial topological feature extraction, to spatial topological feature temporal evolution modeling. This results in a more complete spatiotemporal representation of EEG features and further improves classification accuracy. Attached Figure Description
[0019] Figure 1 This is a method framework diagram of Embodiment 1 of the present invention; Figure 2 This is a visual comparison chart of the feature distribution of different emotion categories before and after processing in Embodiment 1 of the present invention; Figure 3 This is a diagram showing the connectivity results of shallow directed graph convolutional branch EEG channels in Embodiment 1 of the present invention. Figure 4 This is a diagram showing the connectivity results of deep directed graph convolutional branch EEG channels in Embodiment 1 of the present invention. Detailed Implementation
[0020] To make the technical means, inventive features, objectives, and effects of the invention readily understandable, the invention is further described below with reference to specific illustrations. However, the invention is not limited to the embodiments described below.
[0021] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings of this specification are only used to complement the content disclosed in the specification for those skilled in the art to understand and read, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0022] Example 1: like Figure 1 The EEG emotion recognition method shown here integrates directed topology and block-based temporal attention, and includes the following steps: Step 1: Acquire EEG signals and preprocess the signals. The raw EEG signals are downsampled and a bandpass filter is used to eliminate baseline drift and high-frequency electrooculography / electromyography noise.
[0023] Step 2: Extract the relative power spectral density features of each channel from the preprocessed EEG signal, and construct an asymmetric directed adjacency matrix using the EEG channels as graph nodes. By sparsifying the directed connections, directional connections with high correlation strength between EEG channels are preserved, thus establishing a spatial topological foundation for subsequent extraction of effective connectivity relationships and directional information flow between brain regions. The specific steps are as follows: Step 2-1: Extract the relative power spectral density features of the EEG signal. Given an input sample, these features can be represented as a four-dimensional tensor. .in For batch size, The length of the time series. Number of brainwave channels, The time dimension is the extracted relative power spectral density feature dimension. Before being fed into the spatial graph network, the time dimension... Batch Dimension The merging allows the spatial topology learning module to independently process dimensions at each time step. Node feature matrix .
[0024] Step 2-2: Construct an asymmetric directed adjacency matrix ,in, Matrix elements Indicates signal from channel Transmit to Channel The connection weights, matrix elements Indicates signal from channel Transmit to Channel The connection weights. Applying the ReLU activation function to the matrix elements yields... .
[0025] Steps 2-3: Sparsify the asymmetric directed adjacency matrix. For each row of the adjacency matrix, retain only the row with the largest absolute weight. Set one element and set the remaining connections to zero. Define a node. The set of neighbor indexes is The elements of the sparsed matrix are: Subsequently, an identity matrix is introduced into the sparsification matrix. This yields the sparse directed adjacency matrix: Step 3: Extract and fuse spatial features of brain regions through directed graph convolution. Based on the sparse directed adjacency matrix constructed in Step 2, perform graph convolution operations along the inbound and outbound directions respectively, and fuse features from different directions and different spatial views. The specific steps are as follows: Step 3-1: Construct the graph Laplacian matrix for the directions of incoming and outgoing edges, based on the sparse directed adjacency matrix. and its transpose Calculate the inbound degree matrix respectively outbound degree matrix The diagonal elements of the degree matrix are the sum of the connection weights of the corresponding nodes in their respective directions. Symmetric normalization is used to calculate the graph Laplacian matrix in both directions. and : Step 3-2: Extract the features of the inbound and outbound edges using Chebyshev diagram convolution, and utilize... Chebyshev polynomial The Graph Laplace matrix is calculated recursively. The Chebyshev polynomial is defined as: Given input node features Feature filtering is performed separately for both the incoming and outgoing edges: in, For the first The learnable parameter matrix of the Chebyshev filter, the input edge feature aggregation and the output edge feature aggregation share the same set of filter weights. .
[0026] Step 3-3: Merge the incoming edge features and outgoing edge features to obtain the incoming edge features separately. Outbound features Then, set the learnable balance coefficient. After mapping by the Sigmoid activation function, the features from the two directions are fused: in, For bias terms, This represents the Sigmoid function.
[0027] Steps 3-4: Then, fuse the multi-view spatial features by constructing residual mapping branches. Shallow graph encoder branch and deep graph encoder branches The residual mapping branch performs linear feature dimension projection on the input features; the shallow graph encoder branch uses fewer directed graph convolutional layers; and the deep graph encoder branch uses more directed graph convolutional layers.
[0028] The feature matrices output from the three branches are flattened and labeled respectively, and then uniformly mapped to a one-dimensional feature tensor. ,in, , For the hidden layer dimension, the channel weights of each branch are calculated using a two-layer perceptron: in, and These are the weight matrices for dimensionality reduction and dimensionality increase, respectively. This is the compression ratio.
[0029] Then, the channel weights are multiplied element-wise with the corresponding branch features: in This represents Hadamard element-wise multiplication. The processed multi-view features are stacked into tensors The score vector for each branch is calculated using an attention evaluation network. : in, and These are the weight matrices for the linear mappings of the first and second layers of the attention evaluation network, respectively. and This is the corresponding bias vector.
[0030] Using the Softmax function on the score vector The elements in the data are normalized to obtain the fusion weights of different views. And perform a weighted sum: Finally, the integrated spatial topological feature matrix will be used. It is restored to a sequence tensor with a time dimension and input into the block-based temporal attention module in step 4.
[0031] Step 4: Extract local and global temporal features through block-based temporal attention, restore the comprehensive spatial topological features output in Step 3 to a continuous time series, perform non-overlapping block segmentation along the time dimension, and complete temporal feature extraction through linear embedding, positional encoding, and Transformer encoder. The specific steps are as follows: Step 4-1: Arrange the comprehensive spatial topological feature matrix in chronological order to restore it as a sequence tensor with a time step dimension. ,in, For batch size, The length of the time series. The hidden layer dimension represents the spatial features.
[0032] Given data block length Calculate the number of complete data blocks The sequence is truncated, and time steps shorter than a single data block are removed from the end of the sequence. Reorganize along the time dimension to obtain the block feature tensor .
[0033] Step 4-2: Perform linear embedding and positional encoding on local data blocks, and then perform dimensionality reduction mapping on the block features through a linear projection layer: in, and These are the weight matrix and bias vector of the linear projection layer, respectively. After mapping, block-level embedded features are obtained. .
[0034] Set up a learnable absolute position encoding matrix Its parameters are initialized by sampling from a normal distribution. The positional encoding is added element-wise to the block-level embedding features: Step 4-3: Perform temporal global modeling using multi-head self-attention, embedding the initialized block into the sequence. The input is a network consisting of multiple Transformer encoders. For the first... Layer Transformer encoder, input features Generate query matrices through linear transformations respectively Key matrix Sum matrix : The scaling dot product attention is calculated as follows: in, The feature dimension for a single attention head. The output of the multi-head self-attention system is residually connected to the input features and then normalized layer by layer. Subsequently, the features are input into the feedforward neural network, and residual connections and layer normalization are performed again: in, , Represents a linear mapping. This represents a Gaussian error linear unit. After... After processing by the Transformer encoder, the output feature matrix is obtained. .
[0035] Step 4-4: Perform layer normalization and global average pooling on the feature matrix output from Step 4-3 to obtain a fixed-dimensional spatiotemporal feature vector. Then, process the Transformer encoder output matrix... Perform layer normalization along the feature dimension: Subsequently, global average pooling is performed along the time block dimension: Obtain a one-dimensional spatiotemporal feature vector of fixed dimension .
[0036] Step 5: Use the SoftMax classifier to process the extracted spatiotemporal feature vectors. Categorize: in Indicates the first i Predicted probability of an EEG sample This represents the set of these samples. and These represent the weights and biases of SoftMax, respectively.
[0037] in, For the first i The true labels of each EEG sample, with a low cross-entropy loss. This corresponds to a higher recognition accuracy.
[0038] This invention utilizes the Physiological Signal Emotion Analysis Database (SEED), a multimodal dataset designed to study human emotional states. It records the electroencephalograms (EEGs) and peripheral physiological signals of 15 participants while they watch 15 different film clips. These signals are recorded using 62 electrodes according to the international 10-20 system. Each participant is passively induced to experience three emotions: positive, neutral, and negative, with each emotion corresponding to five film clips. The dataset is preprocessed, including downsampling to 128 Hz and removal of electrooculography (EOG) artifacts; in this embodiment, only EEG signals are used.
[0039] During the experimental evaluation, a leave-one-out cross-validation method was used to assess the emotion recognition performance of the invention on unknown subjects. In each experiment, all EEG data from one subject were selected as the test set, and data from the remaining 14 subjects were used as training data. The training data was further divided into training and validation sets in an 8:2 ratio. Fifteen subjects were then used as test subjects, and the average accuracy, F1 score, and standard deviation of the 15 trials were calculated as the final experimental results.
[0040] Table 1: Average accuracy (%) and F1 score (%) of different methods on the emotion classification task in SEED
[0041] Table 1 shows the experimental results of this invention and other methods on the SEED dataset's three-class classification task. This invention achieved an average accuracy of 79.60% and an average F1 score of 79.46%, both higher than the other comparative methods. Among the comparative methods, TCN, which had higher accuracy, achieved an average accuracy of 76.56% and an average F1 score of 73.75%, with this invention improving accuracy and F1 score by 3.04 percentage points and 5.71 percentage points, respectively. Furthermore, regarding performance fluctuations among different subjects, the standard deviation of the accuracy of this invention was 12.65%, and the standard deviation of the F1 score was 13.81%, both lower than the comparative methods listed in Table 1. This indicates that the results of this invention have less fluctuation among different subjects, demonstrating higher consistency and reliability.
[0042] Table 2: Ablation results across subject categories on SEED (mean ± standard deviation)
[0043] To further demonstrate the effectiveness of the method of this invention, ablation experiments were conducted on the SEED dataset to illustrate the impact of each module within the model. The results of the ablation experiments are shown in Table 2. Table 2 shows that after replacing the multi-branch graph convolutional structure with a single graph convolutional structure, the average accuracy of the model decreased from 79.60% to 77.94%, and the F1 score decreased from 79.46% to 76.03%, indicating that the multi-branch structure can improve emotion recognition performance by fusing spatial features at different levels. After replacing the directed topology module with an undirected topology module, the average accuracy of the model decreased to 74.52%, and the F1 score decreased to 69.02%, which are 5.08 percentage points and 10.44 percentage points lower than the complete method, respectively. This result shows that distinguishing the direction of information transmission between EEG channels and extracting directional connectivity features between brain regions plays an important role in EEG emotion recognition. In addition, after removing the time block mechanism, the average accuracy of the model decreased to 78.43%, and the F1 score decreased to 75.91%. This demonstrates that dividing continuous EEG features into local temporal data blocks and modeling the long-range dependencies between different data blocks can enhance the model's ability to extract local temporal information and global dynamic features from EEG data. The final experimental results also show that each module has a significant impact on improving the performance of emotion recognition and classification.
[0044] To further verify the ability of this invention to extract emotion discrimination features, a t-distributed random neighborhood embedding method is used to project the original relative power spectral density features and the deep features processed by this invention from the SEED dataset into a two-dimensional space. For example... Figure 2 As shown, in the original features, the positive, neutral, and negative emotion samples overlapped, and the category boundaries were relatively blurred. However, after processing by this invention, the clustering degree of similar emotion samples was significantly improved, and clearer distribution boundaries were formed between different emotion categories. This result indicates that this invention can extract emotion features with strong category discrimination ability from cross-subject EEG data.
[0045] To further verify the effectiveness of this invention in extracting directional connectivity features of EEG channels, the adjacency matrices generated by shallow and deep directed graph convolution branches were visualized. For example... Figure 3 , Figure 4 As shown, the adjacency matrices generated by both branches exhibit significant asymmetry, indicating that this invention can assign different weights to EEG channel connections in opposite directions, achieving effective representation of directional information flow in brain regions. Furthermore, the connection structures generated by the shallow and deep branches differ, enabling the extraction of local connectivity features and higher-order cross-channel connectivity features, respectively. These results verify that the directed topology and multi-branch graph convolutional structure employed in this invention can effectively extract EEG channel connectivity information at different spatial scales, providing effective spatial feature support for improving EEG emotion recognition performance.
[0046] Example 2: A brainwave emotion recognition system integrating directed topology and block-based temporal attention includes: The signal acquisition and preprocessing module is used to acquire and preprocess EEG signals to obtain multi-channel EEG data. An asymmetric directed topology network construction module is used to extract the relative power spectral density features of multi-channel EEG data; an asymmetric directed adjacency matrix is constructed by using EEG channels as graph nodes. The multi-branch directed graph convolution module is used to perform feature aggregation and adaptive fusion along the inbound and outbound directions of the multi-branch directed graph convolution network based on the sparse directed adjacency matrix and relative power spectral density features. After multi-branch parallel encoding and multi-view adaptive fusion, the comprehensive spatial topological features are obtained. The block-based temporal attention module is used to generate a spatiotemporal comprehensive feature vector by dividing the time series into non-overlapping blocks and processing them with block-based temporal self-attention based on comprehensive spatial topological features. The emotion classification module is used to classify emotions based on spatiotemporal integrated feature vectors using a classifier and output emotion recognition results.
Claims
1. A brainwave emotion recognition method integrating directed topology and block-based temporal attention, characterized in that, Includes the following steps: S1. Acquire and preprocess EEG signals to obtain multi-channel EEG data; S2. Extract the relative power spectral density features of multi-channel EEG data; An asymmetric directed adjacency matrix is constructed using EEG channels as graph nodes; S3. Based on the sparse directed adjacency matrix and relative power spectral density features, feature aggregation and adaptive fusion are performed along the inbound and outbound directions by a multi-branch directed graph convolutional network, and then multi-branch parallel encoding and multi-view adaptive fusion are used to obtain comprehensive spatial topological features. S4. Based on the comprehensive spatial topological features, a spatiotemporal comprehensive feature vector is generated by non-overlapping segmentation of the time series and segmented temporal self-attention processing. S5. Based on the spatiotemporal integrated feature vector, the emotion recognition result is output by classifying the feature vector.
2. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, S2 include: For each time location, a learnable weight matrix is initialized. The elements in the weight matrix are asymmetric to distinguish the differences in connection strength between brain regions in the direction of information transmission and information reception. The elements of the weight matrix are nonnegated by applying the modified linear unit activation function, and the negative elements are set to zero to obtain a nonnegative directed adjacency matrix. For each row of a non-negative directed adjacency matrix, only a predetermined number of elements with the largest absolute weight are retained, and the remaining elements are set to zero to obtain a row-sparsed directed adjacency matrix. The sparse directed adjacency matrix is obtained by adding the row-sparsed directed adjacency matrix to the identity matrix.
3. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, S3 include: Based on the sparse directed adjacency matrix, construct the graph Laplacian matrix for the incoming edge direction and the graph Laplacian matrix for the outgoing edge direction respectively, and perform symmetric normalization processing on them respectively. Based on the normalized Laplacian matrix of the incoming edge direction graph and the Laplacian matrix of the outgoing edge direction graph, Chebyshev polynomial recursion is used to perform graph convolution operations of a preset order to aggregate the features of neighboring nodes in the corresponding directions. The incoming edge direction and the outgoing edge direction share the filter weights, and the corresponding aggregated features of the incoming edge direction and the aggregated features of the outgoing edge direction are obtained. The learnable balance coefficients are mapped by the Sigmoid function to obtain the orientation-adaptive weights. The inbound and outbound direction aggregation features are then weighted and fused according to the orientation-adaptive weights to obtain the single-layer directed graph convolution output.
4. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 3, characterized in that, S3 also includes the construction of three parallel processing branches: The residual mapping branch performs dimension mapping on the output of a single-layer directed graph convolution through linear projection to obtain residual mapping features; the shallow directed graph encoder branch performs shallow encoding on the output of a single-layer directed graph convolution to obtain shallow spatial encoding features; and the deep directed graph encoder branch performs deep encoding on the output of a single-layer directed graph convolution to obtain deep spatial encoding features. The residual mapping features, shallow spatial coding features, and deep spatial coding features are flattened and labeled to obtain the sequence labels corresponding to each branch. Based on the sequence labels corresponding to each branch, the channel attention weights of each branch are generated through a two-layer multilayer perceptron. The features of each branch are weighted according to the channel attention weights to obtain the weighted features of each branch. Based on the weighted features of each branch, an attention evaluation network is constructed using a two-layer multilayer perceptron and normalized using Softmax to generate the view attention weights for each branch. The weighted features of each branch are then summed based on the view attention weights to obtain the fused integrated spatial topology features.
5. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, In S4, the non-overlapping block segmentation of the time series and the block-based time series self-attention processing include: The comprehensive spatial topological features are restored to a sequence tensor with a continuous time dimension; Based on the preset block length, the sequence tensor is processed into non-overlapping blocks in the time dimension. The tail segments with a time dimension length less than one block length are truncated to obtain multiple block feature tensors. Each block feature tensor is dimensionality-reduced through a linear projection layer and superimposed with a learnable absolute position encoding to obtain block-level embedded features; the block-level embedded features are then processed by a multi-layer Transformer encoder for temporal self-attention to obtain encoded temporal features. The encoded temporal features are subjected to layer normalization and global average pooling operations in sequence to obtain a fixed-dimensional one-dimensional spatiotemporal feature vector.
6. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 5, characterized in that, In S4, temporal self-attention processing is performed through multi-layer Transformer encoders. The processing steps of each Transformer encoder layer include: Based on the input features of the current layer, the query matrix, key matrix, and value matrix are generated through linear transformation, and then the attention output is calculated through a multi-head scaling dot product attention mechanism. Based on the residual connection between the attention output and the input features of the current layer, the attention intermediate features are obtained after layer normalization. The attention intermediate features are then processed by a feedforward network. Based on the residual connection between the output of the feedforward network and the attention intermediate features, the output features of the current layer are obtained after layer normalization.
7. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, In S3, a sparse directed adjacency matrix is constructed for each time position, so that different time positions have different topological connection structures, in order to capture the dynamic time-varying characteristics of EEG topology.
8. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, In S1, bandpass filtering is used to eliminate baseline drift and high-frequency noise. By extracting the relative power spectral density of each channel in multiple frequency bands, a four-dimensional tensor containing channel dimension, frequency band dimension, time dimension and batch dimension is constructed. After merging the time dimension and batch dimension in the four-dimensional tensor into a single dimension, the node feature matrix corresponding to each time position is obtained.
9. The EEG emotion recognition method integrating directed topology and block-based temporal attention as described in claim 1, characterized in that, The classifier in S5 is the Softmax classifier; During the model training phase, the cross-entropy loss function is used as the optimization objective to train and update the various learnable parameters of the model. The learnable parameters include the parameters of the asymmetric directed adjacency matrix, the parameters of the multi-branch directed graph convolutional network, and the parameters in the block-based temporal attention mechanism.
10. A brainwave emotion recognition system integrating directed topology and segmented temporal attention, used to implement the brainwave emotion recognition method and steps integrating directed topology and segmented temporal attention as described in claims 1-9, characterized in that, include: The signal acquisition and preprocessing module is used to acquire and preprocess EEG signals to obtain multi-channel EEG data. An asymmetric directed topological network building module is used to extract the relative power spectral density features of multi-channel EEG data; An asymmetric directed adjacency matrix is constructed using EEG channels as graph nodes; The multi-branch directed graph convolution module is used to perform feature aggregation and adaptive fusion along the inbound and outbound directions of the multi-branch directed graph convolution network based on the sparse directed adjacency matrix and relative power spectral density features. After multi-branch parallel encoding and multi-view adaptive fusion, the comprehensive spatial topological features are obtained. The block-based temporal attention module is used to generate a spatiotemporal comprehensive feature vector by dividing the time series into non-overlapping blocks and processing them with block-based temporal self-attention based on comprehensive spatial topological features. The emotion classification module is used to classify emotions based on spatiotemporal integrated feature vectors using a classifier and output emotion recognition results.
