Method for classifying motor imagery electroencephalogram signals generated based on feature data

By dividing EEG signals into time and frequency domains and extracting CSP features, and combining the data generation with a denoising diffusion model, the problem of insufficient sample quantity was solved, high-reliability classification was achieved, the application scope of EEG data generation was broadened, and the classification and recognition accuracy was improved.

CN116662741BActive Publication Date: 2025-11-28HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310693086.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2025-11-28
Estimated Expiration
2043-06-13

AI Technical Summary

Technical Problem

With limited training samples, existing technologies struggle to achieve highly reliable classification of EEG signals. Furthermore, existing data generation methods are computationally expensive, generate low-quality data, and fail to effectively expand the sample size.

Method used

By simultaneously acquiring motor imagery EEG signals from 20 channels, dividing them into time and frequency domains, extracting features using the CSP algorithm, and combining them with a denoising diffusion model to generate data, the reliability of the generated data is ensured.

Benefits of technology

It effectively solves the problem of insufficient sample size, generates highly reliable data, shortens equipment training time, broadens the application scope of EEG data generation, and improves classification and recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116662741B_ABST
    Figure CN116662741B_ABST
Patent Text Reader

Abstract

The application discloses a motor imagery electroencephalogram signal classification method based on feature data generation, and comprises the following steps: collecting electroencephalogram signals and recording the starting time point and the ending time point of each imagination. The signals collected in step 1 are subjected to band-pass filtering and ICA independent component analysis, and the preprocessed signals are subjected to multiple sets of overlapping filtering and time window division. The CSP algorithm is used for feature extraction for each time-frequency segment of step 2. The extracted CSP features are subjected to 2000 rounds of training to establish a denoising diffusion model and generate data. The reliability of the generated data is evaluated by using the method combining the second moment calculation and the probability distribution histogram. The method firstly synchronously collects motor imagery electroencephalogram signals on 20 channels, then divides the signals into multiple small segments in the time domain and the frequency domain respectively, and then uses the CSP to extract features for each segment. The extracted features not only retain the channel information of the original data, but also have the characteristics of small volume and low dimension.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of bioelectric signal processing, and relates to a brain muscle information transmission rule extraction method based on standard template electromyographic decomposition, and particularly relates to a method for extracting the change rule between the corresponding features obtained after signal decomposition and another synchronous signal. BACKGROUND

[0002] Brain-computer interface (BCI) is a system that measures electroencephalogram (EEG) signals of a user to command external devices such as computers, wheelchair controllers or prostheses. With the development of science and technology, scientists have proved the ease of use and perceptibility of motor imagery EEG signals for subjects, and BCI has also been able to achieve accurate brain intention recognition. Moreover, EEG has the advantages of high time resolution, light weight, safety, etc., and has attracted widespread attention in restoring motor function for people with movement disorders, and is a promising form of communication control.

[0003] The motor imagery EEG decoding task is divided into two steps of feature extraction and classification recognition. Scientists have conducted a large number of studies on these two problems. However, due to the low signal-to-noise ratio of EEG signals and the chaotic distribution, the discrimination between different categories of samples is not significant enough, and a large number of samples are often needed to train the model, but the collection of signals requires a large amount of time and human resources. Insufficient number of samples is a new challenge in the field of motor intention recognition, which limits the development and application of motor intention recognition devices based on brain-computer interface.

