Motor imagery eeg classification method based on multi-domain entropy heterogeneous gating and time difference
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-08-11
AI Technical Summary
[0009]本发明的目的在于提供一种基于多域熵异质门控与时序差分的运动想象脑电分类方法,以解决现有运动想象脑电分类方法中时序变化建模不足、非线性统计特征融合不充分、多尺度差分特征冗余以及训练约束针对性不足等技术问题
[0029]1、本发明通过多域熵门控特征生成样本级调制权重,对短时、中时和长时差分分支进行自适应调制,使模型能够根据当前运动想象脑电样本的统计复杂度自适应调整不同差分尺度的重要性。
Smart Images

Figure CN122548446A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of brain-computer interface and EEG signal processing technology, specifically relating to a motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference. Background Technology
[0002] Motor imagery brain-computer interfaces (BCIs) are human-computer interaction technologies that identify patterns of electroencephalogram (EEG) signals generated when a subject imagines specific limb movements and convert them into external control commands. They have significant application value in fields such as rehabilitation training, assisted control, intelligent interaction, and neuroengineering. Due to the advantages of electroencephalography (EEG), including high temporal resolution, non-invasiveness, and low acquisition cost, motor imagery classification based on EEG signals has become an important research direction in the field of BCIs.
[0003] However, EEG signals from motor imagery are typically characterized by low signal-to-noise ratio, strong non-stationarity, significant individual variability, and noticeable fluctuations between trials. While existing methods can automatically extract EEG features using convolutional neural networks, recurrent neural networks, or attention mechanisms, they still suffer from the following problems.
[0004] Insufficient modeling of temporal variations: Conventional one-dimensional convolution mainly uses a fixed convolution kernel to weight and aggregate local amplitude patterns. Although it can extract local temporal features, it lacks the ability to explicitly model the dynamic changes between adjacent sampling points and between sampling points at different time intervals. The class discrimination information in motor imagery EEG signals is not only reflected in the amplitude magnitude, but also in the rhythmic changes, local fluctuations, and temporal evolution patterns at different time scales.
[0005] Insufficient fusion of nonlinear statistical features: EEG signals of motor imagery exhibit certain nonlinear complexity and differences in spectral energy distribution. Entropy features can describe the statistical characteristics of EEG signals from the perspectives of amplitude complexity, spectral structure, and temporal energy distribution complexity. However, existing methods mostly use entropy features as static artificial features input to classifiers, or simply concatenate them with deep features, lacking a mechanism for heterogeneous gating modulation based on the physical meaning of different entropy features.
[0006] Multi-scale differential feature redundancy: EEG temporal differential features at different time scales are complementary. Short-term changes can reflect local rapid fluctuations, medium-term changes can reflect rhythmic evolution over a medium time range, and long-term changes can reflect changes in motor imagery states over a larger time span. Existing multi-scale structures usually directly connect or stack multiple convolutional branches in parallel, lacking an adaptive differential scale selection mechanism guided by the complexity information of the sample itself.
[0007] Insufficient targeting of training constraints: Existing deep models typically rely primarily on classification loss for optimization, with little focus on constraining the stability of entropy-gated responses and the complementarity of multi-scale difference features. When EEG signals are affected by noise disturbances, amplitude fluctuations, or non-stationary changes between trials, the model's gating response may drift, and different scale branches may learn repetitive features.
[0008] In summary, there is currently a lack of a motor imagery EEG classification method that can utilize multi-domain entropy information, explicitly model multi-scale temporal differential dynamics, and jointly optimize entropy gating stability and differential scale complementarity. Summary of the Invention
[0009] The purpose of this invention is to provide a motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference, to address the technical problems of existing motor imagery EEG classification methods, such as insufficient modeling of temporal variations, inadequate fusion of nonlinear statistical features, redundancy of multi-scale difference features, and insufficient targeting of training constraints. This invention can effectively improve the discriminative power and robustness of motor imagery EEG classification.
[0010] To achieve the above objectives, the present invention adopts the following technical solution: a motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference, comprising:
[0011] S1. EEG signal acquisition and preprocessing: Acquire multi-channel motor imagery EEG signals and preprocess them to obtain standardized EEG feature representations;
[0012] S2. Construction of Multi-Domain Entropy Descriptors: Based on standardized EEG feature representations, entropy features are extracted from multiple perspectives, including amplitude distribution, temporal variation, spectral structure, and multi-scale temporal energy distribution, to construct multi-domain entropy descriptors that characterize the nonlinear statistical complexity of the current motor imagery EEG sample. The multi-domain entropy descriptor These include entropy features related to amplitude distribution complexity, entropy features related to temporal variation complexity, entropy features related to spectral structure complexity, and entropy features related to multi-scale temporal energy distribution complexity.
[0013] S3, Multi-domain Entropy Heterogeneous Gating: Gating multi-domain entropy descriptors Divided into temporal complexity entropy subvectors Spectral structure entropy subvector and multi-scale time-energy entropy subvector Then, for the time-domain complexity entropy subvector Apply learnable static attention gating to the spectral structure entropy subvector Apply input-related dynamic gating to the multi-scale time-entropy subvectors. Apply variance-based stability gating; map the gated modulated entropy sub-vectors to preset dimensions and concatenate them to obtain multi-domain entropy-gated features. ; and based on multi-domain entropy gated features Generate sample-level modulation weights corresponding to the short-time difference branch, the medium-time difference branch, and the long-time difference branch, respectively. , and ;
[0014] S4. Entropy-guided multi-scale temporal difference feature extraction: The standardized EEG feature representation is input into the multi-scale temporal difference feature extraction module for feature extraction. The multi-scale temporal difference feature extraction module includes parallel short-time difference branches, medium-time difference branches, and long-time difference branches. The short-time difference branch is used to extract rapidly changing features between adjacent sampling points, i.e., to obtain short-time difference features. The intermediate time difference branch is used to extract the variation features under intermediate time intervals, that is, to obtain the intermediate time difference features. The long-time difference branch is used to extract the long-term span variation features between the current sampling point and multiple historical sampling points, thus obtaining the long-time difference features. ; Utilizing sample-level modulation weights , and Adaptive weighted fusion of the difference features output from the short-time difference branch, the medium-time difference branch, and the long-time difference branch yields entropy-guided multi-scale temporal difference features. ;
[0015] S5. Long-range temporal context enhancement: Guiding entropy to multi-scale temporal difference features The input is a long-range temporal dependency extraction module to capture long-range temporal contextual information of motor imagery EEG signals, and the output is long-range temporal context-enhanced features. ;
[0016] S6. Feature Fusion and Classification: Gating features from multiple domain entropy. Long-range temporal context enhancement features The features are fused to obtain a multi-domain entropy-gated fusion feature representation for motion image classification. And multi-domain entropy-gated fusion feature representation Input the classifier and output the motion image category results;
[0017] S7. Model Training Optimization: Constructing a loss function based on motion imagery classification. Entropy-gated stability constraint loss Complementary constraint loss of difference scale The weighted summation of the comprehensive loss function is used to train and optimize the model, resulting in a well-trained and optimized classifier. The entropy-gated stability constraint loss is used to constrain the multi-domain entropy-gated response of the same motor imagery EEG sample to remain consistent before and after the disturbance or between adjacent time segments. The differential scale complementary constraint loss is used to reduce the redundant correlation between the output features of the short-term, medium-term, and long-term differential branches.
[0018] S8. Motor Imagery Category Output: The EEG signals of motor imagery to be classified are processed to obtain a multi-domain entropy-gated fusion feature representation. Then, input the trained and optimized classifier, and output the corresponding motion image category result.
[0019] Furthermore, in step S2, the multi-domain entropy descriptor This includes amplitude entropy, differential entropy, global spectral entropy, frequency band spectral entropy, frequency band energy distribution entropy, and multi-scale temporal energy entropy; wherein, the amplitude entropy is used to characterize the amplitude distribution complexity, the differential entropy is used to characterize the temporal variation complexity between adjacent sampling points or sampling points at a preset time interval, and the amplitude entropy and differential entropy are used to construct a temporal complexity entropy subvector. The global spectral entropy, band spectral entropy, and band energy distribution entropy are used to construct the spectral structure entropy sub-vector. The multi-scale time energy entropy includes time energy entropy calculated based on multiple scale time windows, and the multi-scale time energy entropy is used to construct a multi-scale time energy entropy sub-vector. .
[0020] Furthermore, in step S3, the temporal complexity entropy subvector is... Apply learnable static attention gating to assign weights to the magnitude complexity-related entropy components during training; apply it to the spectral structure entropy subvector. Apply input-related dynamic gating to adaptively adjust the contribution of the spectral entropy components based on the spectral complexity of the current sample; apply this to the multi-scale time-entropy subvector. A variance-based stability gate is applied to adjust the contribution of the multi-scale temporal energy entropy according to the degree of cross-scale fluctuation. The multiple entropy sub-vectors after gate modulation are input into a fully connected mapping layer and concatenated to obtain the multi-domain entropy-gated features. .
[0021] Further, in step S3, the sample-level modulation weights , and Features gated by multi-domain entropy The short-time difference (LTD) branch, medium-time difference (MTD) branch, and long-time difference (LTD) branch are obtained through fully connected mapping and normalization. Sample-level modulation weights are then used to optimize the short-time difference features. Mid-time difference characteristics and long time difference features Perform weighted fusion.
[0022] Furthermore, in step S4, the short-time difference branch, the medium-time difference branch, and the long-time difference branch are all implemented using differential convolution kernels and correspond to different difference time intervals, respectively; wherein, the short-time difference branch is used to convert the features of the current sampling point... Features of adjacent historical sampling points The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, and the mid-temporal difference branch is used to incorporate the features of the current sampling point. Features of historical sampling points at medium time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, and the long-time difference branch is used to incorporate the features of the current sampling point. Features of historical sampling points over long time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, so that each difference branch can complete the convolution modeling of the temporal change relationship of motor imagery EEG without explicitly constructing the difference sequence.
[0023] Further, in step S5, the long-range temporal dependency extraction module employs a progressively dilated convolution module, which includes multiple one-dimensional dilated convolutional layers cascaded according to a preset dilation rate. Long-range temporal context modeling is performed on the multi-scale temporal difference features modulated by multi-domain entropy gates through these multiple one-dimensional dilated convolutional layers to obtain long-range temporal context enhancement features. .
[0024] Furthermore, in step S7, the entropy-gated stability constraint loss The specific implementation method is as follows: construct a perturbation sample for the same motor imagery EEG sample, or select adjacent time segments from the same motor imagery trial; calculate the multi-domain entropy-gated response difference between the same motor imagery EEG sample and its perturbation sample, or between adjacent time segments of the same motor imagery trial; maintain response stability under sample perturbation or adjacent time segment conditions by minimizing the multi-domain entropy-gated response difference; wherein, the perturbation sample is constructed by at least one of weak noise perturbation, time clipping perturbation or amplitude perturbation.
[0025] Furthermore, in step S7, the differential scale complementary constraint loss The specific implementation method is as follows: obtain short-time difference features respectively. Mid-time difference characteristics and long time difference features ; Calculate the correlation, cosine similarity, or covariance redundancy between features at different difference scales; in motion image classification loss Under common constraints, the redundancy between features at different differential scales is minimized to encourage each differential branch to learn complementary temporal variation features of motor imagery EEG.
[0026] The present invention also provides a motor imagery EEG classification system based on multi-domain entropy heterogeneous gating and temporal difference, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, it can implement the above-mentioned method.
[0027] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the above-described method.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] 1. This invention generates sample-level modulation weights through multi-domain entropy gating features, and adaptively modulates short-time, medium-time and long-time difference branches, enabling the model to adaptively adjust the importance of different difference scales according to the statistical complexity of the current motor imagery EEG sample.
[0030] 2. This invention uses a multi-domain entropy heterogeneous gating mechanism to perform differentiated gating on the temporal complexity entropy subvector, the spectral structure entropy subvector, and the multi-scale time energy entropy subvector, thereby avoiding the simple splicing of entropy features with different physical meanings as homogeneous features.
[0031] 3. This invention improves the stability of the entropy-gated response and the complementarity of different difference scale features during the training process by using entropy-gated stability constraints and differential scale complementary constraints, thereby enhancing the robustness of the model to noise disturbances and inter-trial fluctuations. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the implementation of the motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference provided in this embodiment of the invention.
[0033] Figure 2 This is a diagram of the overall architecture of the model in an embodiment of the present invention;
[0034] Figure 3 This is a block diagram illustrating the implementation principle of multi-domain entropy heterogeneous gating in this embodiment of the invention.
[0035] Figure 4 This is a block diagram illustrating the implementation principle of model training optimization in this embodiment of the invention. Detailed Implementation
[0036] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0037] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0038] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0039] like Figure 1-2 As shown in the figure, this embodiment provides a motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference, and its specific implementation process is as follows.
[0040] S1. EEG Signal Acquisition and Preprocessing: Acquire multi-channel motor imagery EEG signals and perform preprocessing to obtain standardized EEG feature representations. .
[0041] In this embodiment, the publicly available dataset BCI Competition IV-2a was used. This dataset contains EEG data from 9 subjects on motor imagery. EEG signals were acquired using 22 EEG channels arranged according to the international 10-20 system at a sampling rate of 250 Hz. The motor imagery task included four categories: left hand, right hand, both feet, and tongue. The raw EEG signals were bandpass filtered in a preset frequency band to remove baseline drift, high-frequency noise, and interference components unrelated to the motor imagery rhythm. A 4-second time segment following the motor imagery task prompt was used as a trial input sample, with each trial containing 1000 sampling points. For each trial, a standardized EEG feature representation was obtained. Where 22 represents the number of EEG channels and 1000 represents the number of sampling points. The mean and standard deviation are calculated based on the training set, and the training and test sets are standardized respectively.
[0042] S2. Construction of Multi-Domain Entropy Descriptors: Based on Standardized EEG Feature Representation Entropy features were extracted from four perspectives: amplitude distribution, temporal variation, spectral structure, and multi-scale temporal energy distribution, to construct a multi-domain entropy descriptor for characterizing the nonlinear statistical complexity of current motor imagery EEG samples. The multi-domain entropy descriptor These include entropy features related to amplitude distribution complexity, entropy features related to temporal variation complexity, entropy features related to spectral structure complexity, and entropy features related to multi-scale temporal energy distribution complexity.
[0043] In this embodiment, the multi-domain entropy descriptor The feature vector is 13-dimensional, including one amplitude entropy, one difference entropy, one global spectral entropy, five frequency band spectral entropies, one frequency band energy distribution entropy, and multi-scale temporal energy entropy (including four-scale temporal energy entropies). The amplitude entropy characterizes the complexity of the amplitude distribution, the difference entropy characterizes the temporal variation complexity between adjacent sampling points or sampling points at a preset time interval, and the amplitude entropy and difference entropy are used to construct the temporal complexity entropy subvector. Global spectral entropy, band spectral entropy, and band energy distribution entropy are used to construct the spectral structure entropy subvector. Among them, the spectral entropy of the five frequency bands respectively corresponds to , , , and Frequency bands and frequency band energy distribution entropy are used to describe the uncertainty of energy distribution between different frequency bands. Multi-scale time energy entropy is used to construct multi-scale time energy entropy sub-vectors. The time energy entropy at the four scales is calculated based on time windows of 0.5 seconds, 1 second, 2 seconds, and 4 seconds, respectively, and is used to characterize the energy distribution complexity within the range of local short-term energy fluctuations, medium-short-term energy changes, medium-long-term energy evolution, and complete motion imagination trials.
[0044] S3, Multi-domain entropy heterogeneous gating: such as Figure 3 As shown, the multi-domain entropy descriptor Based on physical meaning, it is divided into time-domain complexity entropy sub-vectors. Spectral structure entropy subvector and multi-scale time-energy entropy subvector Then, for the time-domain complexity entropy subvector Apply learnable static attention gating to the spectral structure entropy subvector Apply input-related dynamic gating to the multi-scale time-entropy subvectors. Apply variance-based stability gating. Map the three gated entropy sub-vectors to a preset dimension and concatenate them to obtain the multi-domain entropy-gated features. Then, based on multi-domain entropy-gated features... Generate sample-level modulation weights corresponding to the short-time difference branch, the medium-time difference branch, and the long-time difference branch, respectively. , and .
[0045] Among them, the time-domain complexity entropy subvector Used to characterize time-domain magnitude complexity and local variation uncertainty; for the time-domain complexity entropy subvector Apply learnable static attention gating to assign weights to the magnitude complexity-related entropy components during training. Spectral structure entropy subvectors. Used to characterize frequency structure complexity; for the spectral structure entropy subvector Apply input-related dynamic gating to adaptively adjust the contribution of the spectral entropy components based on the spectral complexity of the current sample. Multi-scale temporal energy entropy sub-vectors. Used to characterize the complexity of energy distribution at different time scales; for multi-scale time energy entropy sub-vectors A variance-based stability gate is applied to adjust the contribution of the multi-scale temporal energy entropy according to its cross-scale fluctuations. The three gated and modulated entropy sub-vectors are then input into a fully connected mapping layer and concatenated to obtain the multi-domain entropy-gated features. The sample-level modulation weights , and Features gated by multi-domain entropy The features are obtained through fully connected mapping and normalization, corresponding to short-time difference branches, medium-time difference branches, and long-time difference branches, respectively. In this embodiment, multi-domain entropy-gated features are used. The dimensions are [1, 64].
[0046] S4. Entropy-guided multi-scale temporal difference feature extraction: The standardized EEG feature representation is input into the multi-scale temporal difference feature extraction module for feature extraction. The multi-scale temporal difference feature extraction module includes parallel short-time difference branches, medium-time difference branches, and long-time difference branches. The short-time difference branch is used to extract rapidly changing features between adjacent sampling points, i.e., to obtain short-time difference features. The intermediate time difference branch is used to extract the variation features under intermediate time intervals, that is, to obtain the intermediate time difference features. The long-time difference branch is used to extract the long-term span variation features between the current sampling point and multiple historical sampling points, thus obtaining the long-time difference features. ; Utilizing sample-level modulation weights , and Adaptive weighted fusion of the difference features output from the short-time difference branch, the medium-time difference branch, and the long-time difference branch yields entropy-guided multi-scale temporal difference features. .
[0047] In this embodiment, as Figure 2 As shown, the system represents standardized EEG features. Input short-time difference branch, medium-time difference branch, and long-time difference branch. The short-time difference branch is used to extract rapidly changing features between adjacent sampling points. Mid-time difference branching is used to extract variation features over medium time intervals. Long-time difference branch is used to extract long-term variation features between the current sampling point and multiple historical sampling points. In this embodiment, all three difference branches are implemented using one-dimensional temporal convolution constructed with differential convolution kernels, and the number of output channels is set to 128 for each branch, resulting in differential features. , , The shapes are all [128, 1000]. The system is based on multi-domain entropy-gated features. Generate three sample-level modulation weights , and And using the sample-level modulation weights to , Weighted fusion is performed to obtain multi-scale temporal difference features guided by multi-domain entropy gating. Its shape is [128, 1000].
[0048] In this embodiment, the short-time difference branch, the medium-time difference branch, and the long-time difference branch are all implemented using differential convolution kernels, and each corresponds to a different difference time interval. Specifically, the short-time difference branch corresponds to a difference interval... Used to extract features from the current sampling point Features of adjacent historical sampling points The difference relationship between them is embedded in a one-dimensional temporal convolution kernel to model the features of the current sampling point. Features of adjacent historical sampling points The rapid changing relationship between them; the difference interval corresponding to the mid-time difference branch. Used to extract features from the current sampling point Features of historical sampling points at medium time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel to model the features of the current sampling point. Features of historical sampling points at medium time intervals The rhythmic evolution relationship between them; the difference interval corresponding to the long-term difference branch. Used to extract features from the current sampling point Features of historical sampling points over long time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel to model the features of the current sampling point. Features of historical sampling points over long time intervals The long-span variation relationship between them. Through the above method, each difference branch can complete the convolution modeling of the variation relationship of motor imagery EEG at different temporal scales without explicitly constructing the difference sequence.
[0049] S5. Long-range temporal context enhancement: Guiding entropy to multi-scale temporal difference features The input is a long-range temporal dependency extraction module to capture long-range temporal contextual information of motor imagery EEG signals, and the output is long-range temporal context-enhanced features. .
[0050] Preferably, the long-range temporal dependency extraction module employs a progressively dilated convolution module, which includes multiple one-dimensional dilated convolutional layers cascaded according to a preset dilation rate. Long-range temporal context modeling is performed on the multi-scale temporal difference features modulated by multi-domain entropy gates through these multiple one-dimensional dilated convolutional layers to obtain long-range temporal context enhancement features. In this embodiment, the progressively dilated convolution module includes six cascaded one-dimensional dilated convolutional layers with dilation rates set to 1, 2, 4, 8, 16, and 32, respectively. Each one-dimensional dilated convolutional layer is followed by a normalization layer, a nonlinear activation layer, and a random deactivation layer to progressively expand the temporal receptive field and extract long-range temporal context information. After processing by the progressively dilated convolution module, long-range temporal context enhancement features are obtained. And a long-range context feature representation with shape [1,256] is obtained by global average pooling.
[0051] S6. Feature Fusion and Classification: Gating features from multiple domain entropy. Long-range temporal context enhancement features The features are fused to obtain a multi-domain entropy-gated fusion feature representation for motion image classification. And multi-domain entropy-gated fusion feature representation Input the classifier and output the motion image category results.
[0052] In this embodiment, The shape is [1, 64]. The shape is [1,256], after splicing The shape is [1, 320]. [The rest of the text is missing.] The input is further fused into a fully connected layer, which has an output dimension of 128 and uses ReLU activation. Finally, a 4-dimensional Softmax classification layer is used to output the probability of the motor imagery category, corresponding to the four motor imagery tasks of left hand, right hand, both feet and tongue.
[0053] S7. Model Training Optimization: Constructing a loss function based on motion imagery classification. Entropy-gated stability constraint loss Complementary constraint loss of difference scale The weighted summation of the comprehensive loss function is used to train and optimize the model, resulting in a well-trained and optimized classifier. The entropy-gated stability constraint loss is used to constrain the multi-domain entropy-gated response of the same motor imagery EEG sample to remain consistent before and after the disturbance or between adjacent time segments. The differential scale complementary constraint loss is used to reduce the redundant correlation between the output features of the short-term differential branch, the medium-term differential branch, and the long-term differential branch.
[0054] Among them, the entropy-gated stability constraint loss The specific implementation method is as follows: construct a perturbation sample for the same motor imagery EEG sample, or select adjacent time segments from the same motor imagery trial; calculate the multi-domain entropy-gated response difference between the same motor imagery EEG sample and its perturbation sample, or between adjacent time segments of the same motor imagery trial; maintain response stability under sample perturbation or adjacent time segment conditions by minimizing the multi-domain entropy-gated response difference; wherein, the perturbation sample is constructed by at least one of weak noise perturbation, time clipping perturbation or amplitude perturbation.
[0055] The differential scale complementary constraint loss The specific implementation method is as follows: obtain short-time difference features respectively. Mid-time difference characteristics and long time difference features ; Calculate the correlation, cosine similarity, or covariance redundancy between features at different difference scales; in motion image classification loss Under common constraints, the redundancy between features at different differential scales is minimized to encourage each differential branch to learn complementary temporal variation features of motor imagery EEG.
[0056] Figure 4 This is a schematic diagram illustrating the model training and optimization process in this embodiment. For example... Figure 4 As shown, during model training, a comprehensive loss function is minimized. The comprehensive loss function Represented as:
[0057]
[0058] in, Cross-entropy loss is used; The difference in multi-domain entropy-gated response between the same motor imagery EEG sample and its perturbation sample is obtained by calculating the difference between the two samples. The perturbation sample is constructed by at least one of weak noise perturbation, time clipping perturbation, or amplitude perturbation. By calculating short-time difference characteristics Mid-time difference characteristics and long time difference features The correlation, cosine similarity, or covariance redundancy between them are obtained.
[0059] In this embodiment, Set to 0.1, Set to 0.05. During training, the Adam optimizer is used with an initial learning rate of 0.0005, a batch size of 16, 100 training epochs, and early stopping is performed using the classification accuracy of the validation set.
[0060] S8. Motor Imagery Category Output: The process involves signal preprocessing of the EEG signal to be classified as motor imagery, construction of multi-domain entropy descriptors, multi-domain entropy heterogeneous gating, entropy-guided multi-scale temporal difference feature extraction, and long-range temporal context enhancement to obtain a multi-domain entropy-gated fusion feature representation. Then, input the trained and optimized classifier, and output the corresponding motion image category result.
[0061] This embodiment also provides a motor imagery EEG classification system based on multi-domain entropy heterogeneous gating and temporal difference, including a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, it can implement the above-described method.
[0062] This embodiment also provides a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method.
[0063] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0064] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0065] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0066] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0067] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for classifying motor imagery EEG based on multi-domain entropy heterogeneous gating and temporal difference, characterized in that, include: S1. EEG signal acquisition and preprocessing: Acquire multi-channel motor imagery EEG signals and preprocess them to obtain standardized EEG feature representations; S2. Construction of Multi-Domain Entropy Descriptors: Based on standardized EEG feature representations, entropy features are extracted from multiple perspectives, including amplitude distribution, temporal variation, spectral structure, and multi-scale temporal energy distribution, to construct multi-domain entropy descriptors that characterize the nonlinear statistical complexity of the current motor imagery EEG sample. The multi-domain entropy descriptor These include entropy features related to amplitude distribution complexity, entropy features related to temporal variation complexity, entropy features related to spectral structure complexity, and entropy features related to multi-scale temporal energy distribution complexity. S3, Multi-domain Entropy Heterogeneous Gating: Gating multi-domain entropy descriptors Divided into temporal complexity entropy subvectors Spectral structure entropy subvector and multi-scale time-energy entropy subvector Then, for the time-domain complexity entropy subvector Apply learnable static attention gating to the spectral structure entropy subvector Apply input-related dynamic gating to the multi-scale time-entropy subvectors. Apply variance-based stability gating; map the gated modulated entropy sub-vectors to preset dimensions and concatenate them to obtain multi-domain entropy-gated features. ; And based on multi-domain entropy gating features Generate sample-level modulation weights respectively corresponding to short-time difference branch, medium-time difference branch and long-time difference branch 、 And ; S4. Entropy-guided multi-scale temporal difference feature extraction: The standardized EEG feature representation is input into the multi-scale temporal difference feature extraction module for feature extraction; the multi-scale temporal difference feature extraction module includes parallel short-time difference branches, medium-time difference branches, and long-time difference branches; The short-time difference branch is used to extract rapidly changing features between adjacent sampling points, thus obtaining short-time difference features. The intermediate time difference branch is used to extract the variation features under intermediate time intervals, that is, to obtain the intermediate time difference features. The long-time difference branch is used to extract the long-term span variation features between the current sampling point and multiple historical sampling points, thus obtaining the long-time difference features. ; Utilizing sample-level modulation weights , and Adaptive weighted fusion of the difference features output from the short-time difference branch, the medium-time difference branch, and the long-time difference branch yields entropy-guided multi-scale temporal difference features. ; S5. Long-range temporal context enhancement: Guiding entropy to multi-scale temporal difference features The input is a long-range temporal dependency extraction module to capture long-range temporal contextual information of motor imagery EEG signals, and the output is long-range temporal context-enhanced features. ; S6. Feature Fusion and Classification: Gating features from multiple domain entropy. Long-range temporal context enhancement features The features are fused to obtain a multi-domain entropy-gated fusion feature representation for motion image classification. And multi-domain entropy-gated fusion feature representation Input the classifier and output the motion image category results; S7. Model Training Optimization: Constructing a loss function based on motion imagery classification. Entropy-gated stability constraint loss Complementary constraint loss of difference scale The weighted summation of the comprehensive loss function is used to train and optimize the model, resulting in a well-trained and optimized classifier. The entropy-gated stability constraint loss is used to constrain the multi-domain entropy-gated response of the same motor imagery EEG sample to remain consistent before and after the disturbance or between adjacent time segments. The differential scale complementary constraint loss is used to reduce the redundant correlation between the output features of the short-term, medium-term, and long-term differential branches. S8. Motor Imagery Category Output: The EEG signals of motor imagery to be classified are processed to obtain a multi-domain entropy-gated fusion feature representation. Then, input the trained and optimized classifier, and output the corresponding motion image category result.
2. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference as described in claim 1, characterized in that, In step S2, the multi-domain entropy descriptor This includes amplitude entropy, differential entropy, global spectral entropy, frequency band spectral entropy, frequency band energy distribution entropy, and multi-scale temporal energy entropy; wherein, the amplitude entropy is used to characterize the amplitude distribution complexity, the differential entropy is used to characterize the temporal variation complexity between adjacent sampling points or sampling points at a preset time interval, and the amplitude entropy and differential entropy are used to construct a temporal complexity entropy subvector. The global spectral entropy, band spectral entropy, and band energy distribution entropy are used to construct the spectral structure entropy sub-vector. The multi-scale time energy entropy includes time energy entropy calculated based on multiple scale time windows, and the multi-scale time energy entropy is used to construct a multi-scale time energy entropy sub-vector. .
3. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S3, the time domain complexity entropy sub-vectors Applying a learnable static attention gate to assign weights to the magnitude complexity dependent entropy components during the training process; Spectral structure entropy sub-vector Applying input-dependent dynamic gating to adaptively adjust the contribution of the spectral entropy component depending on the spectral complexity of the current sample; Sub-vectors of multiscale temporal energy entropy Applying variance-based stability gating to adjust contribution of multiscale temporal energy entropy according to its cross-scale fluctuation degree; Multiple entropy subvectors after gating modulation are input into a fully connected mapping layer and concatenated to obtain multi-domain entropy-gated features. .
4. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S3, the sample-level modulation weights , and Features gated by multi-domain entropy The results, obtained through fully connected mapping and normalization, correspond to short-time difference branches, medium-time difference branches, and long-time difference branches, respectively.
5. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S4, the short-time difference branch, the medium-time difference branch, and the long-time difference branch are all implemented using differential convolution kernels and correspond to different difference time intervals, respectively; wherein, the short-time difference branch is used to convert the features of the current sampling point... Features of adjacent historical sampling points The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, and the mid-temporal difference branch is used to incorporate the features of the current sampling point. Features of historical sampling points at medium time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, and the long-time difference branch is used to incorporate the features of the current sampling point. Features of historical sampling points over long time intervals The difference relationship between them is embedded in a one-dimensional temporal convolution kernel, so that each difference branch can complete the convolution modeling of the temporal change relationship of motor imagery EEG without explicitly constructing the difference sequence.
6. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S5, the long-range temporal dependency extraction module employs a progressively dilated convolution module, which includes multiple one-dimensional dilated convolutional layers cascaded according to a preset dilation rate. Long-range temporal context modeling is performed on the multi-scale temporal difference features modulated by multi-domain entropy gates using these multiple one-dimensional dilated convolutional layers, resulting in enhanced long-range temporal context features. .
7. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S7, the entropy-gated stability constraint loss The specific implementation method is as follows: construct a perturbation sample for the same motor imagery EEG sample, or select adjacent time segments from the same motor imagery trial; calculate the multi-domain entropy-gated response difference between the same motor imagery EEG sample and its perturbation sample, or between adjacent time segments of the same motor imagery trial; maintain response stability under sample perturbation or adjacent time segment conditions by minimizing the multi-domain entropy-gated response difference; wherein, the perturbation sample is constructed by at least one of weak noise perturbation, time clipping perturbation or amplitude perturbation.
8. The motor imagery EEG classification method based on multi-domain entropy heterogeneous gating and temporal difference according to claim 1, characterized in that, In step S7, the differential scale complementary constraint loss The specific implementation method is as follows: obtain short-time difference features respectively. Mid-time difference characteristics and long time difference features ; Calculate the correlation, cosine similarity, or covariance redundancy among features at different difference scales; in motion image classification loss. Under common constraints, the redundant relationships between features at different differential scales are minimized to encourage each differential branch to learn complementary temporal variation features of motor imagery EEG.
9. A motor imagery EEG classification system based on multi-domain entropy heterogeneous gating and temporal difference, characterized in that, It includes a memory, a processor, and computer program instructions stored in the memory and executable by the processor, which, when executed by the processor, enable the implementation of the method as described in any one of claims 1-8.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by a processor, the method as described in any one of claims 1-8 is implemented.