Domain adaptive method for solving subject difference in motor imagery brain-computer interface

By adopting the domain adaptive manifold embedded distribution alignment feature mapping method in the motor imagination brain-computer interface, the problem of low classification accuracy caused by subject differences is solved, and the recognition accuracy and robustness are significantly improved, providing an effective solution for the further development of MI-BCI technology.

CN119987544AActive Publication Date: 2025-05-13HARBIN INST OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510063312.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-13
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Due to the difference in electroencephalogram signals between subjects in the motor imagination brain-computer interface, the classification accuracy of the MI-BCI system is low, which has become the main obstacle to the further development of technology.

Method used

A domain adaptive method is proposed. Through the online brain-computer interface system, multiple motion imagination tasks are performed, the subject's EEG signal data is collected, preprocessed and feature extraction is performed, and the domain adaptive manifold embedding distribution alignment feature mapping method is used to project the data of the training set and the target domain, construct a classifier and perform feature fusion to improve classification accuracy.

Benefits of technology

It significantly improves the recognition accuracy and robustness of sports imagination tasks, effectively avoids the problem of low classification accuracy of MI-BCI system caused by differences in subjects, and lays a solid foundation for the application of related fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987544A_ABST
    Figure CN119987544A_ABST
Patent Text Reader

Abstract

The invention discloses a domain adaptive method for solving subject differences in a motor imagery brain-computer interface, and belongs to the technical field of transfer learning in the motor imagery brain-computer interface. According to the method, the problem of low classification accuracy of the MI-BCI system caused by electroencephalogram signal difference between subjects is solved. According to the method, the information of source domain and target domain samples is fully utilized, and the recognition precision and robustness of the motor imagery task are remarkably improved in combination with data processing and a classification algorithm. Through efficient data preprocessing and a feature extraction method in domain adaptive manifold embedding, the consistency of data feature mapping of a training set and a target domain is ensured. The classifier optimization based on the structural risk minimization principle further enhances the classification performance. Through a feature fusion and voting mechanism, the credibility of label classification is effectively improved, and the method can effectively avoid the problem of low classification accuracy of an MI-BCI system caused by electroencephalogram signal difference between subjects. The method can be applied to electroencephalogram signal classification in a motor imagery brain-computer interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of transfer learning in motor imagery brain-computer interface, and specifically relates to a domain adaptation method for solving subject differences in motor imagery brain-computer interface. Background Art

[0002] Brain-Computer Interface (BCI) is a powerful communication tool between users and systems, which enhances the ability of the human brain to communicate and interact directly with the environment. BCI represents an innovation in technological progress and is an indispensable frontier that has an important impact on the development of future society. It can achieve direct communication between the brain and external devices without using muscles or nerves. Brain-computer interfaces can be divided into different types of brain-computer interfaces according to the type of EEG signals used. Among them, the motor imagery brain-computer interface (MI-BCI) based on motor imagery electroencephalogram (MI-EEG) is widely used because it is active and related to movement. However, in MI-BCI, individual differences exist significantly. In this case, if different subjects use the same model structure and parameters, it often leads to a decrease in the classification accuracy of the MI-BCI paradigm. Traditional machine learning algorithms perform poorly in dealing with subject differences. Therefore, this problem has become one of the main obstacles to the further development of MI-BCI technology. Summary of the invention

[0003] The purpose of the present invention is to solve the problem of low classification accuracy of the MI-BCI system due to differences in EEG signals between subjects in a motor imagery brain-computer interface, and to propose a domain adaptation method for solving subject differences in a motor imagery brain-computer interface.

[0004] The technical solution adopted by the present invention to solve the above technical problems is: a domain adaptation method for solving subject differences in motor imagery brain-computer interface, the method specifically comprising the following steps:

[0005] Step 1: ID subject uses the online brain-computer interface system to perform multiple motor imagery tasks, wherein the motor imagery tasks include leftward motor imagery tasks and rightward motor imagery tasks. During each motor imagery task, the subject's EEG signal data is collected, and the collected EEG signal data of ID subject is used as training set data, and the EEG signal data collected during the motor imagery task of the subject to be tested is used as target domain data;

[0006] Step 2: extracting the EEG signal data corresponding to the motor imagery time period from each group of EEG signal data in the training set and the target domain, and preprocessing the extracted EEG signal data to obtain each group of preprocessed EEG signal data;

[0007] Step 3: Use a pre-alignment strategy to process each group of preprocessed EEG signal data in the training set and the target domain to obtain each group of processed EEG signal data;

[0008] Step 4: Calculate the covariance matrix of each group of EEG signal data according to the processed EEG signal data, and then use the tangent space feature mapping method to project the covariance matrix of each group of EEG signal data to the tangent space to obtain the tangent space vector of each group of EEG signal data;

[0009] Step 5: Initialize id=1;

[0010] Step 6: Use the domain adaptive manifold embedding distribution alignment feature mapping method to project the tangent space vectors of each group of EEG signal data of the idth subject in the training set and the tangent space vectors of each group of EEG signal data in the target domain to obtain the feature vectors of the tangent space vectors of the idth subject and the target domain after projection mapping;

[0011] Step 7: Construct the classifier CLS using the feature vector after projection mapping of the idth subject and the target domain id ;

[0012] Step 8: Determine whether id=ID is satisfied;

[0013] If it satisfies, then we get the constructed ID classifiers CLS1, CLS2,…, CLS ID ; The feature vectors after projection mapping of the target domain are passed through classifiers CLS1, CLS2, ..., CLS ID , and obtain the classification results Rst1, Rst2, …, Rst ID , then execute step nine;

[0014] If not satisfied, set id=id+1 and return to step 6;

[0015] Step nine: perform feature fusion on the ID classification results obtained in step eight to obtain the final classification result of the target domain data.

[0016] Furthermore, the specific process of step one is:

[0017] For any subject, the subject is made to face the computer screen, and a fixed cross symbol pattern appears on the computer screen at t=0, and a motor imagery prompt appears on the computer screen at t=2 seconds to prompt the subject to perform motor imagery; wherein the motor imagery prompt is an arrow prompt, and the arrow prompt includes two types: a left arrow prompt and a right arrow prompt;

[0018] From t = 2 to t = 6, a total of 4 seconds, the arrow prompt on the computer screen remained unchanged, and the subject continued to perform the motor imagery of the current prompt; then rested for two seconds; at t = 8 seconds, the second round of motor imagery experiment began, and the above process was repeated, and the subject was subjected to multiple motor imagery experiments; and during each motor imagery task, the subject's EEG signal data was collected from the beginning to the end of the task;

[0019] Similarly, the EEG signal data of each subject during the motor imagery task is collected, and then the collected EEG signal data of the subject with the ID position is used as the training set, and the training set data is the source domain data;

[0020] The EEG signal data collected during the motor imagery task of the subject is used as the target domain data.

[0021] Furthermore, the specific process of step 2 is as follows:

[0022] For each set of collected EEG signal data, the motor imagery period is extracted, that is, the EEG signal data within 2.5 seconds to 5.5 seconds are extracted, and the extracted EEG signal data are processed by power frequency notch filtering and bandpass filtering.

[0023] Furthermore, the specific process of step three is:

[0024] The covariance matrix is ​​calculated based on the preprocessed EEG signal data of the ID position subject and the target domain in the training set, and then the mean of the covariance matrix in the Riemann space is calculated. The preprocessed EEG signal data of each group are aligned according to the mean to obtain the processed EEG signal data of each group.