[0004] How to achieve high reliability classification of EEG signals under the condition of limited training samples is a problem to be solved. The current solution mainly starts from two aspects of extracting more effective features or generating simulation data. Common spatial pattern (CSP) is proved to be able to efficiently extract motor intention features from EEG signals, which separates the data of two classes by maximizing the variance between two data sets. Regularization can be introduced into the CSP algorithm to solve the overfitting problem. Since the effectiveness of the CSP algorithm depends on the optimization selection of the EEG signal frequency band and time window, in order to improve the robustness of CSP to EEG uncertainty, many algorithms start from the optimization of the selection of frequency band and time window. For example, filter bank CSP (FBCSP) divides the EEG into multiple sub-band EEGs through multiple filter banks, and uses CSP to extract features in each frequency band; the method of sliding window discriminative CSP (SWDCSP) uses a sliding event window to segment the EEG signal in time, and then extracts the CSP features of the EEG signal in each time period. Since different users have different optimal frequency bands and time windows, time-constrained sparse group CSP divides both time and frequency before extracting features, and filters out the most useful features.

[0005] A commonly used method for expanding the number of samples is data generation. Traditional data generation methods include adding noise, blurring, rotating distortion, etc. The data generated by these methods has too high similarity with the original data, and is not helpful for training complex models. Therefore, a generation model is used, which is a method of directly controlling a high-dimensional distribution to generate data, and is usually divided into two categories: likelihood-based models and implicit generation models. The likelihood-based model directly learns the probability density function of the distribution by approximating the maximum likelihood, including autoregressive models, normalized flow models, energy-based models, and variational autoencoders. Among them, the variational autoencoder is the most commonly used, which optimizes the log-likelihood of the data implicitly by maximizing the lower bound of the evidence. But it depends on the proxy loss function. The probability distribution of the implicit generation model is implicitly represented by the model of its sampling process, the most prominent example is the generative adversarial network, which consists of a generator and a discriminator, and makes each other stronger while competing with each other. However, training a GAN model is quite challenging because people face problems such as training instability or failure to converge. In recent years, diffusion models (DPM) have gradually entered people's field of vision, inspired by non-equilibrium thermodynamics, a Markov chain of diffusion steps is defined, and random noise is gradually added to the data, and then the inverse diffusion process is learned to construct the required data samples from noise. Unlike VAE or flow models, diffusion models are learned with a fixed procedure, and the latent variable has the same dimension as the original data.

[0006] In addition, the existing researches mostly directly input the original data without processing for training to generate more realistic generated data. This method consumes more computing power, takes more time, and increases the complexity of the model. However, if the data of each channel is separately input into the model for generation, although parallel processing can be performed to save time, the generated data loses the coupling between different brain regions, and the authenticity is greatly reduced. SUMMARY

[0007] In order to overcome the deficiencies in the prior art, the application provides a motor imagery electroencephalogram signal classification method based on feature data generation. First, the motor imagery electroencephalogram signals on 20 channels are synchronously collected, then divided into multiple small segments in the time domain and the frequency domain, and then the features of each segment are extracted using CSP. The extracted features not only retain the channel information of the original data, but also have the characteristics of small volume and low dimension. The feature data is input into the denoising diffusion model for generation, which can effectively solve the above problems.

[0008] In order to solve the above technical problems, the technical scheme of the application is as follows:

[0009] A motor imagery electroencephalogram signal classification method based on feature data generation comprises the following steps:

[0010] Step 1, collect 20 channels of synchronous electroencephalogram signals while the subject performs the specified imaginary action. Record the starting time point and ending time point of each imagination.

[0011] Step 2, band-pass filter, ICA independent component analysis on the signals collected in step 1, and multiple groups of overlapping filtering and time window division on the preprocessed signals.

[0012] Step 3, use CSP algorithm to extract features for each time-frequency segment of step 2.

[0013] Step 4, use the CSP features extracted in step 3 to establish a denoising diffusion model (DDPM) through 2000 rounds of training, and generate data.

[0014] Step 5, use the method of combining second moment calculation and probability distribution histogram to evaluate the reliability of the generated data. If the reliability does not meet the requirements, retrain until the application requirements are met.

[0015] As a preferred, in step 1, the electroencephalogram signal collection position is CZ, C2, C3, C4, C5, C6, FCZ, FC1, FC2, FC3, FC4, FC5, FC6, CP1, CP2, CP3, CP4, CP5, CP6, a total of 20 channels; the imaginary action is according to the visual prompt during the experiment, which is left hand, right hand, both feet and tongue, each for 6 seconds; the rest time between two imaginations is 3 seconds according to the experimental prompt.

