EEG Signal Decoding Method, Device, Equipment and Medium Based on Aggregation-Aware Enhanced Convolutional Transformer Network

Through aggregation perception enhanced convolution Transformer network, combined with spatiotemporal convolution, adaptive feature recalibration and sparse information aggregation modules, the shortcomings of multi-scale feature joint modeling in EEG signal decoding are solved, and high-precision decoding of EEG signals are realized.

CN120067843BActive Publication Date: 2025-08-01XIAMEN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510550978.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-01
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

The existing EEG signal decoding methods have shortcomings in the joint modeling of multi-scale spatiotemporal features. Traditional convolutional neural networks cannot effectively capture dynamic relationships across channels and time. Multi-scale convolutional structures lack effective information interaction and recalibration mechanisms, resulting in insufficient feature expression, loss of fine-grained information and imbalance of global local relationships, affecting the decoding accuracy.

Method used

The aggregation-aware enhancement convolutional Transformer network is adopted to extract multi-scale shallow local features through the spatiotemporal convolution module, the adaptive feature recalibration module performs interactive reinforcement learning, the position-aware enhancement module refines features, and the sparse information aggregation Transformer module strengthens long-range dependence and local correlation, and balances local and global correlation.

Benefits of technology

It effectively solves the defects of traditional networks in feature extraction, realizes the fusion of multi-scale feature interaction, improves the depth and breadth of EEG data analysis, and improves the accuracy and robustness of EEG signal decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067843B_ABST
    Figure CN120067843B_ABST
Patent Text Reader

Abstract

EEG signal decoding method, device, equipment and medium based on an aggregation-aware enhanced convolutional Transformer network, relating to the technical field of EEG signal decoding. The EEG signal decoding method includes: S1, obtaining offline data; S2, extracting multi-scale shallow local features according to the EEG data; S3, performing interactive reinforcement learning on the multi-scale shallow local features to obtain multiple recalibrated features; S4, fusing the multiple recalibrated features to obtain a first fused feature; S5, inputting the first fused feature into a position-aware enhancement module to obtain a position-aware enhanced feature; S6, refining the long-range dependence and local association of features to obtain a comprehensive feature representation; S7, inputting the global refined features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction; S8, obtaining real-time data; S9, inputting the real-time data into the pre-trained model to obtain a decoding result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of EEG signal decoding, and in particular to an EEG signal decoding method, apparatus, device and medium based on an aggregated perception enhanced convolutional Transformer network. Background Art

[0002] The rapid development of brain-computer interface technology has placed higher demands on the accuracy and efficiency of EEG signal decoding. As a typical non-stationary, nonlinear physiological signal, EEG signals are characterized by low signal-to-noise ratio, large individual variability, and complex spatiotemporal dynamics. Effectively extracting their spatiotemporal dynamic features is crucial for improving decoding accuracy. In motor imagery tasks, in particular, the characteristic representation of EEG signals must account for both temporal rhythmic changes and spatial cortical activation patterns, posing a significant challenge to the spatiotemporal modeling capabilities of feature extraction methods.

[0003] Current EEG signal decoding methods primarily employ a technical approach that combines traditional feature engineering with deep learning. Traditional methods rely on manually designed time-frequency domain feature extraction, such as wavelet transforms and power spectrum analysis, which are limited by high feature dimensionality and poor generalization capabilities. Deep learning models based on convolutional neural networks capture spatiotemporal features through local receptive fields, but fixed-scale convolution kernels struggle to adapt to the multi-scale characteristics of EEG signals, resulting in the loss of fine-grained features. Some studies have attempted to introduce multi-scale convolutional structures to enhance feature expression capabilities, but the lack of interaction mechanisms between features at each scale makes it difficult to establish effective cross-scale associations. In addition, methods that rely solely on convolutional neural networks face bottlenecks in modeling long-term dependencies. While models using the Transformer architecture can capture global relationships, they neglect the fine-grained characterization of local features, resulting in the loss of important details.

[0004] Existing technologies still have obvious deficiencies in the joint modeling of multi-scale spatiotemporal features. Traditional convolutional neural networks are limited by local receptive fields and cannot effectively capture the dynamic correlations across channels and time in EEG signals. Although multi-scale convolutional structures can extract features of different granularities, the features of each branch lack effective information interaction and recalibration mechanisms, making it difficult to achieve enhanced expression of key features. At the same time, the global modeling method based on the attention mechanism has a contradiction between computational complexity and local feature retention. Excessive attention to global dependencies will weaken the focus on important local features, while simply emphasizing local features will lead to a lack of contextual associations. These problems of insufficient spatiotemporal feature capture, loss of fine-grained information, and imbalance in global and local relationships have seriously restricted the further improvement of EEG signal decoding accuracy. Summary of the Invention

[0005] The present invention provides an EEG signal decoding method, apparatus, device and medium based on an aggregation-aware enhanced convolutional Transformer network to improve at least one of the above technical problems.

[0006] In a first aspect, the present invention provides an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network, which includes steps S1 to S9.

[0007] S1. Obtain the offline data of the EEG signal.

[0008] S2. Extract multi-scale shallow local features through a spatio-temporal convolutional module according to the offline data.

[0009] S3. Perform interactive reinforcement learning on the multi-scale shallow local features through an adaptive feature recalibration module to obtain multiple recalibrated features.

[0010] S4. Fuse the multiple recalibrated features to obtain a first fused feature.

[0011] S5. Input the first fused feature into a position-aware enhancement module to extract deep fine-grained features through parallel enhanced convolutions, and perform adaptive encoding on the deep fine-grained features to obtain position-aware enhanced features.

[0012] S6. Extract long-range dependencies and local correlations through a sparse information aggregation Transformer module to obtain globally refined features.

[0013] S7. Input the globally refined features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction.

[0014] S8. Obtain the real-time data of the EEG signal.

[0015] S9. Input the real-time data into the pre-trained model to obtain the decoding result of the real-time EEG signal.