[0025] Furthermore, the specific process of step six is ​​as follows:

[0026] Step 6. Calculate the intra-class scattering matrix and inter-class scattering matrix of the idth subject in the training set. The projection matrix is ​​constrained based on the intra-class scattering matrix and the inter-class scattering matrix:

[0027]

[0028] Where A is the projection matrix, A T is the transpose of A, tr(·) is the trace of the matrix, S wis the intra-class scattering matrix of the EEG signal data of the idth subject, is the matrix composed of the tangent space vectors corresponding to the data belonging to category c in the EEG signal data of the idth subject, represents a real number, C is the number of types of EEG signal data of the idth subject, is the number of data groups of category c in the EEG signal data of the idth subject, D is the dimension of the tangent space vector corresponding to each group of EEG signal data, is the data center matrix of category c, is the identity matrix, S b is the inter-class scattering matrix of the EEG signal data of the idth subject, is the mean of the tangent space vectors corresponding to each group of EEG signal data in category c of the idth subject, is the tangent space vector corresponding to the ith group of EEG signal data in category c of the idth subject, is the mean of the tangent space vectors corresponding to all the EEG signal data of the idth subject, X i represents the tangent space vector corresponding to the idth group of EEG signal data of the idth subject, n s Indicates the total number of EEG signal data sets of the idth subject;

[0029] Step 6.2: Calculate the scattering matrix V of the EEG signal data in the target domain t , then the constraint of the projection matrix based on the data scattering matrix is:

[0030] m B axtr(B T V t B)

[0031] Where B represents the projection matrix, X t Represents the matrix composed of tangent space vectors corresponding to each group of processed EEG signal data in the target domain, n t represents the total number of EEG signal data sets in the target domain, H t is the center matrix of the target domain, is the identity matrix;

[0032] Step 6.3. Projection matrix A and projection matrix B satisfy the constraints:

[0033]

[0034] Among them, ||·|| F Indicates calculation of F norm;

[0035] Step 64: Solve the objective function according to the constraints of step 61 to step 63 to obtain projection matrices A and B;

[0036] Then, the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the vectors after projection mapping; the vectors after projection mapping are then input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and the obtained classification results are used as the initial classification results;

[0037] Step 65, initialize the number of iterations l = 1;

[0038] Step 66: Calculate the intra-class scattering matrix and inter-class scattering matrix of each group of EEG signal data in the target domain. Then the constraints of the projection matrix based on the intra-class scattering matrix and the inter-class scattering matrix are:

[0039]

[0040] Among them, T w is the intra-class scattering matrix of each group of EEG signal data in the target domain, is the matrix composed of tangent space vectors corresponding to the EEG signal data belonging to category c in the target domain, represents the number of EEG signal data sets belonging to category c in the target domain, is the central matrix of the EEG signal data of category c, is the identity matrix, T b is the inter-class scattering matrix of the target domain EEG signal data, represents the mean of the tangent space vector corresponding to the EEG signal data belonging to category c in the target domain, represents the tangent space vector corresponding to the i-th group of EEG signal data belonging to category c in the target domain, represents the mean of the tangent space vectors corresponding to each group of EEG signal data in the target domain, X i is the tangent space vector corresponding to the i-th group of EEG signal data in the target domain;

[0041] Step 67: Solve the objective function according to the constraints of step 61 to step 63 and step 66 to obtain projection matrices A and B;

[0042] Step 68: Determine whether the number of iterations reaches the set maximum number of iterations L;

[0043] If not, then the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B, and the projected and mapped vectors are input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and l=l+1 is set, and the obtained classification results are used to return to execute step six-six;

[0044] If it is achieved, the tangent space vectors of the idth subject in the training set and each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the projection mapping result, that is, the feature vector of the tangent space vector of the idth subject and the target domain after projection mapping.

[0045] Furthermore, the objective function in step six-four is:

[0046]

[0047] Where I is the identity matrix, ω, μ, α, and λ are coefficients;

[0048] By constructing the Lagrangian function and setting the derivative of the Lagrangian function to 0, the objective function is expressed as:

[0049]

[0050] Among them, Φ is a matrix The diagonal matrix composed of the eigenvalues ​​of k ), Φ1, Φ2, ..., Φ k Represents the matrix The first, second, ..., kth eigenvalues ​​after sorting the eigenvalues ​​from large to small, W1, W2, ..., W k The eigenvalues ​​are Φ1, Φ2, ..., Φ k The corresponding eigenvector, matrix W = [W1,...,W k ], W=[A;B].

[0051] Furthermore, the specific process of step seven is as follows:

[0052] Step 71, initialize the number of iterations l′=1;

[0053] Step 72: Minimize the SRM principle as follows:

[0054]

[0055] In the formula, represents a set of classifiers in the kernel space, f is the classifier, represents the loss function on the matrix x composed of the projection mapping results (feature vectors after projection mapping) corresponding to the EEG signal data of the idth subject in the training set and each group in the target domain, y represents the classification label of x, η represents the hyperparameter of R(f), and R(f) represents The square norm of f in ;

[0056] The expanded form of f is as follows:

[0057]

[0058] Where n s Indicates the number of EEG signal data sets of the idth subject in the training set, n t represents the number of EEG signal data sets in the target domain, β represents the weight vector, represents the weight of each group of EEG signal data, is a real number, K(x i ,x) represents x i Correlation with x, x i Represents the projection mapping result of the idth subject in the training set and any set of EEG signal data in the target domain;

[0059] Expand f to:

[0060]

[0061] In the formula, f(·) represents the output of classifier f, K represents the kernel matrix, and K(x i ,x j ) represents x i With x j The correlation, K(x i ,x j ) is the element in the i-th row and j-th column of the kernel matrix K, y i Represents x i The classification label of represents the label vector, Y is the one-hot encoding matrix of y, A′ represents the diagonal matrix, if i belongs to the training set data, then the i-th diagonal element A in the diagonal matrix i ' i =1; otherwise, A i ' i =0;

[0062] Step 7.3: Calculate the maximum average difference between the projection mapping result of the EEG signal data of the idth subject in the training set and the projection mapping result of the EEG signal data in the target domain:

[0063]

[0064] In the formula, represents the maximum mean difference, M0 represents the marginal MMD matrix, K i is the i-th column vector of K, is the j+nth s column vector, H K represents the Hilbert kernel space;

[0065]

[0066] In the formula, represents the set of projection mapping results of each group of EEG signal data of the idth subject in the training set, Represents the set of projection mapping results of each group of EEG signal data in the target domain, (M0) ij represents the element in row i and column j in M0;

[0067] Step 74: Calculate conditional metric constraints

[0068]

[0069] in, represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the idth subject in the training set; (x t ) (c) Represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the target domain; (x) (c) represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain; Indicates the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain, belonging to the category The matrix composed of the projection mapping results corresponding to the data; represents the category that does not belong to category c; E[·] represents the expectation; is the intra-class MMD matrix; is the between-class MMD matrix;

[0070]

[0071] in, express The element in row i and column j in represents the data set belonging to category c in the projection mapping results of the idth subject in the training set, represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set, represents the data set belonging to category c in the projection mapping result of the target domain, Represents the number of mapping results belonging to category c in the projection mapping results of the target domain;

[0072]