[0016] As a preferred, the time-frequency segment in step 2 is: there are overlapping sub-bands: 4-8Hz, 6-10Hz, 8-12Hz, 10-14Hz, 12-16Hz, 14-18Hz, 16-20Hz, 18-22Hz, 20-24Hz, 22-26Hz, 24-28Hz, 26-30Hz, 28-22Hz, 30-34Hz, 32-36Hz, 34-38Hz, 36-40Hz; there are overlapping time windows: 0-1.4s, 0.9-2.3s, 1.8-3.2s, 2.7-4.1s, 3.6-5.0s, 4.5-5.9s.

[0017] As a preferred, the specific steps of CSP feature extraction in step 3 are:

[0018] (1) The common spatial pattern algorithm first performs spatial filtering on the time series electroencephalogram signal:

[0019] z i,j =WE (1)

[0020] Wherein z i,jEij represents the jth feature extracted in the ith trial, E is a multi-channel time series matrix containing the brain electrical signals, and W is a projection matrix.

[0021] (2) The variance of the projection values, i.e. the common spatial pattern features, is calculated using the first K rows and the last K rows of the matrix, and a logarithmic transformation is used to make it close to a Gaussian distribution. In this case, K is set to 3. i,j

[0022]

[0023] where N is the number of trials in the time series signal input into the algorithm, and p is the current trial number.

[0024] (3) Generating a feature matrix: regarding a trial as a sample, the number of features obtained for each sample is m x n x D, and a total of N trials are performed in each data set, and the generated feature matrix is:

[0025]

[0026] X i,j is the jth feature extracted in the ith trial after projection, and D = m x n x 2 x K is the dimension of the features in each trial.

[0027] Preferably, the learning model for establishing the DDPM in step 4 is:

[0028]

[0029]

[0030]

[0031]

[0032] where α t = 1-β t , β t is the variance of the Gaussian noise x is the real sample to which Gaussian noise is gradually added, and T is the number of steps of adding noise.

[0033] Preferably, in step 5, the reliability of the generated data is judged comprehensively by the relative changes in the expectation and variance of the real data and the generated data calculated by the second moment, the peak value and range of the real data and the generated data in the probability distribution histogram, i.e. the similarity between the generated data and the real data. For data with insufficient reliability, the generated model is retrained using a larger number of times, and the retrained model is used to generate data. Until the reliability of the generated data and the classification accuracy of the motor imagery EEG meet the actual application requirements.​

[0034] The present application has the following characteristics and benefits:

[0035] The method for generating data using feature data proposed by the above technical solution can supplement experimental data of related research without consuming a large amount of computing power, and can be applied in practice, for example, to shorten the training time of equipment with large individual differences such as mechanical hands before being put into use. On the other hand, the present application further broadens the application range of data generation in the field of electroencephalogram, and innovatively proposes a method for directly generating extracted effective features, which opens up a new way for the research of electroencephalogram data expansion method. In addition to the number of generated samples, the extracted features also play a key role in the prediction and learning stage of the classifier. Therefore, the method has broad application prospects in the classification and recognition of bioelectric signals, makes up for the shortcomings of the difficulty of bioelectric signal acquisition, and has positive significance for the research and development of devices for the elderly and the disabled. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0037] Figure 1 The flowchart for the implementation of the present application.

[0038] Figure 2 The experimental data acquisition flowchart is shown.

[0039] Figure 3 The flow for adding Gaussian noise when generating data in the present application.

[0040] Figure 4 The second moment calculation result of the generated data in the present application is shown.

[0041] Figure 5 The probability distribution histogram calculation result of the generated data in the present application is shown. DETAILED DESCRIPTION

