Motor imagery electroencephalogram signal classification method based on multi-scale feature extraction and adaptive feature fusion

By using the method of fusion of multi-scale feature extraction and adaptive feature in the classification of motor imagination EEG signals, the problems of low signal-to-noise ratio and poor spatial resolution in the prior art are solved, and higher decoding performance and feature extraction capabilities are achieved.

CN119538094APending Publication Date: 2025-02-28CHANGCHUN UNIV

Patent Information

Application Number
CN202411596275.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art has problems such as low signal-to-noise ratio, poor spatial resolution and large individual differences in the classification of motor imagined EEG signals, resulting in limited decoding performance.

Method used

Using a method based on the fusion of multi-scale feature extraction and adaptive feature, multi-scale time domain and spatial features are extracted through the MFE module, combined with the AFF module adaptive selection and fused global and local features, and finally classification is used using the classifier module.

Benefits of technology

It effectively improves the feature extraction and classification performance of motor imaginary EEG signals and improves the feature extraction ability of EEG signals of different subjects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538094A_ABST
    Figure CN119538094A_ABST
Patent Text Reader

Abstract

The invention discloses a motor imagery electroencephalogram signal classification method based on multi-scale feature extraction and adaptive feature fusion, which is called EEG-MAFENet for short, and belongs to the field of brain-computer interfaces. The EEG-MAFENet is provided to promote the development of a motor imagery brain-computer interface and solve the problem of low classification accuracy in the prior art. Firstly, multi-scale time domain information and channel space information of electroencephalogram signals are extracted through a multi-scale feature extraction (MFE) module, and a primary spatial-temporal feature sequence is obtained. Next, the most valuable global and local feature information is adaptively fused through an adaptive feature fusion (AFF) module to obtain an advanced fusion time feature vector; and finally, completing a classification task by a classifier module formed based on a full connection layer. Experiments prove that the classification method provided by the invention can more effectively improve the feature extraction and classification performance of the motor imagery electroencephalogram signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a motor imagery EEG signal classification method based on multi-scale feature extraction and adaptive feature fusion, which can be used for the classification of motor imagery EEG signals and belongs to the field of brain-computer interface. Background Art

[0002] Brain-computer interface technology can convert the brain's thoughts into actual commands to control external devices, realizing a new way of human-computer communication. Non-invasive technologies such as electroencephalography (EEG), magnetoencephalography (MEG), near-infrared spectroscopy (NIRS) and functional magnetic resonance imaging (fMRI) provide a simple way to monitor brain activity without surgical intervention. EEG has been widely used due to its non-invasiveness, easy acquisition and high temporal resolution.

[0003] Among various BCI paradigms, motor imagery (MI) is popular due to its cost-effectiveness and high temporal resolution and is often used in BCI systems. Motor imagery is a mental simulation of movement without actually performing the movement, which can generate EEG patterns similar to actual movements. By decoding these patterns, direct communication between the brain and external devices can be achieved. Due to the low signal-to-noise ratio, poor spatial resolution, and large individual differences of EEG, it poses a major challenge to the development of an efficient EEG-based motor imagery BCI.

[0004] Early studies mainly focused on manually extracting features and completing classification tasks through traditional machine learning algorithms. The feature extraction of EEG signals mainly includes four aspects: time domain, frequency domain, time-frequency domain and spatial domain. For example, in spatial domain feature extraction, methods such as Common Spatial Pattern (CSP) and its variant FilterBank Common Spatial Pattern (FBCSP) have been widely used. In terms of time-frequency feature extraction, different wavelet transform-based methods such as continuous wavelet transform (CWT) and empirical wavelet transform (EWT) have been used to detect dementia, epilepsy and motor imagery classification, and have achieved good performance. After extracting the above features, they can be used as input to the classifier to obtain the decoding results, such as linear discriminant analysis (LDA) and support vector machine (SVM). Although these methods have achieved good performance in the field of MI-EEG classification, traditional machine learning algorithms have high requirements for manual feature design and rely on prior knowledge. They lack the ability to directly extract abstract high-dimensional features from raw data, which to some extent limits the decoding performance of MI-EEG.