[0073] In the formula, express The element in row i and column j in represents the projection mapping result of the idth subject in the training set and the projection mapping result of the target domain that belongs to category c, n (c) represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain, represents the number of projection mapping results that do not belong to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain;

[0074] Step 75: Calculate the mean H of the intra-class difference center matrix:

[0075]

[0076] in, when When the data at the corresponding position in belongs to category c, the element at the corresponding position is 1, otherwise, the element at the corresponding position is 0; Represents a vector whose elements are all 1, n=n s +n t ;

[0077] Step 76. Calculate the matrix S:

[0078]

[0079] In the formula, S ij represents the element in the i-th row and j-th column of the matrix S, sim(·,·) represents the distance between two points, Represents point x i Belong to x j The neighborhood set of ;

[0080] Laplace Regularization It is expressed as:

[0081]

[0082] Where L is the Laplace matrix, L ij represents the element in the i-th row and j-th column of the Laplace matrix, L = DS, D is a diagonal matrix, and

[0083] Step 77: Based on steps 72 to 76, the final classifier is obtained:

[0084]

[0085] In the formula, ε, ρ and γ are coefficients;

[0086] According to the final classifier of the above formula, the objective function is established:

[0087]

[0088] Derivative the objective function and set the derivative of the objective function to 0 to obtain the weight vector β of the classifier * :

[0089] β * =((A′+εM0+(1-ε)M c +ρL+γH)K+ηI) -1 A'Y T

[0090] Step 78: Determine whether the number of iterations l' reaches the set maximum number of iterations L';

[0091] If not, set l′=l′+1, use the classifier obtained in step 77 to obtain the pseudo label of the target domain, and then return to step 72;

[0092] If it is reached, the classifier obtained in the last iteration is used as the classifier CLS obtained based on the idth subject in the training set id .

[0093] Furthermore, the specific process of step nine is as follows:

[0094] Step 91: Initialize the subject id in the source domain to 1;

[0095] Step 92: Pass the tangent space vector of all EEG signal data in the target domain and the tangent space vector of all EEG signal data of the idth subject in the source domain through a linear classifier, and calculate the edge distance according to the output of the linear classifier.

[0096] The projection mapping results corresponding to the tangent space vectors of all EEG signal data in the target domain and the projection mapping results corresponding to the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier, and the edge distance is calculated based on the output of the linear classifier.

[0097] Step 93: Pass the tangent space vector of the c-th type of EEG signal data of the id-th subject in the target domain and the source domain through the linear classifier, and calculate the conditional distance of the tangent space vector of the c-th type of EEG signal data according to the output of the linear classifier.

[0098] The projection mapping results of the tangent space vector of the c-th EEG signal data of the id-th subject in the target domain and the source domain are passed through a linear classifier, and the conditional distance of the projection mapping result corresponding to the tangent space vector of the c-th EEG signal data is calculated according to the output of the linear classifier. c=1,2,…,C;

[0099] Step 94: Edge distance And the conditional distance Perform integration to obtain the integrated distance corresponding to the idth subject in the source domain;

[0100] The specific process of calculating the integrated distance is:

[0101]

[0102] Among them, d M and d c All are intermediate variables;

[0103] Then the integration distance d corresponding to the idth subject in the source domain is id,Mc for:

[0104]

[0105] Step 95: determine whether id=ID is satisfied;

[0106] If id=ID, execute step 96;

[0107] If id=ID is not satisfied, set id=id+1 and return to step 92;

[0108] Step 96: According to the integration distance d corresponding to each subject in the source domain id,Mc , to calculate the weight factor of the classifier corresponding to each subject, and record the weight factor of the classifier corresponding to the idth subject in the source domain as wt id ;

[0109] Then execute step 97;

[0110] Step 97: for any group of EEG signal data in the target domain, the projection mapping results corresponding to the group of EEG signal data are used as the input of the classifier corresponding to each subject in the source domain;

[0111] Then the output of the classifier corresponding to the idth subject in the source domain is combined with the weight factor wt id Multiply to obtain a multiplication result, wherein the multiplication result includes the probability that the group of EEG signal data belongs to each category, and id=1,2,...,ID;

[0112] The elements in the multiplication results of each classifier are added up accordingly. The elements contained in the addition results are the final probabilities that the group of EEG signal data belongs to each category. Then the maximum value is selected from the final probabilities of each category. The category corresponding to the maximum value is the category to which the group of EEG signal data belongs.

[0113] Furthermore, the edge distance is calculated as follows:

[0114] For edge distance The tangent space vectors of all EEG signal data of the target domain and the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier, and the linear classifier is used to output whether the EEG signal data corresponding to each tangent space vector belongs to the source domain or the target domain;

[0115]

[0116] Among them, h represents the linear classifier, and ε(h) represents the incorrect rate of the linear classifier output result.

[0117] Furthermore, the specific process of step ninety-six is ​​as follows:

[0118]

[0119] Among them, wt id It represents the weight factor of the classifier corresponding to the idth subject in the source domain, and e is the base of the natural logarithm.

[0120] The beneficial effects of the present invention are:

[0121] The present invention makes full use of the information of the source domain (training set) and the target domain samples, combined with systematic data processing and classification algorithms, to significantly improve the recognition accuracy and robustness of the motor imagery task. Through efficient data preprocessing and feature extraction methods in domain adaptive manifold embedding, the consistency of the feature mapping of the training set and the target domain data is ensured. In addition, the classifier optimization based on the principle of structural risk minimization further enhances the classification performance. Through feature fusion and voting mechanisms, the credibility of label classification is effectively improved. The method of the present invention can effectively avoid the problem of low classification accuracy of the MI-BCI system due to differences in EEG signals between subjects, laying a solid foundation for applications in related fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0122] Figure 1 Flowchart of the experimental paradigm for EEG signal acquisition;

[0123] Figure 2 Flowchart of the distribution alignment method for domain adaptive manifold embeddings. DETAILED DESCRIPTION

[0124] Specific implementation method 1: Combination Figure 2 This embodiment describes a domain adaptation method for solving subject differences in a motor imagery brain-computer interface, and the specific process of the method is as follows:

[0125] Step 1: ID subject uses the online brain-computer interface system to perform multiple motor imagery tasks, wherein the motor imagery tasks include leftward motor imagery tasks and rightward motor imagery tasks. During each motor imagery task, the subject's EEG signal data is collected, and the collected EEG signal data of ID subject is used as training set data, and the EEG signal data collected during the motor imagery task of the subject to be tested is used as target domain data;

[0126] Step 2: extracting the EEG signal data corresponding to the motor imagery time period from each group of EEG signal data in the training set and the target domain, and preprocessing the extracted EEG signal data to obtain each group of preprocessed EEG signal data;

[0127] Step 3: Use a pre-alignment strategy to process each group of preprocessed EEG signal data in the training set and the target domain to obtain each group of processed EEG signal data;

[0128] Step 4: Calculate the covariance matrix of each group of EEG signal data after processing, and then use the tangent space feature mapping method to project the covariance matrix of each group of EEG signal data to the tangent space to obtain the tangent space vector of each group of EEG signal data. The dimension of a single trial after projection is D.

[0129] Step 5: Initialize id=1;

[0130] Step 6: Use the domain adaptive manifold embedding distribution alignment feature mapping method to project the tangent space vectors of each group of EEG signal data of the idth subject in the training set and the tangent space vectors of each group of EEG signal data in the target domain to obtain the feature vectors of the tangent space vectors of the idth subject and the target domain after projection mapping;

