A motor imagery eeg channel selection and classification method based on average energy difference
By combining the channel selection method based on average energy difference (ECS) and CSP spatial filtering with SVM classification, the problems of channel selection algorithm being susceptible to noise interference and subject differences are solved, achieving higher classification accuracy and fewer channels, and adapting to brain-computer interface systems for different subjects.
Patent Information
- Application Number
- CN202211495332.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-11-25
AI Technical Summary
In existing brain-computer interface systems, channel selection algorithms are susceptible to noise interference, leading to a decrease in classification accuracy. Furthermore, when selecting channels with a fixed threshold, they cannot adapt to different subjects, affecting the classification performance of motor imagery tasks.
The channel selection method based on average energy difference (ECS) is adopted. By calculating the average channel energy as a threshold, combined with CSP spatial filtering and SVM classification, channels with energy discrimination are selected, and energy features are extracted to improve classification accuracy.
It effectively improves the classification accuracy of brain-computer interface systems, reduces the number of channels, adapts to different subjects, alleviates the low signal-to-noise ratio problem caused by multiple channels, and improves classification performance.
Smart Images

Figure CN115935269B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for motor imagery EEG channel selection and classification based on average energy difference. It proposes an energy-based channel selection method (ECS) and constructs an energy feature extraction method based on ECS (ECS-E) for classification of motor imagery tasks, belonging to the field of pattern recognition technology. Background Technology
[0002] Brain-computer interfaces (BCIs), as a channel connecting the brain and the outside world, can be used to interpret brain waveforms and control external devices, showing broad application prospects. EEG is an important method in non-invasive BCI, offering high temporal resolution and good cost-effectiveness, usability, and convenience. Among many EEG-based BCI systems, motor imagery (MI) data is widely used due to its naturally evoked signals and ease of acquisition. Alpha rhythms (8-12 Hz) and beta rhythms (13-30 Hz) are the two most commonly used rhythms in MI. When activity in specific frequency bands of these rhythms increases, this is called event-related synchronization (ERS), while a decrease in specific frequency bands is called event-related desynchronization (ERD). ERD and ERS are commonly used mechanisms to distinguish different motor imagery actions.
[0003] In recent years, in order to improve the performance of brain-computer interfaces, many methods have been developed to decode tasks in EEG signals. These applications include analysis through time-domain and frequency-domain representations, power spectrum, coherence, phase coupling (phase-locked value), and power spectral density.
[0004] CSP (Collateral Spectrum Spectrum) is a commonly used algorithm in BCI (Brain-Integrated Communication) for detecting ERD / ERS (Electronic Reaction / Electronic Reaction). In this two-class decoding problem, CSP uses the signal's covariance matrix as input, aiming to find a spatial filter that maximizes the variance of one class of filtered signals and minimizes the variance of the other. However, CSP is highly susceptible to noise interference. While multi-channel EEG recording can comprehensively capture brain activity, increasing the number of channels also increases noise, which is detrimental to CSP feature extraction. Therefore, correctly selecting channels containing useful information is crucial for improving the performance of the MI-BCI system. If noise is introduced during the superposition of channel signals, the classification accuracy will be significantly reduced. In recent years, many channel selection algorithms have selected channels beneficial for classification by calculating the correlation between channels in different imagined actions, such as using the Pearson correlation coefficient to select the most relevant channel. Besides channel correlation, other features can also be used for channel selection. Since signals for different motor imagery actions are generated by different signal sources, the distances between these sources and the electrodes vary. Considering effects such as volumetric conduction, this leads to differences in signal energy at specific frequencies within the electrodes. The energy differences across these channels can, to some extent, correspond to relevant motor imagery tasks, thus channel selection is based on this characteristic. Some studies have used channel energy as a feature to set energy thresholds for channel selection, achieving significant improvements in accuracy and reducing the number of channels, and providing a rationale for channel selection from an energy perspective. However, due to differences in distance between different EEG electrodes and signal sources, as well as the existence of volumetric conduction, noise, and subject variability, simply setting a fixed threshold for channel selection often results in channels unrelated to the motor imagery task and cannot flexibly adapt to different subjects.
[0005] To address the above issues and improve classification accuracy, this invention proposes an Energy-based Channel Selection Method (ECS), and constructs an Energy Feature Extraction Method (ECS-E) based on this channel selection method. Summary of the Invention
[0006] To overcome the shortcomings of existing research, this invention provides a method for selecting and classifying EEG channels for motor imagery based on average energy difference. The channels selected in this invention have certain neurophysiological significance, contributing to improved brain-computer interface performance. Furthermore, the selected channels also include those that are energy-discriminative but not located within the motor imagery region, which also aids in the classification of motor imagery. In addition, this invention extracts energy features from the selected channels; these energy features become more discriminative with an increasing number of selected channels. This can, to some extent, compensate for the accuracy decrease caused by multiple channels, demonstrating feasibility and superiority.
[0007] The specific steps of a method for selecting and classifying EEG channels for motor imagery based on average energy difference are as follows:
[0008] Step 1: Data preprocessing: After acquiring multi-channel EEG data signals, bandpass filtering of 8-30 Hz is performed on all datasets;
[0009] Step 2: Channel selection: The average channel energy of the two types of motion image signals is used as the threshold for voting;
[0010] Step 3: Energy Feature Extraction: Extract channel energy features from the selected channels and normalize these energy features;
[0011] Step 4: Perform CSP spatial filtering on the selected channels, extract spatial features, and classify using SVM.
[0012] Step two specifically includes:
[0013] Collect two motion imagery tasks N tr1 N tr2 These represent the first type of motion visualization task and the second type of motion visualization task, respectively, in the voting operation for each type of task. Let K represent the energy value of the i-th channel in the j-th trial of this type of task, F represent the voting operation, and ε represent the energy value of the i-th channel in the j-th trial of this type of task. i The average energy of the i-th channel in the two types of motion imagery tasks in the training set.
[0014] The channel energy is calculated as shown in equation (1):
[0015]
[0016] In the voting process for various tasks This represents the energy value of the i-th channel in the j-th trial of this type of task, and K represents the number of sampling points.
[0017] Channels exhibiting significant energy differences between the two types of motion imagery tasks are considered relevant to the current motion imagery task. The average energy of the channels in both types of motion imagery signals is used as a voting threshold. A voting method is employed to measure the importance of a channel. If the channel energy exceeds the corresponding channel's energy threshold in a single trial, a vote is taken for that trial. The total channel voting difference between the two tasks represents the number of trials with significant energy differences, and channel selection is based on this.
[0018]
[0019] in
[0020]
[0021] Step three specifically includes:
[0022] The energy characteristic is represented by the average energy of a single subject minus the energy of the two types of motor imagery task channels, as shown in Equation (4):
[0023]
[0024] in This represents the energy feature extracted from sample j, used in voting operations for various tasks. ε represents the energy value of the i-th channel in the j-th trial of this type of task. i This represents the average energy of the i-th channel in the two types of motion imagery tasks within the training set.
[0025] Step four specifically includes:
[0026] The preprocessed EEG data in a single trial is represented as an N×T matrix, where N is the number of channels used and T is the number of samples recorded per channel in each trial. The CSP projection matrix W is used to obtain the spatially filtered EEG signal, as shown in Equation (5):
[0027] Z = WX (5)
[0028] W has fixed-space filters in its rows and columns. -1 It can be viewed as the source distribution matrix of the EEG signal.
[0029] The normalized spatial covariance matrix of EEG data is usually expressed as the ratio of the data's covariance to the trace of the data's covariance, as shown in equation (6), where X T This represents the transpose of matrix X.
[0030]
[0031] CSP analysis aims to design W to simultaneously diagonalize these matrices so that they satisfy:
[0032] W T C1W=λ1,W T C2W=λ2 (7)
[0033] λ1 and λ2 are diagonal matrices that satisfy:
[0034] λ1+λ2=I (8)
[0035] The CSP projection matrix is determined by the eigenvalue decomposition method. When used to train a classifier, only a few rows j of the matrix can effectively distinguish between classes. The matrix row vector Z that maximizes classification accuracy is... P (p = 1 to 2j) are usually the eigenvectors corresponding to the largest λ1 and λ2, which are the first j rows and the last j rows of Z.
[0036] The spatial characteristics of EEG signals can be derived from (9).
[0037]
[0038] An SVM model is used to classify the features extracted by the above method. Assume x (i) Let y be the feature vector of the i-th training sample, y ∈ {+1, -1} be the class label, and the decision function is given by (10):
[0039] h(x) = sign(w) T x) (10)
[0040] Finding the hyperplane with the maximum margin can be transformed into finding the optimal solution for the following:
[0041]
[0042] Where C is the penalty parameter for the error term, and ξ is a slack variable that allows for some misclassification.
[0043] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0044] The ECS-CSP method proposed in this invention effectively improves classification accuracy by selecting channels that reduce the number of channels. The channels are reasonably distributed and of moderate quantity. Furthermore, the energy feature effectively compensates for the accuracy decrease caused by the low signal-to-noise ratio in multi-channel systems. In addition, due to differences among subjects, the proposed method, compared to other channel selection methods, selects channels with low correlation but distinct energy characteristics. Experiments demonstrate that the energy differences between these channels can be used as a classification feature to improve accuracy, providing insights for future improvements to channel selection methods. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is an experimental flowchart of the method for selecting and classifying motor imagery EEG channels based on average energy difference, as presented in this invention.
[0047] Figure 2 This is the timeline of a single experiment in this invention;
[0048] Figure 3 This is a map showing the selection of channels for each subject in the dataset of this invention;
[0049] Figure 4 The energy distribution and voting graph of subject a in this invention;
[0050] Figure 5 The energy distribution and voting diagram of subject a1 in this invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] Assume the experiment collects data from two motion imagery tasks N. tr1 N tr2 These represent the first type of motion visualization task and the second type of motion visualization task, respectively. In the voting process for each type of task... Let K represent the energy value of the i-th channel in the j-th trial of this type of task, F represent the voting operation, and ε represent the energy value of the i-th channel in the j-th trial of this type of task. i This represents the average energy of the i-th channel in the two types of motion imagery tasks within the training set.
[0053] The following is a detailed explanation of each step.
[0054] Step 1: Multi-channel EEG signal acquisition and data preprocessing
[0055] In this invention, all datasets are bandpass filtered from 8 to 30 Hz.
[0056] Step 2: Channel Selection
[0057] The channel energy is calculated as shown in equation (1).
[0058]
[0059] In the voting process for various tasks This represents the energy value of the i-th channel in the j-th trial of this type of task, and K represents the number of sampling points.
[0060] This paper considers channels with significant energy differences between two types of motion imagery tasks as channels relevant to the current motion imagery task. The average energy of the channels in both types of motion imagery signals is used as a voting threshold to measure the importance of a channel. If the channel energy in a single trial exceeds the corresponding channel's energy threshold, a voting operation is performed on that trial. The total channel voting difference between the two tasks represents the number of trials with significant energy differences, and channel selection is based on this. The channel voting difference between the two types of motion imagery will serve as an indicator of channel relevance.
[0061]
[0062] in
[0063]
[0064] The steps for channel selection are as follows:
[0065]
[0066]
[0067] Step 3: Energy Feature Extraction
[0068] CSP is highly sensitive to noise in the signal, and multiple channels will further increase the proportion of noise in the signal, at which point the feature classification effect extracted by CSP is often poor. In binary motion imagery, although the energy difference between a single channel and the resting state is not significant, as the number of channels selected increases, these energy differences become very significant in some subjects. In this case, the combination of spatial features and energy features extracted by CSP can alleviate the accuracy decline caused by multiple channels to a certain extent. This paper uses the energy of a single subject minus the average energy of the two types of motion imagery task channels to represent the energy feature, as shown in Equation (4):
[0069]
[0070] in This represents the energy feature extracted from sample j, used in voting operations for various tasks. ε represents the energy value of the i-th channel in the j-th trial of this type of task. iThis represents the average energy of the i-th channel in the two types of motion imagery tasks within the training set.
[0071] Step 4: Perform CSP spatial filtering on the selected channels, extract spatial features, and classify using SVM.
[0072] The CSP algorithm is typically used to calculate the spatial filter W from the covariance matrix of two classes of data, in order to maximize the difference between the two classes. The preprocessed EEG data in a single trial is represented as an N×T matrix, where N is the number of channels used and T is the number of samples recorded per channel in each trial. The CSP projection matrix W is used to obtain the spatially filtered EEG signal, as shown in equation (5):
[0073] Z = WX (5)
[0074] W has fixed-space filters in its rows and columns. -1 It can be viewed as the source distribution matrix of the EEG signal.
[0075] The normalized spatial covariance matrix of EEG data is usually expressed as the ratio of the data's covariance to the trace of the data's covariance, as shown in equation (6), where X T This represents the transpose of matrix X.
[0076]
[0077] CSP analysis aims to design W to simultaneously diagonalize these matrices so that they satisfy:
[0078] W T C1W=λ1,W T C2W=λ2 (7)
[0079] λ1 and λ2 are diagonal matrices that satisfy:
[0080] λ1+λ2=I (8)
[0081] The CSP projection matrix is determined by the eigenvalue decomposition method. When used to train a classifier, only a few rows j of the matrix can effectively distinguish between classes. The matrix row vector Z that maximizes classification accuracy is... P (p = 1 to 2j) are usually the eigenvectors corresponding to the largest λ1 and λ2, which are the first j rows and the last j rows of Z.
[0082] The spatial characteristics of EEG signals can be derived from (9).
[0083]
[0084] Support Vector Machines (SVMs) have been successfully applied to solve classification problems in various fields. Their basic idea is to map data to a high-dimensional space using supervised learning and find the optimal classification hyperplane. In BCI (Browser-Integrated Computer), they are often combined with various feature extraction methods to form a MI-EEG model structure. Therefore, we use an SVM model here to classify the features extracted by the above methods. Assume x... (i) Let y be the feature vector of the i-th training sample, y ∈ {+1, -1} be the class label, and the decision function is given by (10):
[0085] h(x) = sign(w) T x) (10)
[0086] Finding the hyperplane with the maximum margin can be transformed into finding the optimal solution for the following:
[0087]
[0088] Where C is the penalty parameter for the error term, and ξ is a slack variable that allows for some misclassification. In this paper, the radial basis function (RBF) is chosen as the kernel function.
[0089] The extracted CSP features were used to train an SVM model, and the kernel function C was determined during the step of selecting the optimal threshold. Cross-validation was used to obtain performance indicators such as classification accuracy. Here, it is compared with other channel selection methods, and BCICompetitionⅢDataSetsⅣa was selected as the experimental dataset. This invention selects a co-space pattern method based on three channels (C3, C2, and C4) (3C-CSP), a co-space pattern method based on spatial filter ranking (CSP-Rank), and a method based on maximizing Rayleigh coefficients (RC–GA) to select channels for comparison in terms of channels and accuracy. Table 1 shows the comparison results of five subjects on the dataset.
[0090] As can be seen from Table 1, except for CSP-rank, which has lower accuracy, the accuracy of other subjects is better than other channel selection methods. In terms of the number of channels, the number of channels selected by the ECS-CSP method is similar to that of CSP-rank and RC-GA methods, but the accuracy is improved by about 6 percentage points, which effectively improves the classification performance of the BCI system. This shows that the method can remove redundant channels and effectively improve classification accuracy.
[0091] Table 1 Comparison of classification accuracy and number of channels selected by different methods
[0092]
[0093] from Figure 3 It can be seen that most of the selected channels are located in the motor perception region near C3 and C4, where the ERD / ERS phenomenon exists. This indicates that the ECS algorithm is meaningful from a neurophysiological perspective. Furthermore, due to differences among subjects, the ECS method also selects some channels that are energy-discriminative but not located in the motor imagery region. These channels have proven helpful in classifying motor imagery. The number of channels selected by the aw subject was significantly greater than that of the other four subjects.
[0094] Taking subjects a and a1 as examples, we will discuss the average channel energy and average vote difference during the five-fold cross-validation process. Here, we show the top 20 channels by vote difference, such as... Figure 4 As shown, the number of voting differences reflects the number of trials with significant energy differences between the two types of imaginary tasks, and can also reflect channel energy differences to some extent. It can be seen that subject a has higher voting differences near channel C4 and channel Fz, while subject a1 has a higher voting difference near channel C3, indicating a greater number of trials with significant energy differences between the two types of motor imaginary tasks. The voting differences demonstrate that the energy characteristics of these channels are beneficial for binary classification of motor imaginary tasks and can reduce the adverse effects of inter-individual and inter-channel differences on classification performance.
[0095] Combination Figure 3 It can be seen that the overall energy difference falls into two categories. One category is the overall energy difference caused by the number of trials with significant energy differences. The other category is the larger overall energy difference caused by large energy fluctuations near the channel threshold in the two types of imagination tasks, such as... Figure 4 The P6 channel of subject a and the POZ channel of subject a1 were analyzed. To select representative channels with discriminative characteristics, the first type of channel, which resulted in the overall energy difference, was the primary target. The distribution range of the selected channels, to some extent, justifies the invention.
[0096] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and these variations still fall within the protection scope of the present invention.
Claims
1. A motor imagery electroencephalogram channel selection and classification method based on average energy difference, characterized in that: The method comprises the following steps: Step one: data preprocessing: after collecting multi-channel electroencephalogram data signals, all data sets are subjected to 8-30hz band-pass filtering; Step two: channel selection: the channel mean energy of two-class motor imagery signals is calculated as the threshold of voting; Step three: energy feature extraction: the channel energy feature is extracted on the selected channel, and the energy feature is normalized; Step four: CSP spatial filtering is performed on the selected channel, the spatial feature is extracted, and SVM classification is performed; The step two specifically comprises: Collect two motor imagery tasks N tr1 , N tr2 respectively represent the first motor imagery task and the second motor imagery task, in the voting operation of each type of task represents the energy value of the i th channel in the j th trial of the task, K represents the number of sampling points F represents the voting operation, ε i is the average value of the energy of the i th channel in the two motor imagery tasks in the training set The channel energy is calculated as shown in formula (1): In the voting operation of various tasks denotes the energy value of the i-th channel in the j-th trial of the task, and K denotes the number of sampling points. The channels with obvious energy difference in two-class imagination tasks are regarded as the channels related to the current motor imagination task, the channel mean energy of two-class motor imagery signals is taken as the threshold of voting, the voting method is adopted to measure the importance of a channel, the channel energy of a single trial exceeds the energy threshold of the corresponding channel, and the voting operation is performed on the trial, the total channel voting difference of two-class tasks is used to represent the number of trials with obvious energy difference, and the channel selection is performed based on the same, The step three specifically comprises: The energy feature is represented by the average energy of the energy of a single subject minus the energy of the two-class motor imagination task channel, and is specifically shown in formula (4): The step four specifically comprises: wherein denotes the energy feature extracted from sample j, in the voting operation of each task denotes the energy value of the i-th channel in the j-th trial of the task, ε i is the average value of the i-th channel energy in the two motor imagery tasks in the training set.
2. The motor imagery EEG channel selection and classification method based on average energy difference according to claim 1, characterized in that: The preprocessed EEG data in a single test is represented as an N×T matrix, wherein N is the number of channels used, T is the number of samples recorded in each test, the CSP projection matrix W is used to obtain the spatially filtered EEG signal, and is shown in formula (5): Z=WX (5) The CSP analysis aims to diagonalize these matrices by designing W at the same time, so as to satisfy: The rows of W are fixed spatial filters and columns of W -1 are considered as the source distribution matrix of the EEG signal, The normalized spatial covariance matrix representation of the EEG data is given as the ratio of the covariance of the data over the trace of the covariance of the data, as shown in equation (6), where X T denotes the transpose of the matrix X; λ1 and λ2 are diagonal matrices, satisfying: W T C1W= λ1,W T C2W= λ2 (7) λ1+λ2=I (8) The spatial feature of the electroencephalogram signal is obtained from (9) The CSP projection matrix is determined by eigenvalue decomposition method. When used for training the classifier, only a few rows j of the matrix are effective for classifying the categories; the matrix row vector Z that maximizes the classification accuracy P (p = 1 to 2j) are the eigenvectors corresponding to the largest λ1and λ2, which are the first j rows and the last j rows of Z; Solving the maximum margin hyperplane conversion into solving the following optimal solution problem: The SVM model is used to classify the features extracted by the above method. Assuming x (i) is the feature vector of the ith training sample, y∈{+1,-1} is the class label, and the decision function is given by equation (10): h(x) = sign(w T x) (10) Where C is the penalty parameter of the error term, and ξ is the relaxation variable allowed for some misclassification. s.t.y i (w T x (i) +b)≥1-ξ i ,ξ i ≥0,i=(1,....,n) (11)