Method for decoding electroencephalogram intention by convolutional manifold attention network model

Through the convolutional manifold attention network model, combined with a variety of loss functions and modules, the problem of distribution shift in motor imagination EEG signal decoding is solved, the generalization and robustness of the model are improved, and effective EEG processing is achieved. Intent decoding promotes the application of brain-computer interfaces.

CN118734181APending Publication Date: 2024-10-01YANSHAN UNIV

Patent Information

Application Number
CN202410723385.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing motor imagery EEG signal decoding models face distribution shift problems in practical applications, causing the model to fail on test data and hindering the development of brain-computer interface technology.

Method used

The convolutional manifold attention network model is used, through the spatiotemporal convolution module, Euclidean space to Riemannian space conversion unit, semantic latent coding module and mutation latent coding module, combined with reconstruction loss and Hilbert-Schmidt independence criterion and variational information bottleneck loss, decoding motor imagery intentions in EEG signals, and identifying variation factors caused by individual differences and confounding factors.

Benefits of technology

It improves the out-of-distribution generalization and robustness of the model, effectively extracts the representation of movement intention in the EEG signal, and reduces the deviation of intention decoding, thereby improving the practical application potential of brain-computer interface.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734181A_ABST
    Figure CN118734181A_ABST
Patent Text Reader

Abstract

The invention discloses a method for decoding an electroencephalogram intention through a convolution manifold attention network model, and belongs to the field of biological signal processing and application, and the method comprises the steps: constructing a motor imagery intention decoding model which comprises a space-time convolution module, a semantic implicit coding module, a variation implicit coding module and a reconstruction module, the extraction module is used for extracting category-related representations of electroencephalogram signals; the loss of the motor imagery intent decoding model is calculated, and the loss comprises Hilbert-Schmidt independence criterion loss between coded semantics and variation implicit factors, reconstruction loss between coded spatial-temporal characteristics and reconstruction spatial-temporal characteristics, and variational information bottleneck constraints between model data, coded implicit factors and a prediction target; the constraint module is used for cooperating with a model structure and constraining gradient change of the model in a training process; the multi-channel electroencephalogram signals are input into the model, and discrimination information representing the motion intention is coded from the electroencephalogram signals. The real intention of the subject can be decoded from the cross-domain electroencephalogram signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of biological signal processing and application, and in particular to a method for decoding electroencephalogram intention using a convolutional manifold attention network model. Background Art

[0002] Brain-Computer Interface (BCI) is a very promising technology that establishes a direct channel for communication and control between the brain and external devices. By recording and decoding brain activity, BCI systems can achieve many exciting applications, such as helping people with disabilities recover motor function and improving the entertainment experience of healthy people. Among the many BCI paradigms, motor imagery is one of the most widely adopted active experimental paradigms. This paradigm allows users to imagine the movement of a limb without actual movement and is considered to be a very effective rehabilitation training method. Although motor imagery has great potential in the field of rehabilitation, its application is subject to some limitations. One of the main challenges is to improve the accuracy and stability of motor imagery EEG signal decoding. In recent years, a lot of efforts have been invested in the decoding of motor imagery EEG signals, especially deep learning-based methods, and remarkable achievements have been made.

[0003] However, these studies implicitly assume that the training data and test data of the model come from the same distribution, which is contrary to the situation faced by practical applications. In practice, test data is often out of distribution, and this distribution shift caused by test data may cause the model to fail in the test data, which seriously hinders the development of BCI technology in practical applications. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for decoding EEG intention using a convolutional manifold attention network model, so as to decode the true intention of the subject from cross-domain EEG signals.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A method for decoding EEG intention using a convolutional manifold attention network model, comprising the following steps:

[0007] S1. Constructing a motor imagery intention decoding model:

[0008] S11. Construct a spatiotemporal convolution module to extract spatiotemporal features from multi-channel motor imagery EEG signals.

[0009] S12, constructing a Euclidean space to Riemannian space conversion unit, converting the EEG spatiotemporal features in the Euclidean space to the Riemannian space, and obtaining the spatiotemporal features in the Riemannian space;