[0042] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0043] In the description of the present application, it should be understood that the terms "center", "longitudinal", "transverse", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the present application. In addition, the terms "first", "second" and the like are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined with "first", "second" and the like can explicitly or implicitly include one or more of the features. In the description of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more.

[0044] In the description of the present application, it should be noted that unless otherwise specified and limited, the terms "mounting", "connection", "connection" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood through specific circumstances.

[0045] The embodiment provides a motor imagery electroencephalogram signal classification method based on feature data generation, as shown in the figure, comprising the following steps: Figure 1 As shown in the figure, comprising the following steps:

[0046] Step 1: When the subject completes the motor imagery according to the prompt, the electroencephalogram signals of 20 channels of C Z , C2, C3, C4, C5, C6, FC Z , FC1, FC2, FC3, FC4, FC5, FC6, CP1, CP2, CP3, CP4, CP5, CP6 are collected at a frequency of 1000Hz. The interval between imagination and rest is 6 seconds and 3 seconds. The experimental object is a healthy male, and the subject is required to avoid strenuous exercise before the experiment to avoid fatigue, Figure 2 As shown in the figure, the data collection process of this experiment is shown.

[0047] For each subject's dataset, first, the original motor imagery is band-pass filtered from 0.5 Hz to 200 Hz using a Butterworth filter, and then notch filtered at 50 Hz to remove power frequency interference. Next, the electroencephalogram signal is decomposed into multiple time-frequency bands, each of which includes a local time period and a frequency band of the electroencephalogram signal. In the third step, for each time-frequency band, a characteristic matrix is extracted using the CSP algorithm, but no feature selection is performed. Then, the features extracted from each 15-time trial of motor imagery are input into the noise diffusion model along with the corresponding motor imagery label to generate data. Finally, the generated feature data is used to train the machine learning model, and the real feature data is used to verify the effect.

[0048] Step 2: Remove high-frequency noise and eye movement artifacts in the electroencephalogram signal by 0.5-200 Hz band-pass filtering and ICA independent component analysis.

[0049] The preprocessed electroencephalogram signal is filtered according to the overlapping sub-band: 4-8 Hz, 6-10 Hz, 8-12 Hz, 10-14 Hz, 12-16 Hz, 14-18 Hz, 16-20 Hz, 18-22 Hz, 20-24 Hz, 22-26 Hz, 24-28 Hz, 26-30 Hz, 28-22 Hz, 30-34 Hz, 32-36 Hz, 34-38 Hz, 36-40 Hz.

[0050] The obtained different sub-band electroencephalogram signals are segmented according to the overlapping time window: 0-1.4s, 0.9-2.3s, 1.8-3.2s, 2.7-4.1s, 3.6-5.0s, 4.5-5.9s.

[0051] Step 3: The multiple time-frequency band electroencephalogram signals obtained after step 2 are respectively subjected to feature extraction using the CSP algorithm.

[0052] Specifically:

[0053] (2) The common spatial pattern algorithm first performs spatial filtering on the time series electroencephalogram signal:

[0054] z i,j =WE (1)

[0055] Where z i,j represents the jth feature extracted in the ith trial, E is a multi-channel time series matrix containing the electroencephalogram signal, and W is a projection matrix.

[0056] (2) The first K rows and the last K rows of z i,j are used to calculate the variance of the projection value, i.e., the common spatial pattern feature, and a logarithmic transformation is used to make it close to a Gaussian distribution. In this embodiment, K is set to 3.

[0057]

[0058] where N is the number of trials in the time series input into the algorithm, and p is the current trial number.

[0059] (3) Generating feature matrix: regarding each trial as a sample, the number of features obtained for each sample is m x n x D, and a total of N trials are performed in each data set, and the generated feature matrix is:

[0060]

[0061] X i,j is the jth feature extracted from the ith trial after projection, and D = m x n x 2 x K is the dimension of the feature of each trial.

