Space-time decoupling efficient electroencephalogram basic model construction method and device

By employing a highly efficient EEG basic model construction method based on spatiotemporal decoupling, and utilizing linear attention and spatiotemporal data decoupling techniques, this approach addresses the issues of individual variability and high computational complexity inherent in existing models, achieving higher accuracy in EEG signal analysis and anomaly detection.

CN121659709APending Publication Date: 2026-03-13HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing basic EEG models have insufficient generalization ability and high computational complexity under challenges such as large individual differences, low signal-to-noise ratio and scarce annotations, resulting in low accuracy in anomaly detection tasks.

Method used

We employ an efficient EEG basic model construction method based on spatiotemporal decoupling. By decoupling linear attention and spatiotemporal data, we construct a spatiotemporal hybrid module and a forward propagation network based on EEG embedding layers and multiple alternating stacks. Combined with an enhanced bidirectional weighted key-value algorithm based on one-dimensional grouped convolution and linear attention mechanisms, we achieve spatiotemporal decoupling and feature encoding of signals.

Benefits of technology

It improves the accuracy and efficiency of EEG signal analysis, enhances the model's generalization ability across subjects and tasks, reduces computational resource consumption, and improves the accuracy of anomaly detection tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121659709A_ABST
    Figure CN121659709A_ABST
Patent Text Reader

Abstract

The invention discloses a space-time decoupling efficient electroencephalogram basic model construction method and device, and relates to the technical field of brain signal processing. The method comprises the following steps: constructing an electroencephalogram basic model based on linear attention and spatio-temporal data decoupling; segmenting the acquired electroencephalogram signal data, inputting the segmented electroencephalogram signal data into an electroencephalogram embedding layer, and outputting an embedding vector; inputting the embedded vector into a space-time mixing module for separation and decoupling to obtain a spatial feature and a time feature; performing coding calculation on the spatial features and the time features based on an enhanced bidirectional weighted key value algorithm of a linear attention mechanism to obtain new spatial hidden layer features and time hidden layer features; mixing the two hidden layer features to obtain spatial-temporal features; inputting the spatial-temporal characteristics into a forward propagation network, and pre-training the model to obtain a trained model; and inputting a downstream task to be executed into the trained model for processing, and outputting a task result. According to the invention, the brain signal processing efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of brain signal processing technology, and in particular to a method and apparatus for constructing a spatiotemporally decoupled, efficient basic EEG model. Background Technology

[0002] Electroencephalography (EEG) signal decoding, as a crucial component of brain-computer interfaces, has made significant progress. Early techniques primarily relied on traditional machine learning methods, such as support vector machines and linear discriminant analysis. While effective, these methods were limited by manually designed features, required substantial prior knowledge, and exhibited weak generalization capabilities. With the rapid development of deep learning technology, deep learning-based EEG decoding methods have overcome these limitations. However, the lack of high-quality, labeled EEG data severely restricts the practical application of deep learning models. Furthermore, the differences in EEG signal formats across different datasets also challenge the generalization ability of these models. In recent years, with the rise and maturation of large-scale modeling techniques, EEG foundation models have emerged. These models are pre-trained on a wide range of data distributions to learn general representations and possess strong cross-scenario generalization capabilities. As a bridge connecting artificial intelligence and neuroscience, EEG foundation models have achieved significant breakthroughs in EEG signal analysis in recent years. Currently, various EEG foundation models have been proposed and applied to downstream tasks in various neural activity patterns and clinical application scenarios. Most of these models are based on a self-supervised learning paradigm, pre-trained on large-scale unlabeled EEG data to learn general neural representations. Although these models perform well on specific tasks, the development of current basic EEG models still faces many challenges.

[0003] Currently, most basic EEG models follow the design principles of time series prediction models. While EEG signals are similar in form to time series data, the complex neural mechanisms and spatiotemporal dynamics they contain cause significant deviations in the application of general time series models to basic EEG models. These general models often neglect the spatial correlation features of EEG signals, making it difficult to effectively model the collaborative activities between different brain regions, thus limiting their performance in cognitive state recognition and disease detection tasks. To overcome this deficiency, some methods attempt to model the spatiotemporal features of EEG signals separately, designing specialized modules to handle temporal dynamic evolution and spatial interaction characteristics, thereby more precisely characterizing the "when" and "where" key neural events occur during EEG activity.

[0004] However, even with the introduction of spatial modeling mechanisms, existing EEG baseline models still face challenges such as significant individual variability, low signal-to-noise ratio, and scarce annotations. While current technical solutions employ techniques such as independent component analysis, wavelet denoising, and bandpass filtering to eliminate the influence of electrooculography (EOG) and electromyography (EMG) artifacts on relevant tasks, these preprocessing methods often fail to completely eliminate individual-specific noise and may inadvertently filter out task-related neural activity information. Existing models are prone to overfitting to specific subject data distributions during training, leading to significant performance degradation when faced with new individuals or experimental paradigms. This limitation exposes the shortcomings in the generalization mechanism design of current EEG baseline models. Most models still rely on supervised learning paradigms, making it difficult to learn biologically meaningful and transferable representations with limited labeled data. Even with self-supervised pre-training strategies, if the alignment of neural response patterns between individuals or the decoupling of task-irrelevant features are not fully considered, the model still struggles to achieve feature transfer between subjects. Furthermore, EEG baseline models have higher requirements for real-time response in downstream task applications. However, most existing EEG basic models are based on self-attention mechanisms, and their computational complexity greatly limits the inference speed of the models in downstream tasks. This results in the existing models failing to meet expectations in real-world application scenarios, leading to low efficiency in processing brain signals and low accuracy in anomaly detection tasks. Summary of the Invention

[0005] To address the technical problems of insufficient model generalization, high computational complexity, and consequently reduced accuracy in anomaly detection tasks due to decreased brain signal processing capabilities in existing technologies, this invention provides a spatiotemporally decoupled, efficient method and apparatus for constructing basic EEG models. The technical solution is as follows:

[0006] On the one hand, a spatiotemporally decoupled, efficient method for constructing a basic EEG model is provided. This method is implemented by a spatiotemporally decoupled, efficient EEG basic model construction device, and includes:

[0007] S1. Construct a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a forward propagation network;

[0008] S2. Acquire multi-channel continuous EEG signal data; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, and learn the expert weights and shared expert weights for different channels through an expert network model; based on the expert weights and shared expert weights, calculate through one-dimensional grouped convolution and output the embedding vector.

[0009] S3. Input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, and separate and decouple the embedded vector in the time dimension to obtain spatial features; separate and decouple the embedded vector in the channel dimension to obtain temporal features.