[0016] As a preferred aspect of the present invention, step S1 specifically includes steps S11 to S15.

[0017] S11. Obtain the stored EEG signal data, eliminate 50Hz power frequency and environmental noise interference, and screen out the EEG signals in the key frequency band of 0.5 - 30Hz.

[0018] S12. Perform segmented cutting on the continuous EEG signals, remove the rest segment data, and only retain the MI segment data.

[0019] S13. Use the mean value of the rest segment data in the first 300 milliseconds of the MI segment data as the baseline, and perform independent baseline correction on each MI segment data to eliminate the potential impact of baseline shift.

[0020] S14. After normalizing the data, remove the artifacts mixed in the EEG signal to obtain the preprocessed EEG data.

[0021] S15. Divide and reconstruct the training data according to the labels, and additionally add random values following a Gaussian distribution to simulate batch data. The newly generated data is shuffled and mixed with the original batch data to obtain the data-augmented EEG data, and then jointly input into the model to learn features.

[0022] As a preferred aspect of the present invention, step S8 specifically includes steps S81 to S83.

[0023] S81. Store the collected real-time EEG data stream through a buffer.

[0024] S82. Extract real-time segment data from the buffer through a sliding time window.

[0025] S83. Preprocess the real-time segment data; wherein, the preprocessing steps of the real-time data are less than those of the offline data by data augmentation processing, and the baseline correction operation is based on the overall mean value of the segment.

[0026] As a preferred aspect of the present invention, the spatio-temporal convolution module is provided with three branches. Each branch is sequentially provided with a temporal convolution layer, a spatial convolution layer, a batch normalization layer, an ELU activation function layer, and an average pooling layer. The temporal convolution layer of the first branch has 16 (1, ) convolutional kernels. The temporal convolution layer of the second branch has 16 (1, ) convolutional kernels. The temporal convolution layer of the third branch has 16 (1, ) convolutional kernels. Fs is the sampling frequency. The spatial convolution layer uses 32 convolutional kernels of size (C, 1), where C is the number of channels. Among them, during model training, a dropout layer is also set.

[0027] As a preferred aspect of the present invention, step S2 specifically includes steps S21 to S22.

[0028] S21. Input the EEG signal into the three branches of the spatio-temporal convolution module respectively to obtain multi-scale shallow local features.

[0029] S22. The three branches of the spatio-temporal convolution module respectively perform convolution operations through a temporal convolution layer and a spatial convolution layer in sequence to extract features, and input the features extracted by the convolution operation into a batch normalization layer, an ELU activation function layer, and an average pooling layer connected in sequence.

[0030] As a preferred aspect of the present invention, step S3 specifically includes step S31 and step S32.

[0031] S31. Feature superposition is performed on the features extracted from each branch of the spatio-temporal convolution module in an interactive connection structure to obtain a plurality of interactive superposition features having the same number as the number of branches of the spatio-temporal convolution module.

[0032] S32. Through a convolutional attention mechanism, the features of the plurality of interactive superposition features along the channel and the space are respectively calculated to obtain a plurality of re-calibrated features.

[0033] As a preferred aspect of the present invention, step S5 specifically includes step S51 to step S54.

[0034] S51. According to the first fusion feature, features are further extracted in the time direction through a parallelly arranged 1x3 convolution and 1x7 convolution respectively. After the extracted features are batch-normalized, feature fusion is performed.

[0035] S52. The features after feature fusion are processed using an ELU activation function and an average pooling layer. Among them, a dropout layer is also provided in the training stage.

[0036] S53. Through skip connection, the features processed by the average pooling layer and the first fusion feature are added together.

[0037] S54. The added features are dimensionally transformed and then adaptively encoded to obtain a position perception enhanced feature.

[0038] As a preferred aspect of the present invention, step S6 specifically includes step S61 to step S64.

[0039] S61. The position perception enhanced feature is divided into blocks through a sliding window to obtain a plurality of blocks.

[0040] S62. The plurality of blocks are respectively averaged, and continuous Tokens within the blocks are averaged and aggregated into a single block representation to obtain aggregated blocks.

[0041] S63. Through a top attention mechanism, the attention scores of each aggregated block are calculated, and k important blocks are selected, and the original Tokens of the important blocks are restored to obtain top attention blocks.

[0042] S64. Combine the aggregated block and the highest attention block through a gating mechanism to obtain the global refined features.

[0043] As a preferred aspect of the present invention, step S7 specifically includes steps S71 to S73.

[0044] S71. Use a flattening layer to perform a flattening and dimensionality reduction operation on the features, converting multi-dimensional features into one-dimensional for feature integration.

[0045] S72. Process the flattened features through two fully connected layers. Among them, a dropout layer is inserted into the two fully connected layers during the training phase.

[0046] S73. Pass the features processed by the fully connected layers through the softmax function to calculate the prediction probability for each category, thereby completing the training of the model and obtaining a pre-trained model that can be used for real-time prediction.

[0047] As a preferred aspect of the present invention, step S9 specifically includes steps S91 to S93.

[0048] S91. At the first prediction, after the buffer accumulates a complete window of data, use the pre-trained model to carry out the prediction.

[0049] S92. For every newly acquired data volume of a sliding distance, use the pre-trained model to perform predictions on the data within this window.

[0050] [[ID=2】4]]S93. Map the prediction result of each time to a control instruction.

[0051] Second aspect, the present invention provides an EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, which includes a signal acquisition module, a spatio-temporal convolution module, a recalibration module, a fusion module, a position perception module, an information aggregation module, and a classifier module.

[0052] An offline data acquisition module for acquiring offline data of EEG signals.

[0053] The spatio-temporal convolution module is used to extract multi-scale shallow local features through the spatio-temporal convolution module according to the offline data.

[0054] The recalibration module is used to perform interactive sharing and enhance key features on the multi-scale shallow local features through an adaptive feature recalibration module to obtain multiple recalibrated features.