[0131] Step 7: Based on structural risk minimization (SRM) and regularization theory (LR), the classifier CLS is constructed using the feature vector after projection mapping of the idth subject and the target domain. id ;

[0132] Step 8: Determine whether id=ID is satisfied;

[0133] If it satisfies, then we get the constructed ID classifiers CLS1, CLS2,…, CLS ID ; The feature vectors after projection mapping of the target domain are passed through classifiers CLS1, CLS2, ..., CLSID , and obtain the classification results Rst1, Rst2, …, Rst ID , then execute step nine;

[0134] If not satisfied, set id=id+1 and return to step 6;

[0135] Step nine: perform feature fusion on the ID classification results obtained in step eight to obtain the final classification result of the target domain data.

[0136] Specific implementation method 2: Combination Figure 1 This embodiment is different from the first embodiment in that the specific process of step 1 is as follows:

[0137] For any subject, the subject is made to face the computer screen, and a fixed cross symbol pattern appears on the computer screen at t=0, and a motor imagery prompt appears on the computer screen at t=2 seconds to prompt the subject to perform motor imagery; wherein the motor imagery prompt is an arrow prompt, and the arrow prompt includes two types: a left arrow prompt and a right arrow prompt;

[0138] From t=2 to t=6, a total of 4 seconds, the arrow prompt on the computer screen remained unchanged, and the subject continued to perform the motor imagery of the current prompt; then rested for two seconds; at t=8 seconds, the second round of motor imagery experiment began again, and the above process was repeated, and the subject was subjected to multiple motor imagery experiments; and during each motor imagery task, the subject's EEG signal data from the beginning to the end of the task were collected (the sampling rate was set to 100 Hz); and the number of appearances of the left arrow prompt was set to be the same as the number of appearances of the right arrow prompt, without experimental bias, and 200 sets of experimental data were collected for each subject;

[0139] Similarly, the EEG signal data of each subject during the motor imagery task is collected separately, and then the collected EEG signal data of the subject with the ID position is used as the training set. The training set data is the source domain data (and the data in the training set are numbered according to the order of the experiment to ensure the standardization of data processing and the repeatability of the experiment, to assist in the classification of the EEG data of the subjects in the test set);

[0140] The EEG signal data collected during the motor imagery task of the subject to be tested is used as the target domain data (the category of the EEG signal data of the subject to be tested is unknown in advance, and the purpose of the present invention is to classify the EEG signal data of the subject to be tested).

[0141] The other steps and parameters are the same as those in the first embodiment.

[0142] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that the specific process of step two is as follows:

[0143] For each set of EEG signal data collected, the motor imagery period is extracted, that is, the EEG signal data within 2.5 seconds to 5.5 seconds are extracted, and the extracted EEG signal data are processed by power frequency notch filtering (filter frequency is 50Hz) and bandpass filtering (filter frequency is 8H to 30Hz).

[0144] The other steps and parameters are the same as those in the first or second embodiment.

[0145] Specific implementation method 4: This implementation method is different from any one of the specific implementation methods 1 to 3 in that the specific process of step 3 is as follows:

[0146] The covariance matrix is ​​calculated based on the preprocessed EEG signal data of the ID position subject and the target domain in the training set, and then the mean of the covariance matrix in the Riemann space is calculated. The preprocessed EEG signal data of each group are aligned according to the mean to obtain the processed EEG signal data of each group.

[0147] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0148] After data alignment, the distribution of all trial data is more similar and more suitable for subsequent classification.

[0149] Specific implementation method 5: This implementation method is different from the specific implementation methods 1 to 4 in that the specific process of step 6 is as follows:

[0150] Step 6. Calculate the intra-class scattering matrix and inter-class scattering matrix of the idth subject in the training set. The projection matrix is ​​constrained based on the intra-class scattering matrix and the inter-class scattering matrix:

[0151]

[0152] Where A is the projection matrix, A T is the transpose of A, tr(·) is the trace of the matrix, S w is the intra-class scattering matrix of the EEG signal data of the idth subject, is the matrix composed of the tangent space vectors corresponding to the data belonging to category c in the EEG signal data of the idth subject, represents a real number, C is the number of types of EEG signal data of the idth subject (since the present invention includes leftward movement prompts and rightward movement prompts, the value of C is 2), is the number of data groups of category c in the EEG signal data of the idth subject, D is the dimension of the tangent space vector corresponding to each group of EEG signal data, is the data center matrix of category c, is the identity matrix, S b is the inter-class scattering matrix of the EEG signal data of the idth subject, is the mean of the tangent space vectors corresponding to each group of EEG signal data in category c of the idth subject, is the tangent space vector corresponding to the ith group of EEG signal data in category c of the idth subject, is the mean of the tangent space vectors corresponding to all the EEG signal data of the idth subject, X i represents the tangent space vector corresponding to the idth group of EEG signal data of the idth subject, n s Indicates the total number of EEG signal data sets of the idth subject;

[0153] The intra-class scattering matrix and the inter-class scattering matrix can maintain the discriminative information in the domain, ensuring that the data samples of the same category are close to each other and the data samples of different categories are far away from each other;

[0154] Step 6.2: Calculate the scattering matrix V of the EEG signal data in the target domain that is independent of the category t , then the constraint of the projection matrix based on the data scattering matrix is:

[0155]

[0156] Where B represents the projection matrix, X t Represents the matrix composed of tangent space vectors corresponding to each group of processed EEG signal data in the target domain, n t represents the total number of EEG signal data sets in the target domain, H t is the center matrix of the target domain, is the identity matrix;

[0157] Due to the uncertainty of the predicted labels, relying solely on discriminative information is not enough to prevent irrelevant features from entering irrelevant dimensions. We continue to use the target domain variance maximization method to avoid the information brought by irrelevant dimensions.

[0158] Step 6.3. In order to obtain better generalization performance, it is necessary to ensure that A and B do not contain extreme values, that is, the projection matrix A and the projection matrix B satisfy the constraints:

[0159]

[0160] Among them, ||·|| F Indicates calculation of F norm;

[0161] Requiring projection matrix A and projection matrix B to satisfy the above conditions can reduce the difference between the source domain and the target domain, and continue to narrow the difference between the source domain and the target domain;

[0162] Step 64: Solve the objective function according to the constraints of step 61 to step 63 to obtain projection matrices A and B;

[0163] Then, the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the vectors after projection mapping; the vectors after projection mapping are then input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and the obtained classification results are used as the initial classification results;

[0164] Step 65, initialize the number of iterations l = 1;

[0165] Step 66: Calculate the intra-class scattering matrix and inter-class scattering matrix of each group of EEG signal data in the target domain. Then the constraints of the projection matrix based on the intra-class scattering matrix and the inter-class scattering matrix are:

[0166]

[0167]

[0168] Among them, T w is the intra-class scattering matrix of each group of EEG signal data in the target domain, is the matrix composed of tangent space vectors corresponding to the EEG signal data belonging to category c in the target domain, represents the number of EEG signal data sets belonging to category c in the target domain, is the central matrix of the EEG signal data of category c, is the identity matrix, T b is the inter-class scattering matrix of the target domain EEG signal data, represents the mean of the tangent space vector corresponding to the EEG signal data belonging to category c in the target domain, represents the tangent space vector corresponding to the i-th group of EEG signal data belonging to category c in the target domain, represents the mean of the tangent space vectors corresponding to each group of EEG signal data in the target domain, X i is the tangent space vector corresponding to the i-th group of EEG signal data in the target domain;