[0010] S13, constructing a semantic latent coding module, sending the spatiotemporal features in the Riemann manifold space into the semantic latent coding module to encode semantic latent factors;

[0011] S14, constructing a variation latent coding module, sending the spatiotemporal features in the Riemann manifold space into the variation latent coding module to encode the variation latent factors;

[0012] S15, construct a decoding module to jointly decode the semantic latent factors and the variation latent factors into EEG spatiotemporal features;

[0013] S2. Calculate the loss of the motor imagery intention decoding model:

[0014] S21, the reconstruction loss is introduced between the spatiotemporal features encoded by the model and the spatiotemporal features decoded;

[0015] S22, the Hilbert-Schmidt independence criterion loss is introduced between the semantic latent factors and the variation latent factors encoded by the model;

[0016] S23, a variational information bottleneck loss is introduced between the input EEG signal, the latent factors encoded by the model, and the target;

[0017] S24, defining the overall loss of the model according to the calculated Hilbert-Schmidt independence criterion loss, reconstruction loss and variational information bottleneck loss;

[0018] S3. Input multi-channel EEG signals into the constructed model, use the semantic and variation latent factor encoding module of the model, and combine the loss of the motor imagery intention decoding model, so that the model can effectively encode the discriminative information representing the motor intention from the EEG signals, and identify the variation factors caused by individual differences, artifacts, etc. caused by physiological and technical confounding factors.

[0019] A further improvement of the technical solution of the present invention is that in S11, the spatiotemporal convolution module includes a spatial convolution block and a temporal convolution block, and the process of processing the EEG signal is expressed as follows:

[0020] F se =f e (f s (X i ))

[0021] In the formula, f s and f e Respectively represent the spatial convolution unit and the temporal convolution unit, X i ∈R c×t represents a multi-channel EEG signal, c represents the number of EEG signal leads, and t represents the number of samples in t seconds;

[0022] For a multi-channel EEG signal X i, reorganize it into a three-dimensional tensor of size (1, c, t), and send it to the spatial convolution block, the convolution kernel size is c×1, the output feature map channel is o, and the output feature map The feature map is then fed into the temporal convolution block (the convolution kernel size is 1×k and the feature map channel is d), and the output feature map is and reorganize it into In order to prepare for the subsequent encoding of different types of latent factors; finally, the spatiotemporal features Transformed to size d×t e The feature matrix F of .

[0023] A further improvement of the technical solution of the present invention is that: in S12, the extracted spatiotemporal feature map Divided into n fragments, namely:

[0024]

[0025] In order to map the spatiotemporal feature maps of each fragment into the Riemann space, the symmetric matrix of each fragment is calculated:

[0026] C i ={F i ′(F i ′) T |F i ′=F i -mean(F i )}∈sym(d)

[0027] The symmetric matrix is ​​subjected to trace normalization, namely:

[0028] C i / tr(C i )+τI

[0029] Where tr(·) represents the trace operation, τ is 1e-4, and I represents the unit matrix;

[0030] The symmetric matrix is ​​mapped to the Riemann manifold using the exponential mapping, namely:

[0031]

[0032] Among them, Exp(·) represents exponential mapping, sym(d) represents symmetric matrix, and sym + (d) represents a symmetric positive definite matrix.

[0033] A further improvement of the technical solution of the present invention is that: in S13, the semantic latent coding module includes a manifold attention unit, a Riemann space to Euclidean space conversion unit, a feature coding unit and a classifier;

[0034] The process of encoding semantic latent factors is: for the spatiotemporal features in the Riemann manifold space First, manifold attention is used to make the model focus on more critical time segments and reduce model bias;

[0035] Manifold attention processes spatiotemporal features The specific process is: for the Riemann manifold feature of the i-th segment The query (query, q), key (key, k) and value (value, v) of the fragment in the manifold space are calculated through bilinear mapping:

[0036]

[0037]

[0038] In the formula, They represent the transformation matrix with full row rank, namely:

[0039] R(W q )=R(W k )=R(W v ) = d o , d represents The dimension, d o Indicates q i , k i and v i The output dimension of ; then, the similarity between q and k is measured using the logarithmic Euclidean method, that is

