Motor imagery EEG signal recognition method based on probability learning Riemann space quantization
By using the Riemann spatial quantization method of probability learning in the recognition of motor imaginary EEG signal, using the affine constant Riemann distance and Gaussian-like hybrid model, the challenge of decoding of motor imaginary EEG signal is solved, efficient and real-time recognition effect is achieved, and the stability of the brain-computer interface system is improved.
Patent Information
- Application Number
- CN202011526846.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-22
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2040-12-22
AI Technical Summary
There are challenges in decoding EEG signals in motion imagination, including nonstationarity, weak signal, large noise interference and small data volume, resulting in a high recognition error rate.
The Riemann spatial quantization method based on probability learning is used to calculate the distance of the covariance matrix through affine invariant Riemann distance, a Gaussian-like hybrid model is established, the cost function is minimized by using the stochastic gradient descent method, the prototype and variance parameters are learned, and the categories of the EEG signal are finally output through the maximum posterior probability method.
This method simplifies the preprocessing steps, reduces the computational complexity, improves recognition efficiency and accuracy, can identify categories of electroencephalogram signals in real time, and enhances the stability of the brain-computer interface system.
Smart Images

Figure CN114722850B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of biological signal recognition, and in particular is a method for recognizing motor imagery electroencephalogram signals based on probability learning vector quantization and adopting affine invariant Riemann distance. Background Art
[0002] Brain-computer interface is a direct connection between the human brain and external devices. It has broad application prospects in many fields such as neurorehabilitation and intelligent human-computer integration. Its core technology is the decoding of EEG signals. Motor imagery EEG signals are a kind of spontaneous EEG that can be achieved by imagining movement without external stimulation. Because of the simplicity, flexibility and non-invasiveness of this technology, motor imagery brain-computer interface technology is favored by many researchers. However, due to its non-stationarity, weak signal, large noise interference, and small amount of data, the decoding of motor imagery EEG signals is still challenging.
[0003] The second-order statistical information of motor imagery EEG signals contains separable information of the brain, and the covariance matrix is the most commonly used second-order statistical feature in EEG signals. The covariance matrix features of EEG signals are easily extracted from EEG signals. The covariance matrix features form a symmetric positive definite matrix space. Given a Riemann measure to this space, the symmetric positive definite matrix space will become a curved Riemann manifold. At present, the learning method based on Riemann space using the covariance matrix as feature input is one of the most promising methods for decoding motor imagery EEG signals. The Riemann distance can more effectively characterize the distance between covariance features than the Euclidean distance. Riemann manifolds are difficult to analyze directly. Based on the property that the Riemann manifold is locally homeomorphic to the Euclidean space, most current methods expand the tangent space at the Riemann mean point, and then use the Euclidean space learning method in the flat tangent space. However, data points far from the Riemann mean point may produce large distortions when mapped to the tangent space, resulting in an increase in the subsequent recognition error rate. Summary of the invention
[0004] The purpose of the present invention is to provide a simple, fast, and small sample learning environment-suitable motor imagery EEG signal recognition method with probabilistic output, which provides confidence for the EEG signal recognition results and helps to improve the stability of the brain-computer interface system.
[0005] The technical solution adopted by the present invention to achieve the above-mentioned purpose is:
[0006] The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization includes the following steps:
[0007] Collect EEG signals of different motor imagery tasks;
[0008] Obtain the covariance matrix of the EEG signal to form a sample space;
[0009] The covariance matrix is regarded as a point in the Riemann symmetric space, and the Riemann affine invariant distance is used to measure the distance between two points in the Riemann symmetric space;
[0010] A Gaussian mixture model is established using the Riemann affine invariant distance as the covariance matrix, and a likelihood function is established to obtain the cost function of the probability learning Riemann space quantization method.
[0011] Minimize the cost function through the stochastic gradient descent method, calculate the Riemann gradient corresponding to the prototype, establish the prototype learning rule, calculate the gradient of the variance parameter, and establish the learning rule of the variance parameter;
[0012] The maximum a posteriori probability method is used to output the category of the EEG signal to be predicted.
[0013] The motor imagery task includes at least one of imagining left hand movement, imagining right hand movement, imagining foot movement, and imagining tongue movement.
[0014] The Riemann affine invariant distance is:
[0015]
[0016] Among them, X1 and X2 represent any two points in the Riemann symmetric space, ||·|| F is the Frobenius norm, β i Yes X1 -1 The i-th eigenvalue of X2, i=1,…,n; n is the number of channels of the EEG signal.
[0017] The Gaussian mixture model is:
[0018]
[0019] Among them, C is the number of categories, represents the distribution of data, represents a set of labeled prototypes, i.e. represents the representative model parameters learned from the training samples, c j W j category; P(j) is the probability that the covariance matrix X is generated by the jth component of the Gaussian mixture model; p(X|j) represents the probability that the jth component in the Gaussian mixture model generates the data X, that is, σ 2 >0 is the variance parameter, δ 2 (X,W j ) is X and W j The square of the affine invariant Riemann distance between .
[0020] The likelihood function is:
[0021]
[0022]
[0023] in, The posterior probability of assigning label y to a sample X.
[0024] The cost function is:
[0025]
[0026] in, σ 2 >0 is a real number parameter, called the variance parameter, δ 2 (X i ,W j ) is X i and W j The square of the affine invariant Riemann distance between .
[0027] The learning rule of the prototype is:
[0028]
[0029] Where l = 1, …, M; α is the learning rate, P(l|X,y) represents the posterior probability that the data X is generated by a component of the mixture model corresponding to its true category y; P(l|X) represents the posterior probability that X is generated by the lth component in the mixture model when it is known that the data X is generated by a component of the mixture model corresponding to its true category y; P(l|X) represents the posterior probability that X is generated by the lth component in the mixture model when it is unknown whether X is generated by the component corresponding to its true category.
[0030] The learning rules of the variance parameters are:
[0031]
[0032] in, It is X and W l is the abbreviation of the square of the affine Riemann invariant distance between them, and η is the learning rate.
[0033] The maximum a posteriori probability method for outputting the category of the EEG signal to be predicted comprises the following steps:
[0034] Collect the EEG signal of the motor imagery task to be identified t ;
[0035] Calculate the covariance matrix X t ;
[0036] Calculate X according to the following formula tThe category is y k Posterior probability:
[0037]
[0038] Among them, f(X t ,W j )=δ 2 (X,W j ) / σ 2 , δ 2 (X t ,W j ) is the sample X t With prototype W j The Riemann affine invariant distance between 2 is the variance parameter;
[0039] Find the label corresponding to the maximum posterior probability by the following formula
[0040]
[0041] The label corresponding to the maximum posterior probability Estimated as EEG signal E t The category, that is
[0042] The present invention has the following beneficial effects and advantages:
[0043] 1. The present invention adopts a spatial covariance matrix to characterize the characteristics of motor imagery EEG signals, and only uses a bandpass filter as a signal preprocessing, avoiding complex preprocessing calculations such as spatial filtering and time-frequency filtering, and the method is easy to implement.
[0044] 2. The present invention adopts affine invariant Riemann measure to establish a prototype-based learning method. During recognition, it only needs to calculate the affine invariant Riemann distance with several prototypes. The calculation complexity is low, and the category of motor imagery EEG signals can be identified in real time, providing a fast EEG signal recognition method for building a practical brain-computer interface system.
[0045] 3. The parameters of the present invention are just a few prototypes, and the algorithm can converge well without a large number of learning samples. The brain-computer interface system established based on this method does not need a long time to collect learning samples to modulate the classifier.
[0046] 4. The present invention adopts the Riemann gradient descent method to establish prototype learning rules, and uses local tangent space to approximate Riemann space, which avoids the data distortion caused by the global tangent space approximating Riemann space and improves the classification accuracy. At the same time, the learning model can be updated online, providing an effective EEG signal recognition method for building an online brain-computer interface system, which is conducive to the promotion of brain-computer interface systems based on motor imagery in practical applications.
[0047] 5. The present invention is established under the framework of probability theory, and the prediction results are accompanied by probability output, which can provide a confidence level for the prediction results. Prediction results with lower confidence levels can be discarded, which helps to improve the stability of the brain-computer interface system. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a block diagram of the method for identifying motor imagery EEG signals based on probability learning Riemann space quantization of the present invention;
[0049] Figure 2 is a schematic diagram of the Riemann distance of the present invention;
[0050] Figure 3 is a schematic diagram of the Riemann space quantization learning method of the present invention;
[0051] Figure 4 is a flow chart of the model training phase of the present invention;
[0052] Figure 5 This is the flow chart of the model’s likelihood ratio-based prediction phase;
[0053] Figure 6a It is the convergence graph of the cost function of the proposed model;
[0054] Figure 6b It is the convergence diagram of recognition accuracy of the proposed model;
[0055] Figure 6c is the convergence diagram of the proposed model parameter σ;
[0056] Figure 7a It is the distribution diagram of the posterior probability size corresponding to the correctly identified samples;
[0057] Figure 7b It is the distribution diagram of the posterior probability size corresponding to the misidentified samples;
[0058] Figure 8 This is a comparison chart of the effects of the present invention and the top three in the competition. DETAILED DESCRIPTION
[0059] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0060] A method for recognizing electroencephalogram (EEG) signals based on probability learning Riemann space quantization, which characterizes motor imagery EEG signals as covariance features. This feature expression is a symmetric positive definite matrix located in a curved Riemann space; the affine invariant Riemann distance is used to calculate the distance between points in the Riemann space. Based on the affine invariant Riemann distance, it is assumed that the data probability density distribution is a Gaussian mixture model, and a probability learning Riemann space quantization method is constructed. The covariance matrix corresponding to each category of EEG signals is learned through Riemann gradient descent, and the variance parameters in the Gaussian mixture model are automatically learned; when identifying the EEG data to be predicted, the final a posteriori probability method is used, and the category with the largest posterior probability is taken as the category of the EEG signal.
[0061] like Figure 1 As shown, the specific implementation of the present invention includes the following steps:
[0062] First, the EEG signal was collected according to the commonly used motor imagery paradigm. According to the action instructions displayed on the computer, the motor imagery task was performed, and the data was collected through the commonly used wet electrode EEG cap. The motor imagery actions included: imagining the left hand movement, imagining the right hand movement, imagining the foot movement, and imagining the tongue movement. Each motor imagery task lasted for 4 seconds. After completing a motor imagery task, rest for 1 to 2 seconds. The data set collected in this process is recorded as Where S i represents the EEG signal collected during the i-th motor imagery task, y i Indicates the category label corresponding to the motor imagery task, y i =1 means imagine the left hand movement, y i =2 means imagine the right hand moving, y i =3 means imagining foot movement, y i =4 represents imagining tongue movement, and m represents the number of times the process performs the motor imagery task.
[0063] Secondly, a bandpass filter is used to convert the EEG signal S i Filter to 10-30Hz frequency band, i=1,…,m. The filtered EEG signal is recorded as The bandpass recorder mentioned here includes a 5th-order Butterworth filter. In the motor imagery system, the second-order statistical information of the EEG signal contains separable information of brain activity, and the covariance feature is the most commonly used second-order statistical feature in the EEG signal. Calculate the covariance matrix of the EEG signal Forming sample space Where l represents the number of times the 4-second motor imagery EEG signal is sampled, and X i It is an n×n symmetric positive definite matrix, where n represents the number of electrodes used to collect EEG signals.
[0064] The covariance matrix is a symmetric positive definite matrix. All n×n symmetric positive definite matrices form a symmetric positive definite matrix space, denoted as Give the symmetric positive definite matrix space Define a Riemann measure, and the space will become a curved differentiable Riemann manifold. Here we use the affine invariant Riemann measure. The affine invariant Riemann distance between two points is:
[0065]
[0066] Among them, X1, X2 are Two points in space, ||·|| F is the Frobenius norm, β i Yes X1 -1 The i-th eigenvalue of X2. Figure 2 As shown, the Riemann distance between two points is the length of the shortest arc between the two points, not the length of the straight line between the two points. The solid line is the Riemann distance between two points in the 2x2 symmetric positive definite matrix, and the dotted line is the Euclidean distance.
[0067] Next, based on the affine invariant Riemann distance, it is assumed that the data probability density distribution can be approximated by a Gaussian mixture model:
[0068]
[0069] Among them, P(j) is the probability that the data is generated by the jth component of the mixture model, and p(X|j) is the probability that the jth component in the mixture model generates data X. It is the prototype W j The prototype W represents the model parameters that need to be learned from the training samples for the covariance matrix of different motor imagery actions. In the present invention, it is a Gaussian-like function established using the affine invariant Riemann distance, that is, is a real number parameter, called the variance parameter, δ 2 (X,W j ) is X and W j The square of the affine invariant Riemann distance between .
[0070] Here, the probability density of a data point being generated by the correct class of the mixture model is:
[0071]
[0072] The likelihood function is obtained by maximizing the likelihood ratio of the correct classification probability and the total probability:
[0073]
[0074] According to Bayes' theorem:
[0075]
[0076] in, It can be regarded as the posterior probability that sample X belongs to category y. Therefore, the likelihood ratio can be expressed as:
[0077]
[0078] Maximizing the likelihood function can be transformed into minimizing the negative log-likelihood function, resulting in the following cost function:
[0079]
[0080] By minimizing the above cost function through the stochastic gradient descent method, the prototype W is obtained j And the learning rule of variance parameter σ. Choose any training sample X i , the valence function E for the training sample i for:
[0081]
[0082] Prototype W l The Riemann gradient It is expressed as:
[0083]
[0084] in,
[0085]
[0086]
[0087] P(l|X i ,y i ) represents the known data X i Its true category is y i The corresponding component in the mixed model is generated, and the data is considered to be the posterior probability generated by the lth component in the mixed model; P(l|X i ) means that when we do not know the data X i In the case of whether it is generated by the component corresponding to its true category, under the components corresponding to all categories, it is considered to be the posterior probability generated by the lth component in the mixed model. Therefore, by moving along the Riemann gradient of the tangent space and mapping back to the manifold (through the Riemann index mapping), the prototype learning rule is obtained, such as Figure 3 As shown, the prototype moves along the geodesic between it and the sample. The small square is the input sample. The prototype is attracted if the label is the same as the input sample, and repelled if it is different. The correct prototype will approach the learning sample along the geodesic, and the wrong prototype will learn the sample according to the geodesic principle:
[0088]
[0089] Where 0<α<1 is the learning rate, P(l|X i ,y i )-P(l|X i ) is always positive. Here, the Riemann logarithmic mapping operator is used Map the local neighborhood B on the manifold to the tangent space at point X On, that is, Log X (X i )=V i ; Riemann index mapping operator It is the inverse operation of Log, Exp X (V i )=X i , specifically:
[0090]
[0091]
[0092] where log(·) is the matrix logarithm, which can be obtained by log(X)=Vdiag(log(λ1),…,log(λ n ))V T Calculate,λ1,...,λ n is the eigenvalue of X, V is an n×n square matrix composed of its eigenvectors, and the kth column is the kth eigenvector. exp(·) represents the matrix exponential operation, which is the inverse operation of the matrix logarithm log(·), which can be obtained by exp(V)=Udiag(exp(λ1),…,exp(λ n ))U T Calculate,λ1,...,λ n is the eigenvalue of V, and U is the square matrix of its eigenvectors.
[0093] The derivative of the parameter σ is solved as:
[0094]
[0095] in, is a sample X i With prototype W l is the abbreviation of the square of the affine invariant Riemann distance between . From this, we can get the learning rule of σ as:
[0096]
[0097] Among them, 0<η<1 is the σ learning rate.
[0098] So far, the probability learning Riemann space quantization method proposed in the present invention has been deduced.
[0099] like Figure 4 As shown, the specific process of learning the prototype and parameter σ is as follows:
[0100] Step 1: Input m training sample pairs into a positive definite matrix data (X1, y1),…, (X m ,y m ),in y i ∈{1,…,C} represents the sample label, sets the number of prototypes to M, the learning rate of the prototype to α, the learning rate of the hyperparameter σ to η, and the total number of learning times to T;
[0101] Step 2: Use the Riemann mean of each sample data and add a very small random symmetric matrix interference to initialize each prototype (W1c1),…,(W M ,c M ),in c i ∈{1,…,C} represents the prototype label, and the hyperparameter is randomly initialized as a real number;
[0102] Step 3: Randomly select a training sample (X i ,y i ), calculate the posterior probability P(l|X i ,y i ):
[0103]
[0104] and the posterior probability P(l|X i ):
[0105]
[0106] Step 4: Determine each prototype label c l With the training sample label y i , if c l =y i ,but
[0107]
[0108] If c l ≠y i ,but
[0109]
[0110] Get the updated prototype:
[0111] Step 5: Calculation:
[0112]
[0113] Get the updated σ new =σ+Δσ;
[0114] Step 6: Repeat steps 3 to 6 until all training samples are traversed;
[0115] Step 7: The number of learning times increases by 1, t=t+1;
[0116] Step 8: Repeat steps 3 to 7 until t>T, and the learning process ends;
[0117] Step 9: Finally, we get a set of trained labeled prototypes (W1c1),…,(W l ,c M ), and parameter σ;
[0118] Finally, the maximum a posteriori probability is used to obtain the category of the EEG signal to be predicted. The specific process is as follows: Figure 5 As shown:
[0119] Step 1: Collect EEG signals E of a new motor imagery task t ;
[0120] Step 2: Bandpass filter the EEG signal to be predicted to a frequency band of 10-30 Hz and calculate the covariance matrix X t ;
[0121] Step 3: Calculate X as follows: t The category is y k Posterior probability:
[0122]
[0123] Among them, f(X t ,W j )=δ 2 (X,W j ) / σ 2 , δ 2 (X t ,W j ) is the sample X t With the prototype W j The Riemann affine invariant distance between 2 is the power variance parameter;
[0124] Step 4: Find the label corresponding to the maximum posterior probability by the following formula
[0125]
[0126] Step 5: The label corresponding to the maximum posterior probability Estimated as EEG signal E t The category, that is
[0127] In order to verify the classification performance of the present invention in the recognition of motor imagery-based brain-computer interface, the present invention was tested on the public dataset 2a of the brain-computer interface competition IV, and the recognition accuracy was compared with that of the top three algorithms. The recognition accuracy is measured by the kappa value. where p a represents the proportion of all correct classifications, and p c is the proportion of random classification. Figure 6a to Figure 6c As shown in Figure 1, on the subject 1 dataset, it shows an excellent convergence effect, and the parameter σ, the cost function and the test accuracy all converge to a stable value. Figure 7a As shown in , in most cases, the posterior probability value corresponding to the correct recognition is large, while the posterior probability value corresponding to most of the wrong recognition is small, such as Figure 7b As shown. Figure 8 As shown, the average recognition kappa value of the method for the EEG signals of 9 subjects is higher than the average recognition kappa value of the first place in the BCI competition, and is much higher than the average recognition kappa values of the second and third places, reaching 0.59, showing good classification performance.
Claims
1. A method for identifying motor imagery EEG signals based on probability learning Riemann space quantization, characterized in that: The following steps are involved: Collect EEG signals of different motor imagery tasks; Obtain the covariance matrix of the EEG signal to form a sample space; The covariance matrix is regarded as a point in the Riemann symmetric space, and the Riemann affine invariant distance is used to measure the distance between two points in the Riemann symmetric space; A Gaussian mixture model is established using the Riemann affine invariant distance as the covariance matrix, and a likelihood function is established to obtain the cost function of the probability learning Riemann space quantization method. Minimize the cost function through the stochastic gradient descent method, calculate the Riemann gradient corresponding to the prototype, establish the prototype learning rule, calculate the gradient of the variance parameter, and establish the learning rule of the variance parameter; The maximum a posteriori probability method is used to output the category of the EEG signal to be predicted; The cost function is: in, σ 2 >0 is a real parameter called the variance parameter, δ 2 (X i ,W j ) is X i and W j The square of the affine invariant Riemann distance between ; The maximum a posteriori probability method for outputting the category of the EEG signal to be predicted comprises the following steps: Collect the EEG signal of the motor imagery task to be identified t ; Calculate the covariance matrix X t ; Calculate X according to the following formula t The category is y k Posterior probability: Among them, f(X t ,W j )=δ 2 (X,W j ) / σ 2 , δ 2 (X t ,W j ) is the sample x t With prototype W j The Riemann affine invariant distance between 2 is the variance parameter; Find the label corresponding to the maximum posterior probability by the following formula The label corresponding to the maximum posterior probability Estimated as EEG signal E t The category, that is 2. The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1 is characterized in that: The motor imagery task includes at least one of imagining left hand movement, imagining right hand movement, imagining foot movement, and imagining tongue movement.
3. The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1, characterized in that: The Riemann affine invariant distance is: Among them, X1 and X2 represent any two points in the Riemann symmetric space, ||·|| F is the Frobenius norm, β i Yes X1 -1 The i-th eigenvalue of X2, i=1,…,n; n is the number of channels of the EEG signal.
4. The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1, characterized in that: The Gaussian mixture model is: Among them, C is the number of categories, represents the distribution of data, represents a set of labeled prototypes, i.e. W j represents the representative model parameters learned from the training samples, c j W j category; P(j) is the probability that the covariance matrix X is generated by the jth component of the Gaussian mixture model; p(X|j) represents the probability that the jth component in the Gaussian mixture model generates the data X, that is, σ 2 >0 is the variance parameter, δ 2 (X,W j ) is X and W j The square of the affine invariant Riemann distance between .
5. The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1, characterized in that: The likelihood function is: in, The posterior probability of assigning label y to a sample X.
6. The method for recognizing motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1, characterized in that: The learning rule of the prototype is: Where l = 1, …, M; α is the learning rate, P(l|X,y) represents the posterior probability that the data X is generated by a component of the mixture model corresponding to its true category y; P(l|X) represents the posterior probability that X is generated by the lth component in the mixture model when it is known that the data X is generated by a component of the mixture model corresponding to its true category y; P(l|X) represents the posterior probability that X is generated by the lth component in the mixture model when it is unknown whether X is generated by the component corresponding to its true category.
7. The method for identifying motor imagery EEG signals based on probability learning Riemann space quantization according to claim 1, characterized in that: The learning rules of the variance parameters are: in, It is X and W l is the abbreviation of the square of the affine Riemann invariant distance between them, and η is the learning rate.
Citation Information
Patent Citations
motor imagery electroencephalogram classification method and system based on Riemannian distance
CN109657642A
Self-training brain-computer interface system and related training method
CN110123313A