[0062] Step 4: The CSP features extracted in step 3 are used to establish a denoising diffusion model (DDPM) through 2000 rounds of training, and data generation is performed.

[0063] Specifically, a small amount of Gaussian noise is gradually added to the real sample x0~q(x) in T steps, and after it becomes a isotropic Gaussian distribution, reverse diffusion is performed in T steps to obtain generated data, that is, the diffusion process is reversed, and Markov chain sampling is continuously performed, so that the real sample can be reproduced from the input Gaussian noise. The forward diffusion and reverse diffusion model is:

[0064]

[0065]

[0066]

[0067]

[0068] where, α t = 1-β t , β t is the variance of the Gaussian noise In order to ensure the authenticity of the data, the training rounds of the model are set to 2000 rounds.

[0069] As Figure 3 shown, the figure is a visualization diagram of gradually adding Gaussian noise to the features, and it can be seen that after T times of addition, the input signal has completely lost the distinguishable features and has become isotropic Gaussian noise.

[0070] Step 5: The reliability of the generated data is evaluated by the method of second moment calculation combined with the probability distribution histogram. If the reliability does not meet the requirements, retraining is performed until the application requirements are met. Then the generated data is used for identification and classification.

[0071] As shown in Figure 4 , the figure is the second moment calculation result of the generated data and the real data in the example. It can be seen that the expected percentage error of the real data and the generated data is controlled within 3%.

[0072] As shown in Figure 5 , the figure is the second moment calculation result of the generated data and the real data in the example. It can be seen that the expected percentage error of the real data and the generated data is controlled within 3%. Figure 5 (a) is the probability distribution histogram of the left hand imaginary movement in the example, Figure 5 (b) is the probability distribution histogram of the right hand imaginary movement in the example, Figure 5 (c) is the probability distribution histogram of the feet imaginary movement in the example, Figure 5 (d) is the probability distribution histogram of the tongue imaginary movement in the example. The horizontal coordinate is the amplitude of the electroencephalogram signal, and the vertical coordinate is the kernel density value corresponding to the amplitude.

[0073] Firstly, it can be seen that the expected error of the generated data and the real data is less than 3% on average, and basically less than 1%; the average value of the variance error is within 7%, and basically less than 15%. The amplitude position where the real data and the generated data reach the peak is basically consistent, and the amplitude range also deviates little, and the similarity is high in the probability distribution angle. It is proved that the stability and authenticity of the generated data.

[0074] It can be seen from the above technical solutions and data that in the embodiment, the generated data is classified by using the random forest classifier, and the accuracy can reach 100%. Based on the above frequency band and time window division method, the method of combining TSGSP feature extraction and DDPM data generation can obtain relatively ideal data results.

[0075] The embodiments of the application are described in detail above with reference to the drawings, but the application is not limited to the described embodiments. For those skilled in the art, various changes, modifications, replacements and variations of the embodiments including components can be made without departing from the principles and spirits of the application, and still fall within the protection scope of the application.

Claims

1. A method for classifying motor imagery EEG signals based on feature data, characterized in that, Includes the following steps: Step 1: Collect EEG signals from the subject regarding motor imagery; Step 2: Preprocess the acquired EEG signals, and then perform multiple sets of overlapping filtering and time window division; Step 3: For each time-frequency band obtained after division in Step 2, feature extraction is performed using the co-space mode; The feature extraction method in step 3 is as follows: (1) The co-spatial pattern algorithm first performs spatial filtering on EEG signals of different time-frequency bands: z i,j =WE (1) Where z i,j Let E represent the j-th feature extracted in the i-th trial, E be a multi-channel time series matrix containing EEG signals, and W be a projection matrix. (2) Using z i,j The variance of the projected values, i.e., the co-space pattern characteristics, is calculated from the first K rows and the last K rows, and then a logarithmic transformation is used to make it approximate a Gaussian distribution. Where N is the number of trials in the time-series signal input into the algorithm, and p is the current trial number; (3) Generating the feature matrix: Consider each trial as a sample. Each sample can yield m×n×D features. N trials are conducted for each dataset. The generated feature matrix is: X i,j The j-th feature extracted for the i-th trial after projection, where D = m·n·2·K is the dimension of the feature for each trial; Step 4: Use a denoising diffusion model to generate data from the extracted features; Step 5: Evaluate the reliability of the generated data using a combination of second-order moment calculation and probability distribution histogram. If the reliability does not meet the requirements, retraining is performed until the application requirements are met. The reliability judgment method for the generated data is: the expected error between the generated data and the real data does not exceed 3%.

