A text output method based on six-category motor imagery EEG signals
Through the text output method based on six-categorized motor imagined EEG signals, the problems of passive output and human fatigue in the prior art are solved, and more efficient and convenient EEG signal classification and text output effects are achieved.
Patent Information
- Application Number
- CN202210001739.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-04
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-01-04
AI Technical Summary
When the prior art realizes the output text of motion imagination through EEG signal processing, there are problems with passive output paradigms and fatigue caused by the human body staring at the screen for a long time.
The text output method based on six-class motion imaginary EEG signals is adopted, and the EEG signals are collected through multi-channel EEG signal acquisition equipment, adaptive filtering, bandpass filtering and notch processing are performed to remove artifacts, and feature extraction and classification are used using OVR-CSP and sequence forward selection algorithm to achieve active output of text.
It realizes a more convenient and effective output method, improves the accuracy and output efficiency of EEG signal classification, and adds commonly used punctuation marks and sentences to the design, improving humanized design.
Smart Images

Figure CN114492514B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of artificial intelligence and biological signal processing related technologies, and specifically relates to a text output method based on six-category motor imagery electroencephalogram signals. Background Art
[0002] EEG signal processing is undoubtedly a hot field at present. For imagined movements, its essence is to predict and analyze the behavior that will occur before the action occurs. When a person imagines a certain behavior and this behavior does not occur, the brain will generate an EEG signal to perform this behavior, which is called a motor imagery EEG signal.
[0003] Traditionally, text is output through EEG imaginary movement, mainly based on the p300 event-related potential principle, which is to watch the text flashing on the screen with the eyes, collect the corresponding frequency within 300 microseconds through the flashing of different frequencies, and then output the text. However, this method is a passive output paradigm, and the human body is prone to fatigue if staring at the flashing screen for a long time. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the present invention proposes a text output method based on six-category motor imagery EEG signals, in order to effectively grasp the behavioral intention of motor imagery, thereby achieving effective communication between people and the new external environment.
[0005] In order to achieve the above-mentioned purpose, the present invention adopts the following technical scheme:
[0006] The text output method based on six-category motor imagery EEG signals of the present invention is characterized by being performed according to the following steps:
[0007] Step 1: Use a multi-channel EEG signal acquisition device to collect EEG signals of the subject in six imagining states, and each state is maintained for m seconds, with the first n seconds in the imagining state and the last z seconds in the calming state, and repeat K rounds, thereby obtaining a set of EEG signals of K groups of samples; the six states are left and right hand movement state, left and right foot movement state, fist movement state, and rest state;
[0008] Step 2: using an adaptive filter to remove frequency interference signals from the EEG signal set, and then performing bandpass filtering and notching, as well as preprocessing to remove artifacts, thereby obtaining a preprocessed EEG signal set;
[0009] Step 3: Perform time-frequency analysis on the EEG signals in the preprocessed EEG signal set, find out the k seconds with the highest energy of α rhythm and β rhythm in a single group of samples and intercept them, so as to obtain the effective action signal of a single group of samples;
[0010] Step 4: Use the OVR-CSP algorithm to extract features from the effective action signals of a single group of samples, and obtain s groups of feature vectors with the largest spatial differences in a single group of samples;
[0011] Step 5: Based on the sequence forward selection algorithm, the multi-channel features in the s group feature vectors are screened to find several channel features with the best classification effect, and use them as the screened s group feature vectors;
[0012] Step 6: Input the filtered s groups of feature vectors into the classifier to obtain the classification results under six states;
[0013] Step 7: Set the classification result of imagining left hand movement to 1, the classification result of imagining right hand movement to 2, the classification result of imagining left foot movement to 3, the classification result of imagining right foot movement to 4, the classification result of imagining fisting movement to 5, and the classification result of resting state to 6;
[0014] Step 8: Combine the classification results under the six states in pairs to form corresponding text results and output them.
[0015] Compared with the prior art, the present invention has the following beneficial effects:
[0016] 1) The present invention proposes a new active output paradigm, which overcomes the shortcomings of the passive output paradigm in the prior art and makes the output method more convenient and effective.
[0017] 2) The present invention adopts an improved EEG preprocessing algorithm to better remove artifacts generated during the EEG acquisition process, further improving the quality of the acquired signals, thereby achieving a higher accuracy rate in EEG signal classification and improving the efficiency of text output through motor imagery.
[0018] 3) The text result of the present invention includes common punctuation marks and some common sentences, making the design more humane. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a signal processing flow chart of the present invention;
[0020] Figure 2 It is a graph showing the relationship between signal energy and frequency according to the present invention;
[0021] Figure 3 This is a comparison diagram before and after removing artifacts of the present invention;
[0022] Figure 4 It is a comparison chart of the accuracy of each classifier of the present invention;
[0023] Figure 5 It is a text output paradigm diagram of the present invention. DETAILED DESCRIPTION
[0024] In this embodiment, a text output method based on six-category motor imagery EEG signals is provided. Figure 1 As shown, the steps are as follows:
[0025] Step 1: Use a multi-channel EEG signal acquisition device to collect EEG signals of the subjects in six imagining states, and each state lasts for m seconds, with the first n seconds in the imagining state and the last z seconds in the calming state, and repeat K rounds to obtain K groups of EEG signal sets of samples; the six states are left and right hand movement state, left and right foot movement state, fist movement state, and rest state;
[0026] Step 2: EEG signals come from the scalp and are easily contaminated by noise, which can produce various artifacts. Artifacts are parts of the signal that come from sources that are different from the desired signal. Therefore, artifacts are also called interference or noise. First, perform frequency domain analysis on the signal and draw a signal spectrum diagram, such as Figure 2 As shown, Figure 2 It shows the relationship between signal energy and frequency, and the frequency range is 0-250Hz. Figure 2 The continuous periodic oscillation around 50Hz shown in the figure is the power frequency noise, which can be removed by a 50Hz notch. Then, an adaptive filter is used to remove the frequency interference signal of the EEG signal set, and then bandpass filtering and notching are performed. EEG can be divided into five different types: Delta (Δ), Theta (θ), Alpha (α), Beta (β), and Gamma (γ), with frequencies ranging from 0.1-45Hz. Therefore, the signal is subjected to a 0.1-45Hz bandpass filter to perform frequency screening and prevent low-frequency drift. Then, preprocessing is performed to remove artifacts. In this embodiment, the PCA-FastICA algorithm is used to suppress the influence of electrooculographic artifacts and electrocardiographic artifacts in the signal. The FastICA algorithm is an improved ICA algorithm. The idea flow is as follows: let the original EEG data be E, and its dimension is N×T, where N represents the number of channels and T represents the sampling points of each channel.
[0027] First, use formula (1) to calculate the spatial covariance C of EEG data:
[0028] C=(EET) / (tr(EET)) (1)
[0029] Then calculate the spatial covariance matrix of the two categories separately, using C l and C r In other words, the composite space covariance matrix C C It can be expressed as formula (2):
[0030] C C =C l +C r(2)
[0031] C C Using formula (3) to decompose,
[0032] C C =U C λ C U C T (3)
[0033] In formula (3), U C is the matrix of eigenvectors, λ C is the diagonal matrix of eigenvalues. In this process, the eigenvalues are arranged in descending order. So the whitening transformation can be expressed as formula (4):
[0034]
[0035] Then use the whitening matrix P to transform the covariance matrix C l and C r Transformed into the variance matrix S of the letter l , S r As shown in formula (5):
[0036] S l =PC l P T ,S r =PC r P T (5)
[0037] S l , S r have the same eigenvector, assuming it is vector B, then we have formula (6)
[0038] S l =Bλ l B T ,S r =Bλ r B T (6)
[0039] In formula (6), λ l and λ r YesS l , S r diagonal matrix;
[0040] The projection matrix F can be calculated using formula (7):
[0041] F=(B T P) T (7)
[0042] The projection matrix F is the spatial filter to be constructed. After the EEG signal is whitened, the EEG data E can be projected onto the first m columns and the last m columns of the feature vector B using F. m represents the number of optimal spatial filters. The calculation formula is shown in formula (8):
[0043] Z=FE (8)
[0044] In formula (8), Z represents the signal after being projected by the spatial filter, and the variance difference between the two types of signals after projection is the largest.
[0045] Data after artifact removal p That is, we can use formula (9) to calculate and extract:
[0046]
[0047] After decomposing the signal using the improved PCA-FastICA algorithm, the artifact-free data f p ,To more intuitively show the effect of removing artifacts, compare the original signal and the signal after artifact removal, such as Figure 3 As shown, the upper figure is the original signal, and the lower figure is the signal after artifact removal, thereby obtaining a set of preprocessed EEG signals;
[0048] Step 3: Perform time-frequency analysis on the EEG signals in the preprocessed EEG signal set, find out the k seconds with the highest energy of α rhythm and β rhythm in a single group of samples and intercept them, so as to obtain the effective action signal of a single group of samples;
[0049] Step 4: Use the OVR-CSP algorithm to extract features from the effective action signals of a single group of samples, and obtain s groups of feature vectors with the largest spatial differences in a single group of samples;
[0050] Step 5: Based on the sequence forward selection algorithm, the multi-channel features in the s group feature vectors are screened to find several channel features with the best classification effect, and use them as the screened s group feature vectors;
[0051] Step 6: Input the filtered s groups of feature vectors into the classifier. In this embodiment, k-NN, NB, DTRF, LDA, MLP, SVM (RBF kernel), and SVM (Linear kernel) are compared. Figure 4are various classification effects. The SVM with RBF kernel has the highest recognition accuracy of 78.3%. Compared with the recognition accuracy of 76.5% before artifact removal, it can be found that although 8 channels are subtracted and the operation time is increased, the recognition accuracy has not decreased but increased. In addition, EEG signals are highly nonlinear, non-Gaussian, random and non-correlated, so the effects of classifiers such as LDA and SVM (linear kernel) are not ideal, only 61.7%. The classification accuracy of MLP is second only to SVM (RBF kernel), with an accuracy of 76.3%, indicating that artificial neural networks are effective in BCI systems based on EEG signals. After the above analysis, SVM (RBF kernel) was finally selected as the EEG signal classifier. This method compares the algorithms of various pattern recognition classifiers, finds the most suitable classifier, improves the classification accuracy, and obtains classification results under six states;
[0052] Step 7: After the classifier successfully classifies 6 types of signals, the two groups of actions are combined into one group, such as Figure 5 As shown, the output results are combined in pairs to form text output; among them, the classification result of imagining left hand movement is output 1, the classification result of imagining right hand movement is output 2, the classification result of imagining left foot movement is output 3, the classification result of imagining right foot movement is output 4, the classification result of imagining fist movement is output 5, and the classification result of resting state is output 6; for example, if you want to output the text a, just imagine the left hand movement twice, and the combination can output the corresponding text. This is a new output paradigm. It can also output punctuation marks and set common sentences, which greatly improves the efficiency of output.
Claims
1. A text output method based on six-category motor imagery EEG signals, characterized by Proceed as follows: Step 1: Use a multi-channel EEG signal acquisition device to collect EEG signals of the subject in six imagining states, and each state is maintained for m seconds, with the first n seconds in the imagining state and the last z seconds in the calming state, and repeat K rounds, thereby obtaining a set of EEG signals of K groups of samples; the six states are left and right hand movement state, left and right foot movement state, fist movement state, and rest state; Step 2: using an adaptive filter to remove the frequency interference signal of the EEG signal set, and then performing bandpass filtering and notching, as well as preprocessing to remove artifacts, so as to obtain a preprocessed EEG signal set; wherein the PCA-FastICA algorithm is used to suppress the influence of electrooculographic artifacts and electrocardiographic artifacts in the signal; Step 3: Perform time-frequency analysis on the EEG signals in the preprocessed EEG signal set, find out the k seconds with the highest energy of α rhythm and β rhythm in a single group of samples and intercept them, so as to obtain the effective action signal of a single group of samples; Step 4: Use the OVR-CSP algorithm to extract features from the effective action signals of a single group of samples, and obtain s groups of feature vectors with the largest spatial differences in a single group of samples; Step 5: Based on the sequence forward selection algorithm, the multi-channel features in the s group feature vectors are screened to find several channel features with the best classification effect, and use them as the screened s group feature vectors; Step 6: Input the filtered s groups of feature vectors into the classifier to obtain the classification results under six states; Step 7: Set the classification result of imagining left hand movement to 1, the classification result of imagining right hand movement to 2, the classification result of imagining left foot movement to 3, the classification result of imagining right foot movement to 4, the classification result of imagining fisting movement to 5, and the classification result of resting state to 6; Step 8: Combine the classification results under the six states in pairs to form corresponding text results and output them.
Citation Information
Patent Citations
Method and device for reconstructing visual image by using electroencephalogram signal
CN111568412A
Electroencephalogram signal recognition system and method
CN111973178A