[0010] S4. An enhanced bidirectional weighted key-value algorithm based on linear attention mechanism encodes and calculates spatial features to obtain new spatial hidden features; it encodes and calculates temporal features to obtain new temporal hidden features; and it mixes the new spatial hidden features and the new temporal hidden features to obtain the mixed spatiotemporal features.

[0011] S5. Input the mixed spatiotemporal features into the feedforward network, and pre-train the model by calculating the original input EEG signal data to obtain the trained model;

[0012] S6. Obtain the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

[0013] On the other hand, a spatiotemporally decoupled, high-efficiency EEG basic model construction device is provided. This device is applied to the spatiotemporally decoupled, high-efficiency EEG basic model construction method. The device includes:

[0014] The building unit is used to construct a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a feedforward network;

[0015] An acquisition unit is used to acquire multi-channel continuous EEG signal data; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, learn the expert weights and shared expert weights of different channels through an expert network model; and calculate the embedding vector based on the expert weights and shared expert weights through one-dimensional grouped convolution.

[0016] The decoupling unit is used to input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, to separate and decouple the embedded vector in the time dimension to obtain spatial features; and to separate and decouple the embedded vector in the channel dimension to obtain temporal features.

[0017] The encoding unit is used in the enhanced bidirectional weighted key-value algorithm based on the linear attention mechanism to encode and calculate spatial features to obtain new spatial hidden features; to encode and calculate temporal features to obtain new temporal hidden features; and to mix the new spatial hidden features and the new temporal hidden features to obtain the mixed spatiotemporal features.

[0018] The training unit is used to input the mixed spatiotemporal features into the feedforward network and pre-train the model by calculating the original input EEG signal data to obtain a trained model.

[0019] The processing unit is used to acquire the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

[0020] On the other hand, a spatiotemporally decoupled, high-efficiency EEG basic model construction device is provided, the spatiotemporally decoupled, high-efficiency EEG basic model construction device comprising: a processor; a memory, the memory storing computer-readable instructions, which, when executed by the processor, implement any of the methods described above for spatiotemporally decoupled, high-efficiency EEG basic model construction.

[0021] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement any of the above-described methods for constructing an efficient EEG basic model with spatiotemporal decoupling.

[0022] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:

[0023] This embodiment proposes an innovative EEG fundamental model framework that significantly improves the accuracy, efficiency, and generalization ability of EEG signal analysis through multi-level collaborative design. The framework integrates signal segmentation, unified embedding representation, spatiotemporal decoupling of signals, spatiotemporal feature encoding based on a linear attention mechanism, and a dynamic spatiotemporal feature fusion method. A unified embedding strategy maps signals from different channels, frequency bands, and time windows to a shared semantic space, enhancing the model's generalization ability across subject and task data. This embodiment introduces an explicit spatiotemporal decoupling mechanism for EEG signals, modeling spatially dependent features and temporal dynamic evolution separately, thereby capturing the complex spatiotemporal dependencies of brain activity more comprehensively and accurately. Furthermore, to balance computational efficiency and modeling capability, this embodiment employs a feature encoder based on a linear attention mechanism, reducing computational resource consumption. Finally, an adaptive weighted integration of the decoupled spatiotemporal features through a dynamic fusion mechanism further enhances the model's ability to discriminate task-related neural patterns and improves its robustness to noise and individual differences. Using this embodiment can improve the efficiency of brain signal processing and increase accuracy in anomaly detection tasks. Attached Figure Description

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

[0025] Figure 1 This is a flowchart of a method for constructing a high-efficiency EEG basic model with spatiotemporal decoupling, provided by an embodiment of the present invention;

[0026] Figure 2 This is a schematic diagram of the structure of a basic EEG model based on linear attention mechanism and spatiotemporal data decoupling provided in an embodiment of the present invention;

[0027] Figure 3 This is a flowchart of an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism provided in an embodiment of the present invention;

[0028] Figure 4 This is a block diagram of a spatiotemporally decoupled, high-efficiency EEG basic model construction device provided in an embodiment of the present invention;

[0029] Figure 5 This is a schematic diagram of the structure of a high-efficiency EEG basic model construction device with spatiotemporal decoupling provided in an embodiment of the present invention. Detailed Implementation

[0030] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0031] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.

[0032] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.

[0033] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0034] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0035] This invention provides a spatiotemporally decoupled, high-efficiency EEG basic model construction method. This method can be implemented using a spatiotemporally decoupled, high-efficiency EEG basic model construction device, which can be a terminal or a server. Figure 1 The flowchart shown illustrates a method for constructing an efficient EEG basic model with spatiotemporal decoupling. The processing flow of this method may include the following steps:

[0036] S1. Construct a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a forward propagation network.

[0037] Among them, such as Figure 2 The diagram shown is a schematic diagram of the structure of a basic EEG model based on linear attention mechanism and spatiotemporal data decoupling provided by an embodiment of the present invention; wherein, the basic EEG model based on linear attention and spatiotemporal data decoupling specifically includes: an EEG embedding layer, two regularization layers, a multi-layered alternating spatiotemporal hybrid module, a forward propagation network, and an output layer.

[0038] Optionally, the EEG embedding layer is used to convert the raw input EEG signal data into a high-dimensional feature representation;

[0039] The multi-layered, alternatingly stacked spatiotemporal hybridization module includes a shared spatiotemporal encoder and a shared feature encoder, which effectively fuse and decouple information in the spatial and temporal dimensions through a linear attention mechanism.

[0040] Among them, the forward propagation network is used to enhance the representational ability of the EEG basic model based on linear attention and spatiotemporal data decoupling.

[0041] S2. Acquire continuous EEG signal data from multiple channels; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, and learn the expert weights and shared expert weights for different channels through an expert network model; based on the expert weights and shared expert weights, calculate the embedding vector through one-dimensional grouped convolution.

[0042] In one feasible implementation, a multi-channel electroencephalography (EEG) device is used to acquire electrical signals generated by brain neural activity, recording time-series data from multiple electrode channels, each channel corresponding to the electrophysiological activity of a specific brain region. The acquired raw signals are organized into a two-dimensional matrix, represented as follows. The data structure, where M represents the number of EEG signal channels used and T represents the total number of time points sampled, not only preserves the evolutionary characteristics of EEG signals over time but also reflects the spatial distribution relationships between different brain regions, thus facilitating a comprehensive analysis of the spatiotemporal dynamics of brain function.

