A hybrid time-frequency-space electroencephalogram feature extraction method based on whale optimization algorithm
Patent Information
- Application Number
- CN202310297233.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-03-23
AI Technical Summary
但是,在进行运动想象脑电信号采集的同时,也伴随着大量其他无关干扰频段,如眼电信号、环境噪声等
[0013] First, the parameters of the VMD algorithm were optimized using the whale optimization algorithm to determine the optimal combination of decomposition parameters, i.e., the number of mode decompositions. and penalty factor
While reducing modal aliasing and improving EEG purity, this invention maximizes the preservation of frequency band information. Secondly, it employs the WPD algorithm for EEG signal decomposition and secondary reconstruction, effectively subdividing the time-frequency features of motor imagery EEG. Simultaneously, it combines this with the CSP filter to find an optimal set of spatial filters for projection, maximizing the variance differences among the various task signals, thus achieving EEG feature extraction from the mixed time-frequency spatial feature domain. Finally, comparative experiments demonstrate that the proposed method not only improves the purity of EEG signals but also fully leverages the complementarity of each feature domain, significantly enhancing the accuracy of motor imagery task recognition.
Smart Images

Figure CN117113067B_ABST
Abstract
Description
Technical Field
[0001] This invention falls within the interdisciplinary research scope of biomedical engineering and computer science, specifically involving the application of electroencephalogram (EEG) signal processing technology in motor imagery rehabilitation therapy, and particularly proposing a hybrid time-frequency-space EEG feature extraction method based on the whale optimization algorithm. Background Technology
[0002] Stroke not only causes economic losses to Chinese society but also seriously threatens human health and quality of life. For the sequelae of such neurological function impairment, rehabilitation therapies centered on neurodevelopmental techniques, such as Brunnstrom, are widely used clinically, along with symptomatic training targeting functional impairments in the heart, lungs, and swallowing. Motor imagery therapy, an emerging rehabilitation therapy based on the theory of brain functional remodeling, is characterized by its lack of physical output; that is, it involves mentally replaying previously experienced actions without muscle contraction or execution. It activates specific areas of the brain, thereby improving motor function and is applicable to any stage after stroke. Therefore, research on rehabilitation techniques for post-stroke motor dysfunction has significant practical implications.
[0003] Regarding the application of EEG signal processing technology in motor imagery rehabilitation, although many scholars both domestically and internationally have proposed various EEG feature extraction methods, they all have certain limitations. Firstly, EEG signals are characterized by high dimensionality and instability. During motor imagery, the EEG waves closely related to it are mainly alpha and beta waves, with their frequency range primarily concentrated between 8 and 30 Hz. However, during the acquisition of motor imagery EEG signals, a large number of other irrelevant interference frequency bands, such as electrooculography (EOG) signals and environmental noise, are also present. Secondly, EEG signals inherently possess time-varying, low-frequency, and spatial characteristics. Existing feature extraction methods mainly rely on single or dual feature domains for EEG feature extraction, rarely considering the feature relationships between the time, frequency, and spatial domains of EEG signals. Therefore, to address these issues, this invention proposes a hybrid time-frequency-spatial feature extraction method based on the whale optimization algorithm. This method can improve the purity of EEG signals and fully exploit the complementarity between various feature domains, providing a technical reference for EEG signal processing technology in the field of motor imagery rehabilitation for post-stroke sequelae. Summary of the Invention
[0004] This invention provides a hybrid time-frequency-spatial EEG feature extraction method based on the Whale Optimization Algorithm (WOA). It primarily improves the Variational Mode Decomposition (VMD) algorithm using the Whale Optimization Algorithm (WOA) to enable adaptive selection of the optimal number of modes for VMD decomposition of EEG signals. Then, it combines the Wavelet Packet Decomposition (WPD) algorithm and the Common Spatial Pattern (CSP) algorithm to further achieve complementary mining of feature domain information in the time, frequency, and spatial domains, laying a technical foundation for improving the accuracy of motor imagery EEG recognition.
[0005] This invention discloses a hybrid time-frequency spatial EEG feature extraction method based on the whale optimization algorithm, the specific steps of which are as follows:
[0006] (1) Preprocessing: The raw EEG signals of the collected motor imagery are preprocessed, including FIR (Finite Impulse Response) filtering and noise reduction, deletion of useless electrode channels, and extraction of motor imagery task segments of interest, to complete the preliminary data cleaning of the EEG data.
[0007] (2) Variational mode decomposition: VMD decomposition is performed on the EEG signal segments of motor imagery to obtain a series of intrinsic mode functions (IMFs). The principle is based on the signal superposition principle, which can treat complex EEG signals as a superposition of a series of simple sub-signals.
[0008] (3) Whale optimization: The WOA algorithm is used to optimize the decomposition parameters of the VMD algorithm to improve the feature extraction performance of the VMD algorithm on the processed motor imagery EEG signal, further clean the data, reduce modality aliasing, and improve the purity of EEG.
[0009] (4) Signal reconstruction: Perform Hilbert transform on each order IMF in step (3) to obtain the Hibert spectrum, select the frequency band energy of 8~30Hz in each order variational mode component for reconstruction, and repeat steps (2), (3) and (4) until the judgment termination condition of the optimal decomposition parameters is met.
[0010] (5) Feature extraction: The reconstructed EEG signal in step (4) is decomposed by wavelet packet decomposition (WPD, external technique) to obtain representative multi-level subdivided time-frequency features. A common spatial filter (CSP, external technique) is constructed, and the selected time-frequency feature subset is then subjected to spatial domain feature extraction to obtain a hybrid time-frequency spatial EEG feature matrix.
[0011] This invention proposes a method and steps for hybrid time-frequency-spatial EEG feature extraction based on the whale optimization algorithm. The whale optimization algorithm's global optimization capability is used to improve the VMD algorithm, thereby reducing modality aliasing and improving the purity of motor imagery EEG waves. Simultaneously, this invention also introduces the WPD algorithm and the CSP algorithm to further strengthen the connection between EEG features in the time, frequency, and spatial domains.
[0012] Compared with the prior art, the present invention has the following advantages:
[0013] First, the parameters of the VMD algorithm were optimized using the whale optimization algorithm to determine the optimal combination of decomposition parameters, i.e., the number of mode decompositions. and penalty factor While reducing modal aliasing and improving EEG purity, this invention maximizes the preservation of frequency band information. Secondly, it employs the WPD algorithm for EEG signal decomposition and secondary reconstruction, effectively subdividing the time-frequency features of motor imagery EEG. Simultaneously, it combines this with the CSP filter to find an optimal set of spatial filters for projection, maximizing the variance differences among the various task signals, thus achieving EEG feature extraction from the mixed time-frequency spatial feature domain. Finally, comparative experiments demonstrate that the proposed method not only improves the purity of EEG signals but also fully leverages the complementarity of each feature domain, significantly enhancing the accuracy of motor imagery task recognition. Attached Figure Description
[0014] Figure 1 This is a system framework diagram of the present invention;
[0015] Figure 2 This is a flowchart of the EEG feature extraction method based on the whale optimization algorithm in the hybrid time-frequency-spatial feature domain of the present invention;
[0016] Figure 3a , Figure 3b , Figure 3c This is a simulation result of a comparative experiment using other feature extraction methods combined with a typical classifier model. Detailed Implementation
[0017] To better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings, such as... Figure 1 As shown, the specific process of this invention is as follows:
[0018] (1) Preprocessing: The 2592 original EEG samples of motor imagery collected were cleaned according to the subject number to obtain relatively pure EEG signal fragments for motor imagery tasks. First, the original EEG data was filtered and denoised using an FIR filter with a bandpass filter of 8-30Hz to initially retain information in the frequency band of interest. Then, useless Electrooculogram (EOG) channels were manually deleted: EOG-left, EOG-central, and EOG-right, to reduce the interference of EOG signals on the analysis of motor imagery EEG signals. Finally, motor imagery task fragments were extracted from each subject's EEG signal set, and the motor imagery event type labels of the original EEG signals were redefined as Class I, Class II, Class III, and Class IV, representing four basic motor imagery categories: left hand, right hand, both feet, and tongue. The dimensions of the preprocessed single subject's EEG data were (288, 22, 750), and this data matrix was used as the initial input for variational mode decomposition. Where 288 represents the total number of imagined movements in the EEG signal acquisition experiment, 22 represents 22 electrode channels, and 750 represents the 3-second imagined movement segment captured at a sampling rate of 250Hz.
[0019] (2) Variational Mode Decomposition: First, the EEG data is decomposed using the VMD algorithm to obtain a series of IMFs, namely, a low-rank matrix L and a sparse matrix S. EEG features are extracted from the low-rank matrix L as the objective function. The VMD-constrained variational model is as follows: st
[0020] In the formula, To determine the number of decomposition modes, For each order of modal function, denoted as the center frequency of each modality, f as the EEG signal to be decomposed, and "st" as an abbreviation for "subject to," indicating an operation or optimization performed under certain constraints or conditions.
[0021] Next, initialize , , And n, let =1, and , , The iterative update formula is:
[0022] In the formula, Let be the frequency domain representation of the k-th mode, and "n+1" be the result of the (n+1)-th iteration. Let be the center frequency of the k-th mode. For the frequency domain representation of decomposed EEG signals, For noise tolerance, and controlling the Lagrange multipliers .
[0023] (3) Whale optimization: Initialize the whale population, randomly generate the positions and velocities of some whales, and use the minimum value of the envelope entropy as the fitness function to calculate the fitness value of each whale. The formula for calculating the envelope entropy is:
[0024] In the formula for The normalized probability distribution sequence, where N is the number of sampling points. This is the envelope signal of the IMF after Hilbert mediation.
[0025] (4) Signal reconstruction: The frequency band energy of 8~30Hz in each variational mode component is selected for reconstruction. The formula for calculating the frequency band energy is:
[0026] In the formula , These are the upper and lower limits of the frequency, respectively. For the first One variational mode component.
[0027] Based on the current whale position and speed, as well as the global optimal solution and the individual optimal solution, update the whale position and speed, and determine whether the stopping condition has been met. If the stopping condition is met, stop the iteration; otherwise, return to steps (2), (3), and (4) to continue the iteration. The stopping condition formula is:
[0028] In the formula, ε represents the judgment precision. For the first The first mode Frequency domain representation of the next iteration.
[0029] (5) Feature extraction: The reconstructed EEG signal from step (4) is represented as... Wavelet packet decomposition using the "db4" wavelet basis function decomposes the EEG signal into multiple sub-band signals, each representing a different frequency range, forming a multi-level subset of EEG time-frequency features. The decomposition formula for each level is as follows: ,
[0030] In the formula, This represents the decomposed signal corresponding to the j-th node in the i-th layer. These are the low-pass filter coefficients. For high-pass filter coefficients, when the number of nodes j is even, it means that the low-frequency component signal is obtained after decomposition by low-pass filter coefficients; when j is odd, it means that the high-frequency component signal is obtained after decomposition by high-pass filter coefficients.
[0031] Furthermore, CSP filters are constructed using a "one-to-many" strategy, where one of the four categories is treated as one class, and the other three as another. Specifically, for the first category, it is distinguished from the other three categories to obtain a binary classifier; for the second category, it is distinguished from the other three categories to obtain another binary classifier; and binary classifiers are also constructed for the third and fourth categories respectively. Therefore, four CSP filters are required. The EEG time-frequency feature subset obtained in step 5) is reconstructed and input into the four CSP filters. Based on the calculated mean and variance, it is converted into a standard normal distribution to extract the final mixed time-frequency spatial EEG feature matrix. The feature extraction formula is as follows:
[0032] In the formula For spatial factors, For a certain type of task motion imagination matrix, For a certain type of task characteristics, For a certain type of task feature vector, for The variance.
[0033] Through the above steps, hybrid time-frequency spatial EEG feature extraction can be achieved. Figure 3 shows the simulation effect of this invention, including three comparative experiments: Figure 3a This study compares wavelet packet analysis (WPD), common spatial pattern (CSP), and support vector machine (SVM). Figure 3b This study compares wavelet packet analysis (WPD), common spatial pattern (CSP), and artificial neural network (ANN). Figure 3c This study compares wavelet packet analysis (WPD), common spatial pattern (CSP) with one-dimensional convolutional neural network (1D-CNN).
[0034] The hybrid time-frequency-spatial EEG feature extraction method based on the whale optimization algorithm proposed in this invention can not only further improve the purity of EEG signals, but also fully explore the complementarity of EEG features in the time, frequency and spatial domains, and realize the self-optimization of EEG data.
Claims
1. A hybrid time-frequency-spatial EEG feature extraction method based on the whale optimization algorithm, characterized in that, The specific steps include: (1) Preprocessing: The collected raw EEG signals of motor imagery are preprocessed, including filtering and noise reduction, deleting useless electrode channels and extracting motor imagery task segments of interest; (2) Variational Mode Decomposition: Variational Mode Decomposition (VMD) is performed on the EEG signal segments of motor imagery to obtain a series of intrinsic mode functions; (3) Whale Optimization: The Whale Optimization Algorithm (WOA) was used to optimize the decomposition parameters of the VMD algorithm to improve the VMD algorithm's performance in extracting features from processed motor imagery EEG signals. Specific operations included: initializing the whale population, randomly generating the positions and velocities of some whales, using the minimum value of the envelope entropy as the fitness function, and calculating the fitness value of each whale. The formula for calculating the envelope entropy is as follows: In the formula for The normalized probability distribution sequence, where N is the number of sampling points. This is the envelope signal of the IMF after Hilbert mediation; (4) Signal reconstruction: Select the 8~30Hz frequency band energy of each variational mode component for reconstruction. The formula for calculating the frequency band energy is as follows: In the formula , These are the upper and lower limits of the frequency, respectively. For the first There are several variational mode components; based on the current whale position and velocity, as well as the global optimal solution and the individual optimal solution, the whale position and velocity are updated, and it is determined whether the stopping condition has been met. If the stopping condition is met, the iteration stops; otherwise, the iteration returns to steps (2), (3), and (4). The stopping condition formula is: In the formula, ε represents the judgment precision. This represents the (n+1)th iteration frequency domain representation of the k-th mode; (5) Feature extraction: Wavelet packet decomposition is performed on the reconstructed EEG signal to obtain representative multi-level subdivided time-frequency features, and a common space filter is constructed to continue spatial domain feature extraction, thereby obtaining a hybrid time-frequency spatial EEG feature matrix.
2. The method according to claim 1, characterized in that, Step (2) includes: decomposing the EEG data using the VMD algorithm to obtain a series of Intrinsic Mode Functions (IMFs) as the objective function, specifically referring to: the VMD constrained variational model as... st In the formula To decompose the number of modes, For each order of modal function, For the center frequencies of each mode, The EEG signal to be decomposed; "st" is an abbreviation for "subject to," indicating an operation or optimization performed under certain constraints or conditions; initialization. , , and ,make , and , , The iterative update formula is: In the formula Let "n" be the frequency domain representation of the k-th mode, and "n+1" be the result of the (n+1)-th iteration. Let be the center frequency of the k-th mode. For the frequency domain representation of decomposed EEG signals, For noise tolerance, and controlling the Lagrange multipliers .
3. The method according to claim 1, characterized in that, Step (5) includes: representing the reconstructed EEG signal from step (4) as... Wavelet packet decomposition of the EEG signal was performed using "db4" as the wavelet basis function, decomposing the EEG signal into multiple sub-band signals. Each sub-band signal represents a different frequency range, forming a multi-level subset of EEG time-frequency features. The decomposition formula for each level is as follows: , In the formula This represents the decomposed signal corresponding to the j-th node in the i-th layer. These are the low-pass filter coefficients. Here are the high-pass filter coefficients; further, CSP filters are constructed using a "one-to-many" strategy, where one of the four categories is treated as one category, and the other three as another. Specifically, for the first category, it is distinguished from the other three categories, thus obtaining a binary classifier; for the second category, it is distinguished from the other three categories, thus obtaining another binary classifier; and for the third and fourth categories, a binary classifier is also constructed respectively, thus requiring four CSP filters. Then, the obtained EEG time-frequency feature subset is reconstructed and input into the four CSP filters. Based on the calculated mean and variance, it is converted into a standard normal distribution, thereby extracting the final mixed time-frequency spatial EEG feature matrix. The feature extraction formula is as follows: In the formula For spatial factors, For a certain type of task motion imagination matrix, For a certain type of task characteristics, For a certain type of task feature vector, for The variance.