A lightweight motor imagery classification method and device guided by frequency prior features
By combining the EEG signal processing method of spatial convolution layer, residual network and causal convolution network, the problem of overfitting and computational volume in EEG signal processing is solved, the accuracy and calculation efficiency of motion imagination classification are improved, and it is suitable for practical applications with limited resources.
Patent Information
- Application Number
- CN202510351887.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-03-24
AI Technical Summary
Existing EEG signal processing methods face the problems of overfitting, large amount of computation and difficulty in capturing long-term dependence, and traditional methods are difficult to effectively utilize prior knowledge of brain science, resulting in insufficient accuracy in classification of motor imagination.
The lightweight motion imagination classification method guided by frequency prior feature is adopted. The spatial convolution layer and residual network are combined with causal convolution network to perform feature extraction and sequence modeling of EEG signals, and the model structure is optimized using prior knowledge of brain science.
It significantly improves the classification accuracy and computing efficiency of EEG signals, reduces the complexity of the model, is suitable for resource limitations in practical application scenarios, and enhances the interpretability of the model.
Smart Images

Figure CN119884889B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of neural decoding, and particularly to a lightweight motor imagery classification method and device guided by frequency prior features. Background Art
[0002] In the field of Brain-Computer Interface (BCI), realizing human-computer interaction by decoding electroencephalogram (EEG) signals has become an important direction of research and application. Among them, Motor Imagery (MI) refers to the activity of an individual activating the brain regions related to certain movement behaviors by imagining certain movement behaviors without actual limb movement. During the motor imagery process, the electroencephalogram (EEG) signal, as a bioelectrical signal directly reflecting brain electrical activity, is recorded, so as to be used to distinguish and identify the movement intention of an individual. This technology has been widely applied in fields such as stroke rehabilitation and wheelchair control, and its application prospect continues to expand with the development of technology.
[0003] However, EEG signals are easily affected by various interferences and noises during the acquisition process, such as eye movement, muscle artifacts, and environmental noise. These noises and interferences will not only significantly reduce the quality of EEG signals, but may also cause a significant decrease in the classification accuracy in motor imagery tasks. In addition, EEG signals have strong non-linear characteristics, and their time-frequency characteristics vary greatly among different individuals and different experimental conditions. Traditional linear methods often have difficulty effectively capturing and utilizing these complex patterns and features, thereby affecting the recognition effect of the model. Therefore, how to effectively remove noise and improve the classification accuracy of EEG signals has become an important technical problem in the application of BCI technology.
[0004] To solve the above problems, with the continuous development of deep learning technology, researchers have tried to use methods based on deep neural networks (DNNs) for automatic feature extraction and classification of EEG signals. Compared with traditional signal processing and pattern recognition methods, deep learning models can automatically extract high-level features from raw EEG signals, overcoming the limitations of manually designed features, so as to achieve higher classification accuracy in motor imagery tasks. In particular, deep learning models such as convolutional neural networks (CNNs) perform excellently in the extraction of spatio-temporal features, can better capture the time-frequency features in EEG signals, and maintain high stability under diverse experimental conditions.
[0005] The non - linear characteristics and individual differences of EEG signals require deep learning models to effectively handle the uncertainty of signals and possess a certain degree of adaptability. In this context, combining prior knowledge in the field of brain science to design the structure and training strategy of deep learning models has become an effective way to improve model performance. For example, prior knowledge such as signal analysis based on brain functional regions and spatio - temporal patterns of neural signals can help deep learning models capture features related to motor imagery more accurately when processing EEG signals, thereby improving the classification accuracy. At the same time, combining the concept of lightweight model design can effectively reduce the computational complexity of the model and enable it to adapt to the computational resource limitations in real - time application scenarios.
[0006] Currently, there are only a small number of papers and related patents on motor imagery classification methods. It is also very rare to use deep learning technology to complete neural decoding for motor imagery classification in this field. According to investigations and understanding, the existing publicly available technologies are as follows:
[0007] Lawhern et al. proposed EEGNet in the paper [Lawhern V J, Solon A J, Waytowich N R, et al. EEGNet: a compact convolutional neural network for EEG - based brain–computer interfaces[J]. Journal of neural engineering, 2018, 15(5): 056013]. EEGNet is a deep convolutional neural network (CNN) architecture specifically designed for electroencephalogram (EEG) signal classification. When processing EEG signals, it can efficiently extract features and adapt to the spatio - temporal characteristics of EEG data. The main advantage of EEGNet lies in its lightweight structure and high computational efficiency, which is especially suitable for real - time brain - computer interface (BCI) applications. The architecture design of EEGNet is inspired by the convolutional neural network (CNN), but it has been optimized according to the characteristics of EEG signals. The lightweight feature of EEGNet has made it widely used in BCI applications, especially suitable for real - time brain - computer interface systems with high requirements for computational resources. However, the classification effect of EEGNet in practice is difficult to meet the specified requirements.
[0008] Ma et al. proposed a Transformer-based classification method in the paper [Ma X, Chen W, Pei Z, et al. Attention-based convolutional neural network with multi-modal temporal information fusion for motor imagery EEG decoding[J]. Computers in Biology and Medicine, 2024, 175: 108504]. EEGTransNet is an electroencephalogram (EEG) signal classification model based on the Transformer architecture, aiming to process and analyze the temporal and spatial information in EEG signals. Compared with traditional convolutional neural networks (CNNs), EEGTransNet uses the self-attention mechanism of the Transformer to more efficiently capture the long-term dependencies and temporal patterns in EEG signals. EEGTransNet has performed well in multiple EEG classification tasks, especially when dealing with complex EEG signals, and can significantly improve the classification accuracy. Thanks to the powerful modeling ability of the Transformer architecture for long-range dependencies and spatio-temporal features, EEGTransNet has shown great potential in the field of brain-computer interfaces (BCIs). However, its running time and computational complexity often fail to meet the real-time requirements in practical scenarios.
[0009] Existing EEG signal samples are usually relatively limited. Although neural networks have powerful non-linear fitting capabilities, they are prone to overfitting in this case. In addition, most neural network designers are not experts in the field of brain science. Therefore, while existing models emphasize powerful feature extraction capabilities, they often neglect the incorporation of prior knowledge in brain science, which can effectively improve the performance and interpretability of the models. Moreover, the computing resources in actual brain-computer interface (BCI) applications are usually limited. Therefore, there is a great need to design lightweight and efficient models that are more suitable for deployment in practical scenarios.
[0010] EEG signals are a typical type of time series data with complex temporal dependencies and high non-stationarity, which makes it a challenging task to extract meaningful features from them. Traditional neural network architectures, especially convolutional neural networks (CNNs) and recurrent neural networks (RNNs), often face problems such as overfitting, large computational amounts, and difficulty in capturing long-term dependencies when dealing with EEG signals. Summary of the Invention
[0011] To solve the technical problems of overfitting, large computational complexity, and difficulty in capturing long-term dependencies faced in processing EEG signals in the prior art, an embodiment of the present invention provides a lightweight motor imagery classification method and device guided by frequency prior features. The technical solution is as follows:
[0012] On the one hand, a lightweight motor imagery classification method guided by frequency prior features is provided, characterized in that the method includes:
[0013] S1. Obtain high-dimensional EEG signals, perform preliminary processing on the high-dimensional EEG signals, and extract the time-domain features of the high-dimensional EEG signals;
[0014] S2. Input the EEG signals after extracting the time-domain features into a spatial convolution layer; through the spatial convolution layer, the EEG signals collected by different electrodes are weighted and integrated and fused into a single channel; through average pooling for downsampling, the high-frequency information of the weighted and integrated EEG signals is compressed below 30 Hz to obtain compressed EEG signals;
[0015] S3. Input the compressed EEG signals into a residual network to process the high-frequency information of the compressed EEG signals, further optimize the extraction of signal features, and obtain the spatio-temporal features of the EEG signals;
[0016] S4. Perform sequence modeling through a temporal convolutional network designed based on causal convolution, represent the previous sequence information through the last time step, and obtain a sparse representation of the features and a lightweight representation of the model; complete the lightweight motor imagery classification guided by frequency prior features through a classifier.
[0017] Optionally, S1, obtaining high-dimensional EEG signals, performing preliminary processing on the high-dimensional EEG signals, and extracting the time-domain features of the high-dimensional EEG signals, includes:
[0018] Obtain high-dimensional EEG input signals, where the shape of the input signals is N×1×C×T, where N is the number of samples, C is the number of electrodes, and T is the number of time samples;
[0019] Perform preliminary processing on the signals through a 1D convolution operation with weight constraints to extract preliminary features;
[0020] The preliminary features enter a batch normalization layer to perform standardization processing on the preliminary features;
[0021] Use an exponential linear unit as the activation function to perform non-linear modeling on the data, map the data to a non-linear space, and obtain a time-domain feature representation.
[0022] Optionally, the 1D convolution operation with weight constraints includes:
[0023] The size K1 of the convolutional kernel is determined by the design parameters of the temporal convolutional block, and the design parameters are calculated according to the sampling rate Fs of the device and a predetermined parameter T:
[0024]
[0025] where T is set to 4 or 8; when the number of electrodes is large, T is set to 8; conversely, when the number of electrodes is small, T is set to 4.
[0026] Optionally, downsampling is performed through average pooling to compress the high-frequency information of the weighted integrated EEG signal to below 30 Hz, obtaining a compressed EEG signal, including:
[0027] The size of the downsampling operation is determined by the following formula:
[0028] ;
[0029] where represents the size of the convolutional kernel used for average pooling; represents the number of data points within one second.
[0030] Optionally, the formula for calculating the equivalent receptive field of the residual network, i.e., the equivalent convolutional kernel size K3 represented by the multi-layer network, is:
[0031] .
[0032] Optionally, in S3, the number of residual blocks is adjusted according to the actual number of electrodes and the spatial distribution.
[0033] Optionally, sequence modeling is performed through a temporal convolutional network designed based on causal convolution, and the previous sequence information is represented through the last time step, obtaining a sparse representation of features and a lightweight representation of the model; lightweight motor imagery classification guided by frequency prior features is completed through a classifier, including:
[0034] Obtain the time series signal , pad the time series signal to obtain a new sequence signal ;
[0035] Input the new sequence signal into the convolutional layer of the temporal convolutional network for convolution operation, and the output of the next layer is only related to the previous data;
[0036] Through multi-layer convolution operations, the last time point / step will obtain all the previous information and form a new feature representation. At this time, the entire sequence is not required, thus obtaining a lightweight representation of the model;
[0037] New representation expressions are obtained through classifier-based motor imagery classification to complete lightweight motor imagery classification guided by frequency prior features.
[0038] On the other hand, a lightweight motor imagery classification device guided by frequency prior features is provided. This device is applied to the lightweight motor imagery classification method guided by frequency prior features and includes:
[0039] A time-domain feature extraction module for obtaining high-dimensional EEG signals, preliminarily processing the high-dimensional EEG signals, and extracting the time-domain features of the high-dimensional EEG signals;
[0040] A signal compression module for inputting the EEG signals after extracting the time-domain features into a spatial convolutional layer; weighting and integrating the EEG signals collected by different electrodes through the spatial convolutional layer and fusing them into a single channel; performing downsampling through average pooling to compress the high-frequency information of the weighted and integrated EEG signals below 30 Hz to obtain compressed EEG signals;
[0041] An optimization extraction module for inputting the compressed EEG signals into a residual network, processing the high-frequency information of the compressed EEG signals, further optimizing the extraction of signal features, and obtaining the spatio-temporal features of the EEG signals;
[0042] A sequence modeling module for performing sequence modeling through a temporal convolutional network designed based on causal convolution, representing the previous sequence information through the last time step, obtaining a sparse representation of the features and a lightweight representation of the model; completing lightweight motor imagery classification guided by frequency prior features through a classifier.
[0043] On the other hand, a lightweight motor imagery classification device guided by frequency prior features is provided. The lightweight motor imagery classification device guided by frequency prior features includes: a processor; a memory, and computer-readable instructions are stored on the memory. When the computer-readable instructions are executed by the processor, any one of the methods in the above-mentioned lightweight motor imagery classification method guided by frequency prior features is implemented.
[0044] On the other hand, a computer-readable storage medium is provided. At least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the methods in the above-mentioned lightweight motor imagery classification method guided by frequency prior features.
[0045] The beneficial effects brought by the technical solutions provided in the embodiments of the present invention at least include:
[0046] In the embodiments of the present invention, a method combining a temporal convolutional network and a residual network is proposed. Through the design of causal convolution and dilated convolution, the temporal features of EEG signals are effectively captured, and it is ensured that the network structure has good computational efficiency and interpretability. This method provides an efficient and interpretable solution in EEG signal analysis and can significantly improve the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0048] Figure 1 It is a schematic flowchart of a lightweight motor imagery classification method guided by frequency prior features provided by the embodiments of the present invention;
[0049] Figure 2 It is a REDIES structure diagram provided by the embodiments of the present invention;
[0050] Figure 3 It is a block diagram of a lightweight motor imagery classification device guided by frequency prior features provided by the embodiments of the present invention;
[0051] Figure 4 It is a schematic structural diagram of an electronic device provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] The following will describe the technical solutions in the present invention with reference to the drawings.
[0053] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as an "example" in the present invention should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of the word "example" is intended to present concepts in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two.
[0054] In the embodiments of the present invention, sometimes subscripts such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning to be expressed is the same.
[0055] To make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail with reference to the drawings and specific embodiments.
[0056] An embodiment of the present invention provides a lightweight motor imagery classification method guided by frequency prior features. This method can be implemented by a lightweight motor imagery classification device guided by frequency prior features, and the lightweight motor imagery classification device guided by frequency prior features can be a terminal or a server. As Figure 1 shown in the flowchart of the lightweight motor imagery classification method guided by frequency prior features, as Figure 1 shown, the lightweight motor imagery classification method proposed by the present invention, as Figure 2 shown is the REDIES structure diagram provided by the embodiment of the present invention; the processing flow of this method can include the following steps:
[0057] S1. Obtain high-dimensional EEG signals, perform preliminary processing on the high-dimensional EEG signals, and extract the time-domain features of the high-dimensional EEG signals;
[0058] In a feasible implementation manner, S1, obtaining high-dimensional EEG signals, performing preliminary processing on the high-dimensional EEG signals, and extracting the time-domain features of the high-dimensional EEG signals includes:
[0059] Obtain high-dimensional EEG input signals, where the shape of the input signals is N×1×C×T, where N is the number of samples, C is the number of electrodes, and T is the number of time samples;
[0060] In order to process these high-dimensional EEG signals, first perform preliminary processing on the signals through a 1D convolutional operation with weight constraints (Conv1dWithConstraint) to extract preliminary features;
[0061] The preliminary features enter the batch normalization layer to perform standardization processing on the preliminary features;
[0062] Use the exponential linear unit as the activation function to perform nonlinear modeling on the data, map the data to a nonlinear space, and obtain the time-domain feature representation.
[0063] In a feasible implementation manner, the 1D convolutional operation with weight constraints includes:
[0064] The size K1 of the convolutional kernel is determined by the design parameters of the time convolutional block, and the design parameters are calculated according to the sampling rate Fs of the device and a predetermined parameter T:
[0065]
[0066] Among them, T is set to 4 or 8; when the number of electrodes is large, T is set to 8 to extract more information; on the contrary, when the number of electrodes is small, setting T to 4 can better adapt to the feature extraction requirements of the signal.
[0067] In a feasible implementation, in this way, we can select an appropriate convolution kernel size according to the actual situation, avoid over-smoothing the signal, and at the same time retain sufficient time information. After extracting the preliminary features through the convolutional layer, the signal will enter the Batch Normalization layer. The role of batch normalization is to standardize the output of the convolutional layer, reduce the internal covariate shift, thereby accelerating the training process and improving the stability of the model.
[0068] In a feasible implementation, the Exponential Linear Unit (ELU) is used as the activation function. For the positive part in the time data, the positive features are retained. For the negative part, the activation function will output an exponential decay, providing gradient information for the negative value region, thereby performing non-linear modeling on the data. ELU has strong non-linear modeling ability and can effectively alleviate the vanishing gradient problem in the neural network. This combination ensures that the model can fully explore the non-linear relationships in the EEG signal during the learning process.
[0069] S2. Input the EEG signal after extracting the time-domain features into the spatial convolutional layer; through the spatial convolutional layer, the EEG signals collected by different electrodes are weighted and integrated and fused into a single channel; through average pooling for downsampling, the high-frequency information of the weighted and integrated EEG signal is compressed below 30 Hz to obtain a compressed EEG signal.
[0070] In a feasible implementation, after extracting the time-domain features, the EEG signal enters the spatial convolutional layer. The spatial convolutional layer uses a convolution kernel of size (C,1) to weight and integrate the EEG signals collected by different electrodes and fuse them into a single channel. This operation can learn the spatial correlation between different electrodes and provide strong support for subsequent signal processing.
[0071] In a feasible implementation, through average pooling for downsampling (Average Pooling), the high-frequency information of the weighted and integrated EEG signal is compressed below 30 Hz to obtain a compressed EEG signal, including:
[0072] The size of the downsampling operation is determined by the following formula:
[0073] ;
[0074] where represents the convolution kernel size used for average pooling; represents the number of data points within one second.
[0075] In a feasible implementation, assume that the current sampling rate of the device is , and the data within one second will be composed of The dots indicate that in the text, dots are taken as a group, and the values of the dots are averaged to form a new dot. The originally long signal sequence will be compressed into a new signal sequence, and the high-frequency information of the signal is compressed to about 30 Hz. This operation not only reduces the redundant information in the signal but also lightens the computational burden of the subsequent model.
[0076] Through this method, we can effectively limit the frequency range of the EEG signal to about 30 Hz, remove unnecessary high-frequency noise, and ensure that the temporal dependence of the signal is fully preserved.
[0077] S3. Input the compressed EEG signal into the residual network to process the high-frequency information of the compressed EEG signal, further optimize the extraction of signal features, and obtain the spatio-temporal features of the EEG signal;
[0078] In a feasible implementation, in S3, the number of residual blocks is adjusted according to the actual number of electrodes and spatial distribution.
[0079] In a feasible implementation, the signal compressed to 30 Hz will enter a small residual network. To further optimize the extraction of signal features, we introduce a residual network into the model. The signal first passes through several convolutional filtering operations. The size of the previous small convolutional kernels will extract higher frequency bands in the compressed signal. Through multiple small convolutional kernels, the receptive field of the network will continuously expand until it expands to the specified length, and sufficient low-frequency information can be extracted. Through the connections between layers in the residual network, the relatively higher frequency bands of the compressed signal will be retained and fused with the low-frequency information. The residual network transmits information between each layer through skip connections, avoiding the problem of gradient disappearance and being able to retain more high-frequency information. Considering the number of electrodes and spatial distribution, the number of residual blocks needs to be adjusted according to specific circumstances. Increasing the number of residual blocks can expand the receptive field of the model, thereby capturing more spatio-temporal features. Compared with the traditional multi-branch network structure, the residual network is more efficient in processing high-frequency information and reduces the computational amount.
[0080] In a feasible implementation, the formula for calculating the equivalent receptive field of the residual network, that is, the size K3 of the equivalent convolutional kernel represented by the multi-layer network, is:
[0081] .
[0082] In a feasible implementation, it should be noted that although increasing the depth of the network can increase the receptive field, it may also cause the model to focus more on low-frequency information, thereby affecting the accuracy of the model. Therefore, when designing the network, it is necessary to balance the depth and accuracy to ensure that the model can retain high-frequency information and not overly focus on low-frequency components.
[0083] S4. Perform sequence modeling through a temporal convolutional network designed based on causal convolution to complete lightweight motor imagery classification guided by frequency prior features.
[0084] In a feasible implementation, perform sequence modeling through a temporal convolutional network designed based on causal convolution, represent the previous sequence information through the last time step to obtain a sparse representation of features and a lightweight representation of the model; complete lightweight motor imagery classification guided by frequency prior features through a classifier, including:
[0085] Obtain the time series signal , pad the time series signal to obtain a new sequence signal ;
[0086] Input the new sequence signal into the convolutional layer of the temporal convolutional network for convolution operation, and the output of the next layer is only related to the previous data;
[0087] Through multiple layers of convolution operations, all the previous information will be obtained at the last time point / step to form a new feature representation. At this time, the entire sequence is not required, thus obtaining a lightweight representation of the model;
[0088] Perform motor imagery classification through a classifier to obtain a new characterization expression, and complete lightweight motor imagery classification guided by frequency prior features.
[0089] In a feasible implementation, input the new sequence signal into the convolutional layer of the temporal convolutional network for convolution operation, and the output of the next layer is only related to the previous data, including:
[0090] Represent the input sequence as , first pad it to obtain a new sequence . At this time, perform convolution again, and the output of the next layer will only be related to , will only be related to , and so on. The output of the next layer will only be related to the previous data. After multiple layers of causal convolution operations, a new feature representation will be obtained, which means that the output of each time step only depends on the current and previous input signals, thus ensuring temporal causality.
[0091] In a feasible implementation, through this design, the model can effectively eliminate the influence of future signals on the current signal, ensuring that the time dependence is strictly maintained. In addition, the dilated convolution in TCN extends the receptive field by introducing gaps between filter elements, enabling the network to capture dependencies over longer time spans without increasing computational complexity. Compared with traditional recurrent neural networks (RNNs, such as LSTM and GRU), TCN has the advantage of parallel computing, faster training speed, and excellent performance in various sequence modeling tasks. Its simple architecture and low computational complexity make it have strong application potential in EEG signal processing and other time series data analysis.
[0092] In the embodiments of the present invention, without introducing complex Transformer, channel or spatial attention mechanisms, or multi-branch structures, leading performance is still achieved in the motor imagery task. This result proves that superior results can still be obtained without increasing the network complexity, highlighting the efficiency of the method. On the BCI-2A dataset and BCI-2B dataset, the precision rates of this method reached 86.23% and 86.75% respectively. At the same time, compared with the mainstream Transformer architecture, the computational complexity is only 50%.
[0093] By focusing on selecting appropriate frequency bands, the model in this paper can significantly improve computational efficiency and reduce the risk of overfitting without sacrificing performance. This method demonstrates efficient EEG signal processing and feature extraction capabilities, making it suitable for resource-constrained scenarios in practical applications.
[0094] By combining prior knowledge of brain science and calculating appropriate convolutional kernel sizes and signal compression ratios, this paper not only optimizes the model structure but also enhances its interpretability. In the motor imagery task, reasonable frequency band selection and simplified network design help the model capture key features related to brain activity more clearly. This interpretability is particularly important for applications in fields such as brain-computer interfaces (BCIs), which can enhance user trust and the application potential of the model in practical scenarios.
[0095] Figure 3 It is a block diagram of a lightweight motor imagery classification device 300 guided by frequency prior features shown according to an exemplary embodiment. The device 300 is used for the lightweight motor imagery classification method guided by frequency prior features. Refer to Figure 3 and the device includes a time-domain feature extraction module 310, a signal compression module 320, an optimization extraction module 330, and a sequence modeling module 340. Among them:
[0096] The time-domain feature extraction module 310 is configured to obtain high-dimensional EEG signals, perform preliminary processing on the high-dimensional EEG signals, and extract the time-domain features of the high-dimensional EEG signals;
[0097] A signal compression module 320 is configured to input the EEG signal after extracting time-domain features into a spatial convolutional layer; perform weighted integration on the EEG signals collected by different electrodes through the spatial convolutional layer and fuse them into a single channel; perform downsampling through average pooling to compress the high-frequency information of the weighted integrated EEG signal to below 30 Hz, thereby obtaining a compressed EEG signal.
[0098] An optimization extraction module 330 is configured to input the compressed EEG signal into a residual network, process the high-frequency information of the compressed EEG signal, further optimize the extraction of signal features, and obtain the spatio-temporal features of the EEG signal.
[0099] A sequence modeling module 340 is configured to perform sequence modeling through a temporal convolutional network designed based on causal convolution, represent the previous sequence information through the last time step, and obtain a sparse representation of the features and a lightweight representation of the model; complete lightweight motor imagery classification guided by frequency prior features through a classifier.
[0100] Optionally, a high-dimensional EEG signal is obtained, and preliminary processing is performed on the high-dimensional EEG signal to extract the time-domain features of the high-dimensional EEG signal, including:
[0101] Obtain a high-dimensional EEG input signal, where the shape of the input signal is N×1×C×T, where N is the number of samples, C is the number of electrodes, and T is the number of time samples;
[0102] Perform preliminary processing on the signal through a 1D convolution operation with weight constraints to extract preliminary features;
[0103] The preliminary features enter a batch normalization layer to perform standardization processing on the preliminary features;
[0104] Use an exponential linear unit as an activation function to perform non-linear modeling on the data, map the data to a non-linear space, and obtain a time-domain feature representation.
[0105] Optionally, the 1D convolution operation with weight constraints includes:
[0106] The size K1 of the convolution kernel is determined by the design parameters of the temporal convolution block, and the design parameters are calculated according to the sampling rate Fs of the device and a predetermined parameter T:
[0107]
[0108] where T is set to 4 or 8; when the number of electrodes is large, T is set to 8; conversely, when the number of electrodes is small, T is set to 4.
[0109] Optionally, downsampling is performed through average pooling to compress the high-frequency information of the weighted integrated EEG signal to below 30 Hz, and a compressed EEG signal is obtained, including:
[0110] The size of the downsampling operation is determined by the following formula:
[0111] ;
[0112] where represents the convolution kernel size adopted by average pooling; represents the number of data points within one second.
[0113] Optionally, the formula for calculating the equivalent receptive field of the residual network is:
[0114] .
[0115] Optionally, the number of residual blocks is adjusted according to the actual number of electrodes and spatial distribution.
[0116] Optionally, the sequence modeling module 340 is used to obtain a time series signal , fill the time series signal to obtain a new sequence signal ;
[0117] Input the new sequence signal into the convolutional layer of the temporal convolutional network for convolutional operation, and the output of the next layer is only related to the previous data;
[0118] Through multi-layer convolutional operations, all the information of the previous sequence will be obtained at the last time point / step, forming a new feature representation. At this time, the entire sequence is not required, thereby obtaining a lightweight representation of the model;
[0119] Perform motor imagery classification through a classifier to obtain a new representational expression, and complete the lightweight motor imagery classification guided by frequency prior features.
[0120] Figure 4 is a schematic structural diagram of a lightweight motor imagery classification device guided by frequency prior features provided by an embodiment of the present invention. As Figure 4 shown, the lightweight motor imagery classification device guided by frequency prior features may include the lightweight motor imagery classification device shown above Figure 3 . Optionally, the lightweight motor imagery classification device 410 guided by frequency prior features may include a first processor 2001.
[0121] Optionally, the lightweight motor imagery classification device 410 guided by frequency prior features may further include a memory 2002 and a transceiver 2003.
[0122] Among them, the first processor 2001, the memory 2002, and the transceiver 2003 can be connected through a communication bus, for example.
[0123] Next, in conjunction with Figure 4 each component of the lightweight motor imagery classification device 410 guided by frequency prior features will be specifically introduced:
[0124] Among them, the first processor 2001 is the control center of the lightweight motor imagery classification device 410 guided by frequency prior features, which can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or can be an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as: one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs).
[0125] Optionally, the first processor 2001 can execute various functions of the lightweight motor imagery classification device 410 guided by frequency prior features by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.
[0126] In a specific implementation, as an embodiment, the first processor 2001 can include one or more CPUs, such as Figure 4 the CPU0 and CPU1 shown in
[0127] In a specific implementation, as an embodiment, the lightweight motor imagery classification device 410 guided by frequency prior features can also include multiple processors, such as Figure 4 the first processor 2001 and the second processor 2004 shown in
[0128] Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). Here, the processor can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0129] Optionally, the memory 2002 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 can be integrated with the first processor 2001 or exist independently and be coupled to the first processor 2001 through an interface circuit ( Figure 4 not shown) of the frequency prior feature-guided lightweight motor imagery classification device 410. The embodiments of the present invention do not make specific limitations on this.
[0130] The transceiver 2003 is used to communicate with a network device or with a terminal device.
[0131] Optionally, the transceiver 2003 can include a receiver and a transmitter ( Figure 4 not shown separately). Among them, the receiver is used to implement the receiving function, and the transmitter is used to implement the sending function.
[0132] Optionally, the transceiver 2003 can be integrated with the first processor 2001 or exist independently and be coupled to the first processor 2001 through an interface circuit ( Figure 4 not shown) of the frequency prior feature-guided lightweight motor imagery classification device 410. The embodiments of the present invention do not make specific limitations on this.
[0133] It should be noted that Figure 4 the structure of the frequency prior feature-guided lightweight motor imagery classification device 410 shown does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0134] In addition, the technical effects of the frequency prior feature-guided lightweight motor imagery classification device 410 can refer to the technical effects of the frequency prior feature-guided lightweight motor imagery classification method described in the above method embodiments and will not be elaborated here.
[0135] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0136] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM) and direct rambus RAM (DR RAM).
[0137] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable sensors. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that contains one or more collections of available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0138] It should be understood that the term "and / or" in this application is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. In addition, the character " / " in this application generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood with reference to the context.
[0139] It should be understood that in various embodiments of the present invention, the magnitudes of the sequence numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0140] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0141] The unit described as a separation component may or may not be physically separated. The component shown as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0142] In addition, each functional unit in various embodiments of the present invention may be integrated into a processing unit, may exist separately as individual physical units, or two or more units may be integrated into one unit.
[0143] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0144] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A lightweight motor imagery classification method guided by frequency prior features, characterized in that The method comprises: S1. Acquire a high-dimensional EEG signal, perform preliminary processing on the high-dimensional EEG signal, and extract time domain features of the high-dimensional EEG signal; S1, obtaining a high-dimensional EEG signal, performing preliminary processing on the high-dimensional EEG signal, and extracting time domain features of the high-dimensional EEG signal, including: Get a high-dimensional EEG input signal, where the shape of the input signal is N×1×C×T, where N is the number of samples, C is the number of electrodes, and T is the number of time samples; The signal is preliminarily processed through a 1D convolution operation with weight constraints to extract preliminary features; The preliminary features enter the batch normalization layer to perform standardization on the preliminary features; Use exponential linear units as activation functions to perform nonlinear modeling on the data, map the data into a nonlinear space, and obtain time domain feature representation; The 1D convolution operation with weight constraints includes: Size of the convolutional kernel K 1 is determined by the design parameters of the temporal convolutional block, and the design parameters are calculated according to the sampling rate Fs of the device and a predetermined parameter T: ; Among them, T is set to 4 or 8; when the number of electrodes is large, T is set to 8; conversely, when the number of electrodes is small, T is set to 4; S2. Input the EEG signal after extracting the time domain features into the spatial convolution layer; the spatial convolution layer uses a convolution kernel of size (C, 1) to weighted integrate the EEG signals collected by different electrodes and fuse them into a single channel; down-sample by average pooling to compress the high-frequency information of the weighted integrated EEG signal to below 30 Hz to obtain a compressed EEG signal; The size of the downsampling operation is determined by the following formula: ; Among them, represents the convolution kernel size adopted for average pooling; represents the data points within one second; S3, inputting the compressed EEG signal into a residual network, processing the high-frequency information of the compressed EEG signal, further optimizing the extraction of signal features, and obtaining the spatiotemporal features of the EEG signal; The signal first passes through several convolution filtering operations. The size of the small convolution kernel in the front order will extract higher frequency bands in the compressed signal. Through multiple small convolution kernels, the receptive field of the network will continue to expand until it expands to the specified length, extracting sufficiently low-frequency information. Through the connection between the layers of the residual network, the relatively high frequency band of the compressed signal will be retained and fused with the low-frequency information; The residual network transfers information between each layer through skip connections; by adding residual blocks, the receptive field of the model is expanded to capture more spatiotemporal features; The equivalent receptive field of the residual network is the size of the equivalent convolutional kernel represented by the multi-layer network K The calculation formula is as follows: ; The number of residual blocks is adjusted according to the actual number and spatial distribution of electrodes; S4. Sequence modeling is performed through a temporal convolutional network designed based on causal convolution. The previous sequence information is represented by the last time step to obtain a sparse expression of the features and a lightweight expression of the model. The classifier is used to complete lightweight motor imagery classification guided by frequency prior features.
2. The lightweight motor imagery classification method guided by frequency prior features according to claim 1, wherein The method performs sequence modeling through a temporal convolution network designed based on causal convolution, represents the previous sequence information through the last time step, obtains a sparse expression of features and a lightweight expression of the model; and completes lightweight motor imagery classification guided by frequency prior features through a classifier, including: Obtain a time series signal , fill the time series signal to obtain a new sequence signal ; Input the new sequence signal into the convolutional layer of the temporal convolutional network for convolutional operation, and the output of the next layer is only related to the previous data; Through multiple convolutional operations, all previous information will be obtained at the last time point / step to form a new feature representation. At this time, the entire sequence is not required, thus obtaining a lightweight representation of the model; Perform motor imagery classification through a classifier to obtain a new representational expression, and complete the lightweight motor imagery classification guided by frequency prior features.
3. A lightweight motor imagery classification device guided by frequency prior features, the lightweight motor imagery classification device guided by frequency prior features is used to implement the lightweight motor imagery classification method guided by frequency prior features according to any one of claims 1-2, characterized in that, The device includes: A time-domain feature extraction module, configured to obtain high-dimensional EEG signals, perform preliminary processing on the high-dimensional EEG signals, and extract the time-domain features of the high-dimensional EEG signals; A signal compression module, configured to input the EEG signals after extracting the time-domain features into a spatial convolutional layer; perform weighted integration on the EEG signals collected by different electrodes through the spatial convolutional layer and fuse them into a single channel; perform downsampling through average pooling to compress the high-frequency information of the weighted integrated EEG signals below 30 Hz to obtain compressed EEG signals; An optimization extraction module, configured to input the compressed EEG signals into a residual network, process the high-frequency information of the compressed EEG signals, and further optimize the extraction of signal features to obtain the spatio-temporal features of the EEG signals; A sequence modeling module, configured to perform sequence modeling through a temporal convolutional network designed based on causal convolution, represent the previous sequence information through the last time step, and obtain a sparse expression of features and a lightweight expression of the model; complete the lightweight motor imagery classification guided by frequency prior features through a classifier.
4. A lightweight motor imagery classification device guided by frequency prior features, the lightweight motor imagery classification device guided by frequency prior features includes: A processor; a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, any one of the methods in the lightweight motor imagery classification method guided by frequency prior features as described in any one of claims 1-2 is implemented.
5. A computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement any one of the methods in the lightweight motor imagery classification method guided by frequency prior features as described in any one of claims 1-2.
Citation Information
Patent Citations
Electroencephalogram signal decoding method based on space-time convolution and residual connection
CN117224149A
Motor imagery classification method based on electroencephalogram signals and deep learning and storage medium
CN117883096A