[0040]

[0041] In the formula, δ L (·) indicates q i and k j Geodesic distance in manifold space, log(·) represents logarithmic operation;

[0042] Based on this, the Softmax function is used to calculate the attention matrix, that is, Through the attention matrix and v, the model focuses on more critical fragments in the time dimension, that is,

[0043]

[0044] In the formula, v′ i represents the output after manifold attention optimization;

[0045] Next, the optimized output v′ i Send it to the Riemann space to Euclidean space conversion unit and project it into Euclidean space, that is,

[0046]

[0047] In the formula, is a positive definite symmetric matrix v′ i The eigenvalue of The corresponding eigenvectors form a feature matrix; the output features are then flattened and sent to the feature encoding unit to encode the semantic latent factors using the reparameterization technique; at the same time, the unit is followed by a classifier to classify the semantic latent factors in order to identify the EEG intention of motor imagery and classify the motor imagery category.

[0048] A further improvement of the technical solution of the present invention lies in that: in S14, the structure of the variation latent factor encoding module is different from that of the semantic latent factor encoding module in that the module introduces a gradient reversal layer before feature reparameterization encoding; the gradient reversal layer is used to enable the module to encode features that are irrelevant to the target intention, that is, to encode features that change in the EEG signal.

[0049] A further improvement of the technical solution of the present invention is that in S15, the decoding module includes a fully connected layer, a deconvolution block and a Euclidean space to Riemann space conversion unit, which converts the semantic latent factor Latent Factor The specific process of joint decoding is:

[0050] For the encoded semantic latent factor Z s and the latent factor Z u , first connect it into a comprehensive latent factor Z = concat(Z s ,Z u ), and after a fully connected layer, its input is then fed into a deconvolution block; the block includes two deconvolution layers and a batch normalization layer;

[0051] The latent factor Z is decoded into an output with the same number of channels as the spatiotemporal feature map output by the spatiotemporal convolution module through the deconvolution block;

[0052] Finally, the feature map is projected into the Riemannian space using a Euclidean to Riemannian conversion unit, so that it has the same dimension as the Riemannian manifold feature input in the encoder.

[0053] A further improvement of the technical solution of the present invention is that: in S21, for the encoded semantic latent factor Z s and the latent factor Z u , connect it and send it to the decoder to get the reconstructed features The reconstruction loss is then expressed as

[0054]

[0055] Where MSE(·) represents the mean square error.

[0056] The further improvement of the technical solution of the present invention is that: in S22, since there may be correlation between the information of the encoded semantics and the variant latent factor, the Hilbert-Schmidt independence criterion loss is introduced to remove the mutual dependence between the two; for the semantic latent factor Z s , latent factor Z u , and kernels k and l, the Hilbert-Schmidt independence criterion constraint is expressed as

[0057]

[0058] In the formula, m represents the number of latent factors, k and l represent kernel functions, and the radial basis kernel function is used, K,L∈R m×m represents the radial basis kernel function kernel matrix, that is P=Im -1 11 T ∈R m×m represents a centered matrix, where I represents the identity matrix and 1 represents a column vector of all 1s.

[0059] The further improvement of the technical solution of the present invention is that: in S23, the variational information bottleneck constraint is used to compress the semantics and the variation latent factors, eliminating the influence of redundant information on the result latent variables, and at the same time, the gradient reversal layer is combined to separate the semantics and the variation latent factors;

[0060] The overall variational information bottleneck constraint is expressed as

[0061]

[0062] where q(·|·) represents the variational approximation of the conditional distribution p(·|·), r(·) is the variational approximation of the marginal distribution p(·), and f(x n ,∈)=z,∈ represents a Gaussian random variable, β is a trade-off parameter, D KL (·||·) represents the Kullback-Leibler divergence measure, N represents the number of samples, and x n and n Respectively represent the nth sample in the EEG signal X and the corresponding label, Z s With Z u They represent the semantics and variation latent factors of the encoding respectively, and log(·) represents the logarithmic operation.