[0005] In recent years, the emergence of deep learning algorithms and attention mechanisms has significantly improved the decoding performance of MI-EEG. Compared with traditional machine learning algorithms, deep learning algorithms are data-driven and do not require manual feature extraction. They can automatically extract abstract high-dimensional features directly from the original signal without relying on specific prior knowledge. For example, Schirrmeister et al. proposed a shallow ConvNet composed of temporal and spatial convolutional layers to extract task-related feature information from raw EEG signals. Khademi and Shoeibi et al. combined CNN with LSTM to capture the spatiotemporal features of EEG signals at the same time. Lawhern et al. proposed a compact CNN architecture EEGNet to learn the features of EEG signals, which showed good generalization ability in multiple BCI paradigms. Compared with traditional machine learning methods, the above networks have achieved good performance, but they also have limitations. Among them, the convolution kernel size of CNN is limited, and it can only learn features from the local receptive field, ignoring the long-term dependencies in EEG signal decoding. LSTM has good performance in processing time series data and obtaining time series information, but it cannot perform large-scale data processing. With the introduction of the temporal convolutional network (TCN), it has achieved better performance on various time series data. TCN has a wider receptive field than the classic CNN and avoids the gradient explosion and vanishing problems that may occur in LSTM. It has been applied in the classification of MI-EEG. Musallam et al. obtained the TCNet-Fusion model by using the features of different layers in TCN through feature fusion, and achieved better classification performance. Ingolfsson et al. combined the advantages of EEGNet and TCN to obtain the EEG-TCNet model, which can simultaneously capture the temporal and spatial features of EEG data.

[0006] The attention mechanism has a powerful ability to extract features adaptively, which helps to improve the performance of various learning tasks. For example, Song et al. proposed the EEG convolution transformer (Conformer), which combines the convolution module and the self-attention module to extract the temporal features and global dependencies of EEG signals and complete the decoding of MI-EEG signals. Altaheri et al. proposed an attention-based temporal convolutional network (ATCNet) for MI-EEG-based classification tasks, which achieved good performance. Mao et al. proposed a lightweight multi-dimensional attention network (LMDA-Net), which integrates features of multiple dimensions through channel attention modules and deep attention modules, and improves the classification performance of BCI tasks. Although these methods have achieved certain improvements in decoding performance, these methods fail to fully utilize the multi-scale spatiotemporal characteristics of EEG signals and ignore the adaptive attention selection of global and local features, which is likely to be the reason for the limited improvement in model performance. Summary of the invention

[0007] In view of the defects existing in the prior art, the present invention proposes a motor imagery EEG signal classification method based on multi-scale feature extraction and adaptive feature fusion, which can effectively improve the feature extraction and classification performance of motor imagery EEG signals.

[0008] After research, discussion and repeated practice, the final solution of this method is as follows:

[0009] First, the original EEG data is Z-score standardized and segmented, and then the data set is divided into a training set and a test set. The multi-scale temporal and spatial features of the EEG data are obtained through the MFE module, and then the most valuable global and local features are adaptively selected through the AFF module. Finally, a classifier module composed of fully connected layers is used for classification. The classification results are evaluated by accuracy and Kappa coefficient to verify the effectiveness of the method.

[0010] The specific steps of the technical solution of the present invention are as follows:

[0011] Step 1: Obtain the original EEG signal dataset of motor imagery, i.e., the public datasets: BCIC-IV-2a and BCIC-IV-2b; standardize the original data and then divide it into training set and test set;

[0012] Step 2: extracting multi-scale time domain information and channel space information of the EEG data obtained from step 1 through the MFE module;

[0013] Step 3: Adaptively select and fuse the most valuable global and local features of the time series data obtained in step 2 through the AFF module;

[0014] Step 4: Classify the fused feature vector obtained in step 3 through the classifier module to obtain the final classification result and perform performance evaluation on it.

[0015] Compared with the prior art, the advantages of the present invention are:

[0016] 1. Compared with the existing single-scale network, the multi-scale temporal convolutional network composed of temporal convolution groups can more fully extract the multi-scale time domain information of EEG data, thereby further improving the accuracy of motor imagery EEG signal classification tasks.

[0017] 2. A self-attention sliding temporal convolutional network was designed, which can adaptively select and fuse the most valuable feature information at different scales, thereby enhancing the feature extraction capability of EEG signals of different subjects. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 The overall structural diagram of the present invention is

[0020] Figure 2 Schematic diagram of the MFE module

[0021] Figure 3 Schematic diagram of the ECA module

[0022] Figure 4 AFF module schematic diagram DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0024] The embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0025] Figure 1 It is a schematic diagram of the overall structure of the present invention, which can be divided into the following steps.

[0026] Step 1: Obtain the original EEG signal dataset of motor imagery, and then divide it into a training set and a test set.

[0027] Step 2: Extract the multi-scale time domain features and spatial features of EEG data through the MFE module.