[0055] The fusion module is used to fuse the multiple recalibrated features to obtain the first fusion feature.

[0056] A position perception module, which is used to input the first fused feature into a position perception enhancement module to extract deep fine-grained features through parallel enhancement convolutions, and perform adaptive encoding on the deep fine-grained features to obtain position perception enhancement features.

[0057] An information aggregation module, which is used to extract long-range dependencies and local associations through a sparse information aggregation Transformer module to obtain globally refined features.

[0058] A classifier module, which is used to input the globally refined features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction.

[0059] A real-time data acquisition module, which is used to acquire real-time data of EEG signals.

[0060] A real-time decoding module, which is used to input the real-time data into the pre-trained model to obtain the decoding result of the real-time EEG signal.

[0061] In a third aspect, the present invention provides an EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, which is characterized by including a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network as described in any paragraph of the first aspect.

[0062] In a fourth aspect, the present invention provides a computer-readable storage medium, which is characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network as described in any paragraph of the first aspect.

[0063] By adopting the above technical solutions, the present invention can achieve the following technical effects:

[0064] The EEG signal decoding method based on the aggregation-aware enhanced convolutional Transformer network of the present invention performs excellently in the EEG classification and recognition task, and effectively solves some defects of traditional networks in feature extraction. The network is a fusion network structure with multi-scale feature interaction, and gradually refines features in a hierarchical manner. The spatio-temporal convolution and the adaptive feature recalibration module capture roughly coarse-grained features for the network, refine the features through the position perception enhancement module, and input position encoding information to strengthen the internal connection between features. The sparse information aggregation Transformer module strengthens long-range dependencies and local associations, balances local and global correlations, and comprehensively improves the depth and breadth of EEG data analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] To more clearly illustrate the technical solutions of the present invention, the drawings required for the specific embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some specific embodiments of the present invention, and therefore should not be regarded as a limitation of the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0066] Figure 1 is a flowchart of the EEG signal decoding method.

[0067] Figure 2 is the overall network architecture diagram of the EEG signal decoding method.

[0068] Figure 3 is a flowchart of EEG signal preprocessing.

[0069] Figure 4 is a structural diagram of a single branch of the spatio-temporal convolution module.

[0070] Figure 5 is a structural diagram of the position-aware enhancement module.

[0071] Figure 6 is a structural diagram of the sparse information aggregation Transformer.

[0072] Figure 7 is a flowchart of real-time data processing.

[0073] Figure 8 is a logic diagram of real-time data processing. SPECIFIC EMBODIMENTS

[0074] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0075] Embodiment 1. Please refer to Figures 1 to 8, the first embodiment of the present invention provides an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network (hereinafter referred to as: APCformer), which can be executed by an EEG signal decoding device (hereinafter referred to as: decoding device). In particular, it is executed by one or more processors in the decoding device. It can be understood that the decoding device can be an electronic device with computing performance such as a portable notebook computer, a desktop computer, a server, a smart phone, or a tablet computer.

[0076] EEG represents electroencephalogram, and EEG signal is an electroencephalogram signal. In the exploration of deep learning methods for EEG data analysis, there is a challenge of how to effectively decode spatio-temporal dynamic information. Therefore, the analysis model needs to have the ability of accurate multi-domain feature joint learning and powerful sequence processing ability. For this reason, the present invention proposes a new EEG decoding network: APCformer. The overall architecture of the network is as Figure 2 shown. The network mainly includes five parts: a spatio-temporal convolutional module, an adaptive feature recalibration module (hereinafter referred to as: AFR), a position-aware enhancement module (hereinafter referred to as: PAE), a sparse information aggregation Transformer module (hereinafter referred to as: SAT), and a classifier module.

[0077] A brief description of the EEG signal decoding method based on the aggregation-aware enhanced convolutional Transformer network of the present invention is as follows: Set the preprocessed EEG data as , where is a real number, C represents the number of EEG channels, and T represents the number of sampling points along the time dimension. Input the spatio-temporal convolutional module with a batch size of N = 32 to extract multi-scale shallow local features, then focus on key spatio-temporal features through the AFR module, input the fused features into the PAE module to extract deep fine-grained features and perform adaptive encoding on the features, and then refine the features through the SAT module to further extract long-range dependencies and local associations, realizing the effective aggregation of local features and global features. Finally, the classifier outputs the classification result. Through the previous steps, the model is trained to obtain a pre-trained model that can be used for real-time prediction. Then, a sliding window is used to extract real-time data streams for real-time preprocessing, and the data is predicted through the pre-trained model to obtain the final prediction result and map it to an instruction.

[0078] Table 1 APCformer network architecture parameters

[0079]

[0080] In Table 1, N is the number of batch samples. C is the number of channels. T is the number of sampling points. F1 and F2 respectively represent the number of filters in the corresponding convolutional layers. F1 = 16, F2 = 32. Fs is the sampling frequency. axis is the dimension to which the normalization operation is applied. ELU represents the activation function used for convolution. Softmax represents the activation function used for classification.

[0081] S1. Obtain the offline data of the EEG signal.

[0082] In this embodiment, step S1 is the preprocessing of the offline data before the training phase. Specifically, it includes: data filtering, segmentation cutting, independent baseline correction, data normalization, artifact removal, and data augmentation. Among them, data augmentation includes segmentation reconstruction and adding Gaussian noise.

[0083] Specifically, first, eliminate the 50Hz power frequency and environmental noise interference, and screen out the EEG signals in the key frequency band of 0.5 - 30Hz as the basis for subsequent analysis. Then, perform segmentation cutting on the continuous EEG signals, only retain the MI segment data closely related to the task, and splice these segments. Among them, MI represents Motor Imagery, and the MI segment data is the motor imagery segment data obtained after segmentation cutting of the EEG signal.

[0084] In order to further improve the signal quality, according to the time characteristics of human response to stimuli, select the mean value of the data in the 300 - millisecond rest period before the start of each MI segment as the baseline, and then perform independent baseline correction on each MI segment to eliminate the potential impact of baseline shift. Subsequently, use Z - score normalization to remove the artifacts that are often confused with the EEG signal.