[0063] A further improvement of the technical solution of the present invention is that in S24, the overall loss of the model is calculated:

[0064]

[0065] Where α and γ represent the coefficients of the corresponding loss, which are set to 0.8 and 1.0 respectively.

[0066] Due to the adoption of the above technical solution, the technical progress achieved by the present invention is:

[0067] 1. Based on the principle of causal invariance, the present invention successfully disentangles the cross-domain invariant representation of the intention category in the EEG signal from the perspective of causality and the variable representation of confounding factors such as individual differences and signal acquisition environment, effectively improving the distribution out-of-bounds generalization of the model, which is novel and efficient.

[0068] 2. The present invention effectively improves the robustness of the influence of noise on the model by integrating manifold learning. At the same time, it uses the attention mechanism to make the model focus on signal segments that are more relevant to identifying EEG intention categories, thereby reducing the deviation of intent decoding and achieving higher robustness.

[0069] 3. In the field of brain-computer interface research, EEG intention recognition is the focus of current research. The method proposed in this patent can effectively extract the invariant representation of motor intention in EEG signals, improve the generalization ability of the model, and has good research prospects for promoting the practical application of brain-computer interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A flow chart of a method for decoding EEG intention using a convolutional manifold attention network model based on the causal invariance principle disclosed by the present invention;

[0071] Figure 2 The results of the subject dependence experiment of the model of the present invention on the fourth BCI competition data set 1;

[0072] Figure 3 This is the result of the subject independence experiment of the model of the present invention on the fourth BCI competition dataset 1. DETAILED DESCRIPTION

[0073] The present invention is further described in detail below with reference to the accompanying drawings and embodiments:

[0074] like Figure 1 As shown in FIG. 1 , a method for decoding EEG intention using a convolutional manifold attention network model includes the following steps:

[0075] S1. Construct a motor imagery intention decoding model, which includes a spatiotemporal convolution module, a semantic latent coding module, a variational latent coding module and a reconstruction module to extract category-related representations of EEG signals.

[0076] S1 specifically includes the following steps:

[0077] S11. Construct a spatiotemporal convolution module to extract the spatiotemporal features in the multi-channel motor imagery EEG signal; input the EEG signal into the spatiotemporal convolution module to extract the spatiotemporal features in the EEG signal;

[0078] The spatiotemporal convolution module includes a spatial convolution block and a temporal convolution block. The process of processing EEG signals is expressed as:

[0079] F se =f e (f s (X i ))

[0080] In the formula, f s and f e Respectively represent the spatial convolution unit and the temporal convolution unit, X i ∈R c×t represents a multi-channel EEG signal, c represents the number of EEG signal leads, and t represents the number of samples in t seconds; specifically, for a multi-channel EEG signal X i , reorganize it into a three-dimensional tensor of size (1, c, t), and send it to the spatial convolution block (the convolution kernel size is c×1, and the output feature map channel is o), and the output feature map The feature map is then fed into the temporal convolution block (the convolution kernel size is 1×k and the feature map channel is d), and the output feature map is and reorganize it into In order to prepare for the subsequent encoding of different types of latent factors; finally, the spatiotemporal features Transformed to size d×t e The feature matrix F of .

[0081] S12, constructing a Euclidean space to Riemannian space conversion unit, converting the EEG spatiotemporal features in the Euclidean space to the Riemannian space, and obtaining the spatiotemporal features in the Riemannian space;

[0082] The extracted spatiotemporal feature map Divided into n fragments, namely:

[0083]

[0084] In order to map the spatiotemporal feature maps of each fragment into the Riemann space, the symmetric matrix of each fragment is calculated:

[0085] C i ={F i ′(F i ′) T |F i ′=F i -mean(F i )}∈sym(d)

[0086] The symmetric matrix is ​​subjected to trace normalization, namely:

[0087] C i / tr(C i )+τI

[0088] Among them, tr(·) represents the trace operation, τ is a very small number, which is 1e-4, and I represents the unit matrix;

[0089] The symmetric matrix is ​​mapped to the Riemann manifold using the exponential mapping, namely:

[0090]