[0028] Step 3: Adaptively select and fuse the most valuable features through the AFF module.

[0029] Step 4: Complete the classification task through the classifier module and perform performance evaluation on the classification results.

[0030] The following is a detailed description of each step:

[0031] Step 1:

[0032] (1) Perform Z-score standardization on the original EEG data, and the calculation formula is as follows:

[0033]

[0034] Among them, z is the standardized output, x is the original EEG data, μ and σ 2 are the mean and variance of the data respectively.

[0035] (2) For the BCIC-IV-2a dataset, the training session is used for model training and the evaluation session is used for model testing. For the BCIC-IV-2b dataset, the data from the first three sessions are used as the training set and the data from the last two sessions are used as the test set.

[0036] (3) The EEG signals were segmented and each segment represented a motor imagery EEG task. Both training and testing used data from a time period of 4.5 seconds from 0.5 seconds before the prompt began to the end of the experiment.

[0037] Step 2:

[0038] The MFE module consists of three convolutional layers: the first layer consists of a temporal convolution group consisting of four two-dimensional convolutions with different kernel sizes, and the sizes of the convolution kernels are set to (1,16), (1,26), (1,40) and (1,64) respectively. The size of the convolution layer remains unchanged in the temporal dimension. The output of the temporal convolution group is connected along the channel dimension of the convolution, and the weight value is adjusted by batch normalization. This layer outputs 16 temporal feature maps as the input of the next layer. The second layer is a channel convolution layer implemented by depthwise convolution, using 32 convolution kernels of size (C,1), where C is the number of EEG channels. Then, the data is reduced in dimension by an average pooling layer of size (1,8). The third convolution layer consists of a two-dimensional convolution of size (1,16), and the number of output feature maps is 32; finally, the sampling rate is further reduced by an average pooling layer of size (1,7). The final output feature size is 32xT z , T z =T / (8*7). The output features can be considered as T z Tokens are embedded sequentially, each with F 2 The output feature is defined as a Token embedding sequence F c , of the following form: in Represents the Token embedding of the i-th extraction. Batch normalization is used between each convolutional layer to accelerate training and improve model performance, and the exponential linear unit is used as the nonlinear activation function. In order to enable the entire network to better capture the characteristics of the input data, an efficient channel attention (ECA) module is introduced between the first and second convolution layers to realize information interaction between channels and capture the mutual dependence between different channels. First, the input feature map is globally averaged pooled to generate a 1×1×C channel aggregation feature. A one-dimensional convolution operation is performed on the generated channel aggregation feature to capture the interaction between channels. The convolution kernel k can be adaptively determined by the nonlinear mapping of the channel dimension C, which can efficiently establish the dependency between different channels. The calculation process is as follows: Where |t| odd Represents the nearest odd number to t, γ and b are used to change the ratio of channels to convolution kernels, and their values ​​are fixed to 2 and 1 respectively. The result obtained by the convolution operation is used to calculate the channel weight through the activation function, and the channel weight is multiplied element by element with the original input feature map to obtain the weighted output feature map.

[0039] Step 3:

[0040] The purpose of the AFF module is to improve the effectiveness and diversity of feature expression by adaptively extracting and fusing features. The essence of the AFF module is a self-attention sliding temporal convolutional network composed of a sliding window, a self-attention mechanism, and a temporal convolutional network. The temporal feature sequence obtained by the MFE module is first divided into multiple sub-windows through a sliding time window, and then the original sequence and each sub-window sequence data are learned through the self-attention mechanism, while adaptively obtaining the most valuable global and local features. Finally, the feature representation obtained by the sliding window and the attention mechanism is used as the input of the temporal convolutional network to further extract the temporal dependency of the features and ensure that the information of the long time series is not lost. The following is a detailed description of each part:

[0041] (1) Sliding Window

[0042] In order to effectively capture the Token sequence F obtained by the MFE module c In order to obtain the local high-level information of the data, this paper proposes a sliding window-based method. By dividing the data sequence into multiple overlapping data blocks, short-term changes can be effectively captured. Assuming that the window size is n and the step size is m, the data of the next window at each sliding is expressed as:

[0043] W k+1 ={E k+m , E k+m+1 , ..., E k+m+n-1}k∈1,2,...,T-n+1 (4)

[0044] Where W k+1represents the data representation of the k+1th sliding window. Experimental verification shows that this method can effectively capture the local feature information in the sequence.

[0045] (2) Multi-head self-attention mechanism