[0085] Since small - sample EEG data is prone to causing model overfitting, the present invention performs data augmentation on the training data. Specifically, in each batch training process, randomly select samples by category, evenly divide these samples into multiple segments, and randomly select one segment from each sample to form new data, but the time - order principle needs to be followed during combination. Then, data augmentation is achieved by adding random values following the Gaussian distribution to the new data, so as to improve the robustness and generalization ability of the model. Finally, add the new data to the original training data and shuffle the order to jointly complete the training.

[0086] Data augmentation is applied before the model trains and learns each batch of data. The batch size of the model is set to 32. After introducing the data augmentation technique, the system will perform augmentation processing on a batch of input data before the model starts learning data features. Specifically, the system will segment and reconstruct the batch data according to the data labels and generate simulated data by adding Gaussian noise. These newly generated data will be mixed with the original batch data and randomly shuffled, thus doubling the data volume. Finally, the processed batch data will be jointly input into the model to learn features.

[0087] S2. Extract multi-scale shallow local features through a spatio-temporal convolution module according to the offline data.

[0088] In order to enable the model to no longer be limited to a single convolution perception range, but to be able to flexibly process feature information of different scales and levels, the present invention uses multi-scale spatio-temporal convolution to extract local features of EEG data, enhancing the model's feature recognition ability without increasing the network depth.

[0089] The first core component of the network structure of the EEG signal decoding method based on the aggregation-aware enhanced convolutional Transformer network of the present invention is a spatio-temporal convolution module based on the CNN architecture. As Figure 2 shown, the spatio-temporal convolution module is provided with three branches. The structure of each branch is as Figure 4 shown, and each is sequentially provided with a temporal convolution layer, a spatial convolution layer, a batch normalization layer, an ELU activation function layer, an average pooling layer, and a dropout layer.

[0090] Specifically, in the spatio-temporal convolution module, the structural composition of each branch is roughly the same, and a double-layer convolution is used as a shallow feature encoder. However, the temporal convolution of the first layer is different in design, and 16 different-scale large convolution kernels are respectively set, specifically (1, ), (1, ), and (1, ). The purpose is to obtain richer time-dimensional features through convolution kernels with different receptive fields. The spatial convolution of the second layer uses 32 convolution kernels of size (C, 1), and the size of this convolution kernel is consistent with the device sampling channel number, which helps to process the spatial features of the data. After the convolution operation is completed, batch normalization is connected to alleviate the problem of covariate shift. Then, the nonlinear expression ability of the model is enhanced through the ELU activation function. Subsequently, the feature dimension is reduced through an average pooling layer of size (1, 75) to reduce redundant features. During model training, the dropout technique is used to accelerate convergence to reduce the risk of overfitting, and finally more representative shallow spatio-temporal features are obtained.

[0091] S3. Through the adaptive feature recalibration module, interactively share the multi-scale shallow local features and enhance the key features to obtain multiple recalibrated features.

[0092] Step S3 specifically includes Step S31 and Step S32.

[0093] S31. Stack the features extracted by each branch of the spatio-temporal convolution module in an interactive connection structure to obtain multiple interactive stacked features with the same number as the number of branches of the spatio-temporal convolution module.

[0094] S32. Through the convolutional attention mechanism, calculate the features of multiple interactive stacked features along the channels and space respectively to obtain multiple recalibrated features.

[0095] Specifically, the present invention creates an adaptive feature recalibration module (abbreviation: AFR, Adaptive feature recalibration), re-identifies and calibrates the learned spatio-temporal features to emphasize the key partial features, improve the sensitivity of the model to important information, and improve the accuracy of the decoding task for small data sets.

[0096] The adaptive feature recalibration module first realizes the sharing of feature information between branches in an interactive connection structure. After the interaction of the features of each branch, a convolutional attention mechanism is introduced to strengthen the learning of key features with its excellent precise focusing ability.

[0097] S4. Effectively fuse the features passing through the adaptive feature recalibration module in each branch to obtain a more comprehensive feature representation.

[0098] The fusion model is as follows:

[0099] .

[0100] In the formula, is the fusion feature of the branch network, represents the feature splicing operation, respectively represent the features output by the first branch, the second branch, and the third branch.

[0101] S5. Input the first fusion feature into the position-aware enhancement module (abbreviation: PAE, Position aware enhancement) to extract deep fine-grained features through parallel enhanced convolutions, and perform adaptive encoding on the deep fine-grained features to obtain position-aware enhanced features.

[0102] In previous networks, there was a problem of loss of fine-grained information in the spatial and temporal dimensions. The present invention proposes a Position Awareness Enhancement Module (PAE), which can take into account both fine-grained and coarse-grained information, enhance the feature learning ability of the APCformer network, and enable subsequent SAT to optimize global and local features based on richer and more relevant features. The position awareness enhancement module designs a structure of parallel small convolution kernels, which helps to capture fine-grained local features by reducing the receptive field of the convolution kernel. Its structure is as Figure 5 shown. The first fused feature is transmitted into the PAE module to extract deep-level fine-grained EEG features.

[0103] The position awareness enhancement module is as Figure 5 shown. After the features pass through parallel enhancement convolutions, the dimensions of the features are transformed, and position encoding information is added to the sequence.

[0104] Specifically, step S5 specifically includes steps S51 to S54.

[0105] S51. According to the first fused feature, features are further extracted in the time direction through a 1x3 convolution and a 1x7 convolution set in parallel, and the extracted features are processed by batch normalization and then feature fusion is performed.

[0106] S52. The features after feature fusion are processed using an ELU activation function and an average pooling layer. Among them, a dropout layer is also set in the training phase.

[0107] S53. Through skip connection, the features processed by the average pooling layer and the first fused feature are added together.

[0108] S54. The added features are dimensionally transformed and then adaptively encoded to obtain position awareness enhanced features.