[0169] By using the classifier trained in the source domain to help predict pseudo labels, the information of the target domain can be preserved, and the intra-class scattering matrix and inter-class scattering matrix close to the true matrix can be obtained, minimizing T w While maximizing T b , which is easier to classify.

[0170] Step 67: Solve the objective function according to the constraints of step 61 to step 63 and step 66 to obtain projection matrices A and B;

[0171] Step 68: Determine whether the number of iterations reaches the set maximum number of iterations L;

[0172] If not, then the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B, and the projected and mapped vectors are input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and l=l+1 is set, and the obtained classification results are used to return to execute step six-six;

[0173] If it is achieved, the tangent space vectors of the idth subject in the training set and each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the projection mapping result, that is, the feature vector of the tangent space vector of the idth subject and the target domain after projection mapping.

[0174] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0175] In order to obtain a more stable projection matrix, steps 66 to 68 need to be iterated multiple times. After solving the projection matrices A and B, the tangent space vector is projected and mapped to obtain the feature vectors of the projected training set and the target domain. The above step 6 is repeated for the ID subjects in the source domain training set and the current target domain to obtain projection matrices with different ID groups.

[0176] Specific implementation method 6: This implementation method is different from any one of the specific implementation methods 1 to 5 in that the objective function in step 64 is:

[0177]

[0178] Among them, I is the unit matrix, ω, μ, α and λ are all coefficients (the specific values ​​can be selected according to the actual situation), ω corresponds to the parameter of maintaining the discriminative information of the source domain, μ corresponds to the parameter of maximizing the variance of the target domain, λ corresponds to the parameter of minimizing the subspace difference and regularization, and α corresponds to the parameter of maintaining the discriminative information of the target domain;

[0179] By constructing the Lagrangian function and setting the derivative of the Lagrangian function to 0, the objective function can be expressed as:

[0180]

[0181] The above formula can be solved according to the generalized eigenvalue decomposition;

[0182] Among them, Φ is a matrix The diagonal matrix composed of the eigenvalues ​​of k ), Φ1, Φ2, …, Φ k Represents the matrix The first, second, ..., kth eigenvalues ​​after sorting the eigenvalues ​​from large to small, W1, W2, ..., W k The eigenvalues ​​are Φ1, Φ2, …, Φ k The corresponding eigenvectors, matrix W = [W1,...,W k ], W=[A;B].

[0183] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.

[0184] When calculating the objective function in step 64, let T b is a 0 matrix. In each subsequent iteration, the T calculated in step 66 of the current iteration is used. b That's it.

[0185] Specific implementation method 7: This implementation method is different from any one of specific implementation methods 1 to 6 in that the specific process of step 7 is as follows:

[0186] Step 71, initialize the number of iterations l′=1;

[0187] Step 72: Based on the SRM principle, first calculate the square loss in the recursive least squares and the square norm of CLS in the Hilbert kernel space; the minimization SRM principle is expressed as:

[0188]

[0189] In the formula, represents a set of classifiers in the kernel space (the kernel space that can be used includes but is not limited to the rbf kernel space), f is the classifier, represents the loss function on the matrix x composed of the projection mapping results (eigenvectors after projection mapping) corresponding to the idth subject in the training set and each group of EEG signal data in the target domain (the loss function used in the present invention is the square loss in recursive least squares), y represents the classification label of x, η represents the hyperparameter of R(f) (technical personnel in this field can set it according to experience), and R(f) represents The square norm of f in ;

[0190] The expanded form of f is as follows:

[0191]

[0192] Where n s Indicates the number of EEG signal data sets of the idth subject in the training set, n trepresents the number of EEG signal data sets in the target domain, β represents the weight vector, represents the weight of each group of EEG signal data, is a real number, K(x i ,x) represents x i Correlation with x, x i Represents the projection mapping result of the idth subject in the training set and any set of EEG signal data in the target domain;

[0193] Expand f to:

[0194]

[0195] Where f(·) represents the output of classifier f, K represents the kernel matrix (the kernel space that can be used includes but is not limited to the rbf kernel space), K(x i ,x j ) represents x i With x j The correlation, K(x i ,x j ) is the element in the i-th row and j-th column of the kernel matrix K, y i Represents x i The classification label of represents the label vector, Y is the one-hot encoding matrix of y, and A′ represents the diagonal matrix. Since this section only focuses on the SRM of the source domain, the diagonal matrix in the formula For example, if i belongs to the training set data, then the i-th diagonal element A in the diagonal matrix i ' i =1; otherwise, A i ' i =0;

[0196] Step 7.3: Calculate the maximum mean difference (MMD) between the projection mapping result of the EEG signal data of the idth subject in the training set and the projection mapping result of the EEG signal data in the target domain:

[0197]

[0198] In the formula, represents the maximum mean difference, M0 represents the marginal MMD matrix, K i is the i-th column vector of K, is the j+nth s column vector, H K represents the Hilbert kernel space, and the above formula calculates the 2-norm in the Hilbert kernel space;

[0199]

[0200] In the formula, represents the set of projection mapping results of each group of EEG signal data of the idth subject in the training set, Represents the set of projection mapping results of each group of EEG signal data in the target domain, (M0) ij represents the element in row i and column j in M0;

[0201] This step minimizes the distance between the source domain and the target domain measured under the maximum average difference of the projection through the edge metric constraint, so that the global difference between the two domains is further reduced;

[0202] Step 74: Calculate conditional metric constraints

[0203]

[0204] in, represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the idth subject in the training set; (x t ) (c) Represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the target domain; (x) (c) represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain; Indicates the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain, belonging to the category The matrix composed of the projection mapping results corresponding to the data; represents the category that does not belong to category c; E[·] represents the expectation; is the intra-class MMD matrix; is the between-class MMD matrix;

[0205]

[0206] in, express The element in row i and column j in represents the data set belonging to category c in the projection mapping results of the idth subject in the training set, represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set, represents the data set belonging to category c in the projection mapping result of the target domain, Represents the number of mapping results belonging to category c in the projection mapping results of the target domain;

[0207]

[0208] In the formula, express The element in row i and column j in represents the projection mapping result of the idth subject in the training set and the projection mapping result of the target domain that belongs to category c, n (c) represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain, represents the number of projection mapping results that do not belong to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain;

[0209] This step can reduce the intra-class difference between the source domain and the target domain and improve the inter-class difference to facilitate better classification through conditional metric constraints. When constraining the target domain, the first iteration uses a linear discriminator to predict the pseudo-label of the target domain. After multiple iterations, a pseudo-label close to the true label is obtained. Each subsequent iteration of the target domain uses the classifier obtained in the previous iteration to obtain the pseudo-label.

[0210] Step 75: Calculate the mean H of the intra-class difference center matrix:

[0211]

[0212] in, when When the data at the corresponding position in belongs to category c, the element at the corresponding position is 1, otherwise, the element at the corresponding position is 0; Represents a vector whose elements are all 1, n=n s +n t ;

[0213] This step is to balance the excessive constraints generated in the conditional metric constraints, and use metric correction to minimize a certain inter-class difference; projected MMD is also used to minimize the inter-class difference.

[0214] Step 76. Calculate the matrix S:

