A method for classifying motor imagery brain electrical intention based on riemannian space
By using the Riemann space-based EEG intention classification method for motor imagery, optimizing VMD algorithm parameters and employing ICA denoising, combined with the Riemann minimum distance mean field classifier, the problems of difficult parameter setting and poor noise suppression in existing technologies are solved, thereby improving classification accuracy and system real-time performance, and enabling effective control of the lower-level machine.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2026-03-17
AI Technical Summary
Existing methods for classifying motor imagery EEG signals suffer from problems such as difficulty in parameter setting, poor noise suppression, low classification accuracy, and long model training time. In particular, efficient signal decomposition and classification are difficult to achieve in real-time applications and systems with limited resources.
A Riemann space-based EEG intention classification method for motor imagery is adopted. The VMD algorithm parameters are optimized through quantitative evaluation indicators of VMD effect. Combined with ICA denoising and Riemann minimum distance mean field classifier, adaptive denoising and data pruning algorithms are used to optimize classifier performance and improve signal decomposition and classification accuracy.
It achieves more comprehensive signal decomposition, reduces noise interference, improves classification accuracy and system real-time performance, and enhances the effective control capability of the lower-level machine.
Smart Images

Figure CN117235576B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data classification methods, specifically to a method for classifying motor imagery EEG intentions based on Riemann space. Background Technology
[0002] Motor imagery (MI) refers to the process by which the human brain imagines a movement of a limb, but does not actually perform that movement. More precisely, MI refers to the entire process of imagining a trunk movement in the brain, but without any actual trunk movement; the memory of the movement activates the corresponding motor areas in the brain. During MI activity, the human brain stimulates neurons, generating a series of electrical signals. Collecting these signals yields the electroencephalogram (EEG). Preprocessing, feature extraction, and feature classification of the motor imagery EEG (MI-EEG) signals, followed by conversion into computer commands, creates a brain-computer interface based on MI-EEG, enabling tasks such as controlling intelligent wheelchairs, dual-arm robots, drones, and virtual cars.
[0003] Zhang Ruilin et al. (Acta Optica Sinica, 2022) proposed a second harmonic noise reduction method based on a composite algorithm of variational mode decomposition and wavelet threshold function. The quantitative evaluation indicators for variational modes are the bandwidth of the mode, the center frequency of each mode component, and the correlation coefficient. However, the variational empirical mode decomposition (VMD) algorithm also has inherent defects, namely, it requires pre-defining the number of modes K and the penalty factor α. When K and α are set inappropriately, mode aliasing or boundary effects may occur, which seriously affect the signal decomposition effect. Manually setting the parameters K and α is not only time-consuming and laborious, and difficult to find the optimal parameter values, but also difficult to apply to practical systems.
[0004] The VMD algorithm still faces challenges in parameter assignment. Wang Hongxu et al. (Journal of Changchun University of Technology (Natural Science Edition), 2021) proposed that the principle of wavelet denoising is to decompose the wavelet and then perform multi-scale transformation to extract useful EEG signals as much as possible. Then, based on the characteristics of Born EEG signals and noise features, a suitable denoising model is selected, and wavelet reconstruction is performed using Bayesian-estimated coefficients to obtain the denoised EEG signal. However, the effectiveness of wavelet denoising is closely related to the selected wavelet basis function. Different wavelet basis functions have different features extraction capabilities, so it is necessary to select a suitable wavelet basis function according to the specific application scenario and signal characteristics, which requires some experience or experimentation. Furthermore, wavelet denoising usually reduces high-frequency noise components in the signal through filtering, but this may also lead to the loss of some useful high-frequency details. In some applications, preserving detail information may be important, so a trade-off between signal smoothness and detail preservation needs to be balanced during denoising; wavelet denoising usually requires adjusting some parameters, such as threshold size and threshold type. Different parameter settings can lead to different denoising effects, but adjusting these parameters is not always intuitive and simple. Finding the optimal parameter settings for complex signal or noisy environments may require extensive experimentation and optimization. Wavelet denoising can introduce boundary effects at signal boundaries, causing discontinuities or distortions in the denoised signal. This is because wavelet transform is based on local windows, and windows at boundaries may not fully capture all the signal's features, leading to inaccurate processing or artifacts. Wavelet denoising has high computational complexity, especially for long-running sequences or high-dimensional signals. In real-time applications or resource-constrained systems, the impact of computational complexity on real-time performance and efficiency needs to be considered.
[0005] Furthermore, current common classifiers for the four-class classification task of Motor Imagery EEG (MI-EEG) suffer from low classification accuracy, while deep learning methods require long model training times. Li Hongli et al. (Chinese Journal of Medical Physics, 2022) proposed the WMFF and CMFF methods. The WMFF method is an improvement on EEGNet, a shallow neural network that introduces depthwise convolution and separable convolution, effectively reducing network parameters. The WMFF model consists of three parts: temporal convolutional layers, depthwise convolutional layers, and separable convolutional layers. The CMFF network integrates CNN and LSTM models, extracting features from the intermediate layers separately. The proposed WMFF and CMFF four-class classification methods achieved average classification accuracies of 76.19% and 80.46%, respectively. Azab AM et al. (IEEE Transactions on Neural Systems and Rehabilitation Engineering, 2019) proposed a transfer learning method based on supervised weighted logistic regression, which adds regularization parameters to the objective function of the classifier to make the classification parameters as close as possible to the classification parameters of other similar subjects, achieving an average classification accuracy of 75.6%. Summary of the Invention
[0006] To address the aforementioned shortcomings of existing technologies, the present invention aims to provide a method for classifying motor imagery EEG intentions based on Riemannian space.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] A method for classifying motor imagery EEG intentions based on Riemannian space includes the following steps:
[0009] S1. Obtain the motor imagery EEG signals required by the model, and extract frames from the motor imagery EEG signal samples;
[0010] S2. Preprocess the data;
[0011] S3. The VMD performance quantitative evaluation index is used as the fitness function of the Hunger Games Search (HGS) algorithm to adaptively optimize the parameters of the VMD algorithm; the VMD performance quantitative evaluation index includes the normalized residual power P after VMD decomposition. res Modal components u k The minimum envelope entropy min(E) p Adjacent modal components u k The difference in center frequencies
[0012] S4. The preprocessed motor imagery EEG signal is processed using an adaptive denoising algorithm. Specifically, the VMD algorithm optimized in step S3 is first used for decomposition, and the noisy components are denoised using the Independent Component Analysis (ICA) algorithm. Then, the inverse ICA transform is performed to reconstruct the motor imagery EEG signal, thus completing the denoising step.
[0013] S5. The Riemann minimum distance mean field classifier is optimized by using a data cropping algorithm in Riemann space. The denoised motor imagery EEG signal obtained in step S4 is used as the input of the algorithm to obtain the classification result.
[0014] S6. The classification results are converted into control signals, which are then used as inputs to the lower-level machine.
[0015] Furthermore, in step S2, the preprocessing includes interpolation, common space mode, 8-30Hz bandpass filtering, and manual addition of Gaussian white noise.
[0016] The quantitative evaluation index of VMD effect is expressed as shown in formula (1):
[0017]
[0018] In the formula, V res (i) represents the amplitude of the i-th sampling point of the residual signal; N is the number of sampling points; This is the hyperbolic tangent function, used to normalize the power of the residual signal;
[0019]
[0020] In the formula, h k The modal components u obtained after VMD decomposition k The envelope signal obtained after Hilbert demodulation; ε k (i) is achieved by calculating u k The normalized probability distribution sequence; E p (k) is the envelope entropy of the k-th modal component;
[0021]
[0022] In the formula, k = 1, ..., K represents the k-th modal component; f is the normalized value of the difference between the center frequencies of the k-th modal component and the (k-1)-th modal component. C (k) is the center frequency of the kth modal component;
[0023] f C (k) represents the k-th modal component. This is a commonly used normalization function, used to normalize the center frequency difference of modal components;
[0024]
[0025] In the formula, λ∈[0,+∞] is E p (k) and P res The balance coefficient.
[0026] Preferably, λ = 0.2.
[0027] Furthermore, the adaptive denoising algorithm first uses the Hunger Games search algorithm to adaptively optimize two parameters in VMD: the number of modes K and the penalty factor α; then, it uses the independent component analysis algorithm to denoise the obtained noisy components, and then recombines them.
[0028] Furthermore, the data pruning algorithm in the Riemann space prunes the training samples according to the class labels of adjacent samples before classification to remove some outliers.
[0029] Furthermore, the data pruning algorithm within the Riemann space specifically includes the following steps:
[0030] 1). Calculate the known labeled sample X according to formula (16). i covariance matrix P i ;
[0031] For a k-class classification problem, the sample set of the k-th class in the training set is denoted as . in The trial number corresponding to the k-th category;
[0032]
[0033] In the formula T s Indicates the sampling rate;
[0034] 2). Calculate the Riemann distance δ between each pair of known label sample covariance matrices according to formula (19). R (P i ,P j ), where the Riemann distance between a sample and itself is defined as δ R (P i ,P i ) = ∞;
[0035] δ R (P,P i )=||Log P (P i )|| P =||S i || P =||upper(P -1 / 2 LogP (P i )P -1 / 2 )||2=||s i ||2(19)
[0036] s i To normalize the m-dimensional vector upper(P) on the tangent space -1 / 2 Log P (P i )P -1 / 2 );
[0037] 3) For the i-th sample, its nearest neighbor is argmin. j δ R (P i ,P j P is the covariance matrix of the label sample X to be classified;
[0038] 4) Determine the label of each known sample X. i covariance matrix P i The class label and its nearest neighbor P j Are they consistent? If they are consistent, then retain P. i If they do not match, delete P. i ;
[0039] 5) Use the remaining P i Calculate the Riemann power mean of the training set and substitute it into the Riemann minimum distance mean field classifier (RMDMF) for subsequent calculations.
[0040] Furthermore, the noisy raw motor imagery EEG signals are classified into four types of control signals, and sending these four types of control signals to the lower-level machine can achieve effective control of the lower-level machine.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] (1) VMD has rigorous mathematical derivation and good noise robustness, which can suppress mode aliasing to a large extent. The main problem of VMD is that its two parameters, K and α, are difficult to select. If the parameters are not set properly, the decomposition effect of VMD will be seriously affected. This application uses the HGS algorithm to adaptively optimize the two parameters K and α in the VMD algorithm, and adopts the parameter adaptive optimization variational mode decomposition algorithm (HGS-VMD) to improve the performance of the VMD algorithm. This invention uses the normalized residual power P after VMD decomposition as an example. res The degree of signal decomposition is measured by modal components u. k The minimum envelope entropy min(E) p The noise level of the decomposed modal components is measured by the noise level of adjacent modal components u. k The difference in center frequencies The degree of mode aliasing between modal components is used as an evaluation index to judge the quality of VMD decomposition results, thereby improving the performance of the VMD algorithm. When the evaluation index proposed in this invention is used as the fitness function for VMD parameter optimization, mode aliasing can be effectively avoided, and more complete VMD decomposition results can be obtained.
[0043] (2) Due to the complexity of EEG signals, even after using VMD to decompose the EEG signal, the resulting noise will still contain a certain degree of noise in each Intrinsic Mode Function (IMF). Directly deleting these noisy IMF components will result in the loss of some relevant information from the EEG signal, and will also lead to poor subsequent denoising results. Independent Component Analysis (ICA), a commonly used blind source analysis method, has the advantage of decomposing multiple observed signals into independent source signals. Using these noisy IMF components as the observed signals for ICA can further denoise the EEG signal. This application employs an adaptive denoising algorithm for motor imagery EEG signals. After using the denoising algorithm proposed in this application, the signal SNR is improved, and the root mean square error (MSE) is reduced.
[0044] (3) This invention proposes a data pruning algorithm in Riemann space. Before the classifier calculates the Riemann mean, the training samples are pruned in Riemann space according to the class labels of neighboring samples to remove some outliers. The removal of outliers makes the process of finding the Riemann center more reliable, thereby improving the performance of the Riemann minimum distance mean field classifier and increasing the classification accuracy. Attached Figure Description
[0045] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0046] Figure 1 This is a schematic diagram of the motor imagery EEG intention classification method based on Riemann space in this application;
[0047] Figure 2 This is the technology roadmap for this application;
[0048] Figure 3 This is an EEG acquisition amplifier;
[0049] Figure 4 Electrode distribution diagram for a standard 10-20 system;
[0050] Figure 5 Flowchart for constructing VMD evaluation metrics;
[0051] Figure 6 Flowchart of the algorithm for denoising EEG signals for motor imagery;
[0052] Figure 7 This is a schematic diagram illustrating the process of denoising EEG signals using ICA.
[0053] Figure 8 Here is a flowchart of the clipping algorithm in Riemann space;
[0054] Figure 9 The residual components obtained from VMD decomposition under different parameters;
[0055] Figure 10 VMD decomposition results under different parameters;
[0056] Figure 11 The signal is a noisy signal with a signal-to-noise ratio of 10:1;
[0057] Figure 12 Box plots of AUC values for four classifiers. Detailed Implementation
[0058] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention. These all fall within the scope of protection of the present invention.
[0059] Example 1
[0060] like Figure 1 and 2 As shown, a method for classifying motor imagery EEG intentions based on Riemannian space includes the following steps:
[0061] S1. Obtain the motor imagery EEG signals required by the model, and extract frames from the motor imagery EEG signal samples;
[0062] S2. Preprocess the data, mainly including interpolation, common space mode, bandpass filtering, and manually adding Gaussian white noise;
[0063] S3. A quantitative evaluation index for VMD performance is proposed as a fitness function. An adaptive decomposition algorithm for VMD is constructed by combining the HGS algorithm, and the parameters of the VMD algorithm are adaptively optimized.
[0064] S4. After the preprocessed motor imagery EEG signal is processed by the adaptive decomposition algorithm proposed in S3, its noisy components are denoised using ICA; then, the inverse ICA transform is performed to reconstruct the motor imagery EEG signal, thus completing the denoising step.
[0065] S5. A data cropping algorithm in Riemann space is proposed to optimize the Riemann minimum distance mean field classifier. The denoised motor imagery EEG signal obtained in step S4 is used as the input of the algorithm to obtain the classification result.
[0066] S6. The classification results are converted into control signals, which are then used as inputs to the lower-level machine.
[0067] This embodiment uses a portable 40-channel Nu Amps EEG acquisition amplifier developed by Neuroscan, Inc. in San Francisco, USA. It is small in size, has good performance, and high bandwidth. Figure 3 As shown. The Nu Amps has a bandwidth from 0 to 262 Hz, making it well-suited for EEG and ERP research. It simulates 40-channel monopolar input (bipolar can be calculated) and simultaneously acquires 40 channels of data at sampling frequencies of 125 Hz, 250 Hz, 500 Hz, and 1000 Hz per channel. The sampling frequency per channel can be set via software. It features a 16-bit LCD backlight display, primarily showing amplifier status and impedance. The software used is Neurosca's signal analysis software Scan and Curry. When acquiring motor imagery EEG data, the electrodes are placed according to the international 10-20 standard system. The electrode placement diagram is shown below. Figure 4 As shown.
[0068] Quantitative Evaluation Index of VMD Performance: This application proposes a quantitative evaluation index of VMD performance based on normalized residual power, envelope entropy, and the difference in center frequencies of adjacent modal components. The index construction process is as follows: Figure 5 As shown, Formula (1) is the expression of the evaluation index proposed in this invention.
[0069]
[0070] In the formula, V res (i) represents the amplitude of the i-th sampling point of the residual signal; N is the number of sampling points; It is a hyperbolic tangent function used to normalize the power of the residual signal.
[0071]
[0072] In the formula, h k The modal components u obtained after VMD decomposition k The envelope signal obtained after Hilbert demodulation; ε k (i) is achieved by calculating u k The normalized probability distribution sequence; E p (k) is the envelope entropy of the k-th modal component.
[0073]
[0074] In the formula, k = 1, ..., K represents the k-th modal component; f is the normalized value of the difference between the center frequencies of the k-th modal component and the (k-1)-th modal component. C (k) is the center frequency of the kth modal component; This is a commonly used normalization function, used to normalize the center frequency difference of modal components.
[0075]
[0076] In the formula, λ∈[0,+∞] is E p (k) and P res The balance coefficient, after extensive experimentation, is λ = 0.2.
[0077] Adaptive Denoising of Motor Imagery EEG Signals: Based on the diverse and non-stationary characteristics of MI-EEG signals, this application uses the data-driven VMD algorithm as the foundation for designing an adaptive denoising algorithm for motor imagery EEG signals. To address the difficulty of parameter assignment during VMD implementation, the Hunger Games search algorithm is first used to adaptively optimize two parameters in VMD. Then, the noisy components are denoised using Independent Component Analysis (ICA), and then recombined to propose an adaptive denoising algorithm for motor imagery EEG signals. Finally, this invention preprocesses the BCI Competition IV 2a four-class MI-EEG dataset and adds Gaussian white noise as the denoising dataset to be used in subsequent validation. The denoising effect is validated on this dataset, and the validation results demonstrate the effectiveness of the proposed denoising algorithm. The flowchart of the adaptive denoising algorithm for motor imagery EEG signals proposed in this invention is shown below. Figure 6 As shown.
[0078] The Hunger Games Search (HGS) algorithm is designed based on the hunger-driven activities and behaviors of animals. The behavior of animals approaching food can be represented by (5).
[0079]
[0080] In the formula, Game1 simulates the behavior of an animal foraging alone, while Game2 and Game3 simulate the behavior of a group foraging together. This represents a random number between [-a, a], where a is the convergence factor, which decreases linearly from 2 to 0 as the number of iterations increases; r1 and r2 are both random numbers between [0, 1]; rand(1) is a random number that follows a standard normal distribution; t is the current iteration number; and Indicates the hunger weight; Indicates the globally optimal position; The value of E represents the current individual position; l is a constant that is set, and in this embodiment it is set to 0.08. The formula for calculating E is shown in formula (6).
[0081] E = sech(|F(i) - BF|) (6)
[0082] In the formula, F(i), i∈(1,2,...,N) represents the fitness value of the i-th individual; BF represents the current optimal fitness value; sech(.) represents a hyperbolic function, the expression of which is shown in formula (7).
[0083] sech(x)=e x +e -x (7)
[0084] The calculation formula is given by formula (8).
[0085]
[0086] In the formula, r3 is a random number in [0,1]; the calculation method of a is given by formula (9).
[0087]
[0088] Max iter This indicates the maximum number of iterations.
[0089] Mathematical modeling of individual hunger characteristics is performed. In equation (5) The calculation formula is shown in formula (10).
[0090]
[0091] In formula (5) The calculation formula is shown in formula (11).
[0092]
[0093] In the formula, hunger represents the hunger level of each individual; N represents the total number of individuals; SHungry is the sum of the hunger levels of all individuals, i.e., sum(hungry); r3, r4 and r5 are all random numbers in [0,1]; the formula for calculating hunger(i) is shown in (12).
[0094]
[0095] In each iteration, the hunger magnitude of the best individual is set to 0. The formula for calculating H is shown in formula (13).
[0096]
[0097] In the formula, r6 and r7 are both random numbers between [0,1]; LH is the lower bound of H, and LH = 100 is taken; WF is the worst fitness obtained in the previous iteration; UB and LB represent the upper and lower bounds of the search space, respectively.
[0098] Independent Component Analysis (ICA) is an effective method for blind source analysis. Let M observed signals be X = [x1(i), x2(i), ..., x...]. M (i)] T At this point, there are N independent source signals S = [s1(i), s2(i), ..., s... N (i)] T The specific mathematical model of the ICA algorithm is shown in formulas (14) and (15).
[0099] X = B·S (14)
[0100] Y = G·X (15)
[0101] In the formula, Y is the estimated value of S, B is the mixing matrix, and G is the separation matrix.
[0102] The ICA algorithm is based on the observed signal X. By calculating the separation matrix G, it can obtain the estimated value Y of the source signal, while making Y as close as possible to the source signal S. Furthermore, ICA can only be implemented if the following three conditions are met:
[0103] (1) From a statistical point of view, all source signals must be independent of each other;
[0104] (2) The mixing matrix B must be a square matrix;
[0105] (3) Independent components cannot be Gaussian distributed. Generally speaking, for a set of independent components, there can be at most one independent component that is Gaussian distributed.
[0106] In the analysis of EEG signals, the acquired raw EEG signal is composed of a superposition of signal and various types of noise. Signal and noise are generally considered independent. Therefore, if ICA decomposition is applied to the raw EEG signal, noisy and noise-free components can be obtained. Removing the noisy components and then reconstructing the remaining signals achieves denoising of the EEG signal. Figure 7 This refers to the process of denoising noisy signals using ICA (Inductively Coupled Animation).
[0107] exist Figure 7In the process shown, the electrode names are represented by the rows of the original EEG signal X, and the EEG signal amplitudes measured at different time points are represented by the columns of the original EEG signal X. The EEG signals of the multi-channel electrodes are decomposed into a set of independent components Y by ICA using a separation matrix G. These components have the characteristics of being independent in time and fixed in space. Noise components IC1 and IC6 are removed from the obtained independent components Y to obtain the corrected independent components Y. c Next, take the Y obtained in the previous step... c The inverse matrix G of the separation matrix -1 By performing multiplication, the corrected EEG signal X can be obtained. c . Figure 7 The EEG signal topography map in the image reflects the intensity of each independent component mapped onto the scalp electrodes at the time points marked by the vertical lines. Figure 7 The bars on the right reflect the magnitude of the intensity of each signal component.
[0108] Classification of EEG signals related to motor imagery: The Riemann minimum distance mean field classifier is selected as the basis for the classification algorithm, and improvements are made to enhance its performance. To improve the performance of the Riemann minimum distance mean field classifier, this application proposes a data pruning algorithm within Riemann space. Before classification, the training samples are pruned based on the class labels of neighboring samples to remove some outliers, thereby improving the performance of the Riemann minimum distance classifier. The effectiveness of this pruning algorithm is verified and analyzed. The flowchart of the Riemann space pruning algorithm proposed in this invention is as follows: Figure 8 As shown.
[0109] In classification algorithms, the correlation between features can be obtained by calculating the covariance matrix, thus enabling the construction of a classifier to classify the data. Geometrically, the covariance matrix is a type of SPD matrix, and the space spanned by the SPD matrix is called the SPD manifold. The SPD manifold is a type of Riemannian manifold. The core idea of the Riemannian Minimum Distance to Means (RMDM) classifier is to first calculate the Riemann mean of each classification covariance matrix, and then calculate the geodesic distance from the sample to be classified to each Riemann center. The label of the sample to be classified is the classification label corresponding to the Riemann center with the smallest Riemann geodesic distance to that sample.
[0110] For a k-class classification problem, the sample set of the k-th class in the training set is denoted as . in This is the trial number corresponding to the k-th category.
[0111]
[0112] In the formula Ts This indicates the sampling rate.
[0113] The process of the Riemann minimum distance classifier is shown below.
[0114] 1) Calculate the known label sample X according to formula (16). i covariance matrix P i ;
[0115] 2) Calculate the covariance matrix P of the label sample X to be classified according to formula (16);
[0116] 3) Calculate the Riemann mean of the sample covariance matrix in each category according to formula (17). Where k = [1:K] represents the category label;
[0117]
[0118] 4) Calculate each P according to formula (18). Riemann distance between
[0119]
[0120]
[0121] 5) Find the one that minimizes the Riemann distance. That is, the label of the sample X to be classified.
[0122] This application proposes a data pruning algorithm in Riemann space. First, the sample covariance matrix of each sample is calculated. Then, the class label differences between each sample's covariance matrix and those of its neighboring samples determine whether to retain the sample data. After pruning the sample set, the Riemann mean is calculated using the remaining training samples, thereby improving classification accuracy. The pseudocode of the Riemann space pruning algorithm is given in Table 1.
[0123] Table 1. Pseudocode for the clipping algorithm in Riemannian space.
[0124]
[0125]
[0126] The algorithm steps of the Riemann clipping algorithm are as follows:
[0127] 1) Calculate the known label sample X according to formula (16). i covariance matrix P i ;
[0128] 2) Calculate the Riemann distance δ between each pair of known label sample covariance matrices according to formula (19). R (Pi ,P j ), where the Riemann distance between a sample and itself is defined as
[0129] δ R (P i ,P i ) = ∞;
[0130] δ R (P,P i )=||Log P (P i )|| P =||S i || P =||upper(P -1 / 2 Log P (P i )P -1 / 2 )||2=||s i ||2(19)
[0131] s i To normalize the m-dimensional vector upper(P) on the tangent space -1 / 2 Log P (P i )P -1 / 2 );
[0132] 3) For the i-th sample, its nearest neighbor is argmin. j δ R (P i ,P j );
[0133] 4) Determine the label of each known sample X. i covariance matrix P i The class label and its nearest neighbor P j Are they consistent? If they are consistent, then retain P. i If they do not match, delete P. i ;
[0134] 5) Use the remaining P i Calculate the Riemann power mean of the training set and substitute it into the RMDMF for subsequent calculations.
[0135] After the noisy raw motor imagery EEG signal is processed by the denoising and classification algorithm proposed in this application, it is classified into four types of control signals. Sending these control signals to the lower-level computer enables effective control of the lower-level computer.
[0136] Example 2
[0137] This embodiment, based on the denoising and classification algorithms in the MI-BCI system, verifies the proposed MI-EEG signal adaptive denoising algorithm in terms of signal-to-noise ratio (SNR) and root mean square error (RMSE). Furthermore, the improved Riemann space pruning algorithm and the original algorithm are cross-validated using the AUC metric through K-fold cross-validation. Specific content includes: (1) Quantitative evaluation index of VMD effect:
[0138] In the field of BCI (Brain-Computer Interface), Virtual Feature Decomposition (VMD) is used to extract features from EEG signals to monitor and control brain activity. However, VMD faces several challenges in BCI applications. First, EEG signals often contain numerous interfering factors, such as electromyographic interference and eye-tracking interference, which can affect the VMD decomposition results, leading to inaccurate feature extraction. Second, VMD may struggle with non-stationary signals. The frequency and amplitude of EEG signals typically change over time, causing VMD decomposition results to vary over time. Furthermore, as a data-driven method, VMD may lack interpretability in its signal decomposition results.
[0139] In the research of denoising algorithms for motor imagery brain-computer interfaces, VMD can be used to extract effective signal components related to motor imagery activities, thereby improving the accuracy and stability of the MI-BCI system. By denoising the motor imagery signals, interference signals can be weakened or removed, improving the MI-BCI system's ability to recognize and decode motor imagery activities, and providing a more reliable foundation for the application of BCI.
[0140] Currently, researchers lack reliable quantitative evaluation metrics for VMD decomposition results. There are two main methods for judging the effectiveness of VMD decomposition. The first is to manually observe the modal aliasing and residual component energy in the spectrogram after VMD decomposition. These methods rely on user experience, and when images are similar, it is difficult to visually determine which decomposition result is better. The second method uses metrics such as kurtosis and envelope entropy to evaluate the VMD decomposition results. However, practical verification has shown that these evaluation metrics cannot accurately reflect the decomposition effect of the VMD algorithm.
[0141] This application proposes a quantitative index for evaluating the effect of variational mode decomposition. The normalized residual power after VMD decomposition measures the degree of signal decomposition, the minimum envelope entropy of the mode component measures the noise content of the decomposed mode component, and the difference in center frequency between adjacent mode components measures the degree of mode aliasing between mode components. These are used as evaluation indicators to judge the quality of VMD decomposition results, providing a reliable quantitative evaluation index for the decomposition results.
[0142] VMD decomposition quantification evaluation index test: Different values were assigned to the K and α parameters of VMD, and the residual components corresponding to each decomposition were as follows: Figure 9 As shown, the decomposition results are as follows: Figure 10 As shown, the decomposition results are as follows: Figure 10 As shown in the figure, the corresponding evaluation indicators are shown in Table 2. Among them... Figure 9 and Figure 10 (a) to (f) in the table correspond to rows 1 to 6 in Table 2, respectively.
[0143] Table 2. Test results of quantitative indicators under different parameters.
[0144]
[0145]
[0146] from Figure 9 It can be seen that no obvious mode aliasing occurs in Figures (a), (b), and (c), slight mode aliasing is observed in Figure (d), while severe mode aliasing is observed in Figures (e) and (f). Figure 10 It can be seen that Figures (b), (c), (e), and (f) contain a significant amount of residual components, indicating that the decomposition is incomplete. Therefore... Figure 10 The VMD decomposition effect should be (a)>(b)>(d)>(c)>(e)≈(f). Comparing the results in Table 2, arranged from largest to smallest, we get (a)>(b)>(d)>(c)>(e)>(f), indicating that the proposed index is feasible, can reflect the VMD decomposition effect, and can effectively distinguish some VMD decomposition results that are difficult to compare based on experience.
[0147] (2) Adaptive noise reduction of EEG signals for motor imagery:
[0148] Through a brain-computer interface system, intelligent wheelchairs can determine the user's intentions based on changes in EEG signals related to motor imagery and execute corresponding actions. Adaptive denoising technology can effectively reduce noise interference in EEG signals, improve signal quality and accuracy, and thus enhance the stability and reliability of intelligent wheelchair control. Currently, most mainstream denoising algorithms require prior knowledge of the noise source in the signal to be denoised, and use this knowledge to select appropriate parameters and basis functions for denoising. This manual parameter selection process is extremely cumbersome and makes it difficult to determine the optimal parameters. In contrast, while deep learning methods do not require prior knowledge of the noise source, retraining for different types of data each time is too time-consuming. Therefore, it is necessary to research an adaptive denoising method that automatically selects different parameters for denoising based on different noisy input signals, in order to improve the performance of denoising algorithms.
[0149] Denoising algorithm performance evaluation: The modal components are divided into noisy components and noisy components using the center frequency threshold method, and the center frequencies of each modal component are listed in the table.
[0150] Table 3 Center frequencies of each modal component
[0151]
[0152] Observing the center frequencies corresponding to the modal components in Table 3, u5, u6, and u7 are within the range of 0.5-30Hz, and these three modal components are considered effective components. The remaining u1, u2, u3, and u4 are treated as noisy components and denoised using the ICA algorithm. Then, the ICA-denoised components are reconstructed together with the noise-free components to complete the denoising process. (Noisy signal) Waveform and noise-reduced signal The waveform is as follows Figure 11 As shown, Figure (a) is the time-domain waveform of the signal before denoising, Figure (b) is the amplitude-frequency waveform of the signal before denoising, Figure (c) is the time-domain waveform of the signal after denoising, and Figure (d) is the amplitude-frequency waveform of the signal after denoising.
[0153] Figure 11 The signal-to-noise ratio (SNR) of the undenoised signal in Figures (a) and (b) is 10, and the root mean square error (RMSE) is 0.8595. The SNR of the denoised signal in Figures (c) and (d) is 15.8706, and the RMSE is 0.4372. After applying the denoising algorithm proposed in this application, the signal SNR is improved by 5.8706, or 58.706%, and the MSE is reduced by 0.4223, or 49.133%. This result demonstrates the effectiveness of the denoising algorithm proposed in this application.
[0154] Different noise signals were added, and the SNR of the noisy signals were 10, 9, 8, 7, 6 and 5 respectively. The noise signals were denoised using VMD and the denoising method proposed in this invention. The denoising results were evaluated using the SNR and RMSE before and after denoising. The results are shown in Table 4.
[0155] Table 4 Comparison of Denoising Algorithms
[0156]
[0157] As shown in Table 4, the proposed adaptive denoising algorithm for motor imagery EEG signals outperforms the VMD denoising method alone when dealing with noisy signals at different signal-to-noise ratios. Compared to using the VMD denoising method alone, under various signal-to-noise ratios, the SNR of the signals obtained after denoising using the adaptive denoising algorithm for motor imagery EEG signals proposed in this application increased by an average of 2.2871%, and the RMSE decreased by an average of 4.2219%. (3) Classification of motor imagery EEG signals:
[0158] In brain-computer interfaces, motor imagery EEG signal classification refers to the analysis and processing of EEG signals to categorize different types of motor images. This technology utilizes features in EEG signals related to motor images for classification and identification, thereby discriminating different motor intentions. By training machine learning algorithms, EEG signals can be associated with specific motor intentions, such as forward, backward, left turn, and right turn. When a user generates a corresponding motor image, the EEG signal, after classification and decoding, enables the smart wheelchair to perform the corresponding action. Through motor imagery EEG signal classification technology, smart wheelchairs can achieve a more intuitive and natural control method, improving user independence and quality of life. They can also achieve precise control based on the user's motor imagery intentions, enabling direct interaction and collaboration with humans. Although some challenges and limitations remain, such as signal noise and individual differences, the application prospects of motor imagery EEG signal classification technology in the field of smart wheelchairs remain very broad with continuous technological advancements and in-depth research.
[0159] This invention uses K-fold cross-validation to compare the performance of four classifiers—Riemann Minimum Classifier (RMDM), Cut-RMDM, Riemann Minimum Distance Mean Field Classifier (RMDMF), and Cut-RMDMF—on the BCI Competition IV 2a Motion Imagination public dataset. The value of K is generally between [2, 10], and in this embodiment, K = 5. The steps of K-fold cross-validation in this embodiment are as follows:
[0160] (1) Divide the dataset with a sample size of N into K equal parts. Each time, use one part of the data as the validation set and the other parts as the training set to obtain K sets of different datasets.
[0161] (2) Take one set of data from the K sets of data obtained in step (1), train the model, and calculate the AUC value of the model.
[0162] (3) Repeat step (2) using K sets of data, and take the average of the K results as the final AUC value of the model.
[0163] The four classifiers are built on the MOABB architecture.
[0164] Table 5 shows the AUC values of the four classifiers RMDM, Cut-RMDM, RMDMF, and Cut-RMDMF after K-fold cross-validation on the BCI CompetitionIV 2a Motion Imagination public dataset.
[0165] Table 5. Performance comparison between the classification algorithm after applying the cropping algorithm proposed in this invention and the original classification algorithm.
[0166]
[0167] As shown in Table 5, among the 18 datasets in the BCI Competition IV 2a Motion Imagination public dataset, the Cut-RMDM algorithm significantly improved the AUC value compared to RMDM, with an average AUC increase of 3.6%, representing a performance improvement of 4.71%. Compared to the original RMDM algorithm, the program execution time of Cut-RMDM increased slightly by 0.09 seconds. Compared to RMDMF, the average AUC of Cut-RMDMMF increased by 2.4%, representing a performance improvement of 3.06%, and the average program execution time decreased by 1.228 seconds, representing a reduction of 32.5%.
[0168] The reason why the program execution speed of Cut-RMDMF is slower compared to the original RMDMF is that the main time-consuming part of the RMDMF process is the calculation of the power mean. After running the clipping algorithm, the number of samples that need to be calculated for the power mean is reduced, thereby reducing the time cost required for this process.
[0169] The classification results of the four classifiers were plotted as box plots, as shown in the figure. Figure 12 The black dotted line is its mean line, and the gray solid line is its median line. Figure 12 It can be seen that after adding the cropping algorithm, the mean and median of the classification accuracy of RMDM and RMDMF both increase significantly. This demonstrates that the proposed cropping algorithm in Riemann space can effectively improve the classification accuracy of RMDM and RMDMF.
[0170] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for classifying electroencephalography (EEG) motor imagery intention based on Riemannian space, characterized in that, The method comprises the following steps: S1. Obtain the motor imagery electroencephalogram required by the model, and frame the motor imagery electroencephalogram sample; S2. Preprocess the data; S3. Adopt the VMD effect quantitative evaluation index as the fitness function of the Hunger Games search algorithm to perform parameter adaptive optimization on the VMD algorithm; the VMD effect quantitative evaluation index includes normalized residual power P res of VMD decomposition k , minimum envelope entropy min(E p of modal component u k , and difference S4. The motor imagery electroencephalogram after preprocessing is processed by using an adaptive denoising algorithm, specifically, first, the VMD algorithm optimized in step S3 is used for decomposition, and the independent component analysis algorithm is used for denoising of the noisy component; then, ICA inverse transformation is performed, the motor imagery electroencephalogram is reconstructed, and the denoising step is completed; S5. The Riemann space data clipping algorithm is used to optimize the Riemann minimum distance average field classifier, the motor imagery electroencephalogram after denoising obtained in step S4 is taken as the input of the algorithm, and a classification result is obtained; S6. The classification result is converted into a control signal and taken as the input of the lower computer.
2. The Riemannian space based motor imagery electroencephalography (EEG) mental spatial classification method according to claim 1, wherein, In step S2, the preprocessing includes interpolation operation, common spatial pattern, 8-30 Hz band-pass filtering, and manual addition of Gaussian white noise.
3. The motor imagery electroencephalogram intention classification method based on Riemann space according to claim 1, characterized in that wherein V res (i) is the amplitude of the i-th sample point of the residual signal; N is the number of sample points; is the hyperbolic tangent function, which is used to normalize the power of the residual signal; where N is the number of sampling points, h k is the modal component u k obtained after VMD decomposition; ε k (i) is the probability distribution sequence obtained by calculating the normalization of u k ; E p (k) is the envelope entropy of the kth modal component. where k = 1,..., K denotes the kth modal component; D fC (k) is the normalized value of the difference between the center frequency of the kth modal component and the (k-1)th modal component, f C (k) is the center frequency of the kth modal component, is a commonly used normalization function for normalizing the center frequency difference of the modal components; In the formula, Eva is a quantitative evaluation index of VMD effect, λ ∈ [0, +∞] is an equilibrium coefficient of E p (k) with P res .
4. The Riemannian space based motor imagery electroencephalogram (EEG) intention classification method according to claim 3, characterized in that, λ = 0.
2.
5. The Riemannian space based motor imagery electroencephalogram (EEG) intention classification method according to claim 1, characterized in that, The adaptive denoising algorithm: first, the starvation game search algorithm is used to adaptively optimize two parameters in VMD: modal number K and penalty factor α; then, the independent component analysis algorithm is used for denoising of the obtained noisy component, and the noisy component is recombined.
6. The Riemannian space based motor imagery electroencephalogram (EEG) intention classification method according to claim 1, characterized in that, The data clipping algorithm in the Riemann space is used to trim the training samples according to the class labels of adjacent samples before classification, so as to eliminate part of outliers.
7. The Riemannian space based motor imagery electroencephalogram (EEG) intention classification method according to claim 6, characterized in that, The data clipping algorithm in the Riemann space specifically comprises the following steps: 1). Calculate known label samples X according to formula (16) i covariance matrix P of i ; For k-classification problem, the sample set of the kth classification in the training set is denoted as wherein is the test number corresponding to the kth classification. In the formula, T s denotes the sampling rate; 2). Calculate the Riemannian distance δ between each pair of known label sample covariance matrices according to formula (19) R (P i ,P j ), where the Riemannian distance of a sample with itself is defined as δ R (P i ,P i ) = ∞; delta R (P,P i ) = ||Log P (P i )| P = ||S i | P = ||upper(P -1 / 2 Log P (P i )P -1 / 2 ) ||2 = ||s i ||2 (19) s i For a normalized m-dimensional vector upper(P -1 / 2 Log P (P i )P -1 / 2 ), m represents the dimension of the tangent space vector; 3). For the i-th sample, its nearest neighbor is argmin j δ R (P i ,P j ) ; P is the covariance matrix of the label samples X to be classified; 4) Determine the label of each known sample X. i covariance matrix P i The class label and its nearest neighbor P j Are they consistent? If they are consistent, then retain P. i If they do not match, delete P. i ; 5). Use the remaining P i The Riemann power mean of the training set is calculated and substituted into the Riemann minimum distance average field classifier for subsequent calculations.
8. The Riemannian space based motor imagery electroencephalogram (EEG) intention classification method according to claim 1, characterized in that, The noisy original motor imagery electroencephalogram is classified into four types of control signals, and the four types of control signals are sent to the lower computer, so that the lower computer can be effectively controlled.