[0109] Specifically, the input first fused feature further extracts features in the time direction through 32 convolution kernels with sizes of (1, 3) and (1, 7) respectively arranged in parallel, the features obtained from the two convolutions are batch-normalized, and then feature fusion is performed to enrich the extracted information.

[0110] Subsequently, the ELU activation function is used as the activation layer, and the model is optimized through an average pooling layer of size (1, 3) and a Dropout layer. To address the problem of insufficient adaptability of EEG signals in deep networks, skip connections are added, which can reduce the risk of model overfitting and improve the stability of the model to a certain extent. Then, the feature dimension is linearly transformed, and a learnable positional encoder (PE) is added. A trainable matrix of the same size as the input feature dimension is set and randomly initialized. The parameters of the positional encoder will be continuously updated during network training to autonomously discover the association patterns between different positions, enabling the network to perceive the position information of each feature.

[0111] S6. Refine the position-aware enhanced features through a sparse information aggregation Transformer module to further extract long-range dependencies and local correlations, effectively aggregate local features and global features, and obtain globally refined features. Preferably, step S6 specifically includes steps S61 to S64.

[0112] It can be understood that EEG signals often have cross-period correlations in the time series, making it difficult to effectively capture the long-term dependencies in EEG signals, which is extremely crucial for accurate decoding. Transformer demonstrates excellent characteristics when processing sequence data, enabling each element in the sequence to pay attention to all other elements, thereby accurately capturing long-term dependencies.

[0113] Although convolution has unique advantages, it mainly focuses on local information and has obvious deficiencies in dealing with global correlations. A simple fusion Transformer architecture can obtain long-range dependencies but will ignore the local fine-grained features in the time order.

[0114] Therefore, the present invention designs a sparse information aggregation Transformer module (abbreviation: SAT, Sparse Information Aggregation Transformer) to break the bottleneck that traditional networks have difficulty in simultaneously considering global and local features when processing EEG signals. At the same time, the idea of sparse attention is introduced to accelerate the efficiency of processing large-scale and high-dimensional EEG data, so as to efficiently capture all relationships within the sequence. Through SAT, the complex relationships and dependencies between features are fully explored to further improve the performance of the model.

[0115] Such as Figure 6 The SAT structure shown includes: a sliding window, an aggregation attention, a top attention, and a gating mechanism.

[0116] S61. Divide the position-aware enhanced features into blocks through a sliding window.

[0117] Specifically, is the feature sequence input to SAT , and are the first feature, the second feature, and the th feature respectively.

[0118] The sliding window divides the input sequence into blocks, and then processes these blocks. Each block can be regarded as a local area, and finally these local information will be integrated into global features through the attention mechanism.

[0119] Specifically, the present invention uses a sliding window with a fixed length of , divides the input feature sequence of length n into m blocks, and sets the sliding interval between adjacent blocks to , and can divide out non-overlapping blocks. Among them, . In this way, each block contains consecutive Tokens, and a total of Tokens will be generated, which is greater than n.

[0120] Because the present invention sets a sliding interval instead of directly dividing the entire sequence into multiple blocks, compared with before dividing the blocks, the computational amount is increased, but doing so can supplement the connection between blocks to a certain extent, and the degree of information overlap between blocks can be adjusted by controlling the sliding interval, that is, controlling the sparsity ratio , while maintaining the independence of local features, enhancing the global context association, making the entire network more flexible.

[0121] S62. Average each of the multiple blocks, perform an average operation on the consecutive Tokens within the block to aggregate them into a single block representation, and obtain the aggregated features.

[0122] In the initial stage of aggregated attention, considering from a global perspective, the concept of sparse attention is introduced to quickly capture the global pattern of the sequence. It is not necessary for each position in the sequence to perform attention calculation with all other positions. Instead, each of the m divided blocks is averaged, and the consecutive Tokens within the block are averaged to aggregate them into a single block representation to achieve feature capture of the global pattern.

[0123] Unfold the Tokens within all blocks side by side in order. The position information of the first Token in any block can be expressed as , and the position information of any Token within the block can be expressed as . And Respectively represent the key-value pair of the i-th Token in the j-th block, and the corresponding block key and block value vectors are , .

[0124] , Defined as:

[0125] .

[0126] .

[0127] In the formula, Represents the th block, and its value is Represents the serial number of the th Token in the block, and its value is .

[0128] Perform a dot product operation on each query in the sequence with all aggregated block keys to obtain the attention score, and then obtain the weighted sum through the block value . Among them, is the query weight, is the weight of the block key, is the weight of the block value.

[0129] The output of the aggregated attention path can be expressed as:

[0130] .

[0131] In the formula, , represents the position of any Token, and are the sets of block keys and block values , represents transpose, represents the feature vector dimension.

[0132] By aggregating the blocks, the global features of the entire sequence can be obtained, and the computational complexity is reduced from the original to , , significantly improving the processing efficiency of long sequences.

[0133] S63. Through the highest attention mechanism, calculate the attention scores of each aggregated block, select the k important blocks, restore the original Tokens of the important blocks, and obtain the highest attention block.

[0134] Block-based aggregated attention can reduce computational complexity and achieve efficient long-range dependence modeling. However, solely relying on block representations will make it difficult to recover the fine-grained information of the original sequence, and this operation inevitably causes loss of feature information. To balance efficiency and accuracy, the present invention discriminates and selects block information, retaining the key and representative local features therein, thereby achieving efficient long-range dependence modeling without loss of accuracy. For this purpose, the present invention incorporates the top attention mechanism on the basis of aggregated attention, selects the blocks with significant contributions, and constructs a hierarchical attention structure.

[0135] Specifically, the present invention evaluates the importance of the m blocks segmented in the aggregated attention. The evaluation criterion is the attention score obtained by the block, and this criterion can avoid generating new computational overhead without the need for recalculation. Subsequently, the attention scores of all blocks are compared, and the k positions with the largest scores are selected and marked as important, while the remaining positions are marked as unimportant, obtaining the largest k indices, and generating a mask matrix depending on the attention score matrix . Each row corresponds to a query, and each column corresponds to a block. Fill 1 at the selected k index positions, and fill at the remaining positions to make the weights at non-Top-k positions approach 0.