[0046] The attention mechanism mainly consists of two parts: a multi-head attention mechanism and a fully connected feedforward network. In the attention mechanism, X∈R n×d To represent n input sequences (X 1 , X 2 , …, X n )), where d represents the embedding dimension of each element, the attention calculation process can be expressed as:

[0047]

[0048] Where Q, K and V are query matrix, key matrix and value matrix respectively, d k is the dimension of the key vector, is the scaling factor; by defining three learnable weight matrices, each element is encoded according to the global context information to capture the relationship between all n elements. The three weight matrices are: and Project the feature matrix X onto the above weight matrix to obtain the query matrix Q∈XW Q , the bond matrix K∈XW K Sum value matrix V∈XW V The dot product of matrices Q and K can be calculated, and then the weights corresponding to each element in matrix V can be obtained according to the softmax function.

[0049] In essence, the multi-head attention mechanism is a linear transformation after the concatenation of multiple attention calculation results. The calculation process is as follows:

[0050]

[0051] Among them, h represents the number of heads, head i represents the features of the i-th head, is the weight matrix, and Respectively represent the weight matrices when the i-th head Q, K and V are used as input.

[0052] The feedforward network mainly consists of two linear transformations with a ReLU as the activation function. The calculation process can be expressed as:

[0053] FFN(x)=max(0,xW 1 +b 1 )W 2 +b 2(7)

[0054] Among them, W 1 and W 2 represents the weight matrix, max is the maximum value operation, b 2 is the bias term.

[0055] (3) Temporal Convolutional Network

[0056] The temporal convolutional network uses a common network architecture of the temporal convolutional network, which consists of two layers of dilated causal convolution. The size of the receptive field is flexibly controlled by stacking multiple layers of residual blocks. For one-dimensional time series data x belonging to the nth power of R, the dilated convolution operation of its sequence element s is defined as:

[0057]

[0058] Where F represents the dilated convolution operation, k is the convolution kernel size, d is the dilation factor, and s-di represents the past direction. The module adopts a residual connection structure. If the two dimensions are the same, the residual connection operation is performed directly. Otherwise, the input is first transformed in dimension through a convolution layer with a convolution kernel size of (1x1) and then the residual connection operation is performed. Batch normalization is used between layers to accelerate model training, and the nonlinearity of the data is realized through the exponential linear unit activation function. The Dropout technology is used to prevent overfitting.

[0059] Step 4:

[0060] The classifier module uses a fully connected layer to classify the above features. Its output is passed through the softmax function to obtain the predicted probability vector, where the label with the largest probability is the final classification result. The cross entropy loss function commonly used in classification tasks is used to calculate the loss of the entire model framework, and the decoding performance of the model is evaluated by accuracy and Kappa coefficient.

[0061] The data set and experimental results used by the method of the present invention are described as follows:

[0062] 1. Dataset

[0063] The present invention uses two public datasets, BCI Competition IV Dataset 2a and 2b, for experimental verification. The two datasets are introduced in detail as follows.

[0064] The BCI Competition IV-2a dataset consists of EEG data from 9 healthy subjects, recording four motor imagery tasks: left hand (first category), right hand (second category), foot (third category), and tongue (fourth category). The data was collected by 22 Ag / AgCl electrodes at a sampling rate of 250Hz. Each subject was collected twice on different days, once for training and the other for testing. Each session contains 288 EEG experiments, that is, each classification task includes 72 experiments. The motor imagery process lasts for 4 seconds and is filtered between 0.5 and 100Hz.

[0065] BCIC-IV-2b includes EEG data from 9 healthy subjects. The EEG signals were collected by three bipolar electrodes (C3, Cz, and C4) at a sampling rate of 250 Hz and band-pass filtered between 0.5 Hz and 100 Hz. Each subject performed two motor imagery tasks, moving the left hand and moving the right hand. Each subject performed a total of 5 sessions, of which the first two sessions had no feedback (120 trials each), and the last three sessions had feedback (160 trials each).

[0066] The characteristics of motor imagery EEG data vary greatly among different subjects. Therefore, the classification of EEG signals requires calculating the classification accuracy of each subject and taking the average of the classification accuracy of all subjects as the performance indicator of the model.

[0067] 2. Experimental results and discussion

[0068] In order to verify the universality of the method of the present invention and the effectiveness of each module, experimental tests were carried out on the public datasets BCIC-IV-2a and 2b. The experimental results are as follows:

[0069] Table 1: Experimental results on BCIC-IV-2a and 2b datasets