[0091] Among them, Exp(·) represents exponential mapping, sym(d) represents symmetric matrix, and sym + (d) represents a symmetric positive definite matrix.

[0092] S13, constructing a semantic latent coding module, sending the spatiotemporal features in the Riemann manifold space into the semantic latent coding module to encode semantic latent factors;

[0093] The semantic latent coding module includes a manifold attention unit, a Riemann space to Euclidean space conversion unit, a feature encoding unit and a classifier;

[0094] The specific process of encoding semantic latent factors is as follows: for the spatiotemporal features in the Riemann manifold space First, manifold attention is used to make the model focus on more critical time segments and reduce model bias;

[0095] Manifold attention processes spatiotemporal features The specific process is: for the Riemann manifold feature of the i-th segment The query (query, q), key (key, k) and value (value, v) of the fragment in the manifold space are calculated through bilinear mapping:

[0096]

[0097] In the formula, Respectively represent the transformation matrix with full row rank, that is: R(W q )=R(W k )=R(W v ) = d o , d represents The dimension, d o Indicates q i , k i and v i The output dimension of

[0098] Then, the logarithmic Euclidean method is used to measure the similarity between q and k, that is,

[0099]

[0100] In the formula, δ L (·) indicates q i and k j Geodesic distance in manifold space, log(·) represents logarithmic operation;

[0101] Based on this, the Softmax function is used to calculate the attention matrix, that is, Through the attention matrix and v, the model focuses on more critical fragments in the time dimension, that is,

[0102]

[0103] In the formula, v′ i represents the output after manifold attention optimization;

[0104] Next, the optimized output v′ i Send it to the Riemann space to Euclidean space conversion unit and project it into Euclidean space, that is,

[0105]

[0106] In the formula, is a positive definite symmetric matrix v′ i The eigenvalue of The feature matrix is ​​composed of the corresponding feature vectors; the output features are then flattened and sent to the feature encoding unit to encode the semantic latent factors using the reparameterization technique; at the same time, the unit is followed by a classifier to classify the semantic latent factors to identify the EEG intention of motor imagery and classify the motor imagery category;

[0107] S14. The structure of the variation latent factor encoding module is similar to that of the semantic latent factor encoding module. The difference is that this module introduces a gradient reversal layer before the feature reparameterization encoding. The gradient reversal layer is used to enable the module to encode features that are irrelevant to the target intention, that is, to encode the changing features in the EEG signal.

[0108] S15, construct a decoding module to jointly decode the semantic latent factors and the variation latent factors into EEG spatiotemporal features;

[0109] The decoding module consists of a fully connected layer, a deconvolution block, and a Euclidean space to Riemann space conversion unit, which converts the semantic latent factors Latent Factor The specific process of joint decoding is:

[0110] For the encoded semantic latent factor Z s and the latent factor Z u , first connect it into a comprehensive latent factor Z = concat(Z s ,Z u ), and after a fully connected layer, its input is then fed into a deconvolution block; the block includes two deconvolution layers and a batch normalization layer;

[0111] The latent factor Z is decoded into an output with the same number of channels as the spatiotemporal feature map output by the spatiotemporal convolution module through the deconvolution block;

[0112] Finally, the feature map is projected into the Riemannian space using a Euclidean to Riemannian conversion unit, so that it has the same dimension as the Riemannian manifold feature input in the encoder.

[0113] S2. Calculate the loss of the motor imagery intention decoding model. The loss of the model includes the Hilbert-Schmidt independence criterion loss between the encoded semantics and the variational latent factors, the reconstruction loss between the encoded spatiotemporal features and the reconstructed spatiotemporal features, and the variational information bottleneck constraint between the model data, the encoded latent factors and the predicted targets, which is used to match the model structure and constrain the gradient changes of the model during the training process.

[0114] S2 specifically includes the following steps:

[0115] S21, the reconstruction loss is introduced between the spatiotemporal features encoded by the model and the spatiotemporal features decoded;

[0116] For the encoded semantic latent factor Z s and the latent factor Z u , connect it and send it to the decoder to get the reconstructed features The reconstruction loss is then expressed as