[0136] The attention scores of important blocks are expressed as:

[0137] .

[0138] In the formula, k represents the top k blocks with the highest importance.

[0139] The k important blocks screened out by the mask matrix M restore the s original Tokens in each block and rearrange them in the order of their positions in the original sequence. The Token position corresponding to the th important block is . After unfolding the original Tokens of all k blocks in order, the total number of Tokens is . At this time, the original key-value pairs are restored to and .

[0140] The restored key-value pairs will perform attention calculation with the query vector , which is expressed as:

[0141] .

[0142] In the formula, and are the restored keys Sum value set of is the restored key of the i-th Token in the j-th important block, is the restored value of the i-th Token in the j-th important block.

[0143] The highest attention completes feature refinement by screening important blocks and selecting strongly relevant features. It only calculates for a few Tokens within the important blocks, and the computational complexity of this step is much smaller than that of the original input sequence. While maintaining the computational complexity, through the sparse selection of k << m, the complexity is further optimized to , which can significantly reduce computational redundancy while retaining key fine-grained features.

[0144] S64. Combine the aggregated block and the highest attention block through a gating mechanism to obtain the global refined features.

[0145] Specifically, the present invention creates a learnable gating mechanism on the pathways of aggregated attention and highest attention, and combines them through the information gate of the sigmoid activation function to dynamically adjust the information flow. This mechanism can learn and identify the importance of each pathway in the data, map the value to the range of 0 to 1, and adaptively determine the amount of information passing through.

[0146] The final output of SAT is composed of the results of aggregated attention and highest attention, expressed as:

[0147] .

[0148] .

[0149] In the formula, is the output aggregated feature, is the sigmoid activation function, represents the output of aggregated attention, is the output of the highest attention.

[0150] Through the calculation of their weights, local and global perception of EEG information is achieved. The hierarchical attention mechanism captures global patterns through aggregated attention and restores key local details through the highest attention, achieving a balance between computational efficiency and feature integrity. By adjusting the sparse ratio r and the selection coefficient k, the computational amount and feature granularity of the model can be flexibly controlled, which is especially suitable for processing high-dimensional time-series EEG signals.

[0151] S7. Input the global refined features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction.

[0152] The classifier module receives the features processed by SAT, flattens and reduces the dimensionality of the features using a flattening layer, converts the multi-dimensional features into one-dimensional for feature integration. Subsequently, it is processed through two fully connected layers, and a dropout layer is inserted in between to reduce the risk of overfitting. Then these features are passed through the softmax function to calculate the predicted probabilities for each class, thus completing the training of the model and obtaining a pre-trained model that can be used for real-time prediction.

[0153] The model is trained through steps S1 to S7, and a pre-trained model that can be used for real-time prediction is obtained. In this embodiment, the classifier is trained using the cross-entropy loss function, which can quantify the difference between the model's predicted probability distribution and the true labels, and minimize this difference through the optimization process.

[0154] S8. Obtain the real-time data of the EEG signal. In this embodiment, the real-time data needs to be preprocessed. In this embodiment, step S8 is the preprocessing of the real-time data before the prediction stage. Step S8 specifically includes steps S81 to S83.

[0155] S81. Store the collected real-time EEG data stream through a buffer.

[0156] S82. Extract real-time segment data from the buffer through a sliding time window.

[0157] S83. Preprocess the real-time segment data; wherein, the preprocessing steps of the real-time data have one less data augmentation process than the preprocessing steps of the offline data, and the baseline correction operation is based on the overall mean of the segment.

[0158] Specifically, the real-time EEG signal is obtained through the real-time data stream, and data is extracted through a sliding time window for preprocessing to obtain the preprocessed EEG signal. The goal of real-time EEG signal processing is to achieve precise control of external devices through a brain-computer interface. Different from the preprocessing in the offline training stage, the real-time process completely relies on the brain's active imagination, without visual or auditory cues, and the whole process continuously performs imagination stimulation, without rest segment data. Therefore, in real-time preprocessing, there is no need to perform the segmentation operation of the stimulation interval, and the baseline correction is also adjusted from being based on the mean of the first 300 ms rest segment data of the segment to being based on the overall mean of the segment. In addition, the real-time preprocessing stage does not involve data augmentation operations, and the order of the remaining steps is the same as that of the preprocessing steps in the offline training stage.

[0159] Specifically, as Figure 7 and Figure 8As shown in the figure, the present invention sets up a buffer for the real-time data stream to store all the collected real-time data. The sampling frequency of the device is 256Hz. A sliding time window with a size of 1024 sampling points is set in the buffer, and the window sliding distance is 256 sampling points. Fragment data is extracted from the buffer by means of the sliding time window for real-time preprocessing. The setting of the buffer ensures the integrity and continuity of the window data during each prediction, and at the same time provides connection support for the access of subsequent data.

[0160] To solve the influence brought by device and data transmission delays, instead of using absolute time as the division basis, a fixed number of sampling points related to the sampling frequency is used as the window positioning flag. The method of selecting data by using a sliding time window has the following advantages: First, by using a fixed number of sampling points as the window division basis, prediction errors caused by device delays or time drifts can be effectively avoided. Second, the design of the sliding time window can make full use of the continuity of the data, improve the data utilization rate and reduce the system delay. Finally, the gradual update mechanism of the sliding time window can smooth the prediction results, enhance the real-time performance and stability of the system, so as to ensure accurate control of external devices.

[0161] S9. Input the data after real-time preprocessing into the pre-trained model to obtain the decoding result of the real-time EEG signal. Preferably, step S9 specifically includes steps S91 to S93.

[0162] S91. At the first prediction, after the buffer accumulates a complete window of data, use the pre-trained model to carry out the prediction.