[0070]

[0071] It can be seen from Table 1 that the method of the present invention has achieved good classification accuracy on both data sets.

[0072] Table 2: Ablation results of BCIC-IV-2a and 2b datasets

[0073]

[0074] It can be seen from Table 2 that each unit in the method of the present invention is effective and necessary.

[0075] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A motor imagery EEG signal classification method based on multi-scale feature extraction and adaptive feature fusion, characterized in that: The steps include: Step 1: Obtain the original EEG signal dataset of motor imagery, i.e., the public datasets: BCIC-IV-2a and BCIC-IV-2b; standardize the original data and then divide it into training set and test set; Step 2: extracting multi-scale time domain information and channel space information of the EEG data obtained from step 1 through the MFE module; Step 3: Adaptively select and fuse the most valuable global and local features of the time series data obtained in step 2 through the AFF module; Step 4: Classify the fused feature vector obtained in step 3 through the classifier module to obtain the final classification result and perform performance evaluation on it.

2. The method for classifying motor imagery EEG signals based on multi-scale feature extraction and adaptive feature fusion according to claim 1, characterized in that: Step 1 is as follows: (1) Perform Z-score standardization on the original EEG data, and the calculation formula is as follows: Among them, z is the standardized output, x is the original EEG data, μ and σ 2 are the mean and variance of the data respectively; (2) For the BCIC-IV-2a dataset, the training session is used for model training and the evaluation session is used for model testing; for the BCIC-IV-2b dataset, the data of the first three sessions are used as the training set, and the data of the last two sessions are used as the test set; (3) The EEG signals were segmented and each segment represented a motor imagery EEG task. Both training and testing used data from a time period of 4.5 seconds from 0.5 seconds before the prompt began to the end of the experiment.

3. The method for classifying motor imagery EEG signals based on multi-scale feature extraction and adaptive feature fusion according to claim 1, characterized in that: Step 2 is as follows: The MFE module consists of three convolutional layers: the first layer consists of a temporal convolution group consisting of four two-dimensional convolutions with different kernel sizes, and the sizes of the convolution kernels are set to (1,16), (1,26), (1,40) and (1,64) respectively; the size of the convolution layer remains unchanged in the time dimension, the output of the temporal convolution group is connected along the channel dimension of the convolution, and the weight value is adjusted by batch normalization. This layer outputs 16 temporal feature maps as the input of the next layer; the second layer is a channel convolution layer implemented by depthwise convolution, using 32 convolution kernels of size (C,1), where C is the number of EEG channels; then, the data is reduced in dimension by an average pooling layer of size (1,8); the third convolution layer consists of a two-dimensional convolution of size (1,16), and the number of output feature maps is 32; finally, the sampling rate is further reduced by an average pooling layer of size (1,7); the final output feature size is 32 xT z , T z =T / (8*7); the output feature can be regarded as T z Tokens are embedded sequentially, each Token has F2 features; the output feature is defined as a Token embedding sequence F c , of the following form: in represents the embedding of the ith extracted Token; batch normalization is used between each convolutional layer to accelerate training and improve model performance, and the exponential linear unit is used as the nonlinear activation function; In order to enable the entire network to better capture the characteristics of the input data, an efficient channel attention (ECA) module is introduced between the first and second convolution layers to realize information interaction between channels and capture the mutual dependence between different channels. First, the input feature map is globally averaged pooled to generate a 1×1×C channel aggregation feature. A one-dimensional convolution operation is performed on the generated channel aggregation feature to capture the interaction between channels. The convolution kernel k can be adaptively determined by the nonlinear mapping of the channel dimension C, which can efficiently establish the dependency between different channels. The calculation process is as follows: Where |t| odd Represents the odd number closest to t, γ and b are used to change the ratio of channels to convolution kernels, and their values ​​are fixed at 2 and 1 respectively; the result obtained by the convolution operation is used to calculate the channel weight through the activation function, and the channel weight is multiplied element by element with the original input feature map to obtain the weighted output feature map.

