A hand movement electroencephalogram signal classification method based on deep learning
By improving the EEGNet brain signal classification network and utilizing automatic weighted data balancing and attention mechanisms, the problems of noise interference and data imbalance in brain signal classification are solved, achieving higher classification accuracy and making it suitable for hand and limb rehabilitation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HENAN UNIVERSITY
- Filing Date
- 2022-12-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing convolutional neural networks are susceptible to external noise interference when processing EEG signals, leading to loss of feature information, low signal-to-noise ratio, small amplitude, and affecting classification performance. Furthermore, event-related EEG data is prone to causing dataset imbalance, which affects classification accuracy.
An improved EEGNet brainwave signal classification network is constructed using an automatic weighted data balancing module, an action potential feature extraction convolution module, and an attention mechanism module. The dataset is processed by filtering and artifact removal, and features are extracted and normalized using P-Conv2D and depthwise separable convolution modules. The model training is optimized by combining a loss function.
It improved the accuracy of EEG signal classification, with precision and F1-Score improved by approximately 6.6%, recall improved by approximately 6.3%, and Kappa Score improved by approximately 0.33, achieving more efficient feature signal classification.
Smart Images

Figure CN115956928B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electroencephalogram (EEG) signal processing technology, and in particular to a deep learning-based method for classifying hand movement EEG signals. Background Technology
[0002] Electroencephalogram (EEG) signals are typically acquired using precise electronic instruments, amplified from the scalp, and recorded to capture the spontaneous bioelectrical potentials of the brain. These represent the spontaneous and rhythmic electrical activity of brain cell groups recorded by electrodes, playing a crucial role in recognizing human intentions and actions. EEG data is usually specific to a particular object or event, and both the amplitude of the data and its temporal dimension are affected by various individual differences and different events. Hand movements, as a vital part of human locomotion, enable most daily tasks. Therefore, constructing efficient recognition models for effective feature extraction and accurate classification of hand movement EEG signals can improve our understanding of the role of EEG signals and has significant practical value in numerous fields.
[0003] In recent years, Convolutional Neural Networks (CNNs) have experienced rapid development. They can leverage spatial structural relationships to mine features from multi-channel data at multiple scales for EEG decoding, reducing the number of parameters to be learned and improving the training efficiency of backpropagation algorithms. However, EEG signals have dynamic time-series characteristics, making them susceptible to external noise during acquisition, which can interfere with the acquired signals. The downsampling inherent in CNNs can lead to information loss during feature acquisition. Furthermore, due to the low signal-to-noise ratio and small amplitude of EEG signals, feature loss significantly increases the loss rate, severely impacting the network model's feature extraction and thus affecting signal classification results. Additionally, event-related EEG data is prone to dataset imbalance, which also affects EEG signal classification performance to some extent. Summary of the Invention
[0004] To address the aforementioned shortcomings, this invention provides a deep learning-based method for classifying hand movement EEG signals. This method utilizes an automatic weighted data balancing module, an action potential feature extraction convolution module, and an attention mechanism module to better solve the problem of low EEG signal classification and recognition rates.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A deep learning-based method for classifying hand movement EEG signals includes:
[0007] Step 1: Collect data according to the experimental paradigm of hand movements, construct a dataset of hand movement EEG signals, and filter and remove artifacts from the dataset;
[0008] Step 2: Add an automatic weighted data balancing module, an action potential feature extraction convolution module, and an attention mechanism module to construct an improved EEGNet EEG signal classification network;
[0009] Step 3: Set the hyperparameters and loss function of the EEG signal classification network, and train it using the dataset processed in Step 1 to obtain the EEG signal classification network model;
[0010] Step 4: Use the EEG signal classification network model obtained in Step 3 to classify the EEG signals to be classified, and evaluate the classification results.
[0011] Furthermore, in step 1, the EEG information acquisition electrodes include Cz, CPz, and Pz.
[0012] Furthermore, the automatic weighted data balancing module is specifically used for:
[0013] The input data is adjusted according to the standard of "number of channels × sampling rate", and automatic balancing is performed based on the number of data labels of each type.
[0014] After adding labels to the new samples, they are input together with the original data into the action potential feature extraction convolution module.
[0015] Furthermore, the action potential feature extraction convolution module is specifically used for:
[0016] Obtain the data output by the automatic weighted data balancing module;
[0017] The labeled data is fed into the P-Conv2D convolutional module to obtain single-channel temporal features, and the convolutional kernel is trained. The extracted features are then normalized. The P-Conv2D convolutional module consists of 2D convolutional kernels with a scale of (1, 4 / T), where T is the time scale of the input features.
[0018] A deep convolution is performed, and the learning method is to assign a 1D convolution kernel to each channel according to the number of channels and perform feature extraction separately, followed by a normalization process.
[0019] The relevant features are activated using the ELU function, and the sampling rate is reduced using a pooling layer for Dropout output.
[0020] Furthermore, the attention mechanism module is specifically used for:
[0021] The data output from the action potential feature extraction convolution module is obtained and input into the depthwise separable convolution module;
[0022] The data is input into ECANet for multi-channel spatial feature extraction. After feature learning is completed, the Sigmoid function is used to activate the features and re-batch the features. The batch size is the same as the data scale before input into ECANet.
[0023] The features processed by depthwise separable convolution and ECANet are normalized, and after activating the relevant features using the ELU function, the sampling rate is reduced by pooling layers.
[0024] Furthermore, in step 3, the loss function L for network training is:
[0025]
[0026] Where N represents the total number of samples, y i The label of sample i is represented by 1 for positive and 0 for negative; p i 1-p represents the probability that sample i is predicted to be of the positive class; i This represents the probability that sample i is predicted to be the negative class.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] 1. The method provided by this invention acquires the subject's motor EEG signals to determine the temporal, frequency, and synchronization characteristics of hand EEG signals. It specializes strong features within the single-channel temporal features and discards invalid features and interference. Furthermore, it can superimpose some spatial features in multi-channel stages to better obtain the relationships between features across multiple channels, avoiding the impact of single-channel bias on the overall feature set. This method efficiently utilizes both single-channel temporal features and multi-channel spatial features to improve the accuracy of feature signal classification, meeting the normal accuracy requirements for EEG signal classification.
[0029] 2. Compared with the traditional method, the present invention improves precision and F1-Score by about 6.6%, recall by about 6.3%, and Kappa Score by about 0.33, achieving good improvement results.
[0030] 3. The method provided by this invention can quickly and accurately process the classification and detection of hand movement EEG signals, which has development prospects in the field of human hand and limb rehabilitation. It can be applied to hand and limb rehabilitation systems and can effectively expand the scope of application of rehabilitation systems. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the overall process of a deep learning-based method for classifying hand movement EEG signals according to an embodiment of the present invention;
[0032] Figure 2This invention provides an embodiment of a deep learning-based method for classifying hand movement EEG signals, which includes EEG electrode mapping.
[0033] Figure 3 This is a network structure diagram of a deep learning-based method for classifying hand movement EEG signals according to an embodiment of the present invention.
[0034] Figure 4 This is a schematic diagram of the processing flow of a deep learning-based method for classifying hand movement EEG signals according to an embodiment of the present invention. Detailed Implementation
[0035] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0036] like Figure 1 As shown, a deep learning-based method for classifying hand movement EEG signals includes the following steps:
[0037] Step S1. Collect data according to the experimental paradigm of hand movements, construct a dataset of hand movement EEG signals, and perform preprocessing operations such as filtering and artifact removal on the dataset;
[0038] Step S2. Add an automatic weighted data balancing module, add an action potential feature extraction convolution module, introduce an attention mechanism module, and construct an improved EEGNet EEG signal classification network;
[0039] Step S3. Set the hyperparameters and loss function of the EEG signal classification network, and train it using the dataset described in Step S1 to obtain the EEG signal classification network model.
[0040] Step S4. Use the trained network model as described in Step S3 to classify EEG signals and evaluate the classification results.
[0041] The following is a detailed discussion of each step:
[0042] Furthermore, in step S1, the EEG information acquisition electrodes include Cz, CPz, and Pz, such as... Figure 2 As shown.
[0043] Furthermore, the automatic weighted data balancing module in step S2 is specifically used for:
[0044] 1) Adjust the input data according to the standard of "number of channels × sampling rate". In this embodiment, the label uses 0 to represent non-jump and 1 to represent jump;
[0045] 2) Based on the number of data labels in each category, automatic balancing is performed. This automatic balancing is based on the SMOTE algorithm, and the execution formula is as follows:
[0046]
[0047] Where x new Let x be a new sample and x be an existing sample with random weights (0.1, 0.9). This helps avoid marginalization of the dataset. For another randomly selected sample, x and within the weight range New samples are generated from each class. This ultimately results in a balanced number of samples in each class.
[0048] 3) Change the new sample x new Add labels, labels and generate new samples x new The original data x is the same as the original data x, and is input together with the original data x into the action potential feature extraction convolution module.
[0049] Specifically, in step S2, the network structure diagram based on the improved EEGNet brainwave signal classification network is as follows: Figure 3 As shown.
[0050] Furthermore, the action potential feature extraction convolution module in step S2 is specifically used for:
[0051] 1) Obtain the data output by the automatic weighted data balancing module. In this example, its size is (3, 500);
[0052] 2) The labeled data is fed into the P-Conv2D convolutional module for single-channel temporal feature acquisition, and F1 convolutional kernels are trained. The P-Conv2D module is a convolutional module designed based on EEG signal features. This module mainly consists of 2D convolutional kernels with a scale of (1, 4 / T), where T is the time scale of the input features. This module has a unique feature acquisition method, which can effectively enhance the feature acquisition of EEG signals and reduce the feature loss rate caused by excessively small amplitude. Its feature acquisition formula is as follows:
[0053]
[0054] Among them, X and These refer to the features before and after the input, [P] start ,P end [] refers to the interval where the feature to be enhanced is located, D is the range of values for the feature edge, and T is the time scale of the input feature. If this part covers the part of the feature to be enhanced during convolution processing, this part of the feature is preserved; otherwise, this part of the feature is weakened.
[0055] In this example, the kernel size of the P-Conv2D convolution module is (1, 128), the number of kernels F1 is 8, and the value of D is 25. According to the characteristics of hand jump features, enhanced feature acquisition is performed at sampling positions (150, 200) and (300, 350), and the extracted features are normalized.
[0056] 3) Perform a depthwise convolution on the normalized features. The learning method is to assign D 1D convolution kernels to each channel according to the number of channels and perform feature extraction again. Here, two temporal feature filters are assigned to each channel, i.e., D=2; then perform normalization again.
[0057] 4) Activate relevant features using the ELU function and reduce the sampling rate to one-quarter using a pooling layer of size (1,4) for Dropout output. In this example, the output data scale is (1,125), which is then input into the attention mechanism module for deeper multi-channel spatial feature extraction.
[0058] Furthermore, the attention mechanism module in step S2 is specifically used for:
[0059] 1) Obtain the data output from the action potential feature extraction convolution module and input it into the depthwise separable convolution module. The depthwise separable convolution module is essentially a separable convolution module composed of a depthwise convolution and a (1,1) pointwise convolution. Therefore, the number of convolution kernels F2 here is the product of the number of P-Conv2D convolution kernels F1 in the first layer and the number of convolution kernels D in the depthwise convolution, that is, F2 = F1 × D. In this example, F2 = 16.
[0060] 2) Input the data into ECANet for multi-channel spatial feature extraction. Before input, a separate global 2D pooling process is performed within this module, followed by the training of F² convolutional kernels with a kernel size of [log2C], where C refers to the number of data channels and [x] is the floor function. Since the former training uses 16 convolutional kernels (F²) and 3 channels (C), 16 spatial feature composite convolutional kernels of size (2,2) are needed here for partial spatial feature enhancement. After feature learning, ECANet activates the features using the Sigmoid function and re-batches the features. The batch size is the same as the data scale before inputting into ECANet; in this example, this scale is (1,125).
[0061] 3) The features processed by depthwise separable convolution and ECANet are normalized, and after activating the relevant features using the ELU function, the sampling rate is reduced to one-eighth through a pooling layer of size (1,8). In this example, the output data scale is (1,15).
[0062] Furthermore, the hyperparameters for network training in step S3 include: number of training batches: 300, batch size: 16, and initial learning rate: 0.001. The loss function for network training is:
[0063]
[0064] Where N represents the total number of samples, y i This represents the label of sample i, with 1 for positive class and 0 for negative class, p i Then, it represents the probability that sample i is predicted to be of the positive class, 1-p i This represents the probability that sample i is predicted to be the negative class.
[0065] Since Softmax can map the output probabilities to [0,1] and make the sum of the classification probabilities equal to 1, the loss rate can be calculated and the model evaluated by combining the two in classification tasks. The classification part performs classification tests on all data based on the features extracted by the previous two modules (action potential feature extraction convolution module and attention mechanism module). If the accuracy is improved, the result is replaced with the latest result; otherwise, the previous result is retained.
[0066] Specifically, a flowchart illustrating the processing flow of a deep learning-based method for classifying hand movement EEG signals is shown below. Figure 4 As shown.
[0067] As one possible implementation method, the experimental results of this embodiment are shown in Table 1. The dataset used is the hand movement EEG signal dataset collected and constructed according to the hand movement experimental paradigm in step S1. Table 1 contains the comparison results between the proposed method model and mainstream models:
[0068] Table 1 Comparison of experimental results of different models on the finger autocorrection motion signal dataset
[0069]
[0070] As can be seen from the above, compared with the traditional method, the present invention improves the precision and F1-Score by about 6.6%, the recall rate by about 6.3%, and the Kappa Score by about 0.33, achieving a good improvement effect.
[0071] In summary, the method provided by this invention acquires the subject's motor EEG signals to determine the temporal, frequency, and synchronization characteristics of hand EEG signals. It specializes strong features within the single-channel temporal features and discards invalid features and interference. Furthermore, it can superimpose some spatial features in the multi-channel stage to better obtain the relationships between features across multiple channels, avoiding the impact of single-channel bias on the overall feature set. This method efficiently utilizes both single-channel temporal features and multi-channel spatial features to improve the accuracy of feature signal classification, meeting the normal accuracy requirements for EEG signal classification. The method provided by this invention can quickly and accurately process the classification and detection of hand movement EEG signals, showing promising development prospects in the field of human hand and limb rehabilitation. It can be applied to hand and limb rehabilitation systems, effectively expanding the applicability of rehabilitation systems.
[0072] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A deep learning-based method for classifying hand movement EEG signals, characterized in that, include: Step 1: Collect data according to the experimental paradigm of hand movements, construct a dataset of hand movement EEG signals, and filter and remove artifacts from the dataset; Step 2: Add an automatic weighted data balancing module, an action potential feature extraction convolution module, and an attention mechanism module to construct an improved EEGNet EEG signal classification network; Step 3: Set the hyperparameters and loss function of the EEG signal classification network, and train it using the dataset processed in Step 1 to obtain the EEG signal classification network model; Step 4: Use the EEG signal classification network model obtained in Step 3 to classify the EEG signals to be classified, and evaluate the classification results; The action potential feature extraction convolution module is specifically used for: Obtain the data output by the automatic weighted data balancing module; The labeled data is fed into the P-Conv2D convolutional module to obtain single-channel temporal features, and the convolutional kernel is trained. The extracted features are then normalized. The P-Conv2D convolutional module consists of 2D convolutional kernels with a scale of (1, 4 / T), where T is the time scale of the input features. A deep convolution is performed, and the learning method is to assign a 1D convolution kernel to each channel according to the number of channels and perform feature extraction separately, followed by a normalization process. The relevant features are activated by using the ELU function, and the sampling rate is reduced by using a pooling layer for Dropout output. The P-Conv2D module is represented by the following formula: Among them, X and These refer to the features before and after the input, [P] start ,P end [] refers to the interval where the feature needs to be strengthened, D is the value range of the feature edge, and T is the time scale of the input feature; The attention mechanism module is specifically used for: The data output from the action potential feature extraction convolution module is obtained and input into the depthwise separable convolution module; The data is input into ECANet for multi-channel spatial feature extraction. After feature learning is completed, the Sigmoid function is used to activate the features and re-batch the features. The batch size is the same as the data scale before input into ECANet. The features processed by depthwise separable convolution and ECANet are normalized, and after activating the relevant features using the ELU function, the sampling rate is reduced by pooling layers.
2. The method for classifying hand movement EEG signals based on deep learning according to claim 1, characterized in that, In step 1, the EEG information acquisition electrodes include Cz, CPz, and Pz.
3. The method for classifying hand movement EEG signals based on deep learning according to claim 1, characterized in that, The automatic weighted data balancing module is specifically used for: The input data is adjusted according to the standard of "number of channels × sampling rate", and automatic balancing is performed based on the number of data labels of each type. After adding labels to the new samples, they are input together with the original data into the action potential feature extraction convolution module.
4. The method for classifying hand movement EEG signals based on deep learning according to claim 1, characterized in that, In step 3, the loss function L for network training is: Where N represents the total number of samples, y i The label of sample i is represented by 1 for positive and 0 for negative; p i 1-p represents the probability that sample i is predicted to be of the positive class; i This represents the probability that sample i is predicted to be the negative class.