[0163] S92. For every newly collected data volume of the sliding distance, use the pre-trained model to predict the data within this window.

[0164] S93. The prediction result of each time will be mapped into a control instruction in real time.

[0165] Specifically, as Figure 7 and Figure 8 shown, the sliding time window will be set according to the window described in step S8. At the first prediction, when a complete window of data has been accumulated in the buffer, the system will perform real-time preprocessing on the window data, and then perform prediction through the pre-trained model obtained in the offline training stage. These window data used for prediction will be retained in the buffer. Then, whenever a data volume of the sliding distance is newly collected, the sliding time window will intercept these new data, and combine the data retained in the buffer after the previous round of prediction to form a new window of data. The system will immediately process the new window data and perform prediction on the preprocessed data within the window through the pre-trained model. Finally, all prediction results will be mapped into control instructions immediately and sent to the target device.

[0166] The present invention provides a new EEG signal decoding network: APCformer, which performs excellently in EEG classification and recognition tasks and effectively solves some defects of traditional networks in feature extraction. This network is a fusion network structure with multi-scale feature interaction, gradually refining features in a hierarchical manner. Spatiotemporal convolution and the adaptive feature recalibration module capture roughly coarse-grained features for the network. The features are refined through the position-aware enhancement module, and position encoding information is input to strengthen the internal connection between features. The sparse information aggregation Transformer module strengthens long-range dependencies and local associations, balances local and global correlations, and comprehensively improves the depth and breadth of EEG data analysis.

[0167] Embodiment 2. The present invention provides an EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, which includes a signal acquisition module, a spatiotemporal convolution module, a recalibration module, a fusion module, a position-aware module, an information aggregation module, and a classifier module.

[0168] The offline data acquisition module is used to acquire offline data of EEG signals.

[0169] The spatiotemporal convolution module is used to extract multi-scale shallow local features through the spatiotemporal convolution module according to the offline data.

[0170] The recalibration module is used to perform interaction sharing and strengthen key features on the multi-scale shallow local features through the adaptive feature recalibration module, and obtain multiple recalibrated features.

[0171] The fusion module is used to fuse multiple recalibrated features to obtain the first fused feature.

[0172] The position-aware module is used to input the first fused feature into the position-aware enhancement module to extract deep fine-grained features through parallel enhanced convolution, and perform adaptive encoding on the deep fine-grained features to obtain position-aware enhanced features.

[0173] The information aggregation module is used to extract long-range dependencies and local associations through the sparse information aggregation Transformer module to obtain globally refined features.

[0174] The classifier module is used to input the globally refined features into the classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction.

[0175] The real-time data acquisition module is used to acquire real-time data of EEG signals;

[0176] The real-time decoding module is used to input the real-time data into the pre-trained model to obtain the decoding result of the real-time EEG signal.

[0177] Embodiment 3. The present invention provides an EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, which is characterized by including a processor, a memory, and a computer program stored in the memory. The computer program can be executed by the processor to implement an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network as described in any paragraph of Embodiment 1.

[0178] Embodiment 4. The present invention provides a computer-readable storage medium, which is characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network as described in any paragraph of Embodiment 1.

[0179] In several embodiments provided by the embodiments of the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device and method embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0180] In addition, the functional modules in each embodiment of the present invention can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.

[0181] When the above-mentioned functions are implemented in the form of software function modules 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 the present invention, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks, or optical discs that can store program codes. It should be noted that in the present invention, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0182] The terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The singular forms "a", "the" and "said" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise.

[0183] It should be understood that the term "and / or" used in the present invention is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present invention generally represents an "or" relationship between the associated objects before and after.

