Motor imagery electroencephalogram signal recognition method based on PSD and optimized SVM
By using PSD feature extraction and PSO to optimize SVM parameters in the classification of motor imagination EEG signals, the problem of failure to fully utilize band information and kernel function parameter optimization in the prior art is solved, and higher classification accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202311196781.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-03-18
AI Technical Summary
In the classification of motion imagination EEG signals, the prior art fails to fully utilize the information of each frequency band, and the classification performance of traditional support vector machines is greatly affected by the kernel function parameters, and lacks parameter optimization, resulting in insufficient classification accuracy.
The method of optimizing support vector machine (SVM) parameters based on power spectral density (PSD) feature extraction and particle swarm optimization algorithm (PSO) is used to remove EEG signal noise and use the optimized SVM for feature classification.
By fully utilizing PSD features and PSO to optimize SVM parameters, the classification accuracy of motor imaginary EEG signals is improved, and the robustness and classification performance of the algorithm are enhanced.
Smart Images

Figure CN119646639A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electroencephalogram (EEG) signal recognition, and in particular to a method for recognizing motor imagery EEG signals based on PSD and optimized SVM. Background Art
[0002] Common feature extraction methods can be divided into time domain, frequency domain and space domain according to the features extracted in different dimensions. Among them, the frequency domain feature extraction method mainly includes power spectral density analysis, which is widely used in the task of classifying motor imagery EEG signal patterns and is one of the most effective feature extraction methods. Common classification algorithms include support vector machines and decision trees. Raut et al. proposed a method of using wavelet transform to construct feature vectors and then using nonlinear support vector machines for classification, which greatly improved the classification accuracy. Luo et al. classified motor imagery EEG signals by repeatedly establishing branches of decision trees through "one-to-many" co-spatial patterns and support vector machines. Dolzhikova et al. formed an ensemble convolutional neural network classifier by integrating the convolutional neural network architecture and the ability of ensemble learning to classify motor imagery EEG signals with excellent classification results.
[0003] When the above methods are applied to further improve the classification accuracy of motor imagery tasks, they also have limitations. These methods only consider some local aspects of the basic characteristics of motor imagery EEG signals and cannot fully reflect the information of each frequency band. It is not recognized that the classification performance of traditional support vector machines is greatly affected by their kernel function parameters, and there is a lack of algorithms to optimize the kernel function parameters of support vector machines to improve the robustness of the algorithm and obtain higher classification accuracy. Summary of the invention
[0004] In order to solve the above technical problems, this application proposes the following technical solutions:
[0005] In a first aspect, the present application provides a method for recognizing motor imagery EEG signals based on PSD and optimized SVM, comprising:
[0006] Under the assistance of visual interface, the subjects' EEG data of motor imagery were collected;
[0007] Using Butterworth filter and independent component analysis method to remove noise and artifacts from the motor imagery EEG signal data;
[0008] The preprocessed motor imagery EEG signal data is subjected to PSD feature extraction;
[0009] The particle swarm optimization algorithm PSO is used to optimize the parameters of the support vector machine SVM;
[0010] The optimized SVM is used to perform feature classification on the motor imagery EEG signals extracted by PSD features to determine the recognition results of the motor imagery EEG signals.
[0011] In a possible implementation, the step of collecting motor imagery EEG signal data of the subject under the assistance of a visual interface includes:
[0012] The subjects were required to keep their bodies relaxed in a quiet environment with the aid of a visual interface. At the beginning of the experiment, the screen was black and the subjects were required to rest.
[0013] After the first preset time, a “+” cross appears on the screen, prompting the subject to get ready;
[0014] After the second preset, a left-right arrow appears on the screen for a preset period of time to prompt the subject to start motor imagery;
[0015] Perform multiple sets of data collection and multiple times per set.
[0016] In a possible implementation, the step of extracting PSD features from the preprocessed motor imagery EEG signal data includes:
[0017] Divide the EEG signal x(n) of length N into L segments, each segment of data length is M, then the power spectrum of each segment is:
[0018]
[0019] In the formula, U is the normalization factor; g(n) is the window function;
[0020] If the power spectrum of each segment is considered to be unrelated, the final average power spectrum density is estimated as:
[0021]
[0022] In a possible implementation, the optimization of the parameters of the support vector machine (SVM) using a particle swarm optimization algorithm (PSO) includes:
[0023] Initialize the population, including the position and velocity of particles, and learning factors;
[0024] Calculate the current fitness value of the particles in the population and set the individual optimal extreme value p i Assign to g and determine the global optimal value;
[0025] Update the current position and velocity of the particle;
[0026] Evaluate the fitness of the particle according to the current position and speed of the particle, and compare and update the global optimal value;
[0027] Determine whether the termination condition is met. If so, the iteration terminates and the SVM parameters c and σ are output; if not, continue the iteration.
[0028] In a possible implementation, updating the current position and velocity of the particle includes:
[0029]
[0030]
[0031] In the formula, and represents the velocity and position of the i-th and d-th dimensional particles; ω is a non-negative inertia factor, c1 and c2 are learning factors, and rand(0,1) is a random number between (0,1); represents the individual optimal extreme value of the i-th and d-th dimension particles, g d Represents the global optimal extreme value of the d-th dimension particle.
[0032] In one possible implementation, each particle can be regarded as an individual in the S-dimensional search space. Each particle represents a possible solution to a problem, and there is information sharing between particles. In each iteration, all particles in the space will adjust their speed and position according to the current individual extreme value and the global optimal extreme value.
[0033] In a possible implementation, the step of performing feature classification on the motor imagery EEG signal extracted from the PSD feature using the optimized SVM includes:
[0034] Assume that the linearly separable input sample set is (u k ,r k ),k=1,…,l,r k ∈{+1,-1} is the category label, which is transformed into:
[0035]
[0036] In the formula, is the distance between different categories, maximizing it; w is the projection amount of the classification surface, b is the classification threshold, and the optimal classification surface can be obtained by using the Lagrange multiplier method:
[0037]
[0038] In the formula, a i For the Lagrange multiplier corresponding to each constraint condition, the classification decision function of the linearly separable sample is:
[0039] f(x)=sgn(w·u+b) (7)
[0040] The classification decision function for nonlinear problems is:
[0041]
[0042] In the formula, K(u i u) is the kernel function.
[0043] In one possible implementation, a kernel function is used to map inseparable samples in a low-dimensional space to a high-dimensional feature space to make them linearly separable, and an optimal hyperplane is constructed in the high-dimensional space to separate the two types of data as much as possible with the longest separation distance.
[0044] In a second aspect, the embodiment of the present application provides a motor imagery EEG signal recognition system based on PSD and optimized SVM, comprising:
[0045] A data acquisition module, used for collecting the motor imagery EEG signal data of the subject under the assistance of a visual interface;
[0046] A data preprocessing module, for removing noise and artifacts from the motor imagery EEG signal data by using a Butterworth filter and an independent component analysis method;
[0047] A feature extraction module is used to extract PSD features from the preprocessed motor imagery EEG signal data;
[0048] Parameter optimization module, used to optimize the parameters of support vector machine SVM using particle swarm optimization algorithm PSO;
[0049] The feature classification module is used to perform feature classification on the motor imagery EEG signal extracted by PSD features using the optimized SVM to determine the recognition result of the motor imagery EEG signal.
[0050] In the embodiment of the present application, the global optimization capability of the particle swarm optimization algorithm is used to optimize the support vector machine kernel function parameters to achieve the optimal classification performance. Target recognition accuracy is a key part of brain-computer interface research. With the improvement of target recognition accuracy, the accuracy of online brain-computer interface can be greatly increased. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A flowchart of a method for identifying motor imagery EEG signals based on PSD and optimized SVM provided in an embodiment of the present application;
[0052] Figure 2 An experimental timing diagram provided for an embodiment of the present application;
[0053] Figure 3 A schematic diagram of an EEG acquisition device provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of an electrode cap provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a motor imagery EEG signal recognition system based on PSD and optimized SVM provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The present solution is described below in conjunction with the accompanying drawings and specific implementation methods.
[0057] Figure 1 A flow chart of a method for recognizing motor imagery EEG signals based on PSD and optimized SVM provided in an embodiment of the present application is shown in FIG. Figure 1 The motor imagery EEG signal recognition method based on PSD and optimized SVM provided in this embodiment includes:
[0058] S101, collecting motor imagery EEG signal data of the subject under the assistance of a visual interface.
[0059] In this embodiment, the visual interface is used to assist the subject to complete the imagined motor behavior, and the 32-channel wired EEG acquisition device of BP company is used to collect the EEG signals of the motor imagination of the cerebral cortex tissue of the subject. As a kind of brain-computer interface, motor imagination refers to the behavior of imagining a specific action but not actually performing the action. The brain will produce various forms of signals when performing motor imagination activities, which can be measured by different means. And the EEG signals of different motor imagination tasks are usually accompanied by different sensory motor rhythms, that is, the increase and decrease of the power of specific frequency bands in each brain area. We mainly process this sensory motor rhythm.
[0060] During the experiment, the subjects were in a quiet environment and relaxed. Figure 2 As shown in the figure, at the beginning of the experiment (t = 0s), the screen was black and the subjects were resting; after 2s, a "+" cross appeared on the screen, prompting the subjects to get ready; after 1s, a left and right arrow (representing the left hand and right hand, respectively) appeared on the screen for 6s to prompt the subjects to start motor imagery. Each set of experimental data was conducted 20 times, divided into four groups. A total of 80 sets of data were included, including 40 left-hand motor imagery experiments and 40 right-hand motor imagery experiments.
[0061] The EEG acquisition equipment is a product of BP, a German company. Figure 3 As shown. It includes an amplifier, a 32-lead EEG cap, a laptop computer and an EEG analyzer. The distribution of the electrodes in the electrode cap conforms to the 10-20 international standard lead system, such as Figure 4 As shown in the figure. Through this device, we convert the collected EEG signals into a processable format and process them using Matlab software.
[0062] S102, using a Butterworth filter and an independent component analysis method to remove noise and artifacts from the motor imagery EEG signal data.
[0063] The purpose of signal preprocessing is to improve the signal-to-noise ratio. EEG signal is a bioelectric signal with a low signal-to-noise ratio. The signal amplitude is very weak and contains a lot of noise and artifacts. The sources of noise are many, including non-neural noise and neural noise.
[0064] This application mainly uses Butterworth filter and independent component analysis method to remove noise and artifacts in the preprocessing stage. The characteristic of Butterworth filter is that the frequency response curve in the passband is maximally flat, without fluctuations, and gradually decreases to zero in the stopband. On the Bode plot of the logarithm of the amplitude to the diagonal frequency, starting from a certain boundary angular frequency, the amplitude gradually decreases with the increase of the angular frequency and tends to negative infinity. The idea of the independent component analysis method comes from the central limit theorem: the result of the joint action of a group of random variables with the same order of magnitude of mean and variance must be close to the Gaussian distribution. Therefore, the separation result of a group of mixed signals generated by linear combination of mutually statistically independent sources is measured by non-Gaussianity. When its non-Gaussianity reaches the maximum, it can be considered that the mixed signal is optimally separated. Therefore, useful EEG signals can be extracted by independent component analysis.
[0065] S103, extracting PSD features from the pre-processed motor imagery EEG signal data.
[0066] Feature extraction is the core part of the brain-computer interface system. Its purpose is to extract useful information from EEG signals and classify them based on this information. There are four main features of EEG signal data: time domain features, frequency domain features, time-frequency features, and spatial domain features. Different features require different feature extraction methods. Feature extraction involves how to extract a small amount of useful information from EEG signals, and use this information to classify and distinguish different motor imagination states.
[0067] This application uses the Welch method, that is, the improved average periodogram method, to estimate the power spectral density of each frequency band for multiple 6-second EEG signals. First, each data segment is preprocessed using a hamming window, and then the power spectral density of each data segment is calculated, and finally the average power spectral density of each signal is obtained by averaging. This paper selects the power spectral density of the four frequency bands of delta, theta, alpha and beta 0-30Hz as the frequency domain features of EEG signals.
[0068] Divide the EEG signal x(n) of length N into L segments, each segment of data length is M, then the power spectrum of each segment is:
[0069]
[0070] In the formula, U is the normalization factor; g(n) is the window function. If the power spectrum of each segment is considered to be unrelated, the final average power spectrum density is estimated as:
[0071]
[0072] S104, using a particle swarm optimization algorithm PSO to optimize the parameters of the support vector machine SVM.
[0073] SVM has strong adaptability and generalization ability and is widely used, but its classification performance is closely related to its own parameters c and σ. This paper introduces the PSO algorithm to optimize the SVM parameters c and σ to obtain the optimal classification performance. The specific algorithm steps of PSO optimization SVM are as follows:
[0074] PSO initialization: Initialize the population, including the position and velocity of particles, learning factors, etc. The specific parameter settings are shown in Table 1.
[0075] Table 1 PSO parameter settings
[0076]
[0077] Evaluate particle fitness. Calculate the current fitness value of the particles in the population and set the individual optimal extreme value p i Assign to g and determine the global optimal value.
[0078] Update the particle's current position and velocity.
[0079] Evaluate particle fitness. Evaluate the particle fitness based on the current particle position and velocity, and compare and update the global optimal value.
[0080] Determine whether the termination condition is met. If it is met, the iteration is terminated and the SVM parameters c and σ are output; if it is not met, the iteration continues.
[0081] In this embodiment, updating the current position and velocity of the particle includes:
[0082]
[0083]
[0084] In the formula, and represents the velocity and position of the i-th and d-th dimensional particles; ω is a non-negative inertia factor, c1 and c2 are learning factors, and rand(0,1) is a random number between (0,1); represents the individual optimal extreme value of the i-th and d-th dimension particles, g d Represents the global optimal extreme value of the d-th dimension particle.
[0085] The particle swarm optimization algorithm PSO is derived from simulating the predation behavior of birds. In this algorithm, each particle can be regarded as an individual in the S-dimensional search space, each particle represents a possible solution to a problem, and there is information sharing between particles. Particles have two properties: speed and position. In each iteration, all particles in the space will adjust their speed and position according to the current individual extreme value and the global optimal extreme value.
[0086] S105, using the optimized SVM to perform feature classification on the motor imagery EEG signal extracted by the PSD feature, and determining the recognition result of the motor imagery EEG signal.
[0087] SVM performs well in binary classification problems, and by introducing kernel functions, it has true nonlinear classification capabilities. There are four commonly used kernel functions, namely linear kernel, polynomial kernel function, radial basis kernel function and sigmoid kernel function, as shown in Table 2. The core idea is to use kernel functions to map inseparable samples in low-dimensional space to high-dimensional feature space to make them linearly separable, and to construct the optimal hyperplane in high-dimensional space to separate the two types of data as much as possible and with the longest separation distance.
[0088] Table 2 Kernel functions
[0089]
[0090] Assume that the linearly separable input sample set is (u k ,r k ),k=1,...,l,r k ∈{+1,-1} is the category label, which is transformed into:
[0091]
[0092] In the formula, is the distance between different categories, maximizing it; w is the projection amount of the classification surface, b is the classification threshold, and the optimal classification surface can be obtained by using the Lagrange multiplier method:
[0093]
[0094] In the formula, a i For the Lagrange multiplier corresponding to each constraint condition, the classification decision function of the linearly separable sample is:
[0095] f(x)=sgn(w·u+b) (7)
[0096] The classification decision function for nonlinear problems is:
[0097]
[0098] In the formula, K(u i u) is the kernel function.
[0099] The processed EEG signals output by the recognition are converted into control instructions for external devices, where the external devices can be wheelchairs, robotic arms, etc. In the motor imagery brain-computer interface, imagining left-hand movement or right-hand movement represents different control commands. The subjects generate corresponding EEG signals by imagining different movements, which are recognized by the corresponding algorithms to control the lower computer.
[0100] In the embodiment of the present application, first, for data preprocessing, the collected EEG signals are band-pass filtered using a Butterworth filter, because most of the response frequency bands of motor imagery EEG signals are 8-30Hz. Therefore, the passband frequency of the filter is set to 8-30Hz. At the same time, the order of the filter is set to 4. Then, in terms of feature extraction, the power spectral density analysis method is used to extract the frequency domain features of the EEG signal. Finally, in feature classification, the particle swarm optimization algorithm is used to optimize the kernel function parameters of the support vector machine to improve the classification performance and obtain the classification accuracy.
[0101] Corresponding to the method for identifying motor imagery EEG signals based on PSD and optimized SVM provided in the above-mentioned embodiment, the present application also provides an embodiment of a system for identifying motor imagery EEG signals based on PSD and optimized SVM.
[0102] See also Figure 5 The motor imagery EEG signal recognition system 20 based on PSD and optimized SVM in this embodiment includes:
[0103] The data acquisition module 201 is used to collect the motor imagery EEG signal data of the subject under the assistance of the visual interface;
[0104] A data preprocessing module 202, for removing noise and artifacts from the motor imagery EEG signal data by using a Butterworth filter and an independent component analysis method;
[0105] A feature extraction module 203 is used to extract PSD features from the pre-processed motor imagery EEG signal data;
[0106] A parameter optimization module 204 is used to optimize the parameters of the support vector machine SVM using a particle swarm optimization algorithm PSO;
[0107] The feature classification module 205 is used to perform feature classification on the motor imagery EEG signal extracted from the PSD feature using the optimized SVM to determine the recognition result of the motor imagery EEG signal.
[0108] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0109] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for recognizing motor imagery EEG signals based on PSD and optimized SVM, characterized in that: include: Under the assistance of visual interface, the subjects' EEG data of motor imagery were collected; Using Butterworth filter and independent component analysis method to remove noise and artifacts from the motor imagery EEG signal data; The preprocessed motor imagery EEG signal data is subjected to PSD feature extraction; The particle swarm optimization algorithm PSO is used to optimize the parameters of the support vector machine SVM; The optimized SVM is used to perform feature classification on the motor imagery EEG signals extracted by PSD features to determine the recognition results of the motor imagery EEG signals.
2. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 1, characterized in that: The method of collecting motor imagery EEG signal data of the subject under the assistance of the visual interface includes: The subjects were required to keep their bodies relaxed in a quiet environment with the aid of a visual interface. At the beginning of the experiment, the screen was black and the subjects were required to rest. After the first preset time, a "+" cross appears on the screen, prompting the subject to get ready; After the second preset, a left-right arrow appears on the screen for a preset period of time to prompt the subject to start motor imagery; Perform multiple sets of data collection and multiple times per set.
3. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 1, characterized in that: The step of extracting PSD features from the pre-processed motor imagery EEG signal data includes: Divide the EEG signal x(n) of length N into L segments, each segment of data length is M, then the power spectrum of each segment is: In the formula, U is the normalization factor; g(n) is the window function; If the power spectrum of each segment is considered to be unrelated, the final average power spectrum density is estimated as:
4. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 3, characterized in that: The particle swarm optimization algorithm PSO is used to optimize the parameters of the support vector machine SVM, including: Initialize the population, including the position and velocity of particles, and learning factors; Calculate the current fitness value of the particles in the population and set the individual optimal extreme value p i Assign to g and determine the global optimal value; Update the current position and velocity of the particle; Evaluate the fitness of the particle according to the current position and speed of the particle, and compare and update the global optimal value; Determine whether the termination condition is met. If so, the iteration terminates and the SVM parameters c and σ are output; if not, continue the iteration.
5. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 4, characterized in that: The updating of the current position and velocity of the particle includes: In the formula, and represents the velocity and position of the i-th and d-th dimensional particles; ω is a non-negative inertia factor, c1 and c2 are learning factors, and rand(0,1) is a random number between (0,1); represents the individual optimal extreme value of the i-th and d-th dimension particles, g d Represents the global optimal extreme value of the d-th dimension particle.
6. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 4 or 5, characterized in that: Each particle can be regarded as an individual in the S-dimensional search space. Each particle represents a possible solution to a problem, and there is information sharing between particles. In each iteration, all particles in the space will adjust their speed and position according to the current individual extreme value and the global optimal extreme value.
7. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 6, characterized in that: The method of using the optimized SVM to perform feature classification on the motor imagery EEG signal extracted from the PSD feature includes: Assume that the linearly separable input sample set is (u k ,r k ),k=1,...,l,r k ∈{+1,-1} is the category label, which is transformed into: In the formula, is the distance between different categories, maximizing it; w is the projection amount of the classification surface, b is the classification threshold, and the optimal classification surface can be obtained by using the Lagrange multiplier method: In the formula, a i For the Lagrange multiplier corresponding to each constraint condition, the classification decision function of the linearly separable sample is: f(x)=sgn(w·u+b) (7) The classification decision function for nonlinear problems is: In the formula, K(u i u) is the kernel function.
8. The method for recognizing motor imagery EEG signals based on PSD and optimized SVM according to claim 7, characterized in that: The kernel function is used to map the inseparable samples in the low-dimensional space to the high-dimensional feature space to make them linearly separable. The optimal hyperplane is constructed in the high-dimensional space to separate the two types of data as much as possible and with the longest separation distance.
9. A motor imagery EEG signal recognition system based on PSD and optimized SVM, characterized in that: include: A data acquisition module, used for collecting the motor imagery EEG signal data of the subject under the assistance of a visual interface; A data preprocessing module, for removing noise and artifacts from the motor imagery EEG signal data by using a Butterworth filter and an independent component analysis method; A feature extraction module is used to extract PSD features from the preprocessed motor imagery EEG signal data; Parameter optimization module, used to optimize the parameters of support vector machine SVM using particle swarm optimization algorithm PSO; The feature classification module is used to perform feature classification on the motor imagery EEG signal extracted by PSD features using the optimized SVM to determine the recognition result of the motor imagery EEG signal.
Citation Information
Cited By
Adaptive ensemble learning model optimization method for eeg signal classification
CN122634266A