[0117]

[0118] Where, MSE(·) represents mean square error;

[0119] S22, the Hilbert-Schmidt independence criterion loss is introduced between the semantic latent factors and the variation latent factors encoded by the model;

[0120] Since there may be correlation between the information of the encoded semantics and the variant latent factors, the Hilbert-Schmidt Independence Criterion (HSIC) loss is introduced to remove the mutual dependence between the two. s , latent factor Z u , and kernels k and l, the HSIC constraint is expressed as

[0121]

[0122] In the formula, m represents the number of latent factors, k and l represent kernel functions, and the radial basis kernel function (RBF) is used, K,L∈R m×m represents the RBF kernel matrix, that is P=Im - 1 11 T ∈R m×m represents a centered matrix, where I represents the identity matrix and 1 represents a column vector of all 1s.

[0123] S23, a variational information bottleneck loss is introduced between the input EEG signal, the latent factors encoded by the model, and the target;

[0124] The variational information bottleneck constraint is used to compress the semantics and variation latent factors, eliminate the influence of redundant information on the result latent variables, and combine the gradient reversal layer to separate the semantics and variation latent factors; the overall variational information bottleneck constraint in the present invention is expressed as

[0125]

[0126] where q(·|·) represents the variational approximation of the conditional distribution p(·|·), r(·) is the variational approximation of the marginal distribution p(·), and f(x n ,∈)=z,∈ represents a Gaussian random variable, β is a trade-off parameter, D KL (·||·) represents the Kullback-Leibler divergence measure, N represents the number of samples, and x n and n Respectively represent the nth sample in the EEG signal X and the corresponding label, Z s With Z u Respectively represent the semantics and variation latent factors of the encoding, log(·) represents the logarithmic operation, It is regarded as the cross entropy of the classifier output results in the semantic latent factor encoding module. Minimizing this term promotes the classifier to correctly classify motor imagery intentions, that is, it encourages the encoded semantic latent factors to contain more discriminative information related to identifying motor imagery intentions.

[0127] A gradient reversal layer is introduced in the variation latent factor encoding module, thus minimizing Essentially minimize This will promote the classifier in the variant latent factor encoding module to be unable to identify motor imagery intention, thereby encouraging the encoded variant latent factor to contain more information that is irrelevant to motor imagery intention.

[0128] S24. Calculate the overall loss of the model based on the calculated Hilbert-Schmidt independence criterion loss, reconstruction loss, and variational information bottleneck loss:

[0129]

[0130] In the formula, α and γ represent the coefficients of the corresponding loss, which are set to 0.8 and 1.0 respectively in the present invention.

[0131] S3. In the model training stage, multi-channel EEG signals are input into the constructed model. The semantic and variation latent factor encoding module of the model is used in combination with a variety of loss functions to enable the model to effectively encode the discriminative information representing the motor intention from the EEG signals, while identifying the variation factors caused by physiological and technical confounding factors such as individual differences and artifacts. In the model testing stage, the model parameters obtained through training are used to extract only the output of the semantic latent factor encoding module in the model as features to identify the motor imagery intentions of different subjects and realize the decoding of cross-domain motor imagery EEG signals.

[0132] Figure 2 and Figure 3 They are respectively the results of experimental verification of subject dependence and subject independence of the model of the present invention on the fourth BCI competition dataset 1.

[0133] from Figure 2 and Figure 3 It can be seen that the model of the present invention has achieved good experimental results in both subject-dependent and subject-independent experimental verifications. Specifically, in the subject-dependent experiment, the best performance accuracy, Kappa value, precision and F1 score of the model of the present invention on this data set were as high as 93.50%, 0.86, 0.94 and 0.94, respectively, and its worst performance reached 85.00%, 0.70, 0.85 and 0.85. In the subject-independence experiment, the best performance accuracy, Kappa value, precision and F1 score of the model of the present invention on this data set were 67.00%, 0.34, 0.68 and 0.67, respectively. These experimental results demonstrate the superior performance of the model of the present invention.

Claims