[0043] To address the challenges of long-duration, continuous EEG recordings while preserving the ability to capture both local and global temporal patterns, continuous EEG signals are segmented into non-overlapping blocks before being input into the model. Specifically, the EEG signal data X is non-overlappingly divided into multiple fixed-size time windows. Each time window can be viewed as an EEG segment containing several time frames. ,in, This indicates the duration of the time window, where n represents the number of blocks the original signal is divided into, and its value is... .

[0044] Optionally, the specific implementation process of S2 includes S21-S25:

[0045] S21. Input multiple non-overlapping blocks into the EEG embedding layer, process them through a single linear layer, and obtain the initial block embedding.

[0046] In one feasible implementation, segmented data are input into a unified EEG embedding layer. By integrating EEG signals from different electrode locations or different types, a unified representation is formed, and the dynamic characteristics of the input signals are extracted to adapt to EEG variations between different individuals and within the same individual under different states. Specifically, each signal... The initial block embedding is obtained by inputting into an embedding layer consisting of a single linear layer, which is expressed by the following formula (1):

[0047] (1)

[0048] in, This represents the initial block embedding, and d represents the intermediate layer dimension of the model; This indicates a linear operation.

[0049] S22. Input the initial block embedding into an expert route composed of a multilayer perceptron to obtain the selection probability of each initial block embedding for each expert.

[0050] In order to unify the dimensionality of EEG signals with different channel configurations in the model, an expert model is used to learn the proprietary representation weights of different channels, and the obtained proprietary representation weights are mapped to a common weight space. The proprietary representation weights are then fused to obtain the expert weights corresponding to the input signal. The specific process includes: using a learnable weight expert network, where each expert is responsible for a weight space, inputting the initial block embedding into an expert router composed of multilayer perceptrons, and obtaining the selection probability of the initial block embedding for each expert, which is expressed by the following formula (2):

[0051] (2)

[0052] in, This represents the probability of choosing each expert in the initial block embedding.

[0053] S23. Sort the selection probabilities of each expert from highest to lowest, and select the top two expert selection probabilities; based on the top two expert selection probabilities, calculate the expert weights corresponding to the initial block embedding.

[0054] In one feasible implementation, the top k (=2) most important expert weight probabilities are selected, and the expert weights corresponding to the initial embedding are calculated, which are expressed by the following formula (3):

[0055] (3)

[0056] in, This represents the expert weights corresponding to the initial embedding; Indicates the first The probability of each expert module being selected; Indicates the first The learnable weights contained in each expert module; k represents the number of expert modules selected.

[0057] S24. Based on the selection probability, calculate the shared expert weights through the gating unit and the set learnable weight vector;

[0058] In one feasible implementation, to alleviate the problems of uneven load distribution and "expert forgetting" in the weighted expert network, a shared weighted expert is used to process and continuously learn all inputs. Similar to the expert weight generation process described above, a gating unit is used to obtain the weight probability s of the shared expert. The shared expert weight can then be expressed as... ;in, These are learnable weight vectors.

[0059] S25. Based on expert weights and shared expert weights, calculate the embedding vector of the input EEG signal data in the unified embedding space through one-dimensional grouped convolution.

[0060] In one feasible implementation, the process of calculating the embedding vector of the input EEG signal data in a unified embedding space is represented by the following formula (4):

[0061] (4)

[0062] in, denoted as the embedding vector in the uniform embedding space, c represents the number of uniform feature channels in the model; n represents the number of embedding vectors for each feature channel; d represents the dimension of the embedding space; x represents the input EEG signal data. This represents a one-dimensional grouped convolution operation, where the number of scores is equal to the number of channels M in the input data. This represents the expert weights corresponding to the initial embedding; This represents the shared expert weights.

[0063] S3. Input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, and separate and decouple the embedded vector in the time dimension to obtain spatial features; separate and decouple the embedded vector in the channel dimension to obtain temporal features.

[0064] In the spatiotemporal hybrid module with its multiple alternating layers, the spatial distribution characteristics and temporal variation characteristics of EEG signals are processed separately to improve the model's understanding of spatial structure and temporal dynamics. This process involves rearranging and combining input features to separate the originally intertwined spatial and temporal information for subsequent independent processing.

[0065] Optionally, the specific implementation process of S3 includes S31-S33:

[0066] S31. Input the embedding vector into a multi-layered, alternately stacked spatiotemporal mixing module, perform max pooling on the embedding vector along the time dimension to obtain the max pooled features; perform average pooling on the embedding vector along the time dimension to obtain the average pooled features.

[0067] S32. After linear transformation of the features after max pooling and the features after average pooling, sum them to obtain the spatial features;

[0068] In one feasible implementation, the calculation process of spatial features is represented by the following formula (5):

[0069] (5)

[0070] in, Representing spatial characteristics; This represents the max pooling operation; This indicates an average pooling operation; Represents the embedding vector in the unified embedding space; This indicates a linear operation.

[0071] S33. Concatenate the embedded vectors along the channel dimension to obtain the concatenation result; input the concatenation result into the linear layer for calculation to obtain the temporal features.

[0072] In one feasible implementation, in order to preserve the dynamic characteristics of each channel of the EEG signal in the time dimension, this embodiment of the invention splices the hidden layer features along the channel dimension c and then sends the spliced ​​result into a linear layer to obtain the final time features, which are expressed by the following formula (6):

[0073] (6)

[0074] in, The temporal features are represented by t, which represents the duration of the time window in which the EEG data is segmented; and d, which represents the dimension of the embedding space. Indicates a splicing operation;

[0075] S4. An enhanced bidirectional weighted key-value algorithm based on linear attention mechanism encodes and calculates spatial features to obtain new spatial hidden features; it also encodes and calculates temporal features to obtain new temporal hidden features; and it mixes the new spatial hidden features and the new temporal hidden features to obtain the mixed spatiotemporal features.

[0076] Optionally, the specific implementation process of S4 includes S41-S43:

[0077] In one feasible implementation, although the hidden features of EEG signals are decomposed into temporal and spatial dimensions, their distribution ranges are not significantly different. Therefore, in a multi-layered, alternately stacked spatiotemporal hybrid module, a shared encoder is used to encode the decoupled temporal and spatial features. Within this shared spatiotemporal encoder, an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism is proposed, which can effectively model complex spatiotemporal relationships while maintaining computational efficiency.

[0078] To enhance the model's ability to perform well on complex tasks by leveraging historical information when processing sequence data, two special operations are defined: Low-Rank Adaptation (LoRA) and Data-Dependent Linear Interpolation (DDLeRP).

