An online adaptive method for motor imagery algorithm based on ErrP
Through the online adaptive training of ErrP EEG signal, the MI classifier is solved, and the problem of low online recognition accuracy of MI brain-computer interface system is improved, the online application performance of the system is promoted, and its application in clinical and control aspects is promoted.
Patent Information
- Application Number
- CN202211592470.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-12
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-12-12
AI Technical Summary
During the online identification process, the classification accuracy of the MI brain-computer interface system is low due to signal non-stationarity, especially at different times and between different users, which affects the accuracy of the identification.
By detecting ErrP EEG signals to generate pseudo-labels, using ErrP EEG signals to perform online adaptive training of MI recognition algorithms, combining ErrP recognizer and MI classifier for online adaptive training, and updating the MI classifier to improve online classification accuracy.
It improves the online classification accuracy of the MI-BCI system, solves the problem of feature mismatch caused by user fatigue, physiological status, etc., and improves the online application performance of the system.
Smart Images

Figure CN116186532B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of brain-computer interface, and in particular to an online adaptive method of a motor imagery (MI) algorithm based on error-related potential (ErrP). Background Art
[0002] Motor imagery (MI) is a brain activity that involves imagining limb movements without actually performing them, through the brain's spontaneous modulation of corresponding neural centers. Motor imagery can generate event-related synchronization (ERS) potentials in the ipsilateral brain region and event-related desynchronization (ERD) potentials in the contralateral brain region, collectively referred to as motor imagery (MI) brain signals.
[0003] Because MI signals are generated by actively modulating brain activity, they lack the time-locked properties of signals like SSVEP and P300. Their signal characteristics, including generation time, intensity, and spatiotemporal distribution, are influenced by numerous factors, such as the user's fatigue, emotional state, and ambient noise. This results in a high degree of non-stationarity in MI signals, with MI characteristics varying across users over time. Furthermore, differences in brain fold structure, motor function, and memory contribute significantly to the variability in MI signal characteristics. These issues significantly impact online MI recognition. While offline classification accuracy can reach 90%, average online classification accuracy can be as low as 60%-70%, or even lower. Therefore, maintaining MI recognition accuracy in online systems remains a critical challenge. Summary of the Invention
[0004] In order to solve the problem of low online classification accuracy of the MI brain-computer interface system recognition algorithm, the purpose of the present invention is to provide an online adaptive method for the MI recognition algorithm, which generates pseudo labels for MI trials online by detecting ErrP EEG signals, and uses the labeled online MI EEG data for online adaptation of its recognition algorithm, thereby improving the online classification accuracy of the MI recognition algorithm through the online adaptive method. The present invention uses ErrP EEG signals to perform online adaptive training on the MI recognition algorithm. Since the ErrP EEG signals themselves are highly stable and have high classification accuracy, the online classification accuracy of the MI classifier is improved, thereby improving the online application performance of the MI-BCI system and promoting its application in clinical, control and other aspects. It has important theoretical research and practical application value.
[0005] In order to achieve the above objectives, the technical solutions of the present invention are as follows.
[0006] In one aspect, the present invention proposes an online adaptive method for a motor imagery algorithm based on ErrP, the method comprising the following steps:
[0007] Obtain a labeled motor imagery data sample set EM, where there are s subjects in the sample set EM;
[0008] Obtain a labeled motor imagery data sample set EMs and its corresponding ErrP EEG data sample set EE, where the sample set EMs and the sample set EE are the data of the user SN;
[0009] Based on the motor imagery data sample sets EM and EMs, the MI classifier is trained;
[0010] Based on the ErrP EEG data sample set EE, train the ErrP identifier;
[0011] The user's SN online motor imagery data is classified and identified using the trained MI classifier to obtain the ErrP EEG data corresponding to the online motor imagery data, and the trained ErrP identifier is used to perform ErrP EEG signal recognition;
[0012] Based on ErrP EEG signal recognition, the final classification and recognition results of online motor imagery data are determined;
[0013] The final recognition result is used as the label of the online motor imagery data, and the labeled motor imagery data is added to the sample set EMs to form a new sample set EMs. The sample set EM and the new sample set EMs are used to perform online adaptive training on the MI classifier to obtain an updated MI classifier.
[0014] The above technical solution addresses the problem of low online classification accuracy of the classifier of traditional single-modal MI-BCI due to strong signal non-stationarity. The classification results of the MI classifier are corrected by using ErrP EEG signals to obtain pseudo labels of online MI EEG data as data samples. The obtained data samples are fused with the original training data and the MI classifier is retrained. The current MI features can be integrated into the classifier to achieve online adaptation of the MI classifier. Since the ErrP EEG signal itself has strong stability and high classification accuracy, it can improve the online classification ability of the classifier, thereby effectively solving the problem of mismatch between current data features and training data features caused by subjects' fatigue, physiological, emotional state, etc.
[0015] In the above technical solution, based on the motor imagery data sample sets EM and EMs, the MI classifier is trained, including the following steps:
[0016] The motor imagery data sample sets EM and EMs were subjected to bandpass filtering and de-linear trend processing in turn to obtain sample sets EM2 and EMs2 respectively;
[0017] Based on the sample sets EM2 and EMs2, by setting the regularization parameters, calculate P regularized average covariance matrices Where: c = {1, 2}, 1 represents left-hand motor imagery, 2 represents right-hand motor imagery;
[0018] For each regularized mean covariance matrix Compute the pattern extraction projection matrix for the regularized cospatial patterns Take the first a columns and the last a columns to construct an n×Q dimensional matrix That is the final projection matrix, where Q = 2a, thus obtaining P different final projection matrix groups
[0019] Using the sample set EMs2 as the training set, the final projection matrix group After feature extraction and logarithmic variance, we get N1 groups of Q-dimensional feature vectors p = 1, 2, ..., P;
[0020] For each sample, all Its labels are input into the support vector machine for training to obtain the MI classifier.
[0021] In the above technical solution, a regularized mean covariance matrix is calculated as follows:
[0022]
[0023] in:
[0024] I is the n-dimensional identity matrix, 0≤β≤1, 0≤γ≤1, β and γ are regularization parameters, S c is the sum of the covariance matrices obtained based on the sample set EM2, is the sum of the covariance matrices obtained based on the sample set EMs2, N0 is the number of samples of each subject in the sample set EM, N1 is the number of samples of the sample set EMs, and s is the number of subjects included in the sample set EM.
[0025] In the above technical solution, the ErrP identifier is trained based on the ErrP EEG data sample set EE, including:
[0026] The ErrP EEG data sample set EE is filtered, and after filtering, a common average reference process is performed on all channels to obtain a processed ErrP EEG data sample set EE2;
[0027] Perform feature extraction on ErrP EEG data sample EE2, screen out one or more channel groups with the most significant features, and determine the time period group for extracting classification features;
[0028] The hyperparameters of the ErrP recognizer are determined using the time segment group from which the classification features are extracted;
[0029] The time window averaging method is used to extract the features of one or more selected channel groups. The linear discriminant analysis or SVM classifiers that determine the hyperparameters are cross-validated to select the optimal classifier as the ErrP identifier.
[0030] In the above technical solution, an implementation method of obtaining an ErrP EEG data sample set EE corresponding to a labeled motor imagery data sample set EMs is as follows, including:
[0031] Output the classification results of the motor imagery data samples according to the labels with the set accuracy, and represent the classification results graphically. If the graphical classification results are consistent with the labels, it is the correct class, otherwise it is the wrong class;
[0032] When the user annotates the graphical classification results, the user is induced to produce error-related potentials (ErrPs) when the wrong class occurs, and no ErrPs are produced when the correct class occurs. Both are regarded as ErrP EEG signals;
[0033] The EEG signal generated by the user is obtained through the collector and intercepted online, with the graphical output starting time being time 0 and the interception time being the set value, thereby obtaining the ErrP EEG data sample.
[0034] As an improvement to the above technical solution, feature extraction is performed on ErrP EEG data sample EE2 to screen out one or more channel groups with the most significant features, and determine a time period group for extracting classification features, including:
[0035] All correct trials and error trials in the ErrP EEG data sample EE were averaged separately;
[0036] Subtract the average of the correct class trials from the average of the error class trials to obtain an n×tp dimensional matrix, where n is the number of channels and tp is the number of sampling points in each sample;
[0037] For each row of the matrix, draw a curve with time as the horizontal axis;
[0038] Based on the curve, multiple channel groups with the most obvious ErrP features are selected for channel optimization of the next classifier. Based on the curve trend, multiple characteristic time periods are selected for hyperparameter optimization of the classifier.
[0039] In the above technical solution, based on ErrP EEG signal recognition, the final classification and recognition results of online motor imagery data are determined, including:
[0040] If the ErrP EEG signal indicates that the MI classifier is correctly classified, the final classification and recognition result is consistent with the classification of the MI classifier;
[0041] Otherwise, if the MI classifier classifies it as left-hand motor imagery, the final classification and recognition result is right-hand motor imagery; if the MI classifier classifies it as right-hand motor imagery, the final classification and recognition result is left-hand motor imagery.
[0042] In the above technical solution, the filtering adopts a 6th-order Butterworth filter, the filtering frequency band for motor imagery data is [4, 40] Hz, and the filtering frequency band for ErrP EEG data is [1, 10] Hz.
[0043] In the above technical solution, the labeled motor imagery data is obtained by:
[0044] Measuring electrodes A1, A2, ..., An are placed at n positions on the subject's head X, respectively; a reference electrode D is placed at position CPz of the subject's head X; a ground electrode E is placed at position AFz on the forehead of the subject's head X; the output ends of the measuring electrodes A1, A2, ..., An are connected to input ends F1, F2, ..., Fn of a collector F; the output end of the reference electrode D is connected to input end F(n+1) of the collector F; the output end of the ground electrode E is connected to input end F(n+2) of the collector F; the output end of the collector F is connected to the input end of an amplifier G; the output end of the amplifier G is connected to the input end of a computer H; the screen SCR of the computer H displays instructions and results; the sampling frequency is set to fs, and n is the number of channels;
[0045] A left-hand grasping motion video 11 or a right-hand grasping motion video 12 is randomly displayed on the screen of computer H. Each display time is t seconds. The user focuses on the target while imagining the corresponding movement.
[0046] When the user looks at the target in the video, the EEG signal is obtained through the collector F;
[0047] The EEG signals generated by the user when looking at I1 and I2 are marked as category 1 and category 2 respectively. The collected EEG data are intercepted online, with the interception time 0 being the moment when the video starts playing, and the interception time being the set value;
[0048] Each motor imagery data contains EEG signals from n sampling channels.
[0049] In a second aspect, the present invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and execute any one of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0051] Figure 1 , is a schematic diagram of an online cyclic adaptive execution flow of a motor imagery recognition algorithm in one embodiment;
[0052] Figure 2 , is a schematic diagram of hardware connections under one embodiment;
[0053] Figure 3 , is a schematic diagram of left and right hand grasping examples and their positions on the display displayed on a display to instruct a user to perform motor imagery in one embodiment;
[0054] Figure 4 , is a schematic diagram of a graphical output of virtual feedback of motor imagery via a display in one embodiment;
[0055] Figure 5 , is an execution flow chart of initializing an adaptive algorithm for online recognition of motor imagery in one embodiment;
[0056] Figure 6 , is a schematic diagram of the training process of the error-related potential identification algorithm in one embodiment. DETAILED DESCRIPTION
[0057] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0058] An online adaptive method of motor imagery algorithm based on ErrP, referring to Figure 1 Schematic diagram:
[0059] Obtain a sample set EM of labeled motor imagery data, which contains s subjects, and construct a general learning database;
[0060] Obtain a labeled motor imagery data sample set EMs and its corresponding ErrP EEG data sample set EE, where the sample set EMs and the sample set EE are the data of the user SN;
[0061] Based on the motor imagery data sample sets EM and EMs, the MI classifier is trained;
[0062] Based on the ErrP EEG data sample set EE, train the ErrP identifier;
[0063] The user's SN online motor imagery data is classified and identified using the trained MI classifier to obtain the ErrP EEG data corresponding to the online motor imagery data, and the trained ErrP identifier is used to perform ErrP EEG signal recognition;
[0064] Based on ErrP EEG signal recognition, comprehensive judgment is made to determine the final classification and recognition results of online motor imagery data;
[0065] The final recognition result is used as a label for the online motor imagery data. This labeled motor imagery data is added to the sample set EMs to form a new sample set EMs. The MI classifier is then adaptively trained online using the sample set EMs and the new sample set EMs to obtain an updated MI classifier. Based on the final recognition result, it is transmitted to the external device in the form of control instructions.
[0066] By constantly integrating the current online data into the original training data to form a new training set, the current MI features can be incorporated into the classifier, effectively resolving the mismatch between the current data features and the training data features caused by factors such as subject fatigue, physiological and emotional state, and improving the classifier's online classification accuracy. This invention improves the online application performance of the MI-BCI system and promotes its application in clinical and control applications, possessing important theoretical research and practical application value.
[0067] In one embodiment, see Figure 2 , an online adaptive method of ErrP-based motor imagery algorithm was applied to identify the subjects' motor imagery of their hands. Specifically:
[0068] Step 1: According to the 10-20 system, at the subject's head X, calculate Fpz, Fp1, Fp2, AF3, AF4, AF7, AF8, Fz, F1, F2, F3, F4, F5, F6, F7, F8, FCz, FC1, FC2, FC3, FC4, FC5, FC6, FT7, FT8, Cz, C1, C2, C3, C4, C5, C6, T7, T8, CP1, CP2, CP3, CP4, CP5, CP6, TP7, TP8, Pz, P3, P4, P5, P6, P7, P8, POz, PO3, PO4, PO5, PO6, PO7, PO8, Oz, O 1, O2 positions are respectively placed with measuring electrodes A1, A2, ..., A59, a reference electrode D is placed at position CPz of the subject's head X, and a ground electrode E is placed at position AFz of the forehead of the subject's head X. The output ends of the measuring electrodes A1, A2, ..., A59 are connected to the input ends F1, F2, ..., F59 of the collector F, the output end of the reference electrode D is connected to the input end F60 of the collector F, and the output end of the ground electrode E is connected to the input end F61 of the collector F. The output end of the collector F is connected to the input end of the amplifier G, and the output end of the amplifier G is connected to the input end of the computer H. The screen SCR of the computer H displays instructions and results, and the sampling frequency is set to fs.
[0069] Step 2: See Figure 3 A left-hand grasping motion video I1 or a right-hand grasping motion video I2 is randomly displayed on the screen SCR of computer H. Each display lasts for t seconds, and the user visualizes the corresponding movement while focusing on the target. t can be 5 seconds, 10 seconds, 15 seconds, etc., and is configurable.
[0070] Step 3: When the user looks at the target on the display, EEG signals are acquired through the collector F. The EEG signals generated when the user looks at I1 and I2 are marked as Class 1 and Class 2, respectively. The collected EEG data are captured online, with the capture time period being [0, 4] seconds from the start of the video playback as time 0.
[0071] Step 4: Repeat steps 2 to 3 N0 times to obtain N0 labeled motor imagery data samples, each of which contains EEG signals from 59 sampling channels.
[0072] Step 5: Recruit s subjects and perform steps 1 to 4 for each subject to obtain a labeled motor imagery data sample set EM, which contains s×N0 data samples.
[0073] Step 6: For the new MI-BCI system user SN, perform steps 1 to 3, and then perform the following steps.
[0074] Step 7: Randomly classify the MI EEG data captured in step 6 with an accuracy of 80% and output the results. That is, if the subject is performing right-hand motor imagery, the output result will be 80% likely to be class 2 and 20% likely to be class 1, and vice versa. The purpose of this is to generate the output of the MI classifier before it is obtained, in preparation for generating ErrPs based on this output in steps 8 and 9 below.
[0075] Step 8: Reference Figure 4 The moving direction of the black square in the center of the computer screen represents the output result in step 7. Moving to the left means the classification result is class 1, and moving to the right means the classification result is class 2.
[0076] Step 9: The user watches the movement of the box in step 8. If the category represented by the box movement is consistent with the category displayed in step 3), it is recorded as the correct category CC; if it is inconsistent, it is recorded as the error category CE. When the error category occurs, the user is induced to produce an error-related potential ErrP. When the correct category occurs, no ErrP is produced. Here, the two are collectively referred to as ErrP EEG signals.
[0077] Step 10: Obtain the ErrP EEG signal generated by the collector F, and intercept the obtained ErrP EEG data online. The interception period is [0, 1] seconds with the black square movement start time in step 8 as time 0.
[0078] Step 11: Repeat steps 2 to 3 and steps 7 to 10 N1 times in sequence to obtain the labeled motor imagery data sample set EMs and the ErrP EEG data sample set EE. The sample sets EMs and EE each contain N1 data samples, and each sample contains EEG signals from 59 sampling channels.
[0079] Step 12: Reference Figure 5 , perform the same preprocessing process on the sample sets EM and EMs obtained in steps 5 to 11. The specific steps are as follows:
[0080] Step 12.1: Band-pass filter the data samples using a 6th-order Butterworth filter with a filtering frequency band of [4, 40] Hz to obtain the filtered motor imagery data sample sets EM1 and EMs1;
[0081] Step 12.2: Perform de-linear trend processing on all filtered EEG data to remove data drift, and obtain the de-trended motor imagery data sample sets EM2 and EMs2.
[0082] Step 13: Calculate the sum of the covariance matrices S of the sample sets EM2 and EMs2 respectively c and Where c = {1, 2}, representing category 1 and category 2, namely left-hand motor imagery and right-hand motor imagery, respectively.
[0083] Step 14: Use the Regularized Common Spatial Pattern (R-CSP) algorithm to calculate the regularized mean covariance matrix of EM2 and EMs2 based on general learning theory. Where c = {1, 2}, representing class 1 and class 2 respectively, and the calculation formula is as follows:
[0084]
[0085] Where I is the 59-dimensional identity matrix, β and γ are regularization parameters, 0≤β≤1, 0≤γ≤1, The calculation formula is as follows:
[0086]
[0087] Step 15: Using what you learned in step 14 c={1,2}, representing class 1 and class 2 respectively, calculate the pattern extraction projection matrix of R-CSP Take the first a columns and the last a columns to construct a 59×Q dimensional matrix This is the final projection matrix, where Q = 2a;
[0088] Step 16: Set β = {0, 0.01, 0.1, 0.2, 0.4, 0.6}, γ = {0, 0.001, 0.01, 0.1, 0.2} respectively, and get 30 sets of regularization parameter pairs {(β i , γ i )}, where i = 1, 2, ..., 30, for each group (β i , γ i ), execute steps 14 to 15 in sequence to obtain P (P = 30) different final projection matrices Where p = 1, 2,…, 30.
[0089] Step 17: Use the sample set EMs as the training set, pre-process according to step 12, and use the R-CSP projection matrix obtained in step 16 Perform feature extraction and then calculate its logarithmic variance to obtain N1 groups of Q-dimensional feature vectors p = 1, 2, ..., 30;
[0090] Step 18: Use the aggregation strategy to aggregate all The labels are input into the Support Vector Machine (SVM) for training to obtain the MI classifier.
[0091] Step 19: Reference Figure 6 , pre-process the ErrP EEG data sample set EE obtained in step 11, the specific steps are as follows:
[0092] Step 19.1: Filter the EEG data in sample set EE using a 6th-order Butterworth filter with a filtering frequency band of [1, 10] Hz to obtain the filtered ErrP EEG data sample set EE1;
[0093] Step 19.2: Perform common-average reference processing on all channels of the sample set EE1 obtained in step 19.1 to obtain the processed ErrP EEG data sample set EE2;
[0094] Step 20: Perform feature extraction on the ErrP EEG data samples, select one or more channel groups with the most significant features, and determine the time period group for extracting classification features. The specific steps are as follows:
[0095] Step 20.1: Average all correct and incorrect trials in sample set EE2.
[0096] Step 20.2: Subtract the mean of correct trials from the mean of incorrect trials to obtain a 59 × fs matrix.
[0097] Step 20.3: Plot each row of the matrix obtained in step 20.2 (i.e., each acquisition channel) as a curve with the horizontal axis being time;
[0098] Step 20.4: Observe the curve drawn in step 20.3 and select multiple channel groups with the most obvious ErrP features for channel optimization in the next step of the classifier. The most obvious features can be the ones with the largest amplitude.
[0099] Step 20.5: Observe the curve drawn in step 20.3 and select multiple characteristic time periods based on the curve trend for classifier hyperparameter optimization.
[0100] Step 21: For the ErrP EEG data sample set EE2 obtained in step 19, use the hyperparameters obtained in step 20, extract features using the time window averaging method, select two classifiers, Linear Discriminant Analysis (LDA) or SVM, and use a 5-fold cross-validation method to select the optimal channel group, feature time period group, and corresponding ErrP identifier.
[0101] Step 22: Apply the MI classifier and ErrP identifier obtained in steps 18 and 21 to the online recognition of the user's SN by the MI-BCI system. The specific steps are as follows:
[0102] Step 22.1: Execute steps 1 to 3, and apply the MI classifier to the motor imagery data obtained in step 3;
[0103] Step 22.2: Execute steps 8 to 10. In this case, the black squares in step 8 are used to represent the classification results in step 22.1. The ErrP identifier is used to identify the ErrP EEG signals obtained in step 10.
[0104] Step 23: Combine the classification results from step 22.1 and step 22.2 to produce the final output. The specific strategy is:
[0105] Step 23.1: If the recognition result in step 22.2 is the correct class, the final output is consistent with the result in step 22.1;
[0106] Step 23.2: If the recognition result in step 22.2 is the wrong class, correct the result in step 22.1. The specific strategy is:
[0107] Step 23.2.1) If the result in step 22.1 is Class 1, the final recognition result is Class 2;
[0108] Step 23.2.2) If the result in step 22.1 is Class 2, the final recognition result is Class 1;
[0109] Step 24: The final recognition result in step 23 is used as the label to perform online adaptive training on the MI classifier. The specific strategy is as follows:
[0110] Step 24.1: The new MI signal obtained in step 22.1 is labeled with the final recognition result obtained in step 23 and merged into the MI EEG data sample set EMs obtained in step 11 to obtain a new MI EEG data sample set EMsA(1), which contains N1+1 MI EEG data sample sets;
[0111] Step 24.2: For the MI EEG data sample set EMsA(1) obtained in step 24.1, execute steps 12 to 18, replace the MI EEG data sample set EMs with EMsA(1), and obtain the adaptive MI classifier A(1);
[0112] Step 25: Execute steps 22 and 23, replacing the MIMI classifier with the adapted MI classifier A(1) obtained in step 24.2, and obtain the classification result of the next trial;
[0113] Step 26: During subsequent use of the subject's SN, steps 24 and 25 are repeated repeatedly to integrate all online data from the subject's SN into the data sample set for online adaptation of the MI classifier. If the data sample set used for adaptation consists solely of the subject's SN, the resulting MI classifier will not only have high online classification accuracy but also be personalized. If the data sample set used for adaptation includes data from multiple individuals, the resulting MI classifier will not only have high online classification accuracy but also strong generalization capabilities.
[0114] Through the above description of the embodiments, those skilled in the art will clearly understand that the present disclosure can be implemented using software plus necessary general-purpose hardware. Of course, it can also be implemented using dedicated hardware, including application-specific integrated circuits, dedicated CPUs, dedicated memories, and dedicated components. Generally speaking, any function performed by a computer program can be easily implemented using corresponding hardware. Moreover, the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits. However, for the present disclosure, software implementation is often the preferred embodiment.
[0115] In summary, the above implementation method aims to solve the problem of unstable classification accuracy of the classifier caused by strong signal non-stationarity in traditional single-modal MI-BCI. The ErrP EEG signal is used to perform online adaptive training on the MI classifier, and the classification results of the MI are corrected by the ErrP EEG signal to obtain pseudo labels of the online MI data as sample data. After the obtained sample data is fused with the original training data, the R-CSP projection matrix group and its corresponding classifier are recalculated to achieve online adaptation of the classifier. Since the ErrP EEG signal itself has strong stability and high classification accuracy, the online classification ability of the MI classifier can be greatly improved.
[0116] In experimental verification, the above implementation can generate MI labels with an accuracy rate of 83%, which is much higher than the current MI online classification accuracy rate of 60%-70%. Integrating the current online data into the original training data to form a new training set can incorporate the current MI features into the classifier, thereby effectively solving the problem of mismatch between the current data features and the training data features caused by factors such as subject fatigue, physiological and emotional state, and improving the online classification accuracy of the classifier. Therefore, the above implementation improves the online application performance of the MI-BCI system, thereby promoting its application in clinical, control and other aspects, and has important theoretical research and practical application value.
[0117] Although the embodiments of the present invention have been described above with reference to the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields. The above-mentioned specific embodiments are merely illustrative and instructive, and are not restrictive. A person skilled in the art, guided by this specification and without departing from the scope of protection of the claims of the present invention, may also devise various forms, all of which fall within the scope of protection of the present invention.
Claims
1. An online adaptive method for motor imagery algorithm based on ErrP, characterized in that: The method comprises the following steps: Obtain a labeled motor imagery data sample set EM, where there are s subjects in the sample set EM; Obtain a labeled motor imagery data sample set EMs and its corresponding ErrP EEG data sample set EE, where the sample set EMs and the sample set EE are the data of the user SN; Based on the motor imagery data sample sets EM and EMs, the MI classifier is trained; Based on the ErrP EEG data sample set EE, train the ErrP identifier; The user's SN online motor imagery data is classified and identified using the trained MI classifier to obtain the ErrP EEG data corresponding to the online motor imagery data, and the trained ErrP identifier is used to perform ErrP EEG signal recognition; Based on ErrP EEG signal recognition, the final classification and recognition results of online motor imagery data are determined; The final recognition result is used as the label of the online motor imagery data, and the labeled motor imagery data is added to the sample set EMs to form a new sample set EMs. The sample set EM and the new sample set EMs are used to perform online adaptive training on the MI classifier to obtain an updated MI classifier.
2. The method according to claim 1, characterized in that Based on the motor imagery data sample sets EM and EMs, the MI classifier is trained, including the following steps: The motor imagery data sample sets EM and EMs were subjected to bandpass filtering and de-linear trend processing in turn to obtain sample sets EM2 and EMs2 respectively; Based on the sample sets EM2 and EMs2, by setting the regularization parameters, calculate P regularized average covariance matrices Where: c = {1, 2}, 1 represents left-hand motor imagery, 2 represents right-hand motor imagery; For each regularized mean covariance matrix Compute the pattern extraction projection matrix for the regularized cospatial patterns Take the first a columns and the last a columns to construct an n×Q dimensional matrix That is the final projection matrix, where Q = 2a, thus obtaining P different final projection matrix groups Using the sample set EMs2 as the training set, the final projection matrix group After feature extraction and logarithmic variance, we get N1 groups of Q-dimensional feature vectors For each sample, all Its labels are input into the support vector machine for training to obtain the MI classifier.
3. The method according to claim 2, characterized in that Regularized mean covariance matrix in: I is the n-dimensional identity matrix, 0≤β≤1, 0≤γ≤1, β and γ are regularization parameters, S c is the sum of the covariance matrices obtained based on the sample set EM2, is the sum of the covariance matrices obtained based on the sample set EMs2, N0 is the number of samples of each subject in the sample set EM, N1 is the number of samples in the sample set EMs, and s is the number of subjects included in the sample set EM.
4. The method according to claim 1, wherein Based on the ErrP EEG data sample set EE, the ErrP identifier is trained, including: The ErrP EEG data sample set EE is filtered, and after filtering, a common average reference process is performed on all channels to obtain a processed ErrP EEG data sample set EE2; Perform feature extraction on ErrP EEG data sample EE2, screen out one or more channel groups with the most significant features, and determine the time period group for extracting classification features; The hyperparameters of the ErrP recognizer are determined using the time segment group from which the classification features are extracted; The time window averaging method is used to extract the features of one or more selected channel groups. The linear discriminant analysis or SVM classifiers that determine the hyperparameters are cross-validated to select the optimal classifier as the ErrP identifier.
5. The method according to claim 4, characterized in that Obtain the ErrP EEG data sample set EE corresponding to the labeled motor imagery data sample set EMs, including: Output the classification results of the motor imagery data samples according to the labels with the set accuracy, and represent the classification results graphically. If the graphical classification results are consistent with the labels, it is the correct class, otherwise it is the wrong class; When the user annotates the graphical classification results, the user is induced to produce error-related potentials (ErrPs) when the wrong class occurs, and no ErrPs are produced when the correct class occurs. The two are collectively referred to as ErrP EEG signals; The EEG signal generated by the user is obtained through the collector and intercepted online, with the graphical output starting time being time 0 and the interception time being the set value, thereby obtaining the ErrP EEG data sample.
6. The method according to claim 4, characterized in that Perform feature extraction on ErrP EEG data sample EE2, screen out one or more channel groups with the most significant features, and determine the time period group for extracting classification features, including: All correct trials and error trials in the ErrP EEG data sample EE were averaged separately; Subtract the average of the correct class trials from the average of the error class trials to obtain an n×tp dimensional matrix, where n is the number of channels and tp is the number of sampling points in each sample; For each row of the matrix, draw a curve with time as the horizontal axis; Based on the curve, multiple channel groups with the most obvious ErrP features are selected for channel optimization of the next classifier. Based on the curve trend, multiple characteristic time periods are selected for hyperparameter optimization of the classifier.
7. The method according to claim 1, characterized in that Based on ErrP EEG signal recognition, the final classification and recognition results of online motor imagery data are determined, including: If the ErrP EEG signal indicates that the MI classifier is correctly classified, the final classification and recognition result is consistent with the classification of the MI classifier; Otherwise, if the MI classifier classifies it as left-hand motor imagery, the final classification and recognition result is right-hand motor imagery; if the MI classifier classifies it as right-hand motor imagery, the final classification and recognition result is left-hand motor imagery.
8. The method according to claim 2 or 4, characterized in that The filtering adopts a 6th-order Butterworth filter, and the filtering frequency band for motor imagery data is [4, 40] Hz, and the filtering frequency band for ErrP EEG data is [1, 10] Hz.
9. The method according to claim 1, characterized in that Labeled motor imagery data were obtained in the following way: Measuring electrodes A1, A2, ..., An are placed at n positions on the subject's head X, respectively; a reference electrode D is placed at position CPz of the subject's head X; a ground electrode E is placed at position AFz on the forehead of the subject's head X; the output ends of the measuring electrodes A1, A2, ..., An are connected to input ends F1, F2, ..., Fn of a collector F; the output end of the reference electrode D is connected to input end F(n+1) of the collector F; the output end of the ground electrode E is connected to input end F(n+2) of the collector F; the output end of the collector F is connected to the input end of an amplifier G; the output end of the amplifier G is connected to the input end of a computer H; the screen SCR of the computer H displays instructions and results; the sampling frequency is set to fs, and n is the number of channels; A left-hand grasping motion video 11 or a right-hand grasping motion video 12 is randomly displayed on the screen of computer H. Each display time is t seconds. The user focuses on the target while imagining the corresponding movement. When the user looks at the target in the video, the EEG signal is obtained through the collector F; The EEG signals generated by the user when looking at I1 and I2 are marked as category 1 and category 2 respectively. The collected EEG data are intercepted online, with the interception time 0 being the moment when the video starts playing, and the interception time being the set value; Each motor imagery data contains EEG signals from n sampling channels.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Control system and method based on home intelligent service robot
CN109483572A
Multi-person motion imagery recognition method based on cross-brain fusion decision and brain-computer system
CN112465059A