1. A method for decoding EEG intention using a convolutional manifold attention network model, Features: The following steps are involved: S1. Constructing a motor imagery intention decoding model: S11. Construct a spatiotemporal convolution module to extract spatiotemporal features from multi-channel motor imagery EEG signals. S12, constructing a Euclidean space to Riemannian space conversion unit, converting the EEG spatiotemporal features in the Euclidean space to the Riemannian space, and obtaining the spatiotemporal features in the Riemannian space; S13, constructing a semantic latent coding module, sending the spatiotemporal features in the Riemann manifold space into the semantic latent coding module to encode semantic latent factors; S14, constructing a variation latent coding module, sending the spatiotemporal features in the Riemann manifold space into the variation latent coding module to encode the variation latent factors; S15, construct a decoding module to jointly decode the semantic latent factors and the variation latent factors into EEG spatiotemporal features; S2. Calculate the loss of the motor imagery intention decoding model: S21, the reconstruction loss is introduced between the spatiotemporal features encoded by the model and the spatiotemporal features decoded; S22, the Hilbert-Schmidt independence criterion loss is introduced between the semantic latent factors and the variation latent factors encoded by the model; S23, a variational information bottleneck loss is introduced between the input EEG signal, the latent factors encoded by the model, and the target; S24, defining the overall loss of the model according to the calculated Hilbert-Schmidt independence criterion loss, reconstruction loss and variational information bottleneck loss; S3. Input multi-channel EEG signals into the constructed model, use the semantic and variation latent factor encoding module of the model, and combine the loss of the motor imagery intention decoding model, so that the model can effectively encode the discriminative information representing the motor intention from the EEG signals, and identify the variation factors caused by individual differences, artifacts, etc. caused by physiological and technical confounding factors.

2. According to claim 1, a method for decoding EEG intention using a convolutional manifold attention network model, Features: In S11, the spatiotemporal convolution module includes a spatial convolution block and a temporal convolution block, and the process of processing EEG signals is expressed as: F se =f e (f s (X i )) In the formula, f s and f e Respectively represent the spatial convolution unit and the temporal convolution unit, X i ∈R c×t represents a multi-channel EEG signal, c represents the number of EEG signal leads, and t represents the number of samples in t seconds; For a multi-channel EEG signal X i , reorganize it into a three-dimensional tensor of size (1, c, t), and send it to the spatial convolution block, the convolution kernel size is c×1, the output feature map channel is o, and the output feature map The feature map is then fed into the temporal convolution block (the convolution kernel size is 1×k and the feature map channel is d), and the output feature map is and reorganize it into In order to prepare for the subsequent encoding of different types of latent factors; finally, the spatiotemporal features Transformed to size d×t e The feature matrix F of .

3. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S12, the extracted spatiotemporal feature map Divided into n fragments, namely: In order to map the spatiotemporal feature maps of each fragment into the Riemann space, the symmetric matrix of each fragment is calculated: C i ={F i ′(F i ′) T |F i ′=F i -mean(F i )}∈sym(d) The symmetric matrix is ​​subjected to trace normalization, namely: C i / tr(C i )+τI Where tr(·) represents the trace operation, τ is 1e-4, and I represents the unit matrix; The symmetric matrix is ​​mapped to the Riemann manifold using the exponential mapping, namely: Among them, Exp(·) represents exponential mapping, sym(d) represents symmetric matrix, and sym + (d) represents a symmetric positive definite matrix.

4. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S13, the semantic latent coding module includes a manifold attention unit, a Riemann space to Euclidean space conversion unit, a feature encoding unit and a classifier; The process of encoding semantic latent factors is: for the spatiotemporal features in the Riemann manifold space First, manifold attention is used to make the model focus on more critical time segments and reduce model bias; Manifold attention processes spatiotemporal features The specific process is: for the Riemann manifold feature of the i-th segment The query (query, q), key (key, k) and value (value, v) of the fragment in the manifold space are calculated through bilinear mapping: In the formula, They represent the transformation matrix with full row rank, namely: R(W q )=R(W k )=R(W v ) = d o , d represents The dimension, d o Indicates q i , k i and v i The output dimension of Then, the logarithmic Euclidean method is used to measure the similarity between q and k, that is, In the formula, δ L (·) indicates q i and k j Geodesic distance in manifold space, log(·) represents logarithmic operation; Based on this, the Softmax function is used to calculate the attention matrix, that is, Through the attention matrix and v, the model focuses on more critical fragments in the time dimension, that is, In the formula, v′ i represents the output after manifold attention optimization; Next, the optimized output v′ i Send it to the Riemann space to Euclidean space conversion unit and project it into Euclidean space, that is, In the formula, is a positive definite symmetric matrix v′ i The eigenvalue of The corresponding eigenvectors form a feature matrix; the output features are then flattened and sent to the feature encoding unit to encode the semantic latent factors using the reparameterization technique; at the same time, the unit is followed by a classifier to classify the semantic latent factors in order to identify the EEG intention of motor imagery and classify the motor imagery category.

5. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 4, Features: In S14, the structure of the variation latent factor encoding module is different from that of the semantic latent factor encoding module in that the module introduces a gradient reversal layer before feature reparameterization encoding; the gradient reversal layer is used to enable the module to encode features that are irrelevant to the target intention, that is, to encode features that change in the EEG signal.

6. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S15, the decoding module includes a fully connected layer, a deconvolution block, and a Euclidean space to Riemann space conversion unit, which converts the semantic latent factor Latent Factor The specific process of joint decoding is: For the encoded semantic latent factor Z s and the latent factor Z u , first connect it into a comprehensive latent factor Z = concat(Z s ,Z u ), and after a fully connected layer, its input is then fed into a deconvolution block; the block includes two deconvolution layers and a batch normalization layer; The latent factor Z is decoded into an output with the same number of channels as the spatiotemporal feature map output by the spatiotemporal convolution module through the deconvolution block; Finally, the feature map is projected into the Riemannian space using a Euclidean to Riemannian conversion unit, so that it has the same dimension as the Riemannian manifold feature input in the encoder.

7. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S21, for the encoded semantic latent factor Z s and the latent factor Z u , connect it and send it to the decoder to get the reconstructed features The reconstruction loss is then expressed as Where MSE(·) represents the mean square error.

8. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S22, since there may be correlation between the encoded semantics and the information of the variant latent factor, the Hilbert-Schmidt independence criterion loss is introduced to remove the mutual dependence between the two; for the semantic latent factor Z s , latent factor Z u , and kernels k and l, the Hilbert-Schmidt independence criterion constraint is expressed as In the formula, m represents the number of latent factors, k and l represent kernel functions, and the radial basis kernel function is used, K,L∈R m×m represents the radial basis kernel function kernel matrix, that is P=Im -1 11 T ∈R m×m represents a centered matrix, where I represents the identity matrix and 1 represents a column vector of all 1s.

9. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S23, the variational information bottleneck constraint is used to compress the semantic and variation latent factors, eliminating the influence of redundant information on the result latent variables, and the gradient reversal layer is combined to separate the semantic and variation latent factors; The overall variational information bottleneck constraint is expressed as where q(·|·) represents the variational approximation of the conditional distribution p(·|·), r(·) is the variational approximation of the marginal distribution p(·), and f(x n ,∈)=z,∈ represents a Gaussian random variable, β is a trade-off parameter, D KL (·||·) represents the Kullback-Leibler divergence measure, N represents the number of samples, and x n and n Respectively represent the nth sample in the EEG signal X and the corresponding label, Z s With Z u They represent the semantics and variation latent factors of the encoding respectively, and log(·) represents the logarithmic operation.

10. The method for decoding EEG intention using a convolutional manifold attention network model according to claim 1, Features: In S24, the overall loss of the model is calculated: Where α and γ represent the coefficients of the corresponding loss, which are set to 0.8 and 1.0 respectively.

Citation Information

Patent Citations

  • Brain-controlled intelligent limb movement training system based on 40-channel electroencephalogram acquisition equipment

    CN117828339A

Cited By

  • Multi-dimensional feature fusion electroencephalogram signal decoding method and system, medium and equipment

    CN120145313A