Local-global temporal interaction network for unilateral directional motor imagery eeg decoding
By combining shallow CNNs and multi-scale temporal feature extraction with a local-global temporal attention module, the decoding challenge of unilateral limb MI tasks is solved, improving the decoding accuracy of EEG signals and the robustness of the model. This approach is applicable to brain-computer interface technology in the fields of rehabilitation and neuroprosthetic control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SHAONAO SENSING TECH CO LTD
- Filing Date
- 2025-07-22
- Publication Date
- 2026-04-14
AI Technical Summary
Existing MI-BCI systems struggle to effectively decode unilateral limb motor imagery tasks, especially due to high inter-class similarity of EEG signals, overlapping activation regions, and low signal-to-noise ratio, resulting in low decoding accuracy. Furthermore, existing deep learning methods are unable to capture global temporal dependencies and local dynamic changes.
We employ a shallow CNN module and a multi-scale temporal feature extraction and compression module, combined with a local-global temporal attention module. We extract localized time-frequency representations through temporal convolutional layers and deep spatial convolutional layers, model global temporal dependencies using a multi-head self-attention mechanism, and perform adaptive average pooling using a temporal pyramid pooling module to improve feature extraction capabilities.
It significantly improves the decoding accuracy of unilateral limb motor imagery tasks, enhances the ability to capture fine-grained temporal patterns and long-range dependencies, and improves the model's generalization ability and robustness in non-stationary environments.
Smart Images