2. The method for classifying motor imagery EEG signals based on feature data according to claim 1, characterized in that, The method for acquiring the electroencephalogram (EEG) signals: Electroencephalogram (EEG) signals acquired at a frequency of 1000 Hz; The specific exercise visualization was designed as follows: subjects were asked to visualize the movement of their left hand, right hand, both feet, and tongue based on visual cues.

3. The method for classifying motor imagery EEG signals based on feature data according to claim 2, characterized in that, When acquiring the signal, C is acquired at a frequency of 1000Hz. Z C2, C3, C4, C5, C6, FC Z EEG signals from 20 channels: FC1, FC2, FC3, FC4, FC5, FC6, CP1, CP2, CP3, CP4, CP5, and CP6.

4. The method for classifying motor imagery EEG signals based on feature data according to claim 3, characterized in that, In step 1, during each data collection, the corresponding body part is visualized for 6 seconds, followed by 3 seconds of quiet rest with eyes open according to visual cues.

5. The method for classifying motor imagery EEG signals based on feature data according to claim 4, characterized in that, In step 2, the preprocessing method for the acquired EEG signals is as follows: bandpass filtering of 0.5Hz-200Hz, notch filtering of 50Hz, and independent component analysis (ICA).

6. The method for classifying motor imagery EEG signals based on feature data according to claim 5, characterized in that, The overlapping filtering method in step 2 is as follows: First, bandpass filtering is performed using 17 overlapping sub-frequency bands, which are: 4-8Hz, 6-10Hz, 8-12Hz, 10-14Hz, 12-16Hz, 14-18Hz, 16-20Hz, 18-22Hz, 20-24Hz, 22-26Hz, 24-28Hz, 26-30Hz, 28-22Hz, 30-34Hz, 32-36Hz, 34-38Hz, and 36-40Hz. The time window division method is as follows: after overlapping filtering, the time sequence signal is divided into 6 time windows to obtain 102 EEG signals in different time frequency bands. The 6 time windows are: 0-1.4s, 0.9-2.3s, 1.8-3.2s, 2.7-4.1s, 3.6-5.0s, and 4.5-5.9s.

7. The method for classifying motor imagery EEG signals based on feature data according to claim 6, characterized in that, In step 4, the method for generating data is as follows: By gradually adding a small amount of Gaussian noise to the real samples x0~q(x) in T steps until they are equivalent to an isotropic Gaussian distribution, reverse diffusion is performed in T steps to obtain the generated data. That is, the above diffusion process is reversed, and Markov chain sampling is continuously performed to reproduce the real samples from the input Gaussian noise. The denoising diffusion model is as follows: Where, α t =1-β t , β t The variance of Gaussian noise x represents the real samples to which Gaussian noise has been gradually added, and T represents the number of steps to add noise.

8. The method for classifying motor imagery EEG signals based on feature data according to claim 7, characterized in that, In step 4, the training rounds for establishing the denoising diffusion model are set to 2000 rounds.

Citation Information

Patent Citations

  • Motor imagery electroencephalogram signal classification method based on iterative learning

    CN115034272A

  • Electroencephalogram signal recognition method based on language imagination and motor imagination time sequence coding

    CN115590532A