Anti-noise motor imagery electroencephalogram signal classification method and system based on self-adaptive gating weight
Through the lightweight EEG signal classification method of adaptive gating weight adjustment channel weight, the problem of insufficient robustness in the noise environment is solved in the existing technology, and high accuracy and real-time processing capabilities in high noise environments are achieved.
Patent Information
- Application Number
- CN202510547987.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-08
AI Technical Summary
The existing EEG signal classification methods are not robust enough in real noise environments, requiring complex feature engineering and a large number of computing resources, and are not suitable for real-time application scenarios.
The anti-noise motion imaginary EEG signal classification method based on adaptive gating weight is adopted, and the channel weight is dynamically adjusted through the adaptive gating weight module, and combined with the lightweight feature extraction module and classification module, a lightweight EEG signal classification model is constructed.
In high noise environment, the classification accuracy is significantly improved, the calculation complexity and resource requirements are reduced, real-time processing capabilities are achieved, and the noise anti-noise performance and generalization are enhanced.
Smart Images

Figure CN120448914A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electroencephalogram (EEG) signal processing, and in particular relates to a noise-resistant motor imagery EEG signal classification method and system based on adaptive gating weights. Background Art
[0002] Brain-computer interface (BCI) technology, which collects and analyzes brain activity data to establish a direct communication channel between the human brain and external devices, is a key development in human-computer interaction. By collecting, processing, and decoding brain electrical activity, BCI technology converts human thoughts into executable instructions, enabling direct control of external devices. This technology has significant application value in helping people with disabilities regain their ability to care for themselves, for example, by enabling brain-controlled wheelchairs to enhance mobility for those with limited mobility.
[0003] To enhance the detectability and reliability of EEG signals, researchers have developed a variety of experimental paradigms, including P300 event-related potentials, visual steady-state evoked potentials (SSVEPs), and motor imagery. Each paradigm targets different brain cognitive processes and provides users with diverse brain-computer interaction pathways. However, EEG signals have the characteristics of low signal-to-noise ratio and strong non-stationarity, and are extremely susceptible to environmental noise, myoelectric interference, and instrument noise. These problems are particularly significant in actual application environments, resulting in existing brain-computer interface systems facing serious performance degradation when migrating from laboratory environments to real-world scenarios. Especially in noisy environments, how to effectively filter out interfering noise and ensure the accuracy and stability of EEG signal classification has become a key bottleneck restricting the large-scale promotion of applications such as brain-controlled wheelchairs.
[0004] Currently, many methods for processing EEG signals have emerged, such as those based on CSP, CNN, and Transformer. Most EEG signal classification methods primarily use frequency feature extraction and filtering techniques for preprocessing, followed by classification in combination with traditional machine learning algorithms. These methods perform well in low-noise laboratory environments, but lack robustness in real-world noisy environments and often require complex feature engineering and extensive computing resources, making them unsuitable for real-time applications. With the development of deep learning technology, several methods based on deep neural networks have been proposed. However, these methods generally suffer from complex network structures, large number of parameters, and high computational resource requirements, making them difficult to deploy on resource-constrained portable devices.
[0005] Therefore, there is an urgent need for an EEG signal classification method that can efficiently extract EEG signal features in a real-time changing high-noise environment, while having low computational complexity and low resource consumption, to meet the needs of actual application scenarios.
[0006] The present invention provides a noise-resistant motor imagery EEG signal classification method and system based on adaptive gating weights, which can effectively reduce noise interference by dynamically adjusting channel weights by noise levels, and obtain classification results by adopting a lightweight motor imagery EEG signal classification model. While improving the robustness of EEG signal classification, it has good noise resistance, real-time and generalization performance, thereby improving the accuracy of classification. Summary of the Invention
[0007] The purpose of the present invention is to provide a noise-resistant motor imagery EEG signal classification method and system based on adaptive gating weights, so as to solve the problems that the existing EEG signal classification methods proposed in the above background technology are insufficiently robust in real noisy environments, often require complex feature engineering and a large amount of computing resources, and are not suitable for real-time application scenarios.
[0008] To achieve the above objectives, the present invention adopts the following technical solutions:
[0009] In a first aspect, the present invention proposes a noise-resistant motor imagery EEG signal classification method based on adaptive gating weights, comprising the following steps:
[0010] S1. Obtain EEG signals and noise levels;
[0011] S2, preprocessing the EEG signal;
[0012] S3. Constructing a noise-resistant motor imagery EEG signal classification model; the model includes an adaptive gating weight module, a feature extraction module, and a classification module, wherein the adaptive gating weight module is used to dynamically adjust the EEG signal channel weight according to the noise level;
[0013] S4. Training the noise-resistant motor imagery EEG signal classification model to obtain the optimal model parameters;
[0014] S5. Input the preprocessed EEG signal and noise level into the trained noise-resistant motor imagery EEG signal classification model to obtain a classification result.
[0015] Preferably, the preprocessing in S2 is specifically as follows:
[0016] Data preparation: The EEG signal sampling rate was adjusted to 250 Hz, and electrodes were re-referenced and channels were positioned.
[0017] Data processing: The EEG signals were subjected to 0.5 Hz-40 Hz bandpass filtering and independent principal component analysis to remove physiological artifacts of electrooculography and electromyography;
[0018] Data sorting: segment data and remove abnormal segments.
[0019] Preferably, the adaptive gating weight module in S3 includes a Z score calculation unit, a gating network unit and a weighted operation unit;
[0020] The Z-score calculation unit is used to calculate the statistical characteristics of each channel of the EEG signal to obtain a channel significance score;
[0021] The gated network unit is composed of a two-layer fully connected network, and the input is the combined value of the channel significance and the noise level to obtain the weight coefficient;
[0022] The weighted operation unit is used to apply the weight coefficient to the original EEG signal, and multiply the original EEG signal channel by channel to obtain the weighted EEG signal, which is the anti-noise enhanced EEG signal.
[0023] Furthermore, the Z-score calculation unit is specifically as follows:
[0024]
[0025] Among them, x b,c,t is the EEG signal value of the cth channel of the bth sample at time point t; μ b,c is the time series mean of channel c; σ b,c is the time series standard deviation of channel c; T is the total length of the time series; z b,c is the channel significance score; Z b,c is the normalized channel significance score, where z min min b,c z b,c , z max is max b,c z b,c .
[0026] Furthermore, the gated network unit is specifically as follows: calculating a combined value α of the channel significance and the noise level, which is expressed as follows:
[0027] α=Z b,c (1-η)
[0028] Where η is the noise level; Z b,c is the normalized significance score;
[0029] Through two fully connected layer networks, the weight coefficient w is obtained, and the calculation formula is:
[0030] w=σ(W2·ReLU(W1·α+b1)+b2)
[0031] in, is a learnable parameter, σ is the sigmoid function, is the bias vector of the first fully connected layer, with a length of 8; is the bias scalar of the second fully connected layer and is a single-valued parameter.
[0032] Furthermore, the weighted operation unit is specifically as follows:
[0033] y=x⊙w
[0034] Where ⊙ represents channel-by-channel multiplication, x is the original EEG signal, and y is the anti-noise enhanced EEG signal.
[0035] Preferably, the feature extraction module in S3 includes a spectrum feature extraction unit, a spatial feature learning unit, a blueprint convolution unit and a depthwise separable convolution unit;
[0036] The spectrum feature extraction unit extracts spectrum features in the time dimension through a convolutional layer, thereby extracting different frequency features from the EEG signal, such as α, β, and θ waves.
[0037] The spatial feature learning unit uses convolution in the channel dimension to learn the spatial relationship between channels and perform cross-channel spatial feature fusion;
[0038] The blueprint convolution unit fuses local and global features through global pooling and adaptive weighting;
[0039] The depthwise separable convolution unit is used for feature optimization through a combination of depthwise convolution and pointwise convolution.
[0040] Furthermore, the blueprint convolution unit includes a local feature extraction part, a global context extraction part and a feature fusion part;
[0041] First, local feature extraction is performed using convolution operations to extract local features;
[0042] Then, global context extraction is performed, global information is captured through global average pooling, and channel attention weights are generated through a fully connected layer, including a dimensionality reduction layer and a dimensionality increase layer. The dimensionality reduction layer reduces the number of channels to 1 / 4 of the original number, and the dimensionality increase layer restores the original number of channels.
[0043] Finally, feature fusion is performed, multiplying the local features with the global channel attention weight to achieve the fusion of local and global information;
[0044] The process of global context extraction and feature fusion is as follows:
[0045] First, the input features are globally averaged pooled to obtain a global representation:
[0046] F global =GlobalAvgPool(F in )
[0047] Then, the dimensionality reduction operation is performed through the weight matrix to compress the feature representation:
[0048] F down =W down ·F global (Dimensionality reduction to 1 / 4 channel)
[0049] Then, through nonlinear activation and dimensionality increase operations, attention weights are generated:
[0050] F up =W up ReLU(F down )(Restore original channel)
[0051] Feature fusion: Local features are multiplied by attention weights channel by channel. The formula is:
[0052]
[0053] Preferably, the classification module in S3 adopts a fully connected layer for directly mapping the feature space to the classification space;
[0054] The input dimension of the fully connected layer is determined by the length D of the flattened feature, and the output dimension is the number of motor imagery categories n, calculated as:
[0055] y pred =W cls ·F flat +b cls
[0056] Among them, F flat ∈R D is the flattened eigenvector, W cls ∈R n×D is the classification weight matrix.
[0057] Preferably, the S4 is specifically as follows:
[0058] A private dataset with multiple noise levels is obtained for training, and the training set and validation set are divided into 4:1. The training process adopts an early stopping mechanism. If the accuracy of the validation set does not improve for 10 consecutive epochs, the training is terminated and the optimal model parameters are retained.
[0059] In a second aspect, the present invention proposes a noise-resistant motor imagery EEG signal classification system based on adaptive gating weights, comprising:
[0060] A preprocessing acquisition module, used for preprocessing the acquired EEG signals;
[0061] A noise-resistant motor imagery EEG signal classification model includes an adaptive gating weight module, a feature extraction module, and a classification module; it is used to process the preprocessed EEG signal and noise level to obtain a classification result;
[0062] The adaptive gating weight module includes a Z-score calculation unit, a gating network unit, and a weighted operation unit; the feature extraction module includes a spectral feature extraction unit, a spatial feature learning unit, a blueprint convolution unit, and a depthwise separable convolution unit; the classification module is a fully connected layer network;
[0063] The auxiliary equipment control module is used to control the corresponding auxiliary equipment according to the classification results.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] (1) The adaptive gating weight module in the present invention dynamically adjusts the channel weight according to the noise level. The classification accuracy in a high noise environment (55dB) is improved by 5.11% compared with EEGNet, which significantly enhances the noise resistance performance.
[0066] (2) The lightweight gating network adopted in the present invention consists of only two fully connected layers, with low computational complexity (O(n)). The classification model also adopts an innovative lightweight architecture, combined with depthwise separable convolution and blueprint convolution technology, which greatly reduces the number of parameters and computing resource requirements compared with traditional deep learning models, enabling the method to achieve real-time processing on portable devices, with an average inference time of 0.0225s, meeting the needs of actual application scenarios.
[0067] (3) The classification model of the present invention also combines multiple feature extraction units to realize frequency domain feature acquisition, spatial topological relationship learning and multi-scale feature fusion, thereby enhancing the comprehensive capture capability of motor imagery patterns; the spectrum feature extraction unit can effectively capture the key frequency domain features in the process of motor imagery; the spatial feature learning unit establishes the topological relationship between EEG channels and mines spatial pattern information; the blueprint convolution unit adaptively fuses multi-scale features to enhance the sensitivity to tiny motor imagery patterns; the depthwise separable convolution unit significantly reduces the amount of computation while ensuring the feature extraction capability, thereby improving the classification accuracy of the classification model. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 Flowchart of the noise-resistant motor imagery EEG signal classification method based on adaptive gating weights in the present invention;
[0069] Figure 2 Schematic diagram of brain electrode distribution in the present invention;
[0070] Figure 3 This is a structural block diagram of the noise-resistant motor imagery EEG signal classification model of the present invention;
[0071] Figure 4 Schematic diagram of the working principle of the adaptive gating weight module in the present invention;
[0072] Figure 5 This is a workflow diagram of the feature extraction module in the present invention. DETAILED DESCRIPTION
[0073] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0074] Example 1:
[0075] like Figure 1 As shown, the noise-resistant motor imagery EEG signal classification method based on adaptive gating weights provided by the present invention mainly includes the following steps:
[0076] Step 1: Obtain EEG signals and noise levels.
[0077] This embodiment uses a 32-lead EEG acquisition cap and a digital sound level meter to obtain EEG signals and noise levels. Figure 2 As shown, Figure 2 Schematic diagram of brain electrode distribution (based on the 10-20 standard lead system).
[0078] Step 2: Preprocess the EEG signal.
[0079] The pre-processing operation in this embodiment includes:
[0080] 1) Data preparation: The EEG signal sampling rate was adjusted to 250 Hz, and electrodes were re-referenced and channels were positioned.
[0081] 2) Data processing: The EEG signals were subjected to 0.5 Hz-40 Hz bandpass filtering and independent principal component analysis (ICA) to remove physiological artifacts such as electrooculography and electromyography, as well as other artifacts;
[0082] 3) Data sorting: perform operations such as data segmentation and removal of abnormal segments.
[0083] Step 3: Obtain a noise-resistant motor imagery EEG signal classification model.
[0084] like Figure 3As shown, the noise-resistant motor imagery EEG signal classification model includes: an adaptive gating weight module, a feature extraction module and a classification module; the adaptive gating weight module is used to dynamically adjust the EEG signal channel weight according to the noise level; the feature extraction module includes a spectral feature extraction unit, a spatial feature learning unit, a blueprint convolution unit and a depth-separable convolution unit; the classification module is a fully connected layer network.
[0085] 1) About the adaptive gating weight module;
[0086] The adaptive gating weight module used in this embodiment has the following structure: Figure 4 As shown in Figure 1, the adaptive weight gating module includes a Z-score calculation unit, a gating network unit, and a weighted operation unit. By calculating the channel significance score and dynamically generating a weight matrix at the channel level, the Z-score is calculated channel by channel.
[0087] The Z-score calculation unit is used to calculate the statistical characteristics of each channel of the EEG signal. The details are as follows:
[0088]
[0089] Among them, x b,c,t is the EEG signal value of the cth channel of the bth sample at time point t; μ b,c is the time series mean of channel c; σ b,c is the time series standard deviation of channel c; T is the total length of the time series; z b,c is the channel significance score; Z b,c is the normalized channel significance score, where z min min b,c z b,c , z max is max b,c z b,c . Z b,c is the channel significance score, which is normalized and mapped to the [0,1] interval.
[0090] The gated network unit consists of two fully connected layers. The first layer contains 8 neurons and uses the ReLU activation function. The second layer outputs a weight value activated by Sigmoid. The input is the combined value of the channel significance and the noise level α = Z b,c (1-η) (η is the noise level), specifically calculated as:
[0091] weight_input=significance·(1-noise_level)
[0092] Through two fully connected layer networks, the final output weight calculation formula is:
[0093] w=σ(W2·ReLU(W1·α+b1)+b2)
[0094] in, is a learnable parameter, σ is the sigmoid function, and noise_level is the noise level. is the bias vector of the first fully connected layer, with a length of 8; is the bias scalar of the second fully connected layer and is a single-valued parameter.
[0095] The weighted operation unit is used to apply the weight coefficient output by the gated network to the original EEG signal to obtain the weighted EEG signal. The weighted operation unit converts the weight matrix W∈R B×C Multiply the original signal channel by channel to obtain the noise-resistant enhanced signal.
[0096] y=x⊙w
[0097] Where ⊙ represents channel-by-channel multiplication, x is the original EEG signal, and y is the anti-noise enhanced EEG signal.
[0098] After obtaining the weighted EEG signal, feature extraction and classification will be performed. The feature extraction process is as follows: Figure 5 shown.
[0099] 2) About feature extraction module;
[0100] The feature extraction module used in this embodiment consists of the following subunits: spectral feature extraction unit, spatial feature learning unit, blueprint convolution unit, and depthwise separable convolution unit; different processing flow combinations are adopted according to their functional requirements, mainly including convolution operations, batch normalization, ELU activation function, average pooling, and dropout operations. The feature extraction module is as follows:
[0101] The first is the spectrum feature extraction unit.
[0102] The spectral feature extraction unit has two layers, including two consecutive convolutional layers, which use convolution kernels of (1,32) and (1,32) respectively to extract the frequency domain features of the EEG signal.
[0103] The first layer has an input dimension of 1×C×T, uses 8 filters, a kernel size of (1,32), a stride of (1,1), and pads the input data before convolution with the padding method "same". The output dimension is 8×C×T, followed by batch normalization.
[0104] The second layer has 8 input channels, 32 output channels, a convolution kernel size of (1, 32), an activation function of ELU, and an output dimension of 32×C×T.
[0105] This is followed by a spatial feature learning unit, which uses convolution along the channel dimension with a kernel size of (n_channels, 1) to learn the spatial relationship between channels. Specifically, a standard convolutional layer is used instead of a grouped convolution, with 32 input channels, 64 output channels, a kernel size of (C, 1), a stride of (1, 1), followed by batch normalization, ELU activation, average pooling (kernel size (1, 4)), and dropout (ratio 0.5).
[0106] Next is the blueprint convolution unit, which includes the local feature extraction part, the global context extraction part and the feature fusion part, using the convolution kernel of (1,16).
[0107] First, local features are extracted using conventional convolution operations. Specifically, the number of input channels is 64, the number of output channels is 32, the convolution kernel size is (1, 16), and the input data is padded before convolution, with the padding method being "same".
[0108] Global context is then extracted, global information is captured through global average pooling, and channel attention weights are generated through fully connected layers. This includes a dimensionality reduction layer that reduces the number of channels to 1 / 4 of the original number, and a dimensionality increase layer that restores the original number of channels. Specifically, the input is globally average pooled, compressed to 64×1×1, and then reduced to 16 dimensions (with ReLU activation) through a fully connected layer. It is then increased to 32 dimensions (with Sigmoid activation) to generate channel attention weights.
[0109] The specific calculation includes the following steps:
[0110] F global =GlobalAvgPool(F in )
[0111] First, the input features are globally averaged pooled to obtain a global representation:
[0112] F down =W down ·F global (Dimensionality reduction to 1 / 4 channel)
[0113] Then, the dimensionality reduction operation is performed through the weight matrix to compress the feature representation:
[0114] F up =W up ReLU(F down )(Restore original channel)
[0115] Then, through nonlinear activation and dimensionality increase operations, attention weights are generated.
[0116] The subsequent feature fusion is to multiply the local features with the global channel attention weight to achieve the fusion of local and global information.
[0117] Feature fusion: Local features are multiplied by attention weights channel by channel. The formula is:
[0118]
[0119] This is followed by a depthwise separable convolution unit, which combines depthwise convolution (kernel_size=(1,16)) and pointwise convolution (kernel_size=(1,1)) for efficient feature optimization. This includes:
[0120] Depthwise convolutional layer: input channel number 32, group number 32, convolution kernel size (1,16), output dimension 32×C×T / 8.
[0121] Pointwise convolutional layer: 32 input channels, 8 output channels, kernel size (1,1), followed by batch normalization, ELU activation, average pooling (kernel size (1,8)), and dropout (ratio 0.5).
[0122] 3) About the classification module;
[0123] Finally, the classification module is a single-layer fully connected network that maps the feature space directly to the classification space. Specifically, it includes a fully connected layer whose input dimension is determined by the length D of the flattened features (automatically calculated by forward propagation), and whose output dimension is the number of motor imagery categories n, calculated as follows:
[0124] y pred =W cls ·F flat +b cls
[0125] Among them, F flat ∈R D is the flattened eigenvector, W cls ∈R n×D is the classification weight matrix.
[0126] Step 4: Train and optimize the EEG signal classification model to obtain the optimal model parameters; input the preprocessed EEG signal and noise level into the trained EEG signal classification model to obtain the classification results.
[0127] A private dataset with multiple noise levels was obtained, including motor imagery data for wheelchair manipulation at noise levels of 30dB, 35dB, 45dB, and 55dB. After preprocessing the motor imagery data, each noise level was divided into a training set and a validation set in a 4:1 ratio. The training subsets for each noise level were then combined into a mixed training set. An early stopping strategy was used during training. When the validation set accuracy stopped improving over multiple training cycles, training was terminated early to prevent overfitting. The model parameters with the best validation set performance were saved as the final model.
[0128] Specifically, the training strategy used motor imagery data at mixed noise levels (30dB, 35dB, 45dB, and 55dB), with a 4:1 split between the training and validation sets. The Adam optimizer was used, with a learning rate of 1×10⁻¹⁰ and a weight decay of 1×10⁻¹⁰. An early stopping mechanism was used: if the validation set accuracy did not improve for 10 consecutive epochs, training was terminated and the optimal model parameters were retained.
[0129] Experimental verification:
[0130] The present invention uses the same EEG signal dataset for experiments and evaluation. The EEG signal classification model obtained by retaining the optimal model parameters in the present invention is compared with the performance of the most advanced lightweight algorithms such as EEGNet, ConvNeT, FBCSP, and CSP+SVM. The detailed data comparison results of the present invention compared with other models are shown in Table 1.
[0131] Table 1 Detailed data comparison of the present invention compared with other models
[0132] method Average accuracy F1 score Accuracy Recall AUC Average inference time (seconds) The present invention 90.40% 0.9012 0.9226 0.8807 0.9038 0.0225 EEGNet 85.29% 0.8696 0.8876 0.8523 0.8528 0.0183 ConvNeT 81.22% 0.8153 0.8156 0.8150 0.8023 0.1875 FBCSP 76.86% 0.7705 0.7600 0.7811 0.7687 0.0190 CSP+SVM 71.38% 0.7281 0.7122 0.7425 0.7141 0.0147
[0133] As shown in Table 1, the EEG signal classification model of the present invention has an average accuracy of 90.40%, and the classification accuracy in a high noise environment (55dB) is improved by 5.11% compared to EEGNet, which significantly enhances the noise resistance and is far superior to other EEG signal classification algorithms. In other performance indicators such as F1 score, precision, recall rate, and AUC, the EEG signal classification model of the present invention also achieves the best. At the same time, the average inference time of the EEG signal classification model of the present invention is 0.0225s, which can meet the needs of actual application scenarios.
[0134] The above description is only used to help understand the method and core essence of the present invention, but the scope of protection of the present invention is not limited thereto. For those skilled in the art, equivalent replacements or modifications based on the technical solutions and inventive concepts of the present invention within the technical scope disclosed by the present invention should be included in the scope of protection of the present invention. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A noise-resistant motor imagery EEG signal classification method based on adaptive gating weights, characterized by: The steps include: S1. Obtain EEG signals and noise levels; S2, preprocessing the EEG signal; S3. Constructing a noise-resistant motor imagery EEG signal classification model; the model includes an adaptive gating weight module, a feature extraction module, and a classification module, wherein the adaptive gating weight module is used to dynamically adjust the EEG signal channel weight according to the noise level; S4. Training the noise-resistant motor imagery EEG signal classification model to obtain the optimal model parameters; S5. Input the preprocessed EEG signal and noise level into the trained noise-resistant motor imagery EEG signal classification model to obtain a classification result.
2. The method according to claim 1, characterized in that The adaptive gating weight module in S3 includes a Z score calculation unit, a gating network unit and a weighted operation unit; The Z-score calculation unit is used to calculate the statistical characteristics of each channel of the EEG signal to obtain a channel significance score; The gated network unit is composed of a two-layer fully connected network, and the input is the combined value of the channel significance and the noise level to obtain the weight coefficient; The weighted operation unit is used to apply the weight coefficient to the original EEG signal, and multiply the original EEG signal channel by channel to obtain the weighted EEG signal, which is the anti-noise enhanced EEG signal.
3. The method according to claim 2, characterized in that The Z score calculation unit is as follows: Among them, x b,c,t is the EEG signal value of the cth channel of the bth sample at time point t; μ b,c is the time series mean of channel c; σ b,c is the time series standard deviation of channel c; T is the total length of the time series; z b,c is the channel significance score; Z b,c is the normalized channel significance score, where z min min b,c z b,c , z max is max b,c z b,c .
4. The method according to claim 3, characterized in that The gated network unit is specifically as follows: Calculate the combined value α of the channel significance and the noise level, which is expressed as follows: α=Z b,c ·(1-th) Where η is the noise level; z b,c is the normalized significance score; Through two fully connected layer networks, the weight coefficient w is obtained, and the calculation formula is: w=σ(W2·ReLU(W1·α+b1)+b2) in, is a learnable parameter, σ is the sigmoid function, is the bias vector of the first fully connected layer, with a length of 8; is the bias scalar of the second fully connected layer and is a single-valued parameter.
5. The method according to claim 1, wherein The feature extraction module in S3 includes a spectral feature extraction unit, a spatial feature learning unit, a blueprint convolution unit and a depth-separable convolution unit; The spectrum feature extraction unit extracts spectrum features in the time dimension through a convolutional layer; The spatial feature learning unit uses convolution in the channel dimension to learn the spatial relationship between channels and perform cross-channel spatial feature fusion; The blueprint convolution unit fuses local and global features through global pooling and adaptive weighting; The depthwise separable convolution unit is used for feature optimization through a combination of depthwise convolution and pointwise convolution.
6. The method according to claim 5, characterized in that The blueprint convolution unit includes a local feature extraction part, a global context extraction part and a feature fusion part; First, local feature extraction is performed using convolution operations to extract local features; Then, global context extraction is performed, global information is captured through global average pooling, and channel attention weights are generated through a fully connected layer, including a dimensionality reduction layer and a dimensionality increase layer. The dimensionality reduction layer reduces the number of channels to 1 / 4 of the original number, and the dimensionality increase layer restores the original number of channels. Finally, feature fusion multiplies the local features with the global channel attention weight to achieve the fusion of local and global information.
7. The method according to claim 1, characterized in that The classification module in S3 uses a fully connected layer to directly map the feature space to the classification space.
8. The method according to claim 1, characterized in that The S4 is specifically as follows: A private dataset with multiple noise levels is obtained for training, and the training set and validation set are divided into 4:
1. The training process adopts an early stopping mechanism. If the accuracy of the validation set does not improve for 10 consecutive epochs, the training is terminated and the optimal model parameters are retained.
9. A noise-resistant motor imagery EEG signal classification system based on adaptive gating weights applied to the method according to any one of claims 1 to 8, characterized in that: include: A preprocessing acquisition module, used for preprocessing the acquired EEG signals; A noise-resistant motor imagery EEG signal classification model, including an adaptive gating weight module, a feature extraction module, and a classification module; Used to process the preprocessed EEG signals and noise levels to obtain classification results; The adaptive gating weight module includes a Z-score calculation unit, a gating network unit, and a weighted operation unit; the feature extraction module includes a spectral feature extraction unit, a spatial feature learning unit, a blueprint convolution unit, and a depthwise separable convolution unit; the classification module is a fully connected layer network; The auxiliary equipment control module is used to control the corresponding auxiliary equipment according to the classification results.