[0215]

[0216] In the formula, S ij represents the element in the i-th row and j-th column of the matrix S, sim(·,·) represents the distance between two points (cosine distance is used in the present invention), Represents point x i Belong to x j The neighborhood set of point x j The nearest p points, p is a parameter set in advance);

[0217] Laplace Regularization It is expressed as:

[0218]

[0219] Where L is the Laplace matrix, L ij represents the element in the i-th row and j-th column of the Laplace matrix, L = DS, D is a diagonal matrix, and

[0220] In this step, Laplace regularization is used to introduce constraints in the parameter space. These constraints form a smooth hyperplane, which makes the optimized solution tend to the area with less changes.

[0221] Step 77: Based on steps 72 to 76, the final classifier is obtained:

[0222]

[0223] In the formula, ε, ρ and γ are all coefficients; ε corresponds to the edge metric constraint parameter, 1-ε is the conditional metric constraint parameter, ρ represents the Laplace regularization parameter, and γ represents the metric correction parameter;

[0224] According to the final classifier of the above formula, the objective function is established:

[0225]

[0226] Derivative the objective function and set the derivative of the objective function to 0 to obtain the weight vector β of the classifier * :

[0227] β * =((A′+εM0+(1-ε)M c +ρL+γH)K+ηI) -1 A'Y T

[0228] Then β * Substitution Get the classifier f;

[0229] Step 78: Determine whether the number of iterations l' reaches the set maximum number of iterations L';

[0230] If not, set l′=l′+1, use the classifier obtained in step 77 to obtain the pseudo label of the target domain, and then return to step 72;

[0231] If it is reached, the classifier obtained in the last iteration is used as the classifier CLS obtained based on the idth subject in the training set id .

[0232] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0233] Specific implementation eight: This implementation is different from one of the specific implementations one to seven in that the specific process of step nine is as follows:

[0234] Step 91: Initialize the subject id in the source domain to 1;

[0235] Step 92: Pass the tangent space vector of all EEG signal data in the target domain and the tangent space vector of all EEG signal data of the idth subject in the source domain through a linear classifier, and calculate the edge distance according to the output of the linear classifier.

[0236] The projection mapping results corresponding to the tangent space vectors of all EEG signal data in the target domain and the projection mapping results corresponding to the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier, and the edge distance is calculated based on the output of the linear classifier.

[0237] Step 93: Pass the tangent space vector of the c-th type of EEG signal data of the id-th subject in the target domain and the source domain through the linear classifier, and calculate the conditional distance of the tangent space vector of the c-th type of EEG signal data according to the output of the linear classifier.

[0238] The projection mapping results of the tangent space vector of the c-th EEG signal data of the id-th subject in the target domain and the source domain are passed through a linear classifier, and the conditional distance of the projection mapping result corresponding to the tangent space vector of the c-th EEG signal data is calculated according to the output of the linear classifier. c=1,2,…,C;

[0239] Step 94: Edge distance And the conditional distance Perform integration to obtain the integrated distance corresponding to the idth subject in the source domain;

[0240] The specific process of calculating the integrated distance is:

[0241]

[0242] Among them, d M and d c All are intermediate variables;

[0243] Then the integration distance d corresponding to the idth subject in the source domain is id,Mc for:

[0244]

[0245] By integrating the edge distance and the conditional distance, we can get the integrated overall distribution distance. The overall distribution distance difference indicates the overall difference between the source domain and the current target domain. The overall distribution distance difference range obtained after integration has not changed and is still in the interval [0,2]. The larger the distribution distance difference, the lower the credibility of the current source domain label. The classification result generated by the source domain with the smallest distribution distance from the target domain will be considered as having the largest weight factor.

[0246] Step 95: determine whether id=ID is satisfied;

[0247] If id=ID, execute step 96;

[0248] If id=ID is not satisfied, set id=id+1 and return to step 92;

[0249] Step 96: According to the integration distance d corresponding to each subject in the source domain id,Mc , to calculate the weight factor of the classifier corresponding to each subject, and record the weight factor of the classifier corresponding to the idth subject in the source domain as wt id ;

[0250] Then execute step 97;

[0251] Step 97: for any group of EEG signal data in the target domain, the projection mapping results corresponding to the group of EEG signal data are used as the input of the classifier corresponding to each subject in the source domain;

[0252] Then the output of the classifier corresponding to the idth subject in the source domain is combined with the weight factor wt id Multiply to obtain a multiplication result, wherein the multiplication result includes the probability that the group of EEG signal data belongs to each category, and id=1,2,...,ID;

[0253] And add the elements in the multiplication results of each classifier accordingly (add the first element in each multiplication result, and the sum is the first element in the addition result. Similarly, each element in the addition result is obtained separately). Each element contained in the addition result is the final probability that the group of EEG signal data belongs to each category. Then the maximum value is selected from the final probabilities of each category. The category corresponding to the maximum value is the category to which the group of EEG signal data belongs.

[0254] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0255] Specific implementation method 9: This implementation method is different from any one of specific implementation methods 1 to 8 in that the edge distance is calculated as follows:

[0256] For edge distance The tangent space vectors of all EEG signal data of the target domain and the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier (the linear classifier that can be used in the present invention includes but is not limited to SVM), and the linear classifier outputs whether the EEG signal data corresponding to each tangent space vector belongs to the source domain or the target domain;

[0257]

[0258] Wherein, h represents a linear classifier, and ε(h) represents the incorrectness rate of the output result of the linear classifier (in the present invention, the label set for all EEG signal data in the target domain is 0, and the label set for all EEG signal data in the source domain is 1, and the incorrectness rate can be calculated based on the label and the output of the linear classifier).

[0259] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.

[0260] Similarly, and All are calculated using the method of this embodiment.

[0261] Specific implementation method 10: This implementation method is different from specific implementation methods 1 to 9 in that the specific process of step 96 is as follows:

[0262]

[0263] Among them, wt id It represents the weight factor of the classifier corresponding to the idth subject in the source domain, and e is the base of the natural logarithm.

[0264] The other steps and parameters are the same as those in Specific Embodiments 1 to 9.

[0265] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A domain adaptation method for solving subject differences in motor imagery brain-computer interface, characterized in that: The method specifically comprises the following steps: Step 1: ID subject uses the online brain-computer interface system to perform multiple motor imagery tasks, wherein the motor imagery tasks include leftward motor imagery tasks and rightward motor imagery tasks. During each motor imagery task, the subject's EEG signal data is collected, and the collected EEG signal data of ID subject is used as training set data, and the EEG signal data collected during the motor imagery task of the subject to be tested is used as target domain data; Step 2: extracting the EEG signal data corresponding to the motor imagery time period from each group of EEG signal data in the training set and the target domain, and preprocessing the extracted EEG signal data to obtain each group of preprocessed EEG signal data; Step 3: Use a pre-alignment strategy to process each group of preprocessed EEG signal data in the training set and the target domain to obtain each group of processed EEG signal data; Step 4: Calculate the covariance matrix of each group of EEG signal data according to the processed EEG signal data, and then use the tangent space feature mapping method to project the covariance matrix of each group of EEG signal data to the tangent space to obtain the tangent space vector of each group of EEG signal data; Step 5: Initialize id=1; Step 6: Use the domain adaptive manifold embedding distribution alignment feature mapping method to project the tangent space vectors of each group of EEG signal data of the idth subject in the training set and the tangent space vectors of each group of EEG signal data in the target domain to obtain the feature vectors of the tangent space vectors of the idth subject and the target domain after projection mapping; Step 7: Construct the classifier CLS using the feature vector after projection mapping of the idth subject and the target domain id ; Step 8: Determine whether id=ID is satisfied; If it satisfies, then we get the constructed ID classifiers CLS1, CLS2,…, CLS ID ; The feature vectors after projection mapping of the target domain are passed through classifiers CLS1, CLS2, ..., CLS ID , and obtain the classification results Rst1, Rst2, …, Rst ID , then execute step nine; If not satisfied, set id=id+1 and return to step 6; Step nine: perform feature fusion on the ID classification results obtained in step eight to obtain the final classification result of the target domain data.

2. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 1, characterized in that: The specific process of step one is: For any subject, the subject is made to face the computer screen, and a fixed cross symbol pattern appears on the computer screen at t=0, and a motor imagery prompt appears on the computer screen at t=2 seconds to prompt the subject to perform motor imagery; wherein the motor imagery prompt is an arrow prompt, and the arrow prompt includes two types: a left arrow prompt and a right arrow prompt; From t = 2 to t = 6, a total of 4 seconds, the arrow prompt on the computer screen remained unchanged, and the subject continued to perform the motor imagery of the current prompt; then rested for two seconds; at t = 8 seconds, the second round of motor imagery experiment began, and the above process was repeated, and the subject was subjected to multiple motor imagery experiments; and during each motor imagery task, the subject's EEG signal data was collected from the beginning to the end of the task; Similarly, the EEG signal data of each subject during the motor imagery task is collected, and then the collected EEG signal data of the subject with the ID position is used as the training set, and the training set data is the source domain data; The EEG signal data collected during the motor imagery task of the subject is used as the target domain data.

3. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 2, characterized in that: The specific process of step 2 is as follows: For each set of collected EEG signal data, the motor imagery period is extracted, that is, the EEG signal data within 2.5 seconds to 5.5 seconds are extracted, and the extracted EEG signal data are processed by power frequency notch filtering and bandpass filtering.

4. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 1, characterized in that: The specific process of step three is: The covariance matrix is ​​calculated based on the preprocessed EEG signal data of the ID position subject and the target domain in the training set, and then the mean of the covariance matrix in the Riemann space is calculated. The preprocessed EEG signal data of each group are aligned according to the mean to obtain the processed EEG signal data of each group.

5. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 1, characterized in that: The specific process of step six is ​​as follows: Step 6. Calculate the intra-class scattering matrix and inter-class scattering matrix of the idth subject in the training set. The projection matrix is ​​constrained based on the intra-class scattering matrix and the inter-class scattering matrix: Where A is the projection matrix, A T is the transpose of A, tr(·) is the trace of the matrix, S w is the intra-class scattering matrix of the EEG signal data of the idth subject, is the matrix composed of the tangent space vectors corresponding to the data belonging to category c in the EEG signal data of the idth subject, represents a real number, C is the number of types of EEG signal data of the idth subject, is the number of data groups of category c in the EEG signal data of the idth subject, D is the dimension of the tangent space vector corresponding to each group of EEG signal data, is the data center matrix of category c, is the identity matrix, S b is the inter-class scattering matrix of the EEG signal data of the idth subject, is the mean of the tangent space vectors corresponding to each group of EEG signal data in category c of the idth subject, is the tangent space vector corresponding to the ith group of EEG signal data in category c of the idth subject, is the mean of the tangent space vectors corresponding to all the EEG signal data of the idth subject, X i represents the tangent space vector corresponding to the idth group of EEG signal data of the idth subject, n s Indicates the total number of EEG signal data sets of the idth subject; Step 6.2: Calculate the scattering matrix V of the EEG signal data in the target domain t , then the constraint of the projection matrix based on the data scattering matrix is: Where B represents the projection matrix, X t Represents the matrix composed of tangent space vectors corresponding to each group of processed EEG signal data in the target domain, n t represents the total number of EEG signal data sets in the target domain, H t is the center matrix of the target domain, is the identity matrix; Step 6.

3. Projection matrix A and projection matrix B satisfy the constraints: Among them, ||·|| F Indicates calculation of F norm; Step 64: Solve the objective function according to the constraints of step 61 to step 63 to obtain projection matrices A and B; Then, the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the vectors after projection mapping; the vectors after projection mapping are then input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and the obtained classification results are used as the initial classification results; Step 65: Initialize the number of iterations l=1; Step 66: Calculate the intra-class scattering matrix and inter-class scattering matrix of each group of EEG signal data in the target domain. Then the constraints of the projection matrix based on the intra-class scattering matrix and the inter-class scattering matrix are: Among them, T w is the intra-class scattering matrix of each group of EEG signal data in the target domain, is the matrix composed of tangent space vectors corresponding to the EEG signal data belonging to category c in the target domain, represents the number of EEG signal data sets belonging to category c in the target domain, is the central matrix of the EEG signal data of category c, is the identity matrix, T b is the inter-class scattering matrix of the target domain EEG signal data, represents the mean of the tangent space vector corresponding to the EEG signal data belonging to category c in the target domain, represents the tangent space vector corresponding to the i-th group of EEG signal data belonging to category c in the target domain, represents the mean of the tangent space vectors corresponding to each group of EEG signal data in the target domain, X i is the tangent space vector corresponding to the i-th group of EEG signal data in the target domain; Step 67: Solve the objective function according to the constraints of step 61 to step 63 and step 66 to obtain projection matrices A and B; Step 68: Determine whether the number of iterations reaches the set maximum number of iterations L; If not, then the tangent space vectors of each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B, and the projected and mapped vectors are input into the SVM classifier to obtain the classification results of each group of EEG signal data in the target domain, and l=l+1 is set, and the obtained classification results are used to return to execute step six-six; If it is achieved, the tangent space vectors of the idth subject in the training set and each group of EEG signal data in the target domain are projected and mapped according to the projection matrices A and B to obtain the projection mapping result, that is, the feature vector of the tangent space vector of the idth subject and the target domain after projection mapping.

6. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 5, characterized in that: The objective function in step six four is: Where I is the identity matrix, ω, μ, α, and λ are coefficients; By constructing the Lagrangian function and setting the derivative of the Lagrangian function to 0, the objective function is expressed as: Among them, Φ is a matrix The diagonal matrix composed of the eigenvalues ​​of k ), Φ1, Φ2, …, Φ k Represents the matrix The first, second, ..., kth eigenvalues ​​after sorting the eigenvalues ​​from large to small, W1, W2, ..., W k The eigenvalues ​​are Φ1, Φ2, …, Φ k The corresponding eigenvector, matrix W = [W1,…,W k ], W=[A;B].

7. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 6, characterized in that: The specific process of step seven is as follows: Step 71, initialize the number of iterations l′=1; Step 72: Minimize the SRM principle as follows: In the formula, represents a set of classifiers in the kernel space, f is the classifier, represents the loss function on the matrix x composed of the projection mapping results (feature vectors after projection mapping) corresponding to the EEG signal data of the idth subject in the training set and each group in the target domain, y represents the classification label of x, η represents the hyperparameter of R(f), and R(f) represents The square norm of f in ; The expanded form of f is as follows: Where n s Indicates the number of EEG signal data sets of the idth subject in the training set, n t represents the number of EEG signal data sets in the target domain, β represents the weight vector, represents the weight of each group of EEG signal data, is a real number, K(x i ,x) represents x i Correlation with x, x i Represents the projection mapping result of the idth subject in the training set and any set of EEG signal data in the target domain; Expand f to: In the formula, f(·) represents the output of classifier f, K represents the kernel matrix, and K(x i ,x j ) represents x i With x j The correlation, K(x i ,x j ) is the element in the i-th row and j-th column of the kernel matrix K, y i Represents x i The classification label of represents the label vector, Y is the one-hot encoding matrix of y, A′ represents the diagonal matrix, if i belongs to the training set data, then the i-th diagonal element A in the diagonal matrix i ' i =1; otherwise ,A i ′ i =0; Step 7.3: Calculate the maximum average difference between the projection mapping result of the EEG signal data of the idth subject in the training set and the projection mapping result of the EEG signal data in the target domain: In the formula, represents the maximum mean difference, M0 represents the marginal MMD matrix, K i is the i-th column vector of K, is the j+nth s column vector, H K represents the Hilbert kernel space; In the formula, represents the set of projection mapping results of each group of EEG signal data of the idth subject in the training set, Represents the set of projection mapping results of each group of EEG signal data in the target domain, (M0) ij represents the element in row i and column j in M0; Step 74: Calculate conditional metric constraints in, (x s ) (c) represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the idth subject in the training set; (x t ) (c) Represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results of the target domain; (x) (c) represents the matrix composed of the projection mapping results corresponding to the data belonging to category c in the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain; Indicates the projection mapping results corresponding to the idth subject in the training set and each group of EEG signal data in the target domain, belonging to the category The matrix composed of the projection mapping results corresponding to the data; represents the category that does not belong to category c; E[·] represents the expectation; is the intra-class MMD matrix; is the between-class MMD matrix; in, express The element in row i and column j in represents the data set belonging to category c in the projection mapping results of the idth subject in the training set, represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set, represents the data set belonging to category c in the projection mapping result of the target domain, Represents the number of mapping results belonging to category c in the projection mapping results of the target domain; In the formula, express The element in row i and column j in represents the projection mapping result of the idth subject in the training set and the projection mapping result of the target domain that belongs to category c, n (c) represents the number of projection mapping results belonging to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain, represents the number of projection mapping results that do not belong to category c in the projection mapping results of the idth subject in the training set and the projection mapping results of the target domain; Step 75: Calculate the mean H of the intra-class difference center matrix: in, when When the data at the corresponding position in belongs to category c, the element at the corresponding position is 1, otherwise, the element at the corresponding position is 0; Represents a vector whose elements are all 1, n=n s +n t ; Step 76. Calculate the matrix S: In the formula, S ij represents the element in the i-th row and j-th column of the matrix S, sim(·,·) represents the distance between two points, Represents point x i Belong to x j The neighborhood set of ; Laplace Regularization It is expressed as: Where L is the Laplace matrix, L ij represents the element in the i-th row and j-th column of the Laplace matrix, L = DS, D is a diagonal matrix, and Step 77: Based on steps 72 to 76, the final classifier is obtained: In the formula, ε, ρ and γ are coefficients; According to the final classifier of the above formula, the objective function is established: Derivative the objective function and set the derivative of the objective function to 0 to obtain the weight vector β of the classifier * : b * =((A′+εM0+(1-ε)M c +ρL+γH)K+ηI) -1 A′Y T Step 78: Determine whether the number of iterations l' reaches the set maximum number of iterations L'; If not, set l′=l′+1, use the classifier obtained in step 77 to obtain the pseudo label of the target domain, and then return to step 72; If it is reached, the classifier obtained in the last iteration is used as the classifier CLS obtained based on the idth subject in the training set id .

8. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 7, characterized in that: The specific process of step nine is as follows: Step 91: Initialize the subject id in the source domain to 1; Step 92: Pass the tangent space vector of all EEG signal data in the target domain and the tangent space vector of all EEG signal data of the idth subject in the source domain through a linear classifier, and calculate the edge distance according to the output of the linear classifier. The projection mapping results corresponding to the tangent space vectors of all EEG signal data in the target domain and the projection mapping results corresponding to the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier, and the edge distance is calculated based on the output of the linear classifier. Step 93: Pass the tangent space vector of the c-th type of EEG signal data of the id-th subject in the target domain and the source domain through the linear classifier, and calculate the conditional distance of the tangent space vector of the c-th type of EEG signal data according to the output of the linear classifier. The projection mapping results of the tangent space vector of the c-th EEG signal data of the id-th subject in the target domain and the source domain are passed through a linear classifier, and the conditional distance of the projection mapping result corresponding to the tangent space vector of the c-th EEG signal data is calculated according to the output of the linear classifier. Step 94: Edge distance And the conditional distance Perform integration to obtain the integrated distance corresponding to the idth subject in the source domain; The specific process of calculating the integrated distance is: Among them, d M and d c All are intermediate variables; Then the integration distance d corresponding to the idth subject in the source domain is id,Mc for: Step 95: determine whether id=ID is satisfied; If id=ID, execute step 96; If id=ID is not satisfied, set id=id+1 and return to step 92; Step 96: According to the integration distance d corresponding to each subject in the source domain id,Mc , to calculate the weight factor of the classifier corresponding to each subject, and record the weight factor of the classifier corresponding to the idth subject in the source domain as wt id ; Then execute step 97; Step 97: for any group of EEG signal data in the target domain, the projection mapping results corresponding to the group of EEG signal data are used as the input of the classifier corresponding to each subject in the source domain; Then the output of the classifier corresponding to the idth subject in the source domain is combined with the weight factor wt id Multiply to obtain a multiplication result, wherein the multiplication result includes the probability that the group of EEG signal data belongs to each category, and id=1,2,…,ID; The elements in the multiplication results of each classifier are added up accordingly. The elements contained in the addition results are the final probabilities that the group of EEG signal data belongs to each category. Then the maximum value is selected from the final probabilities of each category. The category corresponding to the maximum value is the category to which the group of EEG signal data belongs.

9. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 8, characterized in that: The edge distance is calculated as follows: For edge distance The tangent space vectors of all EEG signal data of the target domain and the tangent space vectors of all EEG signal data of the idth subject in the source domain are passed through a linear classifier, and the linear classifier is used to output whether the EEG signal data corresponding to each tangent space vector belongs to the source domain or the target domain; Among them, h represents the linear classifier, and ε(h) represents the incorrect rate of the linear classifier output result.

10. A domain adaptation method for solving subject differences in motor imagery brain-computer interface according to claim 9, characterized in that: The specific process of step ninety-six is ​​as follows: Among them, wt id It represents the weight factor of the classifier corresponding to the idth subject in the source domain, and e is the base of the natural logarithm.

Citation Information

Patent Citations

  • Brain-computer interface transfer learning method based on manifold embedding distribution alignment

    CN111723661A

  • Domain adaptation method for solving feature migration problem in motor imagery brain-computer interface

    CN113705464A

  • Motor imagery electroencephalogram signal adaptive classification method based on covariance alignment

    CN115640539A

  • Sub-domain adaptive motor imagery EEG decoding method based on dynamic feature consensus

    CN117708499A

  • Electroencephalogram signal classifying method and apparatus, electroencephalogram signal classifying model training method and apparatus, and medium

    WO2022042122A1