[0079] S41. Input the spatial and temporal features into the shared spatiotemporal encoder and the shared feature encoder, and calculate them using the defined low-rank adaptation and data-dependent linear interpolation formulas to obtain the intermediate variables corresponding to the spatial features and the intermediate variables corresponding to the temporal features.

[0080] The linear interpolation process for low-rank adaptation and data dependence is represented by the following formulas (7)-(8):

[0081] (7)

[0082] (8)

[0083] Where α is a marker symbol. This is the first learnable parameter in the model; This is the second learnable parameter in the model; This is the third learnable parameter in the model; is the fourth learnable parameter in the model; a represents the first input parameter of the data-dependent linear interpolation operation; b represents the second input parameter of the data-dependent linear interpolation operation. represents the vector outer product multiplication; z represents the input parameter of the low-rank adaptive operation;

[0084] In order to further enhance the expressive power of the model, when calculating the intermediate variables r, w, k and v, data-dependent linear interpolation operations are performed on the spatial and temporal features of the input in the channel and time dimensions, respectively, as expressed by the following formula (9):

[0085] (9)

[0086] in, A single symbol represents three intermediate variables: r, k, and v. Indicates the symbol The corresponding learnable weights; This represents the features of two adjacent channels in spatial features. and In time features, it represents the characteristics of two adjacent time points. and In the model, r represents the receiver vector, which acts as the receiver of past information and is responsible for collecting and integrating historical data; k represents the key vector, which is functionally similar to the K vector in the self-attention mechanism. It is used to calculate the attention score and help the model focus on relevant information fragments; v is the value vector, which plays a similar role to the V vector in the self-attention mechanism. It carries specific information content and is used by the model to perform weighted combination of input feature information in linear attention calculation.

[0087] In one feasible implementation, the spatial features are input into the above formula (9) to obtain the intermediate variables corresponding to the spatial features, including: a first intermediate variable. Second intermediate variable and the third intermediate variable Inputting the time feature into formula (9) above, the intermediate variables corresponding to the time feature are obtained, including: the first intermediate variable. Second intermediate variable and the third intermediate variable .

[0088] S42. Based on the linear interpolation formula of low-rank adaptation and data dependence, calculate the learnable time decay parameter corresponding to the spatial feature; based on the linear interpolation formula of low-rank adaptation and data dependence, calculate the learnable time decay parameter corresponding to the temporal feature.

[0089] In one feasible implementation, the learnable time decay parameters corresponding to spatial features and the learnable time decay parameters corresponding to temporal features are dynamically changing in the model. When spatial features are used as encoder input, it can respond to the input spatial features of spatial channel c. Similarly, when temporal features are used as encoder input, it can also respond to the input temporal features of time step t. This dynamic characteristic allows the model to adapt more flexibly to various input data without being limited by rigid, predefined structures. The specific calculation process of the learnable time decay parameters is expressed by the following formulas (10)-(11):

[0090] (10)

[0091] (11)

[0092] in, Indicates intermediate variables in the calculation; This indicates a low-rank adaptive operation; This represents a linear interpolation operation that depends on the data; exp is the natural exponent operation. The calculated time decay vector parameter is represented by: inputting the spatial feature into formula (10)-(11) to obtain the learnable time decay parameter corresponding to the spatial feature; inputting the time feature into formula (10)-(11) to obtain the learnable time decay parameter corresponding to the time feature.

[0093] In one feasible implementation, to reduce the computational complexity of the model in the shared feature encoder, this invention proposes an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism. This operation updates a weighted key-value vector independent of the input data bidirectionally, effectively reducing computational complexity while maintaining the model's expressive power. Figure 3 As shown, the core of this operation lies in combining information flows from two directions, thereby more comprehensively capturing and utilizing the spatiotemporal correlations in the data. Specifically, the state vector of the current moment or channel is obtained from the forward and backward state vectors of the previous moment or channel through a series of transformations; where, Figure 3 In Gating vectors for context learning in the control model; This represents the feature vector that should be retained in the current state; This represents the feature vector that should be removed in the current state; This represents the forward state vector of the channel at the previous moment; This represents the backward state vector of the previous moment or channel; This represents a learnable time decay vector; This represents the forward state vector of the current time or channel. This represents the value vector in the current state.

[0094] S43. Based on the intermediate variables corresponding to the spatial features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism is used for encoding calculation to obtain new spatial hidden layer features; based on the intermediate variables corresponding to the temporal features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism is used for encoding calculation to obtain new temporal hidden layer features.

[0095] Optionally, the specific implementation process of the enhanced bidirectional weighted key-value algorithm based on the linear attention mechanism includes S431-S434:

[0096] S431. Assign the state vector of the first time step or channel to 0, that is... Transform the forward and backward state vectors of the previous time step or channel to construct the calculation formulas for the forward and backward state vectors of the current time step or channel, which are expressed by the following formula (12):

[0097] (12)

[0098] in, Gating vectors for context learning in the control model; This represents the feature vector that should be retained in the current state; This represents the feature vector that should be removed in the current state; This represents the forward state vector of the channel at the previous moment; This represents the backward state vector of the previous moment or channel; This represents a learnable time decay vector; This represents the forward state vector of the current time or channel. Represents the value vector in the current state;

[0099] in, The gating vector for context learning of the control model is expressed by the following formula (13):

[0100] (13)

[0101] in, This represents the Sigmoid activation function; This indicates the i-th time or the i-th channel.

[0102] in, The feature vector that should be retained in the current state is represented by the following formula (14):

[0103] (14)

[0104] in, The key vector representing the current input features; This represents the vector outer product operation.

[0105] in, The feature vector that should be removed in the current state is represented by the following formula (15):

[0106] (15)

[0107] in, For control key vectors A learnable weight that needs to remove information from the middle.

[0108] S432. Concatenate the forward state vector and the backward state vector of the current time or channel to obtain the encoded vector, which is represented by the following formula (16):

[0109] (16)

[0110] in, This represents the encoded vector; This represents the forward state vector of the current time or channel. Represents the backward state vector of the current time or channel; Indicates the forward receive vector; Indicates the vector to be received backwards; Concatenation function;

[0111] S433. Input the intermediate variables corresponding to the spatial features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the spatial features; input the intermediate variables corresponding to the time features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the time features.

[0112] S434. Concatenate the forward and backward state vectors of the spatial features to obtain new spatial hidden features; concatenate the forward and backward state vectors of the temporal features to obtain new temporal hidden features.

[0113] In one feasible implementation, the new spatial hidden layer features and the new temporal hidden layer features are first calculated along the channel and time dimensions to recover the feature dimensions of the original EEG signal data. A linear layer is then used to integrate the mixed spatiotemporal features to obtain the mixed spatiotemporal features, which are expressed by the following formula (17):