4. The method for classifying motor imagery EEG signals based on multi-scale feature extraction and adaptive feature fusion according to claim 1, characterized in that: Step 3 is as follows: The purpose of the AFF module is to improve the effectiveness and diversity of feature expression by adaptively extracting and fusing features. The essence of the AFF module is a self-attention sliding time convolutional network composed of a sliding window, a self-attention mechanism, and a time convolutional network. The time series feature sequence obtained by the MFE module is first divided into multiple sub-windows through a sliding time window, and then the original sequence and each sub-window sequence data are learned through the self-attention mechanism, while adaptively obtaining the most valuable global and local features. Finally, the feature representation obtained by the sliding window and the attention mechanism is used as the input of the time convolutional network to further extract the temporal dependency of the features and ensure that the information of the long time series is not lost. The following is a detailed description of each part: (1) Sliding Window In order to effectively capture the Token sequence F obtained by the MFE module c In order to obtain the local high-level information, this paper proposes a sliding window-based method; by dividing the data sequence into multiple overlapping data blocks, it can effectively capture short-term changes. Assuming that the window size is n and the step size is m, the data of the next window at each sliding is expressed as: W k+1 ={E k+m ,E k+m+1 ,...,E k+m+n-1 }k∈1,2,...,T-n+1 (4) Where W k+1 represents the data representation of the k+1th sliding window; experimentally verified that this method can effectively capture the local feature information in the sequence; (2) Multi-head self-attention mechanism The attention mechanism mainly consists of two parts: a multi-head attention mechanism and a fully connected feedforward network. In the attention mechanism, X∈R n×d To represent n input sequences (X1, X2, ... X n ), where d represents the embedding dimension of each element, the attention calculation process can be expressed as: Where Q, K and V are query matrix, key matrix and value matrix respectively, d k is the dimension of the key vector, is the scaling factor; by defining three learnable weight matrices, each element is encoded according to the global context information to capture the relationship between all n elements; the three weight matrices are: and Project the feature matrix X onto the above weight matrix to obtain the query matrix Q∈XW Q , the bond matrix K∈XW K Sum value matrix V∈XW V ; According to the matrices Q and K, their dot product can be calculated, and then the weights corresponding to each element in the matrix V can be obtained according to the softmax function; In essence, the multi-head attention mechanism is a linear transformation after the concatenation of multiple attention calculation results. The calculation process is as follows: Among them, h represents the number of heads, head i represents the features of the i-th head, is the weight matrix, and Respectively represent the weight matrices when the i-th head Q, K and V are used as input; The feedforward network mainly consists of two linear transformations with a ReLU as the activation function. The calculation process can be expressed as: FFN(x)=max(0,xW1+b1)W2+b2 (7) Among them, W1 and W2 represent weight matrices, max is the maximum value operation, and b2 is the bias term; (3) Temporal Convolutional Network The temporal convolutional network adopts the general network architecture of the temporal convolutional network, which consists of two layers of dilated causal convolutions. It uses stacked multi-layer residual blocks to flexibly control the size of the receptive field. For one-dimensional time series data x belonging to the nth power of R, the dilated convolution operation of its sequence element s is defined as: Where F represents the dilated convolution operation, k is the convolution kernel size, d is the expansion factor, and s-di represents the past direction; the module adopts a residual connection structure. If the two dimensions are the same, the residual connection operation is performed directly, otherwise the input is first transformed in dimension through a convolution layer with a convolution kernel size of (1x1) and then a residual connection operation is performed; batch normalization is used between layers to accelerate model training, the exponential linear unit activation function is used to realize data nonlinearity, and the Dropout technology is used to prevent overfitting.

5. The method for classifying motor imagery EEG signals based on multi-scale feature extraction and adaptive feature fusion according to claim 1, characterized in that: Step 4 is as follows: The classifier module uses a fully connected layer to classify the above features. Its output is passed through the softmax function to obtain the predicted probability vector, where the label with the largest probability is the final classification result. The cross entropy loss function commonly used in classification tasks is used to calculate the loss of the entire model framework, and the decoding performance of the model is evaluated by accuracy and Kappa coefficient.

Citation Information

Patent Citations

  • Motor imagery electroencephalogram signal classification method based on self-attention mechanism and parallel convolution

    CN116304815A

  • EEG (electroencephalogram)-based motor imagery electroencephalogram classification method, device and equipment and medium

    CN117150346A

  • Motor imagery electroencephalogram signal classification method based on multi-scale convolution and self-attention

    CN118349906A

Cited By

  • Medicine bottle defect automatic detection method and device and storage medium

    CN115240195A

  • Depression assessment system based on brain-computer interface technology

    CN119949834A

  • Online self-adaptive classification method, device and equipment for electroencephalogram signals in AI glasses

    CN120086659A

  • Motor imagery electroencephalogram signal classification method based on multi-scale time sequence fusion

    CN120448959A

  • Method for constructing relation between electroencephalogram data and emotional state through hierarchical feature fusion

    CN120713524A