[0184] Depending on the context, the word "if" as used herein can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detected (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detected (stated condition or event)" or "in response to detecting (stated condition or event)".

[0185] The "first / second" mentioned in the embodiments is only used to distinguish similar objects and does not represent a specific order for the objects. It can be understood that the "first / second" can be interchanged with a specific order or sequence when permitted. It should be understood that the objects distinguished by the "first / second" can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.

[0186] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network, characterized in that, Including: Obtaining offline data of EEG signals; Extracting multi-scale shallow local features through a spatio-temporal convolution module according to the offline data; Performing interaction sharing and enhancing key features on the multi-scale shallow local features through an adaptive feature recalibration module to obtain multiple recalibrated features; Fusing the multiple recalibrated features to obtain a first fused feature; Inputting the first fused feature into a position-aware enhancement module to extract deep fine-grained features through parallel enhanced convolutions and performing adaptive encoding on the deep fine-grained features to obtain position-aware enhanced features; Performing fine-grained processing on the position-aware enhanced features through a sparse information aggregation Transformer module to extract long-range dependencies and local correlations to obtain globally fine-grained features; Inputting the globally fine-grained features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction; Obtaining real-time data of EEG signals; Inputting the real-time data into the pre-trained model to obtain the decoding result of the real-time EEG signal; Performing fine-grained processing on the position-aware enhanced features through a sparse information aggregation Transformer module to extract long-range dependencies and local correlations to obtain globally fine-grained features, specifically including: Dividing the position-aware enhanced features into blocks through a sliding window to obtain multiple blocks; Averaging each of the multiple blocks, performing an average operation on consecutive Tokens within the block to aggregate them into a single block representation to obtain aggregated blocks; Calculating the attention scores of each aggregated block through a top attention mechanism, screening out k important blocks, and restoring the original Tokens of the important blocks to obtain top attention blocks; Combining the aggregated blocks and the top attention blocks through a gating mechanism to obtain the globally fine-grained features; Inputting the globally fine-grained features into a classifier to complete the training of the model and obtain a pre-trained model that can be used for real-time prediction, specifically including: Using a flattening layer to perform a flattening and dimensionality reduction operation on the features to convert multi-dimensional features into one-dimensional for feature integration; Processing the flattened features through two fully connected layers; where, a random inactivation layer is inserted into the two fully connected layers during the training phase; Processing the features after passing through the fully connected layers through a softmax function to calculate the prediction probability for each category, thereby completing the training of the model and obtaining a pre-trained model that can be used for real-time prediction; Inputting the pre-processed real-time data into the pre-trained model to obtain the decoding result of the real-time EEG signal, specifically including: During the first prediction, after the buffer accumulates a complete window of data, use the pre-trained model to perform the prediction; For each newly acquired data volume of the sliding distance, use the pre-trained model to perform the prediction on the data within this window; The prediction result of each time is mapped to a control instruction.

2. The EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network according to claim 1, wherein Obtaining offline data of EEG signals, specifically including: Obtaining stored EEG signal data, eliminating 50Hz power frequency and environmental noise interference, and screening out EEG signals in the key frequency band of 0.5 - 30Hz; Performing segmentation and cutting on continuous EEG signals, removing rest segment data, and only retaining MI segment data; Taking the mean of the rest segment data in the first 300 milliseconds of the MI segment data as the baseline, independent baseline correction is performed on each MI segment data to eliminate the potential impact of baseline shift; After normalizing the data, artifacts mixed in the EEG signal are removed to obtain preprocessed EEG data; The training data is divided and reconstructed according to the labels, and random values following a Gaussian distribution are additionally added to simulate batch data. The newly generated data is shuffled and mixed with the original batch data to obtain data-augmented EEG data, and then jointly input into the model to learn features; Obtain real-time data of the EEG signal, specifically including: Storing the collected real-time EEG data stream through a buffer; Extracting real-time segment data from the buffer through a sliding time window; Preprocessing the real-time segment data; among them, the preprocessing steps of the real-time data have one less data augmentation process than the preprocessing steps of the offline data, and the baseline correction operation is based on the overall mean of the segment.

3. The EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network according to claim 1, characterized in that The spatio-temporal convolution module is provided with three branches; each branch is successively provided with a temporal convolution layer, a spatial convolution layer, a batch normalization layer, an ELU activation function layer, and an average pooling layer; the temporal convolution layer of the first branch is 16 (1, ) convolutional kernels; the temporal convolution layer of the second branch is 16 (1, ) convolutional kernels; the temporal convolution layer of the third branch is 16 (1, ) convolutional kernels; Fs is the sampling frequency; the spatial convolution layer uses 32 convolutional kernels of size (C, 1), where C is the number of channels; among them, during model training, a dropout layer is also set to reduce the risk of overfitting; According to the EEG signal, multi-scale shallow local features are extracted through a spatio-temporal convolution module, specifically including: Inputting the EEG signal into three branches of the spatio-temporal convolution module respectively to obtain multi-scale shallow local features; The three branches of the spatio-temporal convolution module respectively perform convolution operations through a temporal convolution layer and a spatial convolution layer in sequence to extract features; and the features extracted by the convolution operation are input into a batch normalization layer, an ELU activation function layer, and an average pooling layer connected in sequence.

4. A method for decoding EEG signals based on an aggregation-aware enhanced convolutional Transformer network according to claim 1, characterized in that, The multi-scale shallow local features are interactively shared and key features are strengthened through an adaptive feature recalibration module to obtain multiple recalibrated features, specifically including: Feature superposition is performed on the features extracted by each branch of the spatio-temporal convolution module with an interactive connection structure to obtain multiple interactive features with the same number as the branches of the spatio-temporal convolution module; Through a convolutional attention mechanism, the features of multiple interactive features along the channel and space are calculated respectively to obtain multiple recalibrated features.

5. A method for decoding EEG signals based on an aggregation-aware enhanced convolutional Transformer network according to claim 1, characterized in that, Input the first fusion feature into a position-aware enhancement module to extract deep fine-grained features through parallel enhancement convolutions, and perform adaptive coding on the deep fine-grained features to obtain position-aware enhancement features, specifically including: According to the first fusion feature, features are further extracted in the time direction through a parallelly set 1x3 convolution and 1x7 convolution respectively, and the extracted features are processed through batch normalization and then feature fusion; The feature-fused features are processed using an ELU activation function and an average pooling layer; among them, a dropout layer is also set in the training stage; Through a skip connection, the features processed by the average pooling layer and the first fusion feature are added together; The added features are subjected to dimension conversion and then adaptive coding to obtain position-aware enhancement features.

6. An EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, which is used to execute an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network according to any one of claims 1 to 5, and is characterized in that, Including: An offline data acquisition module for acquiring offline data of the EEG signal; A spatio-temporal convolution module for extracting multi-scale shallow local features through the spatio-temporal convolution module according to the offline data; A recalibration module for interactively sharing the multi-scale shallow local features and strengthening key features through an adaptive feature recalibration module to obtain multiple recalibrated features; A fusion module, configured to fuse multiple recalibrated features to obtain a first fused feature; A position perception module, configured to input the first fused feature into a position perception enhancement module to extract deep fine-grained features through parallel enhanced convolutions, and perform adaptive encoding on the deep fine-grained features to obtain position perception enhanced features; An information aggregation module, configured to extract long-range dependencies and local correlations through a sparse information aggregation Transformer module to obtain globally refined features; A classifier module, configured to input the globally refined features into a classifier to complete the training of the model, and obtain a pre-trained model that can be used for real-time prediction; A real-time data acquisition module, configured to acquire real-time data of EEG signals; A real-time decoding module, configured to input the real-time data into the pre-trained model to obtain a decoding result of the real-time EEG signal.

7. An EEG signal decoding device based on an aggregation-aware enhanced convolutional Transformer network, characterized in that, It includes a processor, a memory, and a computer program stored in the memory; the computer program can be executed by the processor to implement an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an EEG signal decoding method based on an aggregation-aware enhanced convolutional Transformer network according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Brain activity state recognition method and device, equipment and storage medium

    CN115736948A

  • Electroencephalogram cognitive load assessment method and system based on multi-feature-domain attention network

    CN116584955A