[0114] (17)

[0115] in, This represents the spatiotemporal characteristics after mixing; This indicates new spatial hidden layer features; This represents a new temporal hidden layer feature; Indicates linear operations; This represents the vector outer product operation.

[0116] S5. Input the mixed spatiotemporal features into the feedforward network, and pre-train the model by calculating the original input EEG signal data to obtain the trained model.

[0117] After processing the spatiotemporal hybrid block, a forward propagation network is used to further enhance the model's expressive power. Specifically, a multilayer perceptron is used as the basic unit, through two fully connected layers. Each fully connected layer is followed by a ReLU activation function to introduce nonlinear characteristics. To prevent overfitting, the forward propagation network can also incorporate regularization techniques such as dropout, which reduces the model's complexity by randomly discarding some neurons.

[0118] During pre-training, in order to enhance the expressive ability of the unified embedded representation layer of EEG, the obtained expert weights are... and shared expert weights As weights, the raw EEG signal data of the input data is calculated using one-dimensional grouped convolution.

[0119] Optionally, the process of calculating the original input EEG signal data includes:

[0120] The spatiotemporal features, expert weights, and shared expert weights are input into the linear layer, and the original input EEG signal data is obtained by one-dimensional grouped convolution, which is expressed by the following formula (18):

[0121] (18)

[0122] Wherein, Conv1D is a one-dimensional grouped convolution operation; Indicates spatiotemporal characteristics; This represents the raw input EEG signal data; M represents the number of channels for the input EEG data; n represents the number of blocks into which the raw EEG data is divided; and t represents the duration of the time window in which the EEG data is divided. Represents the set of real numbers; This represents the transpose of the expert weights; This represents the transpose of shared expert weights; This indicates a linear operation.

[0123] S6. Obtain the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

[0124] In one feasible implementation, downstream tasks to be executed are obtained; the downstream tasks to be executed may include 10 types of downstream tasks: emotion recognition, motor imagery classification, sleep staging, epileptic seizure detection, speech imagery classification, mental disorder diagnosis, alertness estimation, psychological stress detection, event classification, and anomaly detection; the training set of the downstream tasks to be executed is input into the trained model for supervised fine-tuning training, and the task results are calculated on the test dataset of the downstream tasks.

[0125] During downstream fine-tuning, the mixed spatiotemporal features are directly input into the corresponding downstream task output layer to obtain the final task result.

[0126] In one feasible implementation, the embodiments of the present invention validate the model's performance on a large number of downstream tasks. Specifically, in the emotion recognition task, the embodiments of the present invention were tested on a fine-grained emotion computation EEG dataset, achieving a balance accuracy of 0.5552 and a weighted F1 score of 0.5618; tested on the Shanghai Jiao Tong University Emotion EEG dataset - Video Evoked Version, achieving a balance accuracy of 0.4099 and a weighted F1 score of 0.4101. In the motor imagery classification task, the model was tested on the motor imagery physiological signal dataset and the Shanghai University motor imagery dataset. On the motor imagery multimodal physiological signal dataset, the balance accuracy and weighted F1 score were 0.6204 and 0.6188, respectively, and the area under the receiver operating characteristic curve (AUC) on the SHU-MI dataset was 0.7201. For the sleep staging task, the model constructed in the embodiments of the present invention was tested on the International Center for Sleep Research and Application dataset, achieving a balance accuracy of 0.7865 and a weighted F1 score of 0.8011, respectively. In tasks such as epileptic seizure detection, speech imagery classification, mental disorder diagnosis, alertness estimation, psychological stress detection, event classification, and anomaly detection, the technical solution proposed in this embodiment also demonstrates strong performance. In the mental disorder diagnosis task on the EEG dataset collected by Wajid Mumtaz's team for major depressive disorder research, the balanced accuracy and the area under the receiver operating characteristic curve reached 0.9653 and 0.9960, respectively. In the anomaly detection task on the Temple University EEG abnormality corpus dataset, the area under the receiver operating characteristic curve reached 0.8957.

[0127] This invention integrates EEG signals from different electrode locations or different types to form a unified representation and extracts dynamic features of the input signals to adapt to EEG variations between different individuals and within the same individual under different states. The input features are rearranged and combined to separate the originally intertwined spatial and temporal information for subsequent independent processing. This invention proposes an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism, which can effectively model complex spatiotemporal relationships while maintaining computational efficiency. Through a dynamic fusion mechanism, the decoupled spatiotemporal features are adaptively weighted and integrated, further enhancing the model's ability to discriminate task-related neural patterns and improving its robustness to noise and individual differences.

[0128] This embodiment proposes an innovative basic EEG model framework, which significantly improves the accuracy, efficiency, and generalization ability of EEG signal analysis through multi-level collaborative design. This framework integrates signal segmentation, unified...

[0129] This invention employs an embedded representation, spatiotemporal decoupling of signals, spatiotemporal feature encoding based on a linear attention mechanism, and a dynamic spatiotemporal feature fusion method. By using a unified embedding strategy, signals from different channels, frequency bands, and time windows are mapped to a shared semantic space, enhancing the model's generalization ability across subject and task data. This embodiment introduces an explicit spatiotemporal decoupling mechanism for EEG signals, modeling spatially dependent features and temporal dynamic evolution separately, thereby capturing the complex spatiotemporal dependencies of brain activity more comprehensively and accurately. Furthermore, to balance computational efficiency and modeling capability, this embodiment uses a feature encoder based on a linear attention mechanism to reduce computational resource consumption. Finally, an adaptive weighted integration of the decoupled spatiotemporal features is performed through a dynamic fusion mechanism, further enhancing the model's ability to discriminate task-related neural patterns and improving its robustness to noise and individual differences. Using this embodiment can improve the efficiency of brain signal processing and increase accuracy in anomaly detection tasks.

[0130] Figure 4 This is a block diagram of a spatiotemporally decoupled, high-efficiency EEG basic model construction device provided by an embodiment of the present invention. This device is used for a spatiotemporally decoupled, high-efficiency EEG basic model construction method. (Refer to...) Figure 4 The device includes a construction unit 410, an acquisition unit 420, a decoupling unit 430, an encoding unit 440, a training unit 450, and a processing unit 460. Wherein:

[0131] The building unit 410 is used to build a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a forward propagation network;

[0132] The acquisition unit 420 is used to acquire multi-channel continuous EEG signal data; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, learn the expert weights and shared expert weights of different channels through an expert network model; and calculate the embedding vector based on the expert weights and shared expert weights through one-dimensional grouped convolution.