Figure CN120849917B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of brain-computer interface technology, specifically relating to a local-global temporal interaction network for unilateral directional motor imagery EEG decoding. Background Technology
[0002] Brain-computer interface (BCI) is a groundbreaking technology that enables direct communication between the brain and external devices by decoding neural activity, without relying on peripheral neuromuscular pathways. Among available neural recording modalities, electroencephalography (EEG) has attracted widespread attention due to its non-invasiveness, low cost, portability, and high temporal resolution. In EEG-based BCI, the motor imagery (MI) paradigm shows great potential for rehabilitation and neuroprosthetic control, particularly in patients with movement disorders.
[0003] Traditionally, MI-BCI systems have primarily utilized multi-limb MI tasks (e.g., left hand, right hand, foot) to maximize the separability of neural responses. However, clinical reality shows that many stroke or paralyzed patients often suffer injuries limited to one side of the body. Therefore, MI tasks involving one side of the body are becoming increasingly relevant. Previous studies have shown that EEG signals from the contralateral hemisphere of the injury retain sufficient motion-related information to support decoding. Nevertheless, decoding MI-EEG from one side of the body remains a significant challenge due to high inter-class similarity, overlapping activation regions, and the inherently low signal-to-noise ratio of EEG recordings. Inter-subject variability and the non-stationarity of EEG signals further exacerbate this difficulty, necessitating robust and adaptive decoding algorithms.
[0004] Current deep learning methods in MI-BCI primarily focus on feature extraction tailored to multi-limb tasks. Most algorithms emphasize spatial feature extraction. However, due to the small differences in EEG features associated with unilateral limb tasks and the lack of diverse spatial activations, these methods often struggle to effectively decode tasks involving the same limb. Furthermore, in unilateral limb scenarios, different tasks activate overlapping brain regions.
[0005] While some recent models have begun to incorporate temporal information, most still fail to capture both global temporal dependencies and local dynamic changes simultaneously. This limitation weakens the model's ability to extract fine-grained temporal patterns and long-range dependencies, which are particularly critical for decoding subtle and temporally dispersed motion intentions in unilateral limb MI tasks. Therefore, the lack of fine-grained modeling of complex temporal structures remains a significant challenge in developing effective unilateral limb MI decoding methods.
[0006] Recent datasets for unilateral limb MI tasks have opened up new opportunities for algorithm development. However, due to the unique characteristics of EEG signals associated with unilateral limb tasks, simply fine-tuning existing neural network models is insufficient. There is an urgent need for novel, specially designed decoding models to capture the unique features of these EEG signals and improve decoding accuracy. Summary of the Invention
[0007] To address the aforementioned problems in the existing technology, this invention provides a local-global temporal interaction network for unilateral directional motor imagery EEG decoding, comprising:
[0008] The shallow CNN module is used to extract localized time-frequency representations from the raw EEG signal, and includes temporal convolutional layers and depth spatial convolutional layers.
[0009] The multi-scale temporal feature extraction and compression module extracts complementary features through a parallel four-branch temporal processing path consisting of short temporal convolution kernels, long temporal convolution kernels, average pooling layers, and stride convolutional layers. The outputs of the four branches are concatenated along the feature dimension to form a multi-scale fused feature. The multi-scale fused feature is reduced in dimensionality based on depthwise separable convolution, which compresses the computational load while preserving the discriminative temporal pattern.
[0010] The local-global temporal attention module is used to replace the fixed position encoding in the encoder with learnable position encoding, superimpose random dropout layers, model global temporal dependencies through a multi-head self-attention mechanism, and perform adaptive average pooling on the segment length based on the temporal pyramid pooling module to output multi-scale local features and concatenate them.
[0011] Specifically, the temporal convolutional layer uses a one-dimensional convolutional kernel and performs sliding convolution only in the time dimension, separating neural oscillations of specific frequencies through the weights of the convolutional kernel; the output feature map maintains the original number of channels.
[0012] Specifically, the depth spatial convolutional layer adopts a depth-separable convolutional architecture, where each convolutional kernel acts independently on a single EEG channel, and the number of output channels is equal to the number of input channels. By sliding the convolutional kernel along the channel dimension, the activation patterns of the scalp spatial distribution are learned, and brain region activities related to the MI task are identified. A depth multiplier parameter is introduced to expand the feature mapping dimension of each electrode channel. The spatial distribution relationship of the scalp electrodes is encoded by the convolutional kernel weights, preserving the cortical activation topographic features.
[0013] Specifically, the short-time convolutional kernel is used to detect fast transient neural events, responding to millisecond-level fluctuations in EEG signals; the long-time convolutional layer is used to capture continuous neural oscillation patterns associated with the MI process; the average pooling layer performs windowed average pooling to suppress temporal variation noise; and the stride convolutional layer is used to implement temporal downsampling and abstraction.
[0014] Specifically, the encoder includes a learnable position coding layer, a multi-layer multi-head self-attention mechanism, residual connections, and a feedforward network;
[0015] The learnable position coding layer generates a learnable position coding tensor with the same dimension as the input sequence. By updating the input element by element-wise superposition, it adaptively learns the time-shift characteristics of non-stationary EEG signals.
[0016] The multi-layer multi-head self-attention mechanism is built after the learnable position encoding layer, and captures the complex interdependencies of the input sequence over the entire time span by setting up a multi-head architecture;
[0017] The residual connections and feedforward networks facilitate gradient flow and retain input information, enabling nonlinear transformations and advanced time abstractions.
[0018] The encoder converts a sequence of temporal features into a context-aware embedded representation.
[0019] Specifically, the time pyramid pooling module performs adaptive average pooling based on a preset segment length, extracting features at fine-grained, medium-grained, and coarse-grained levels respectively. The pooled outputs are concatenated into a unified time representation. Before concatenation, the output at each segment level is reshaped into a vector of fixed length and embedded with time information from different levels of abstraction.
[0020] Specifically, the training methods include: using the cross-entropy loss function to optimize model performance; employing the Adam optimizer; implementing a two-stage training strategy, in which the first stage performs early stopping training based on the validation set accuracy to prevent overfitting and identify the optimal training epochs, and in the second stage, retraining on a combination of the training and validation sets to fully utilize the labeled data and maintain model robustness; and configuring all hyperparameters uniformly in the dataset.
[0021] Specifically, the data preprocessing process includes: bandpass filtering the raw EEG signal to remove noise and interference from non-target frequency bands; then downsampling to 250Hz to reduce computational complexity and maintain the signal timing characteristics; using the preprocessed EEG signal as model input to ensure the consistency and standardization of input data; and setting up two evaluation datasets, both using the same preprocessing process.
[0022] Specifically, the validation and evaluation methods include two protocols: intra-subject evaluation and cross-session evaluation. The intra-subject evaluation is performed on data from a single subject to test the model's ability to capture subject-specific discrimination patterns. The cross-session evaluation is performed on data from different sessions to test the model's generalization ability and robustness in non-stationary environments. The evaluation metrics include classification accuracy, and the performance advantage is verified by calculating the significance threshold using the Wilcoxon signed-rank test. A cross-validation strategy is used during the validation process.
[0023] Specifically, the evaluation dataset includes a unilateral limb movement direction task dataset and a multi-directional arm extension task dataset.
[0024] The local-global temporal interaction network for unilateral directional motor imagery EEG decoding of this invention has several significant advantages. First, in terms of feature extraction, the temporal convolutional layers and deep spatial convolutional layers of the shallow CNN module work together to accurately extract localized time-frequency representations from the raw EEG signal. The temporal convolutional layers, through sliding convolution of one-dimensional convolutional kernels in the time dimension, can effectively separate neural oscillations of specific frequencies, while the deep spatial convolutional layers, employing a depth-separable convolutional architecture, can learn activation patterns of scalp spatial distribution and identify brain region activities related to the MI task, providing rich and accurate feature information for subsequent decoding.
[0025] The multi-scale temporal feature extraction and compression module extracts complementary features through parallel four-branch temporal processing paths, then concatenates them into multi-scale fusion features, and then performs dimensionality reduction based on depthwise separable convolution. This preserves the discriminative temporal pattern, reduces the computational load, and improves the model's processing efficiency.
[0026] The local-global temporal attention module is a major highlight of this invention. By replacing fixed-position encoding with learnable positional encoding, it can adaptively learn the temporal shift characteristics of non-stationary EEG signals; the multi-head self-attention mechanism can model global temporal dependencies, and the temporal pyramid pooling module can extract and concatenate features at different granularities, enabling the model to simultaneously capture global temporal dependencies and local dynamic changes. This greatly enhances the model's ability to extract fine-grained temporal patterns and long-range dependencies, playing a crucial role in decoding subtle and temporally dispersed motion intentions in unilateral limb MI tasks.
[0027] In terms of training methods, the cross-entropy loss function and Adam optimizer are used in combination with a two-stage training strategy. The early stopping training in the first stage can prevent overfitting, and the second stage retraining on a combination of training and validation sets can make full use of labeled data and maintain model robustness, ensuring that the model can learn stably and efficiently.
[0028] The data preprocessing process performs bandpass filtering and downsampling on the raw EEG signal, removing noise and interference from non-target frequency bands, reducing computational complexity, maintaining signal timing characteristics, ensuring the consistency and standardization of input data, and laying the foundation for accurate model decoding.
[0029] The validation and evaluation methods employ two protocols: intra-subject evaluation and cross-session evaluation. These protocols test the model's ability to capture subject-specific discrimination patterns and its generalization ability and robustness in non-stationary environments, respectively. The performance advantages are verified through classification accuracy and Wilcoxon signed-rank test, making the model's performance evaluation more comprehensive and scientific.
[0030] In summary, the local-global temporal interaction network for unilateral directional motor imagery EEG decoding of the present invention can effectively solve the problems faced by decoding unilateral limb MI tasks in the prior art, improve decoding accuracy, and provide stronger support for the application of EEG-based brain-computer interface technology in rehabilitation and neuroprosthetic control, etc., and has important practical application value and broad development prospects. Attached Figure Description
[0031] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.
[0032] Figure 1 This is a schematic diagram of the local-global temporal interaction network for unilateral directional motor imagery EEG decoding of the present invention;
[0033] Figure 2 This is a structural block diagram of the multi-scale temporal feature extraction and compression module in this invention;
[0034] Figure 3 This is a schematic diagram of the experimental paradigm for the dataset in this invention. Detailed Implementation
[0035] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.
[0036] Please see Figure 1-2 A local-global temporal interaction network for unilateral directional motor imagery EEG decoding, comprising:
[0037] The shallow CNN module is used to extract localized time-frequency representations from the raw EEG signal, and includes temporal convolutional layers and depth spatial convolutional layers.
[0038] The multi-scale temporal feature extraction and compression module extracts complementary features through a parallel four-branch temporal processing path consisting of short temporal convolution kernels, long temporal convolution kernels, average pooling layers, and stride convolutional layers. The outputs of the four branches are concatenated along the feature dimension to form a multi-scale fused feature. The multi-scale fused feature is reduced in dimensionality based on depthwise separable convolution, which compresses the computational load while preserving the discriminative temporal pattern.
[0039] The local-global temporal attention module is used to replace the fixed position encoding in the encoder with learnable position encoding, superimpose random dropout layers, model global temporal dependencies through a multi-head self-attention mechanism, and perform adaptive average pooling on the segment length based on the temporal pyramid pooling module to output multi-scale local features and concatenate them.
[0040] Specifically, the temporal convolutional layer uses a one-dimensional convolutional kernel and performs sliding convolution only in the time dimension, separating neural oscillations of specific frequencies through the weights of the convolutional kernel; the output feature map maintains the original number of channels.
[0041] Specifically, the depth spatial convolutional layer adopts a depth-separable convolutional architecture, where each convolutional kernel acts independently on a single EEG channel, and the number of output channels is equal to the number of input channels. By sliding the convolutional kernel along the channel dimension, the activation patterns of the scalp spatial distribution are learned, and brain region activities related to the MI task are identified. A depth multiplier parameter is introduced to expand the feature mapping dimension of each electrode channel. The spatial distribution relationship of the scalp electrodes is encoded by the convolutional kernel weights, preserving the cortical activation topographic features.
[0042] Specifically, the short-time convolutional kernel is used to detect fast transient neural events, responding to millisecond-level fluctuations in EEG signals; the long-time convolutional layer is used to capture continuous neural oscillation patterns associated with the MI process; the average pooling layer performs windowed average pooling to suppress temporal variation noise; and the stride convolutional layer is used to implement temporal downsampling and abstraction.
[0043] In this embodiment, local time-frequency features are first extracted by combining temporal convolution and spatial depth convolution to extract a localized time-frequency representation from the raw EEG signal. This initial stage plays a crucial role in capturing specific frequency rhythms (μ and β bands) closely related to the MI process, while preserving the spatial configuration of transelectrode channel cortical activity.
[0044] In the initial stage, a temporal convolutional layer with a kernel that spans only the time dimension is first applied to the input EEG signal. This operation effectively acts as a bandpass filter along the time axis, enabling the model to separate neural oscillations at specific frequencies while maintaining the independence of individual EEG channels by avoiding inter-channel mixing.
[0045] To capture spatial dynamics, depthwise convolutions are then applied along the channel dimension. Unlike standard convolutions, depthwise convolutions allow each filter to operate independently on a single channel, thus maintaining spatial separability and preventing inter-channel interference. This design helps learn channel-specific spatial patterns that are crucial for decoding MI-related neural activities. Furthermore, depth multipliers are introduced to extend the model's ability to learn richer, more discriminative spatial features from each electrode.
[0046] Temporal convolution emphasizes frequency components relevant to the MI task, while depthwise spatial convolution utilizes activation patterns spatially distributed across the scalp. This dual-path design ensures that the extracted features retain both spectral resolution and topographic relevance, laying a solid foundation for subsequent deeper temporal modeling. This combination has proven effective in decoding EEG signals with low signal-to-noise ratios and high inter-trial variability.
[0047] In this embodiment, a timing coding module inspired by the Inception architecture is introduced. For example... Figure 2 As shown, the module comprises four parallel branches, each designed to extract different temporal features: (1) a short temporal filter detects fast, transient neural events, enabling the model to respond to brief fluctuations in the EEG signal; (2) a longer temporal filter captures slower, sustained activity patterns typically associated with the MI process; (3) an average pooling branch enhances robustness to temporal variability by emphasizing temporally consistent features; and (4) a stride convolution branch introduces temporal abstraction through downsampling, facilitating the learning of high-level temporal representations. This multi-branch design enables the model to effectively learn from both fine-grained and coarse-grained temporal features, ensuring a comprehensive representation of the dynamic EEG signal crucial for accurate MI decoding.
[0048] Each branch outputs a temporal feature tensor P. i Their concatenation produces the final Inception output: ;
[0049] This multi-branch structure enables the network to extract complementary temporal information from the output of previous spectral-temporal modules. By fusing short-range, mid-range, and long-range temporal features, the model captures diverse and discriminative temporal representations. This is crucial for differentiating unilateral limb motor imagery (MI) tasks, where temporal dynamics are more significant than spatial differences.
[0050] Specifically, the encoder includes a learnable position coding layer, a multi-layer multi-head self-attention mechanism, residual connections, and a feedforward network;
[0051] The learnable position coding layer generates a learnable position coding tensor with the same dimension as the input sequence. By updating the input element by element-wise superposition, it adaptively learns the time-shift characteristics of non-stationary EEG signals.
[0052] The multi-layer multi-head self-attention mechanism is built after the learnable position encoding layer, and captures the complex interdependencies of the input sequence over the entire time span by setting up a multi-head architecture;
[0053] The residual connections and feedforward networks facilitate gradient flow and retain input information, enabling nonlinear transformations and advanced time abstractions.
[0054] The encoder converts a sequence of temporal features into a context-aware embedded representation.
[0055] In this embodiment, a Transformer encoder (TE) module is designed. Unlike the original Transformer architecture that uses fixed sinusoidal positional encoding, learnable positional encodings (LPE) are employed. This encoding is superimposed on the Transformer encoder before the input sequence enters it. This approach enables the model to adaptively learn temporal positional information based on the characteristics of the MI-EEG signal. Such signals typically exhibit non-stationary patterns and may contain temporal shifts in the expression of motion intent.
[0056] Formally, given the input sequence Introducing a learnable positional encoding And update the input as follows:
[0057] ,
[0058] The encoded representation generated by the LPE module is then further processed through a multi-layer multi-head self-attention (MSA) architecture to establish global temporal dependencies. The MSA mechanism enables the model to simultaneously focus on different temporal locations, capturing complex interdependencies across the entire time span of the input sequence.
[0059] ,
[0060] Where Q,K,V∈ Here, represents the query, key, and value matrices, respectively, and d is the dimension of each attention head. By allowing information to flow freely across all time points, MSA empowers the model to learn high-level temporal dependencies crucial for MI decoding;
[0061] Residual connections stabilize training by facilitating gradient flow and preserving input information, while feedforward networks provide nonlinearity and enable deeper temporal abstraction. Therefore, TE will transform the temporal feature sequence F... seq Transform into a context-aware embedded representation: ;
[0062] The attention mechanism is executed N times to gradually enrich the temporal representation by utilizing global contextual information.
[0063] Specifically, the time pyramid pooling module performs adaptive average pooling based on a preset segment length, extracting features at fine-grained, medium-grained, and coarse-grained levels respectively. The pooled outputs are concatenated into a unified time representation. Before concatenation, the output at each segment level is reshaped into a vector of fixed length and embedded with time information from different levels of abstraction.
[0064] In this embodiment, to further enhance the representation of temporal features, a TPP module is applied after the Transformer encoder (TE) layer. TPP introduces a hierarchical temporal abstraction by applying adaptive average pooling at different scales. Specifically, it performs adaptive average pooling operations at multiple temporal resolutions to extract local features from different scales. While the Transformer is responsible for capturing global dependencies, TPP focuses on extracting localized temporal features across multiple time scales. This dual strategy ensures that both short-term changes and long-term patterns in neural activity are adequately represented.
[0065] The TPP module applies adaptive average pooling operations at multiple time resolutions. Specifically, it uses pooling operations with segment lengths s∈{1,2,4} to extract features at fine-grained, medium-grained, and coarse-grained levels, respectively. The pooled outputs are then concatenated to form a unified temporal representation.
[0066] ,
[0067] Before concatenation, the output of each segment level is flattened to form a fixed-length feature vector. This vector embeds temporal information from different levels of abstraction.
[0068] This hierarchical fusion strategy effectively preserves the multi-scale temporal structure of EEG signals and enhances robustness to inter-subject variability and inter-session fluctuations.
[0069] By combining the global modeling capabilities of the Transformer encoder with the local abstraction capabilities of the TPP, the Local-Global Temporal Attention Module enables the model to learn more expressive and discriminative temporal features, thereby improving classification accuracy in the challenging unilateral motion imagery (MI) decoding task.
[0070] Specifically, the training methods include: using the cross-entropy loss function to optimize model performance; employing the Adam optimizer; implementing a two-stage training strategy, in which the first stage performs early stopping training based on the validation set accuracy to prevent overfitting and identify the optimal training epochs, and in the second stage, retraining on a combination of the training and validation sets to fully utilize the labeled data and maintain model robustness; and configuring all hyperparameters uniformly in the dataset.
[0071] Specifically, the data preprocessing process includes: bandpass filtering the raw EEG signal to remove noise and interference from non-target frequency bands; then downsampling to 250Hz to reduce computational complexity and maintain the signal timing characteristics; using the preprocessed EEG signal as model input to ensure the consistency and standardization of input data; and setting up two evaluation datasets, both using the same preprocessing process.
[0072] Specifically, the validation and evaluation methods include two protocols: intra-subject evaluation and cross-session evaluation. The intra-subject evaluation is performed on data from a single subject to test the model's ability to capture subject-specific discrimination patterns. The cross-session evaluation is performed on data from different sessions to test the model's generalization ability and robustness in non-stationary environments. The evaluation metrics include classification accuracy, and the performance advantage is verified by calculating the significance threshold using the Wilcoxon signed-rank test. A cross-validation strategy is used during the validation process.
[0073] Specifically, the evaluation dataset includes a unilateral limb movement direction task dataset and a multi-directional arm extension task dataset.
[0074] In this embodiment, the focus is on decoding EEG signals related to motor imagery direction associated with unilateral limb movement. The unilateral limb task dataset is a direction of motion (MD) dataset, and the experimental paradigm includes four unilateral limb movement directions: left-right, up-down, upper right-lower left, and upper left-lower right. Each direction contains 100 trials, for a total of 400 trials per subject. EEG signals are recorded through 59 channels at a sampling rate of 1000 Hz. Throughout the experiment, the electrode impedance is kept below 5 kΩ to ensure high-quality signal acquisition.
[0075] In the multi-directional arm extension task dataset, participants were asked to perform a multi-directional arm extension task, starting from the center of their body. The task covered six different directions in three-dimensional space: front, back, left, right, up, and down, such as... Figure 3 As shown in (b). Each direction contains 50 trials, for a total of 300 trials per subject.
[0076] Further ablation experiments were conducted on the aforementioned dataset to explore the specific contributions of each key module. Specifically, the IP (Information Processing Module), TE (Temporal Encoding Module), and TPP (Temporal Feature Aggregation Module) were systematically removed to evaluate their independent impact on classification performance.
[0077] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for constructing a local-global temporal interaction network for unilateral directional motor imagery EEG decoding, characterized in that, include: Unilateral directional motor imagery EEG decoding is performed by constructing a local-global temporal interaction network, wherein the local-global temporal interaction network includes: a shallow CNN module, a multi-scale temporal feature extraction and compression module, a local-global temporal attention module, and a classifier; The shallow CNN module is used to extract localized time-frequency representations from the raw EEG signal. It includes temporal convolutional layers and depth-space convolutional layers. The temporal convolutional layer uses a one-dimensional convolutional kernel and performs sliding convolution only in the time dimension, separating specific frequency neural oscillations through the kernel weights. The output feature map retains the original number of channels. The depth-space convolutional layer adopts a depth-separable convolutional architecture, where each convolutional kernel acts independently on a single EEG channel, and the number of output channels is equal to the number of input channels. By sliding the convolutional kernel in the channel dimension, it learns the activation patterns of the scalp spatial distribution and identifies brain region activities related to the MI task. A depth multiplier parameter is introduced to expand the feature mapping dimension of each electrode channel. The spatial distribution relationship of the scalp electrodes is encoded through the kernel weights, preserving the cortical activation topography features. The multi-scale temporal feature extraction and compression module extracts complementary features through a parallel four-branch temporal processing path consisting of short-time convolutional kernels, long-time convolutional kernels, average pooling layers, and stride convolutional layers. The outputs of the four branches are concatenated along the feature dimension to form a multi-scale fused feature. Dimensionality reduction of the multi-scale fused feature is achieved based on depthwise separable convolution, compressing computation while preserving discriminative temporal patterns. The short-time convolutional kernel is used to detect fast transient neural events, responding to millisecond-level fluctuations in EEG signals. The long-time convolutional layer is used to capture continuous neural oscillation patterns related to the MI process. The average pooling layer performs windowed average pooling to suppress temporal variation noise. The stride convolutional layer is used to achieve temporal downsampling and abstraction. The local-global temporal attention module is used to replace the fixed position encoding in the encoder with a learnable position encoding, superimpose a random dropout layer, model the global temporal dependency through a multi-head self-attention mechanism, perform adaptive average pooling on the segment length based on the temporal pyramid pooling module, and output multi-scale local features and concatenate them. The encoder comprises a learnable positional encoding layer, a multi-layer multi-head self-attention mechanism, residual connections, and a feedforward network. The learnable positional encoding layer generates a learnable positional encoding tensor with the same dimension as the input sequence, and updates the input element-wise to adaptively learn the temporal shift features of the non-stationary EEG signal. The multi-layer multi-head self-attention mechanism is built after the learnable positional encoding layer and captures the complex interdependencies of the input sequence over the entire time span by setting up a multi-head architecture. The residual connections and feedforward network promote gradient flow and preserve input information, realizing nonlinear transformation and high-level temporal abstraction. The encoder converts the temporal feature sequence into a context-aware embedding representation. The time pyramid pooling module performs adaptive average pooling based on a preset segment length, extracting features at fine-grained, medium-grained, and coarse-grained levels respectively. The pooled outputs are concatenated into a unified time representation. Before concatenation, the output at each segment level is reshaped into a fixed-length vector and embedded with time information from different levels of abstraction. The classifier includes a fully connected layer and an output layer; The unified time representation is input into the classifier to obtain the classification result, which corresponds to the direction of motion.
2. The construction method according to claim 1, characterized in that, It also includes training steps, specifically: using the cross-entropy loss function to optimize model performance; employing the Adam optimizer; implementing a two-stage training strategy, the first stage performing early stopping training based on validation set accuracy to prevent overfitting and identify the optimal training epochs, and the second stage retraining on a combination of training and validation sets to fully utilize labeled data and maintain model robustness; all hyperparameters are uniformly configured in the dataset.
3. The construction method according to claim 2, characterized in that, It also includes data preprocessing steps, specifically: bandpass filtering the raw EEG signal to remove noise and non-target frequency band interference; then downsampling to 250Hz to reduce computational complexity and maintain signal timing characteristics; using the preprocessed EEG signal as model input to ensure consistency and standardization of input data; and setting up two evaluation datasets, both using the same preprocessing procedure.
4. The construction method according to claim 3, characterized in that, It also includes validation and evaluation steps, specifically including two protocols: intra-subject evaluation and cross-session evaluation. The intra-subject evaluation is performed on data from a single subject to test the model's ability to capture subject-specific discrimination patterns. The cross-session evaluation is performed on data from different sessions to test the model's generalization ability and robustness in non-stationary environments. The evaluation metrics include classification accuracy, and the performance advantage is verified by calculating the significance threshold using the Wilcoxon signed-rank test. A cross-validation strategy is used during the validation process.
5. The construction method according to claim 4, characterized in that, The evaluation dataset includes a unilateral limb movement direction task dataset and a multi-directional arm extension task dataset.
Citation Information
Patent Citations
Motor imagery electroencephalogram decoding method based on multi-attention bridge structure network
CN119441984A
Gesture recognition method and system based on multi-head attention and spatial-temporal feature fusion
CN119541052A