Motor imagery electroencephalogram classification method based on multi-scale mixed features
Through multi-layer convolutional networks and improved temporal convolutional networks, the multi-scale mixed features of motor imagery EEG signals are extracted, combined with the attention mechanism, to solve the problem of low EEG classification accuracy and achieve higher classification accuracy and Better generalization performance.
Patent Information
- Application Number
- CN202310143512.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-23
Smart Images

Figure HDA0004088406220000013 
Figure HDA0004088406220000014 
Figure HDA0004088406220000012
Abstract
Description
Technical Field
[0001] The present invention relates to a motor imagery EEG classification method based on multi-scale mixed features, belonging to the field of brain-computer interface and pattern recognition. Background Art
[0002] When people perform different motor imagery tasks, they will generate EEG signals with different characteristics. Motor imagery EEG classification is to correctly classify motor imagery tasks based on the relevant characteristics of different EEG signals. It is widely used in the rehabilitation of patients with neurological diseases such as spinal cord injury and cerebral palsy who cannot control their own muscle activities, and has great development potential in the fields of unmanned driving and daily entertainment. However, EEG signals are easily interfered with and unstable, so the accuracy of motor imagery EEG classification is low. How to further improve the accuracy of motor imagery EEG classification is still a great challenge and practical significance.
[0003] At present, the algorithms for classifying motor imagery EEG signals are mainly divided into two categories: one is machine learning methods, and the other is deep learning methods. The machine learning method extracts data features from EEG signals and then uses a classifier for classification processing. Its representative algorithms include: CSP, SBCSP series algorithms; the deep learning method uses network models such as CNN to extract features from different domains of EEG signals, and outputs classification results after multiple training of the model. Its representative algorithms include: EEGNet, CNN+LSTM series algorithms. Based on the deep learning method, the present invention constructs a multi-scale convolutional network (Multi-scale TCNet and Attention Convolutional Network, MTACNet) based on multi-scale mixed features for motor imagery EEG classification. Summary of the invention
[0004] The present invention proposes a motor imagery EEG classification method based on multi-scale mixed features, the purpose of which is to construct a motor imagery EEG classification model MTACNet by preliminarily extracting mixed features containing time domain and spatial domain features in EEG signals, and then further mining the time domain information in the mixed features, and finally realizing four-classification processing.
[0005] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0006] (1) A multi-layer convolutional network is constructed using two-dimensional convolution, channel-by-channel convolution, and point-by-point convolution to extract mixed features of EEG signals containing temporal and spatial features.
[0007] (2) PReLU is selected as the activation function to introduce nonlinear factors.
[0008] (3) The ECANet attention mechanism is embedded in each convolution layer to assign reasonable weights to different channels and improve the utilization rate of the convolutional network.
[0009] (4) After improving the temporal convolutional networks (TCN), a parallel multi-scale time domain feature extraction module composed of it is constructed and connected to a multi-layer convolutional network to further mine the feature information of different time scales.
[0010] (5) The mixed features of two different time scales output by the parallel multi-scale time domain feature extraction module are fused with the original mixed features, and then classified through the fully connected layer. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 Multi-layer convolutional module based on mixed features.
[0012] Figure 2 Improved TCN module.
[0013] Figure 3 Parallel multi-scale time-domain feature extraction module.
[0014] Figure 4 MTACNet network model. DETAILED DESCRIPTION
[0015] The present invention will be further described below in conjunction with the accompanying drawings:
[0016] The MTACNet network model construction method is as follows:
[0017] Starting from the physiological characteristics of EEG signals, the present invention takes the acquisition time of EEG signals and different lead channels as two dimensions, and inputs the EEG signals of a test as a two-dimensional image, thereby extracting the time domain and spatial domain features hidden therein. The structure of the multi-layer convolution module based on mixed features is as follows: Figure 1 As shown in the figure, the module is mainly composed of the following three layers of convolution: the first layer, ordinary two-dimensional convolution (Conv2D), extracts the time domain features in the EEG signal and generates feature maps of multiple channels; the second layer, channel-by-channel convolution (DW Conv2D), extracts the spatial domain features on a single channel while reducing the training parameters; the third layer, composed of two convolutions (PW Conv2D) respectively, after the channel-by-channel convolution further mines the time domain information, through the point-by-point convolution layer operation, the feature information of different channels at the same spatial position can be utilized to fuse the feature maps generated in the previous step in the spatial dimension.
[0018] In order to make the multi-layer convolutional network focus on the channel that it needs to pay most attention to, the present invention adds the ECANet attention mechanism in Layer1, Layer2 and Layer3 respectively. As an improved version of SENet, it removes the fully connected layer in the original SENet, replaces the fully connected layer with 1D convolution, and calculates the adaptive one-dimensional convolution kernel size after the output of each layer of convolution is subjected to global average pooling. The one-dimensional convolution kernel size is used in the one-dimensional convolution to obtain the weight of each channel in the output feature map of each layer of convolution, and finally the normalized weight and the original each layer of convolution output feature map are multiplied channel by channel to obtain the weighted feature map. By embedding the attention mechanism convolutional network, different weights can be reasonably assigned to different channels according to the importance of different channels for the classification results, thereby improving the utilization rate of the convolutional network and improving the classification effect of motor imagery EEG signals. In addition, the module uses the PReLU activation function to introduce nonlinear factors. As an improved version of the ReLU function, the PReLU activation function has a fixed slope in the negative region, which can avoid the problem of the ReLU activation function dying. It can also effectively improve the overfitting problem of the model and make the network converge faster. In addition to the above parts, batch normalization, dropout and pooling operations are introduced after each layer of convolution, making the overall module structure more complete and improving the overall utilization of the model.
[0019] After passing through the multi-layer convolution module, the EEG signal outputs a mixed feature containing time domain and spatial domain features. In order to further mine the time domain information in the mixed feature, the present invention proposes a parallel multi-scale time domain feature extraction module. First, in order to obtain a better classification effect, the TCN network is modified according to the overall network structure and the characteristics of the EEG signal. The TCN network is a network structure for processing time series data, which is mainly composed of three parts: causal convolution, dilated convolution, and residual link. The present invention replaces the ReLU activation function in the TCN network with the more effective ELU activation function, and replaces the weight normalization with a batch normalization process with better accuracy. The improved TCN module is as follows Figure 2 Then, after improving the TCN module, in order to better utilize the time domain information hidden in it and obtain the time domain features of EEG signals at different scales, the present invention designs a parallel multi-scale time domain feature extraction module, as shown in FIG. Figure 3As shown. This module passes the mixed features output by the multi-layer convolution module through two TCN feature combination modules of different time scales. One is composed of two TCN modules with expansion coefficients of 1 and 2 respectively connected in series, and the other is a single TCN module with an expansion coefficient of 1. The convolution kernel size is 4. Through these two different combinations, the time domain features of EEG signals at different time scales can be extracted, thereby further mining the time domain information in the mixed features. At the same time, in order to better utilize the original time domain and spatial domain features in the mixed features, the present invention directly outputs the feature signal after the multi-layer convolution processing as a layer in the parallel processing, and finally performs feature fusion on the three EEG signals containing different features, and outputs a one-dimensional array with a length of 72*T / / 64, which is processed by a fully connected layer for four-category classification.
[0020] The overall MTACNet network structure is as follows: Figure 4 As shown in the figure, the MTACNet overall network model consists of a 5-layer structure. In the first layer, the EEG signal of a motor imagery test is used as the two-dimensional signal input of C*T, where C is the number of EEG leads, that is, the number of channels, and T is the total number of sampling points. 24 C*T feature maps are output through 24 1*32 convolution kernels, and then batch normalization is performed, and the ECA attention mechanism is introduced; in the second layer, the 24 C*T feature maps are convolved channel by channel, and two 22*1 convolution kernels are convolved on each channel to extract spatial features, and then batch normalization is performed, the ECA attention mechanism and PReLU activation function are introduced to output 48 1*T feature maps. In order to remove redundant information and retain relatively important information features, an average pooling process with a convolution kernel of 1*8 is also performed. Finally, by setting dro pout is used to prevent overfitting; in the third layer structure, it consists of a channel-by-channel convolution with a convolution kernel of 1*16 and a point-by-point convolution layer operation, and then similar to the second layer structure, batch normalization processing, introduction of ECA attention mechanism, PReLU activation function processing, average pooling processing with a convolution kernel of 1*8, and dropout are performed in sequence, and finally 48 1*T / / 64 feature maps are output; in the fourth layer structure, the time domain features are further extracted through the parallel multi-scale time domain feature extraction module, and three feature maps of sizes 12*T / / 64, 12*T / / 64, and 48*T / / 64 are output respectively, and then flattened into a one-dimensional array, and finally after splicing, the feature map with a length of 72*T / / 64 is output; the fifth layer structure is a fully connected layer, and four-category processing is performed through the SoftMax function.
[0021] In order to verify the effectiveness of the motor imagery EEG classification based on the MTACNet network proposed in this paper, we conducted a motor imagery four-classification experiment on the public dataset BCI_IV_2a using the MTACNet network. In terms of evaluation indicators, this paper uses the classification accuracy of a single subject, the average classification accuracy Avg, and the standard deviation Std of the overall subject classification results as comparisons, and compares the classification results of the classification models proposed by multiple researchers on the public dataset BCI_IV_2a, as shown in Table 1. The data collected by BCI_IV_2a comes from 9 subjects, and each subject has four different motor imagery tasks, namely left hand, right hand, tongue, and feet. Each subject needs to participate in a total of 576 trials.
[0022] Table 1 Comparison of classification results of different classification models on the BCI_IV_2a dataset
[0023]
[0024] As can be seen from Table 1, although the best performing EEG-Transformer among other classification models has better classification results on individual subjects, it is not well adapted to all subjects, and the classification accuracy on subjects 5 and 6 has dropped significantly. The overall average classification accuracy of MTACNet has increased by 2.68% compared with the former, achieving the highest average classification accuracy. By calculating the standard deviation of the classification accuracy of 9 subjects, the standard deviation of the MTACNet experimental results is also much lower than that of other classification models. It can also be seen that MTACNet has better generalization for different subjects and is more adapted to different subjects. This also shows that MTACNet improves the classification accuracy while ensuring good generalization performance.
[0025] In order to further verify the classification performance of MTACNet, the EEG-Transformer model with the best classification effect on the BCI_IV_2a dataset and MTACNet were selected from the comparison model to perform training and classification tests on four motor imagery tasks on the self-collected dataset SCU_MI_EEG. The results are shown in Table 2. The data collected by SCU_MI_EEG came from 6 subjects in our laboratory. Each subject had four different motor imagery tasks, including left hand, right hand, tongue and feet. Each subject needed to participate in a total of 504 trials.
[0026] Table 2 Comparison of classification results on SCU_MI_EEG
[0027]
[0028] As can be seen from Table 2, compared with the classification results of EEG-Transformer, MTACNet classification results have better classification results for 5 subjects, among which the classification accuracy of subjects 3, 5 and 6 increased by 17.86%, 8.16% and 10.7% respectively, and the overall average classification accuracy increased by 6.89%, and the standard deviation also decreased slightly, which further illustrates that MTACNet has better classification performance and verifies that MTACNet has stronger generalization.
Claims
1. A motor imagery EEG classification method based on multi-scale mixed features, characterized in that The following steps are involved: (1) Two-dimensional convolution, channel-by-channel convolution, and point-by-point convolution are used to construct a multi-layer convolutional network to extract mixed features of EEG signals containing temporal and spatial features; (2) PReLU is selected as the activation function in the multi-layer convolution module in (1) to introduce nonlinear factors, and the ECANet attention mechanism is embedded in each convolution layer to reasonably allocate weights on different channels; (3) After improving the TCN module, a parallel multi-scale time domain feature extraction module is formed by it. After connecting this module to the multi-layer convolution module in (1), the feature information of different time scales is further mined. Then, the mixed features of different time scales are fused with the original mixed features, and then classified through the fully connected layer.
2. The method according to claim 1, characterized in that In step (1), a multi-layer convolutional network is constructed as follows: The multi-layer convolution module is mainly composed of the following three layers of convolution: the first layer, ordinary two-dimensional convolution, extracts the time domain features in the EEG signal and generates feature maps of multiple channels; the second layer, channel-by-channel convolution, extracts the spatial domain features on a single channel while reducing the training parameters; the third layer, composed of two convolutions, channel-by-channel and point-by-point, after further mining the time domain information through the channel-by-channel convolution, can utilize the feature information of different channels at the same spatial position through the point-by-point convolution layer operation, and fuse the feature maps generated in the previous step in the spatial dimension.
3. The method according to claim 1, characterized in that In step (2), PReLU is selected as the activation function on the multi-layer convolutional network built in step (1) and the ECANet attention mechanism is embedded. The specific steps are as follows: The present invention introduces the PReLU activation function after the second and third convolution layers in step (1). As an improved version of the ReLU function, the PReLU activation function has a fixed slope in the negative region, which can avoid the problem of the ReLU activation function dying and effectively improve the overfitting problem of the model, making the network converge faster. Then, the present invention adds the ECANet attention mechanism after the two-dimensional convolution, deep convolution and separable convolution constructed in step (1), and calculates the adaptive one-dimensional convolution kernel size after the output of each convolution layer is globally averaged pooled. The one-dimensional convolution kernel size is used in the one-dimensional convolution to obtain the weight of each channel in the output feature map of each convolution layer, and finally the normalized weight is multiplied by the original output feature map of each convolution layer channel by channel to obtain the weighted feature map.
4. The method according to claim 1, characterized in that In step (3), a parallel multi-scale time-domain feature extraction module is constructed and feature fusion is performed, and then classification processing is performed. The specific steps are as follows: First, in order to obtain better classification effect, the patent of the present invention modifies the TCN network according to the overall network structure and the characteristics of the EEG signal, replaces the ReLU activation function with the ELU activation function with better effect, and replaces the weight normalization with the batch normalization processing with better accuracy; then, after improving the TCN module, the patent of the present invention designs a parallel multi-scale time domain feature extraction module composed of it, which passes the mixed features output by the multi-layer convolution module in step (1) through two TCN time domain feature combination modules of different time scales, thereby realizing the time domain feature extraction of EEG signals at different time scales, and further mining the time domain information in the mixed features; finally, in order to better utilize the original time domain and spatial domain features in the mixed features, the module directly outputs the mixed feature signal processed by the multi-layer convolution module in step (1) as a layer in the parallel processing, and then performs feature fusion on the three layers of EEG signals containing different features, and then performs four-classification processing through the fully connected layer.
Citation Information
Cited By
Electroencephalogram dynamic continuous emotion recognition method, system and equipment based on channel selection
CN119837531A
Sleep detection method and device based on electroencephalogram, program product and electronic equipment
CN122004791A