[0133] The decoupling unit 430 is used to input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, to separate and decouple the embedded vector in the time dimension to obtain spatial features; and to separate and decouple the embedded vector in the channel dimension to obtain temporal features.

[0134] Encoding unit 440 is used for an enhanced bidirectional weighted key-value algorithm based on linear attention mechanism to encode and calculate spatial features to obtain new spatial hidden features; to encode and calculate temporal features to obtain new temporal hidden features; and to mix the new spatial hidden features and the new temporal hidden features to obtain mixed spatiotemporal features.

[0135] Training unit 450 is used to input the mixed spatiotemporal features into the feedforward network and pre-train the model by calculating the original input EEG signal data to obtain a trained model.

[0136] The processing unit 460 is used to acquire the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

[0137] Optionally, the EEG embedding layer is used to convert the original input EEG signal data into a high-dimensional feature representation;

[0138] The multi-layered, alternately stacked spatiotemporal hybridization module includes a shared spatiotemporal encoder and a shared feature encoder, which effectively fuse and decouple information in the spatial and temporal dimensions through a linear attention mechanism.

[0139] The forward propagation network is used to enhance the representational ability of the EEG basic model based on linear attention and spatiotemporal data decoupling.

[0140] Optionally, the acquisition unit 420 is configured to:

[0141] Multiple non-overlapping blocks are input into the EEG embedding layer and processed through a single linear layer to obtain the initial block embedding.

[0142] The initial block embedding is input into an expert route composed of a multilayer perceptron to obtain the selection probability of each initial block embedding for each expert.

[0143] Sort the selection probabilities of each expert from highest to lowest, and select the top two expert selection probabilities; based on the top two expert selection probabilities, calculate the expert weights corresponding to the initial block embeddings.

[0144] Based on the selection probability, shared expert weights are calculated using gating units and a set learnable weight vector;

[0145] Based on expert weights and shared expert weights, the embedding vector of the input EEG signal data in a unified embedding space is calculated through one-dimensional grouped convolution.

[0146] Optionally, the decoupling unit 430 is used for:

[0147] The embedding vector is input into a multi-layered, alternately stacked spatiotemporal mixing module. Max pooling is performed on the embedding vector along the time dimension to obtain the max pooled features. Average pooling is then performed on the embedding vector along the time dimension to obtain the average pooled features.

[0148] The spatial features are obtained by summing the features after max pooling and average pooling respectively after linear transformation.

[0149] The embedded vectors are concatenated along the channel dimension to obtain the concatenated result; the concatenated result is then input into a linear layer for computation to obtain the temporal features.

[0150] Optionally, the encoding unit 440 is used for:

[0151] Spatial and temporal features are input into a shared spatiotemporal encoder and a shared feature encoder, and are calculated using a defined low-rank adaptation and data-dependent linear interpolation formula to obtain intermediate variables corresponding to spatial features and intermediate variables corresponding to temporal features.

[0152] The linear interpolation process for low-rank adaptation and data dependence is represented by the following formulas (1)-(2):

[0153] (1)

[0154] (2)

[0155] Where α is a marker symbol. This is the first learnable parameter in the model; This is the second learnable parameter in the model; This is the third learnable parameter in the model; is the fourth learnable parameter in the model; a represents the first input parameter of the data-dependent linear interpolation operation; b represents the second input parameter of the data-dependent linear interpolation operation. represents the vector outer product multiplication; z represents the input parameter of the low-rank adaptive operation;

[0156] Based on the linear interpolation formula of low-rank adaptation and data dependence, the learnable time decay parameters corresponding to spatial features are calculated; based on the linear interpolation formula of low-rank adaptation and data dependence, the learnable time decay parameters corresponding to temporal features are calculated.

[0157] Based on the intermediate variables corresponding to spatial features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on linear attention mechanism is used for encoding calculation to obtain new spatial hidden layer features; based on the intermediate variables corresponding to temporal features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on linear attention mechanism is used for encoding calculation to obtain new temporal hidden layer features.

[0158] Optionally, the specific implementation process of the enhanced bidirectional weighted key-value algorithm based on the linear attention mechanism includes:

[0159] Assign 0 to the state vector of the first moment or channel; transform the forward and backward state vectors of the previous moment or channel to construct the calculation formulas for the forward and backward state vectors of the current moment or channel, which are expressed by the following formula (3):

[0160] (3)

[0161] in, Gating vectors for context learning in the control model; This represents the feature vector that should be retained in the current state; This represents the feature vector that should be removed in the current state; This represents the forward state vector of the channel at the previous moment; This represents the backward state vector of the previous moment or channel; This represents a learnable time decay vector; This represents the forward state vector of the current time or channel. Represents the value vector in the current state;

[0162] The forward state vector and backward state vector of the current time or channel are concatenated to obtain the encoded vector, which is represented by the following formula (4):

[0163] (4)

[0164] in, This represents the encoded vector; This represents the forward state vector of the current time or channel. Represents the backward state vector of the current time or channel; Indicates the forward receive vector; Indicates the vector to be received backwards; Concatenation function;

[0165] Input the intermediate variables corresponding to the spatial features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the spatial features; input the intermediate variables corresponding to the temporal features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the temporal features.

[0166] The forward and backward state vectors of the spatial features are concatenated and calculated to obtain new spatial hidden layer features; the forward and backward state vectors of the temporal features are concatenated and calculated to obtain new temporal hidden layer features.

[0167] Optionally, the process of calculating the original input EEG signal data includes:

[0168] The spatiotemporal features, expert weights, and shared expert weights are input into the linear layer, and the original input EEG signal data is obtained by one-dimensional grouped convolution, which is expressed by the following formula (5):

[0169] (5)

[0170] Wherein, Conv1D is a one-dimensional grouped convolution operation; Indicates spatiotemporal characteristics; This represents the raw input EEG signal data; M represents the number of channels for the input EEG data; n represents the number of blocks into which the raw EEG data is divided; and t represents the duration of the time window in which the EEG data is divided. Represents the set of real numbers; This represents the transpose of the expert weights; This represents the transpose of shared expert weights; This indicates a linear operation.

[0171] This embodiment proposes an innovative EEG fundamental model framework that significantly improves the accuracy, efficiency, and generalization ability of EEG signal analysis through multi-level collaborative design. The framework integrates signal segmentation, unified embedding representation, spatiotemporal decoupling of signals, spatiotemporal feature encoding based on a linear attention mechanism, and a dynamic spatiotemporal feature fusion method. A unified embedding strategy maps signals from different channels, frequency bands, and time windows to a shared semantic space, enhancing the model's generalization ability across subject and task data. This embodiment introduces an explicit spatiotemporal decoupling mechanism for EEG signals, modeling spatially dependent features and temporal dynamic evolution separately, thereby capturing the complex spatiotemporal dependencies of brain activity more comprehensively and accurately. Furthermore, to balance computational efficiency and modeling capability, this embodiment employs a feature encoder based on a linear attention mechanism, reducing computational resource consumption. Finally, an adaptive weighted integration of the decoupled spatiotemporal features through a dynamic fusion mechanism further enhances the model's ability to discriminate task-related neural patterns and improves its robustness to noise and individual differences. Using this embodiment can improve the efficiency of brain signal processing and increase accuracy in anomaly detection tasks.

[0172] Figure 5 This is a schematic diagram of the structure of a high-efficiency EEG basic model construction device with spatiotemporal decoupling provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the spatiotemporally decoupled, high-efficiency EEG basic model construction device may include the above-mentioned Figure 4 The illustrated device is a spatiotemporally decoupled, high-efficiency EEG basic model construction apparatus. Optionally, the spatiotemporally decoupled, high-efficiency EEG basic model construction apparatus 510 may include a first processor 2001.

[0173] Optionally, the spatiotemporally decoupled, high-efficiency EEG basic model building device 510 may also include a memory 2002 and a transceiver 2003.

[0174] The first processor 2001, memory 2002, and transceiver 2003 can be connected via a communication bus.

[0175] The following is combined Figure 5 A detailed introduction to the various components of the 510 high-efficiency EEG basic model construction device with spatiotemporal decoupling:

[0176] The first processor 2001 is the control center of the spatiotemporally decoupled high-efficiency EEG basic model construction device 510. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0177] Optionally, the first processor 2001 can perform various functions of the spatiotemporally decoupled, high-efficiency EEG basic model construction device 510 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0178] In a specific implementation, as one example, the first processor 2001 may include one or more CPUs, for example... Figure 5 CPU0 and CPU1 are shown in the diagram.

[0179] In a specific implementation, as one example, the spatiotemporally decoupled high-efficiency EEG basic model construction device 510 may also include multiple processors, for example... Figure 5 The first processor 2001 and the second processor 2004 are shown in the diagram. Each of these processors can be a single-core processor or a multi-core processor. Here, a processor can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).

[0180] The memory 2002 is used to store the software program that executes the present invention, and is controlled by the first processor 2001 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0181] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently, and may be connected to the interface circuit of the spatiotemporally decoupled high-efficiency EEG basic model construction device 510. Figure 5 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0182] The transceiver 2003 is used to communicate with network devices or with terminal devices.

[0183] Alternatively, transceiver 2003 may include a receiver and a transmitter. Figure 5 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0184] Optionally, the transceiver 2003 can be integrated with the first processor 2001 or exist independently, and the interface circuit of the device 510 is constructed through a spatiotemporally decoupled, high-efficiency EEG basic model. Figure 5 (Not shown in the image) is coupled to the first processor 2001, and this embodiment of the invention does not specifically limit this.

[0185] It should be noted that, Figure 5 The structure of the spatiotemporally decoupled high-efficiency EEG basic model building device 510 shown does not constitute a limitation on the router. The actual spatiotemporally decoupled high-efficiency EEG basic model building device may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0186] Furthermore, the technical effects of the spatiotemporally decoupled high-efficiency EEG basic model construction device 510 can be referred to the technical effects of the spatiotemporally decoupled high-efficiency EEG basic model construction method described in the above method embodiments, and will not be repeated here.

[0187] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or it may be any conventional processor, etc.

[0188] It should also be understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0189] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0190] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0191] In this invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be a single item or multiple items.

[0192] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0193] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0194] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0195] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0196] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0197] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0198] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0199] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for constructing a highly efficient spatiotemporally decoupled EEG basic model, characterized in that, The method includes: S1. Construct a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a forward propagation network; S2. Acquire multi-channel continuous EEG signal data; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, and learn the expert weights and shared expert weights for different channels through an expert network model; based on the expert weights and shared expert weights, calculate through one-dimensional grouped convolution and output the embedding vector. S3. Input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, and separate and decouple the embedded vector in the time dimension to obtain spatial features; separate and decouple the embedded vector in the channel dimension to obtain temporal features. S4. An enhanced bidirectional weighted key-value algorithm based on linear attention mechanism encodes and calculates spatial features to obtain new spatial hidden features; it encodes and calculates temporal features to obtain new temporal hidden features; and it mixes the new spatial hidden features and the new temporal hidden features to obtain the mixed spatiotemporal features. S5. Input the mixed spatiotemporal features into the feedforward network, and pre-train the model by calculating the original input EEG signal data to obtain the trained model; S6. Obtain the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

2. The method for constructing a highly efficient EEG basic model with spatiotemporal decoupling according to claim 1, characterized in that, The EEG embedding layer is used to convert the raw input EEG signal data into a high-dimensional feature representation; The multi-layered, alternately stacked spatiotemporal hybridization module includes a shared spatiotemporal encoder and a shared feature encoder, which effectively fuse and decouple information in the spatial and temporal dimensions through a linear attention mechanism. The forward propagation network is used to enhance the representational ability of the EEG basic model based on linear attention and spatiotemporal data decoupling.

3. The method for constructing a highly efficient EEG basic model with spatiotemporal decoupling according to claim 1, characterized in that, The S2 inputs multiple non-overlapping blocks into the EEG embedding layer and learns the expert weights for different channels through an expert network model. Based on the expert weights, multiple non-overlapping blocks are uniformly embedded using one-dimensional grouped convolution, outputting an embedding vector, including: S21. Input multiple non-overlapping blocks into the EEG embedding layer, process them through a single linear layer, and obtain the initial block embedding. S22. Input the initial block embedding into an expert route composed of a multilayer perceptron to obtain the selection probability of each initial block embedding for each expert. S23. Sort the selection probabilities of each expert from highest to lowest, and select the top two expert selection probabilities; based on the top two expert selection probabilities, calculate the expert weights corresponding to the initial block embedding. S24. Based on the selection probability, calculate the shared expert weights through the gating unit and the set learnable weight vector; S25. Based on expert weights and shared expert weights, calculate the embedding vector of the input EEG signal data in the unified embedding space through one-dimensional grouped convolution.

4. The method for constructing a highly efficient EEG basic model with spatiotemporal decoupling according to claim 1, characterized in that, The S3 inputs the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, and performs temporal dimension separation and decoupling on the embedded vector to obtain spatial features; The embedding vectors are decoupled along the channel dimension to obtain temporal features, including: S31. Input the embedding vector into a multi-layered, alternately stacked spatiotemporal mixing module, perform max pooling on the embedding vector along the time dimension to obtain the max pooled features; perform average pooling on the embedding vector along the time dimension to obtain the average pooled features. S32. After linear transformation of the features after max pooling and the features after average pooling, sum them to obtain the spatial features; S33. Concatenate the embedded vectors along the channel dimension to obtain the concatenation result; input the concatenation result into the linear layer for calculation to obtain the temporal features.

5. The method for constructing an efficient EEG basic model with spatiotemporal decoupling according to claim 1, characterized in that, The enhanced bidirectional weighted key-value algorithm based on linear attention mechanism in S4 encodes and calculates spatial features to obtain new spatial hidden layer features. Encode and compute the temporal features to obtain new temporal hidden features, including: S41. Input the spatial and temporal features into the shared spatiotemporal encoder and the shared feature encoder, and calculate them using the defined low-rank adaptation and data-dependent linear interpolation formulas to obtain the intermediate variables corresponding to the spatial features and the intermediate variables corresponding to the temporal features. The linear interpolation process for low-rank adaptation and data dependence is represented by the following formulas (1)-(2): (1) (2) in, For a marker symbol, This is the first learnable parameter in the model; This is the second learnable parameter in the model; This is the third learnable parameter in the model; is the fourth learnable parameter in the model; a represents the first input parameter of the data-dependent linear interpolation operation; b represents the second input parameter of the data-dependent linear interpolation operation. represents the vector outer product multiplication; z represents the input parameter of the low-rank adaptive operation; S42. Based on the linear interpolation formula of low-rank adaptation and data dependence, calculate the learnable time decay parameter corresponding to the spatial feature; based on the linear interpolation formula of low-rank adaptation and data dependence, calculate the learnable time decay parameter corresponding to the temporal feature. S43. Based on the intermediate variables corresponding to the spatial features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism is used for encoding calculation to obtain new spatial hidden layer features; based on the intermediate variables corresponding to the temporal features and the learnable time decay parameters, an enhanced bidirectional weighted key-value algorithm based on a linear attention mechanism is used for encoding calculation to obtain new temporal hidden layer features.

6. The method for constructing an efficient EEG basic model with spatiotemporal decoupling according to claim 5, characterized in that, The specific implementation process of the enhanced bidirectional weighted key-value algorithm based on the linear attention mechanism includes: S431. Assign the state vector of the first moment or channel to 0; transform the forward state vector and backward state vector of the previous moment or channel to construct the calculation formula of the forward state vector and backward state vector of the current moment or channel, which is expressed by the following formula (3): (3) in, Gating vectors for context learning in the control model; This represents the feature vector that should be retained in the current state; This represents the feature vector that should be removed in the current state; This represents the forward state vector of the channel at the previous moment; This represents the backward state vector of the previous moment or channel; This represents a learnable time decay vector; This represents the forward state vector of the current time or channel. Represents the value vector in the current state; S432. Concatenate the forward state vector and the backward state vector of the current time or channel to obtain the encoded vector, which is represented by the following formula (4): (4) in, This represents the encoded vector; This represents the forward state vector of the current time or channel. Represents the backward state vector of the current time or channel; Indicates the forward receive vector; Indicates the vector to be received backwards; Concatenation function; S433. Input the intermediate variables corresponding to the spatial features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the spatial features; input the intermediate variables corresponding to the time features and the learnable time decay parameters into the calculation formulas of the forward and backward state vectors of the current time or channel, and output the forward and backward state vectors of the time features. S434. Concatenate the forward and backward state vectors of the spatial features to obtain new spatial hidden features; concatenate the forward and backward state vectors of the temporal features to obtain new temporal hidden features.

7. The method for constructing a highly efficient EEG basic model with spatiotemporal decoupling according to claim 1, characterized in that, The process of calculating the original input EEG signal data includes: The spatiotemporal features, expert weights, and shared expert weights are input into the linear layer, and the original input EEG signal data is obtained by one-dimensional grouped convolution, which is expressed by the following formula (5): (5) Wherein, Conv1D is a one-dimensional grouped convolution operation; Indicates spatiotemporal characteristics; This represents the raw input EEG signal data; M represents the number of channels for the input EEG data; n represents the number of blocks into which the raw EEG data is divided; and t represents the duration of the time window in which the EEG data is divided. Represents the set of real numbers; This represents the transpose of the expert weights; This represents the transpose of shared expert weights; This indicates a linear operation.

8. A spatiotemporally decoupled, high-efficiency EEG basic model construction device, wherein the spatiotemporally decoupled, high-efficiency EEG basic model construction device is used to implement the spatiotemporally decoupled, high-efficiency EEG basic model construction method as described in any one of claims 1-7, characterized in that, The device includes: The building unit is used to construct a basic EEG model based on linear attention and spatiotemporal data decoupling; the model includes: an EEG embedding layer, a multi-layered, alternately stacked spatiotemporal hybrid module, and a feedforward network; An acquisition unit is used to acquire multi-channel continuous EEG signal data; segment the EEG signal data to obtain multiple non-overlapping blocks; input the multiple non-overlapping blocks into the EEG embedding layer, learn the expert weights and shared expert weights of different channels through an expert network model; and calculate the embedding vector based on the expert weights and shared expert weights through one-dimensional grouped convolution. The decoupling unit is used to input the embedded vector into a multi-layered, alternately stacked spatiotemporal mixing module, to separate and decouple the embedded vector in the time dimension to obtain spatial features; and to separate and decouple the embedded vector in the channel dimension to obtain temporal features. The encoding unit is used in the enhanced bidirectional weighted key-value algorithm based on the linear attention mechanism to encode and calculate spatial features to obtain new spatial hidden features; to encode and calculate temporal features to obtain new temporal hidden features; and to mix the new spatial hidden features and the new temporal hidden features to obtain the mixed spatiotemporal features. The training unit is used to input the mixed spatiotemporal features into the feedforward network and pre-train the model by calculating the original input EEG signal data to obtain a trained model. The processing unit is used to acquire the downstream emotion recognition task to be executed; input the downstream emotion recognition task to be executed into the trained model for processing, and output the task result.

9. A highly efficient EEG basic model construction device with spatiotemporal decoupling, characterized in that, The spatiotemporally decoupled, high-efficiency EEG basic model construction device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Training method of electroencephalogram signal processing model and electroencephalogram signal processing method and device

    CN121901990A