Electroencephalogram feature enhancement method, device and equipment based on discrete wavelet transform and medium
Through discrete wavelet transformation, the EEG signal is decomposed and feature enhancement is performed on the detailed signal, combined with the consistency constraint loss function, the shortcomings of the existing EEG data enhancement methods are solved, and higher model generalization and classification accuracy are achieved.
Patent Information
- Application Number
- CN202411775543.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-05
AI Technical Summary
The existing EEG data enhancement methods have problems such as possible destroying the original data characteristics, relying on data distribution proximity, and unstable training effects, which are difficult to effectively improve the generalization ability of the model.
The discrete wavelet transformation method is used to decompose the EEG signal, extract the approximate signal and detailed signal, and feature enhancement is performed on the detailed signal. Through the consistency constraint loss function, we ensure that the consistency between the prediction results of enhanced features and the original features is enhanced, thereby improving the generalization ability of the model.
It effectively avoids destroying category-related features during the enhancement process, generates more diverse features, and improves the generalization and classification accuracy of the model, especially performing better across individual tasks.
Smart Images

Figure CN119917993A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electroencephalogram (EEG), and in particular to a method, device, equipment and medium for enhancing EEG features based on discrete wavelet transform. Background Art
[0002] Brain-computer interface is a very popular research field in the field of artificial intelligence. It can help people convert brain signals into computer instructions for interacting with external devices without transmitting through traditional muscle or nerve pathways, and has broad application prospects. Non-invasive EEG signals are a commonly used physiological electrical signal in the field of brain-computer interface, which can be used in a variety of scenarios such as emotion recognition, epilepsy diagnosis, and sleep analysis. Compared with invasive EEG signals, non-invasive EEG signals have the advantages of lower acquisition difficulty, no harm to subjects, and high acceptance. They have broad application prospects in medical rehabilitation, emotion recognition and other fields, and have important research significance and value.
[0003] With the development of deep learning, data-driven neural network models have achieved good performance in multiple EEG classification tasks. However, the application of deep learning in the EEG field still has some challenges. One of the most prominent problems is the lack of high-quality large-scale data sets. The generalization ability of the model obtained by training with a small data set is difficult to guarantee. On the one hand, the EEG cap, which is the device for collecting EEG signals, can be divided into multiple channel settings such as 32 channels, 64 channels, and 128 channels, which leads to the differentiation of training data and it is difficult to directly combine multiple data sets. On the other hand, since the signal labeling of some tasks such as sleep stage diagnosis requires professional medical knowledge, only doctors can label correctly, so the labeling cost of some EEG data is relatively high. For the above reasons, compared with fields such as computer vision and natural language processing, the EEG field has always lacked a large-scale, high-quality labeled data set. In the context of the lack of high-quality data sets, researchers in the EEG field often use various data enhancement methods to improve the generalization of neural networks, ensure that the model can cope with a variety of EEG data in actual application scenarios, and avoid the decline of model performance due to the distribution difference between training data and actual application scenario data.
[0004] The existing EEG data enhancement methods all have certain shortcomings and need to be further optimized. Specifically: In the field of EEG signal classification, the main data enhancement is currently divided into two categories. The first category is rule-based enhancement of the original signal, and the second category is to increase training samples based on Generative Adversarial Networks (GANs). Rule-based enhancement methods include adding random noise, time series flipping, bandpass filtering, etc. On the one hand, this type of enhancement method has the problem of adjusting the coefficients related to the enhancement, and on the other hand, it will cause defects such as the modification of data statistical features such as mean variance and the destruction of time series features. In practical applications, it may not necessarily have a positive effect. The main content of the method based on GAN synthetic data is to train a generative neural network, sample from the distribution to generate new synthetic data by fitting the distribution of the data in the training set, and then use the synthetic data for classification model training, thereby increasing the amount of training data and improving the performance of the model. The data enhancement method based on GANs also has some shortcomings. First, GAN data synthesis may aggravate the imbalance problem when the training data categories are unbalanced; second, the GAN model synthesizes new samples based on the training data. When the distribution of the test samples is greatly different from the training samples, the model may perform poorly after training with the generated samples. In addition, due to problems such as mode collapse during GAN training, the training process is unstable.
[0005] In summary, existing EEG data enhancement methods may destroy the characteristics of the original data, rely on the distribution proximity between the original data and the test data, and have unstable training effects. There is still room for improvement. Summary of the invention
[0006] In order to solve at least one of the technical problems existing in the prior art to a certain extent, the object of the present invention is to provide a method, device, equipment and medium for enhancing EEG features based on discrete wavelet transform.
[0007] The first technical solution adopted by the present invention is:
[0008] A method for enhancing EEG features based on discrete wavelet transform comprises the following steps:
[0009] Acquire EEG data, pre-process the EEG data, and obtain EEG signals;
[0010] Perform discrete wavelet decomposition on EEG signals to obtain approximate signals and detail signals;
[0011] Slice the approximate signal and the detail signal respectively, and extract features to obtain detail signal features and approximate signal features; concatenate the detail signal features and the approximate signal features to obtain the original features;
[0012] After the detail signal features are enhanced, they are concatenated with the approximate signal features to obtain enhanced features;
[0013] The original features and the enhanced features are respectively input into the model and the model is trained; wherein, the consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
[0014] Furthermore, the obtaining of EEG data, preprocessing of the EEG data, and obtaining of EEG signals include:
[0015] The EEG data are uniformly converted into segments of a preset frequency and a preset time length as sample data;
[0016] Within each sample data, the signal of each channel is normalized according to the 95% percentile of the absolute value of the signal as the maximum value to obtain the EEG signal.
[0017] Furthermore, the step of performing discrete wavelet decomposition on the EEG signal to obtain an approximate signal and a detail signal includes:
[0018] Decompose the EEG signal into approximate signal coefficients and detail signal coefficients through discrete wavelet transform;
[0019] Based on the corresponding coefficients, the approximate signal and the detail signal are reconstructed using the inverse wavelet transform.
[0020] Furthermore, the slicing operation is performed on the approximate signal and the detail signal respectively, and feature extraction is performed to obtain detail signal features and approximate signal features, including:
[0021] Slice the approximate signal and the detail signal in the sampling dimension respectively. The length of each segment is t sampling moments, and the two adjacent segments overlap x samples.
[0022] After obtaining the slice data, each slice time sequence is passed into the feature extraction module to obtain the detail signal feature H d and approximate signal characteristics H a ; The feature extraction module consists of short-time Fourier transform and multi-layer perceptron, which is used to extract features from time series signals.
[0023] Furthermore, the detailed signal features are subjected to feature enhancement processing and then spliced with the approximate signal features to obtain enhanced features, including:
[0024] The detail signal feature H d The signal is passed into the feature enhancement module to generate new enhanced detail signal features, and the enhanced detail signal features are concatenated with the approximate signal features to obtain enhanced features;
[0025] The feature enhancement module works as follows:
[0026] First, calculate the mean and variance of the features in each channel and time slice dimension;
[0027] After obtaining the mean and variance of each channel and time slice dimension, use Gaussian distribution to model the distribution of the mean variance of each channel;
[0028] Use parameter β to adjust the distribution representing the mean and variance, and then sample new means and variances of each channel and time slice dimension from the new distribution;
[0029] The original features are renormalized using the new mean coefficient and variance coefficient to synthesize more diverse data and obtain enhanced detail signal features, denoted as
[0030] Furthermore, the inputting the original features and the enhanced features into the model respectively and training the model includes:
[0031] The original signal features and enhanced features are passed to the encoder respectively; the encoder is composed of N layers of LinearTransformer stacked end to end;
[0032] The output of the encoder is average pooled in the time dimension and then passed into the classifier to obtain the classification result.
[0033] Furthermore, the total loss of the training model includes consistency loss and classification cross entropy loss;
[0034] The consistency loss function expression is as follows:
[0035]
[0036] In the formula, Θ(H l )and They represent the model output results of the original features and enhanced features respectively, Θ represents the model; p(x l ,τ) is a Softmax operation with a temperature coefficient, and the temperature coefficient τ controls the entropy of the predicted probability result; n is the number of EEG samples in each batch during model training; x l Represents the characteristics of a single sample, and l represents the subscript of the sample (the lth sample).
[0037] The second technical solution adopted by the present invention is:
[0038] A device for enhancing electroencephalogram characteristics based on discrete wavelet transform, comprising:
[0039] A data acquisition module is used to acquire EEG data, pre-process the EEG data, and obtain EEG signals;
[0040] The signal decomposition module is used to perform discrete wavelet decomposition on the EEG signal to obtain the approximate signal and the detail signal;
[0041] The feature extraction module is used to perform slicing operations on the approximate signal and the detail signal respectively, and perform feature extraction to obtain the detail signal feature and the approximate signal feature;
[0042] A feature enhancement module is used to perform feature enhancement processing on detail signal features and then concatenate them with approximate signal features to obtain enhanced features;
[0043] The model training module is used to input the original features and the enhanced features into the model respectively to train the model; wherein, the consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
[0044] The third technical solution adopted by the present invention is:
[0045] An electronic device comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a method for enhancing EEG features based on discrete wavelet transform as described above.
[0046] The fourth technical solution adopted by the present invention is:
[0047] A computer-readable storage medium, wherein at least one instruction, at least one program, code set or instruction set is stored in the storage medium, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement a method for enhancing EEG features based on discrete wavelet transform as described above.
[0048] The fifth technical solution adopted by the present invention is:
[0049] A computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned method for enhancing EEG features based on discrete wavelet transform.
[0050] The beneficial effects of the present invention are as follows: the present invention uses discrete wavelet transform to decompose the signal and then enhance it, thereby avoiding the destruction of category-related features by enhancement. In the enhancement scheme, a scheme for controlling statistical features is selected to amplify the feature distribution to provide a larger feature sampling space and synthesize more diverse enhanced sample data. Finally, the consistency constraint loss is introduced to fully guide the model to predict the consistency of the output of the enhanced feature and the original feature, thereby more effectively improving the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the embodiments of the present invention or the drawings of related technical solutions in the prior art are introduced below. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 It is a schematic diagram of EEG data representation;
[0053] Figure 2 is a schematic diagram of an example of discrete wavelet transform decomposition of EEG data;
[0054] Figure 3 This is a schematic diagram of the Linear Transformer structure;
[0055] Figure 4 It is a schematic diagram of the overall structure of the model of an embodiment of the present invention;
[0056] Figure 5 It is a flowchart of the steps of a method for enhancing EEG features based on discrete wavelet transform in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limitations of the present invention. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0058] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0059] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0060] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0061] Technical explanation:
[0062] (1) EEG signal data
[0063] like Figure 1 The figure shows EEG data, which is generally collected by an EEG cap. The number of channels and sampling frequency are determined by the hardware and parameter settings of the EEG cap. Define the EEG signal as X∈R C×T , where C is the number of channels and T is the time frame. T is obtained by multiplying the sampling frequency by the sampling duration.
[0064] (2) Discrete wavelet transform and inverse discrete wavelet transform
[0065] See also Figure 2 Discrete Wavelet Transform (DWT) decomposes the time series signal into approximate signal coefficients and detail signal coefficients from the frequency perspective. During the transformation process, the original signal is input into a high-pass filter to output detail signal coefficients, and input into a low-pass filter to output approximate signal coefficients. The bandpass range of the filter is determined by the wavelet basis category selected by the discrete wavelet transform and the sampling frequency of the input signal. The specific transformation process can be expressed as the following formula:
[0066] C Al ,C Dl =DWT(X)
[0067] C Dl =h★X
[0068] CAl =g★X
[0069] Where X is the input signal, C Al ,C Dl Represents the approximate signal coefficient and the detail signal coefficient. h and g correspond to the high-pass filter and the low-pass filter respectively.
[0070] The inverse wavelet transform can reconstruct the corresponding signal components through the signal coefficients. For example, the approximate signal coefficients correspond to the approximate time series signals, and the detail signal coefficients correspond to the detail time series signals. The specific formula is as follows:
[0071] X=IDWT(C Al ,C Dl )
[0072] =h′★C Dl +g′★C Al ,
[0073] X detail =IDWT(C Dl ,0)
[0074] =h′★C Dl ,
[0075] X appro =IDWR(0,C Al )
[0076] =g′★C Al ,
[0077] h′ and g′ correspond to the symmetrical filter of high-pass filter and low-pass filter, X detail With X appro Represents detail signal and approximate signal. Figure 2 This is an example of decomposing a continuous EEG signal into detail signals and approximate signals. Figure 2 Original Signal represents the original signal, Approx Signal represents the approximate signal, and Detail Signal represents the detail signal. It can be clearly seen that the approximated signal is closer to the original signal fluctuation and contains the main information of the original signal, while the detail signal has a larger fluctuation frequency and may contain more noise.
[0078] (3) Linear Attention Layer (Linear Transformer)
[0079] The Transformer model uses a self-attention mechanism, and its computational complexity is usually quadratic with the input length, while the computational complexity of the Linear Transformer is linear. The main difference between the Linear Transformer and the Transformer is that it uses a linear attention mechanism to reduce the computational complexity through a low-rank matrix. is the input feature of the neural network, W K ,W V , is the KVQ matrix in the attention mechanism, For a low-rank matrix, the calculation process of linear attention is as follows:
[0080]
[0081] The Linear Transformer is mainly composed of a linear attention layer, a fully connected layer, and a normalization layer. The specific structure is as follows Figure 3 . Since EEG signals have the characteristics of high temporal resolution and low signal-to-noise ratio, the information in EEG data is relatively sparse compared to text, image and other modalities. Therefore, using Linear Transformer to extract data features can still achieve comparable results to using Transformer. Therefore, using Linear Transformer as a neural network layer in EEG tasks can achieve a balance between accuracy and speed.
[0082] (4) Rule-based EEG data enhancement method
[0083] Common methods for rule-based enhancement of EEG time series data are divided into time domain data enhancement and frequency domain data enhancement. In the time domain, common enhancement methods include randomly swapping the order of signal segments, randomly adding Gaussian noise, and randomly setting some signals to zero. In the frequency domain, enhancement methods include randomly setting high-frequency or low-frequency parts to zero. As the data set and the enhancement method used are different, these enhancement methods require multiple attempts to adjust the parameters of the model.
[0084] On the one hand, the rule-based EEG data enhancement method has the problem of needing to adjust the enhancement strategy and enhancement coefficient. Inappropriate enhancement methods and coefficients may lead to a decrease in the classification effect of the model. On the other hand, this method has defects such as the modification of data statistical characteristics such as mean variance and destruction of time series characteristics, which leads to a greater difference between the performance of the model on the training set and the performance on the test set, and cannot meet the needs of improving the generalization ability of the model.
[0085] (5) Generative EEG data enhancement method
[0086] The production-based EEG data enhancement method increases training samples based on Generative Adversarial Networks (GANs). GAN contains two competing neural networks: the generator and the discriminator. The two sub-networks compete with each other during the training process to optimize the synthetic data. The goal of the generator is to generate data that is as realistic as possible. It receives random noise as input and converts it into data through a neural network, which should ideally be indistinguishable from real data. The task of the discriminator is to distinguish between the fake data generated by the generator and the real data in the real data set. It receives input data and outputs a probability indicating the possibility that the input data is real data. In the field of EEG, deep convolutional networks are often used as the network architecture of the generator and the discriminator. The data generated by the generator is used to train the classification model, thereby improving the classification accuracy of the classification model.
[0087] The main content of the method of synthesizing data based on GAN is to train a generative neural network, fit the distribution of the data in the training set, and generate new synthetic data by sampling from the distribution. There are also some shortcomings. First, GAN data synthesis may aggravate the imbalance problem when the training data categories are unbalanced. During the training process, a large number of categories will have a greater impact on the learning of the generative model, causing the model to be more biased towards generating a certain type of data. Secondly, the GAN model synthesizes new samples based on training data. When the distribution of the test samples is significantly different from that of the training samples, the model may perform poorly after training with the generated samples. In addition, due to problems such as mode collapse during the training process of GAN, the training process is unstable.
[0088] At present, traditional data enhancement methods in the field of EEG have the disadvantages of changing the statistical characteristics of data and destroying the original characteristics, while the GAN-based method has the disadvantages of training difficulties and cannot handle the distribution offset between the test set and the training set. In view of the above problems, the present invention proposes an EEG feature enhancement method based on discrete wavelet transform to improve the robustness of the model, so that the model has better performance in cross-individual tasks.
[0089] In order to avoid directly destroying the features of the original data and retain the category-related information of the original data as much as possible, the present invention designs a discrete wavelet decomposition module to decompose the original signal into an approximate signal and a detail signal, and perform feature enhancement on the detail signal. In the feature enhancement module, the statistical data of the feature is adjusted and then sampled from the new statistical features to obtain enhanced detail signal features. The original signal features are obtained by concatenating the approximate signal features and the detail signal features, and the enhanced features are obtained by concatenating the approximate signal features and the enhanced detail signal features. The consistency loss constraint is introduced to enhance the prediction results of the features and the original signal features, thereby improving the generalization of the model to different data.
[0090] Example 1
[0091] like Figure 4 and Figure 5 As shown, this embodiment provides an EEG feature enhancement method based on discrete wavelet transform, which specifically includes the following steps:
[0092] S1. Obtain EEG data, pre-process the EEG data, and obtain EEG signals.
[0093] In some embodiments, during the data set preprocessing stage, the EEG data are uniformly converted into 200 Hz, 10 second segments. Within each sample data, the EEG signals of each channel are normalized according to the 95% percentile of the absolute value of the signal as the maximum value.
[0094] S2. Perform discrete wavelet decomposition on the EEG signal to obtain approximate signal and detail signal.
[0095] See also Figure 4 ,Inside the model, the signal is first decomposed into an approximate signal and a detail signal through a discrete wavelet decomposition module. Specifically, the EEG time series signal is first decomposed into an approximate signal coefficient and a detail signal coefficient through discrete wavelet transform. Based on the corresponding coefficients, the approximate signal and the detail signal are reconstructed using the inverse wavelet transform.
[0096] S3. Slice the approximate signal and the detail signal respectively, and perform feature extraction to obtain detail signal features and approximate signal features.
[0097] After obtaining the approximate signal and the detail signal, the two signals are sliced separately, and feature extraction is performed through Fourier transform and fully connected network.
[0098] In an optional implementation, step S3 includes the following steps:
[0099] S31, respectively obtain the approximate signal and the detail signal. Slice the two signals in the sampling dimension, each segment has a length of t sampling moments, and the two adjacent segments overlap z samplings. In this patent, t is 200 and z is 100. For the input signal X detail ,X appro ∈R C×T It can be divided into S[i,(tz)(j-1):(tz)(j-1)+t], where i represents the channel and j represents the time series number of the slice.
[0100] S32. After obtaining the slice data, each slice time series is passed to the feature extraction module. The feature extraction module is composed of short-time Fourier transform and multi-layer perceptron, which can extract features from the time series signal. The feature corresponding to the detail signal is Hd , the approximate signal characteristic is H a .
[0101] S4. After performing feature enhancement processing on the detail signal features, the feature enhancement processing is performed on the detail signal features and then concatenated with the approximate signal features to obtain enhanced features.
[0102] Detailed signal characteristics H d After being passed into the feature enhancement module, a new enhanced detail signal feature will be generated, and the enhanced feature can be obtained by splicing the enhanced detail signal feature and the approximate signal feature.
[0103] Specifically, in the feature enhancement module, the mean and variance of the features in each channel and time slice dimension are first calculated, and the calculation expression is as follows:
[0104]
[0105] B m ,D n Represents the batch dimension and feature dimension, C i ,P j Corresponding to the channel dimension and the time series segment dimension.
[0106] After obtaining the mean and variance of each channel and time slice dimension, use Gaussian distribution to model the distribution of the mean variance of each channel. The specific calculation method is as follows:
[0107]
[0108] Next, we use the parameter β to adjust the distribution representing the mean and variance, and then sample the new mean and variance of each channel and time slice dimension from the new distribution. When β>1, the feature distribution space can be expanded:
[0109]
[0110] Use the new mean coefficient and variance coefficient to renormalize the original features to synthesize more diverse data and improve the robustness of the model:
[0111]
[0112] That is, the enhanced detail signal characteristics.
[0113] S5. Input the original features and the enhanced features into the model respectively, and train the model; wherein, a consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
[0114] The original signal feature is obtained by splicing the similar signal feature and the detail signal feature, and the enhanced feature is obtained by splicing the similar signal feature and the enhanced detail signal feature.
[0115] The original signal features and the enhanced features are respectively transmitted to the encoder. The encoder is formed by stacking N layers of LinearTransformers connected end to end. In this embodiment, the number of layers N=4 is selected.
[0116] The output of the encoder is average pooled in the time dimension and then passed into the fully connected layer to obtain the classification result. The cross entropy loss function is calculated based on the classification result of the original signal features predicted by the model and the category label of the signal.
[0117] This embodiment also refers to related work and introduces consistency loss to constrain the prediction results of enhanced features and original signal features to improve the generalization of the model to different data. The consistency loss function expression is as follows:
[0118]
[0119] In the formula, Θ(H l )and They represent the model output results of the original features and enhanced features respectively, and Θ represents the model. p(x l ,τ) is a Softmax operation with a temperature coefficient. The temperature coefficient τ controls the entropy of the predicted probability result. The τ selected in this embodiment is The entropy of the output of the enhanced feature prediction is controlled to be smaller when it is 0.5 or 1.
[0120] The final model training loss function is the weighted sum of the cross entropy loss function and the consistency loss function.
[0121] Experimental verification: The method of the present invention was experimented on the TUAB and TUEV EEG signal datasets. The TUAB dataset is mainly classified into normal EEG data and abnormal EEG data. TUEV is a 6-category dataset for monitoring and evaluating epilepsy diseases, including spikes and sharp waves (SPSW), generalized periodic epileptiform discharges (GPED), periodic lateralized epileptiform discharges (PLED), eye movements (EYEM), artifacts (ARTF) and background (BCKG). The model has a balanced accuracy (Balance Accuracy) of 80.01% on the TUAB dataset, an AUC index of 88.71%, and an AUROC of 88.56%. The model has a balanced accuracy of 49.78% on the TUEV dataset, a kappa index of 54.38%, and an F1 index of 76.54%.
[0122] In summary, compared with the prior art, the present invention has the following advantages and beneficial effects:
[0123] (1) The present invention solves the problem that the effect of current enhancement methods is greatly affected by differences in data distribution. Through discrete wavelet decomposition, feature enhancement, and consistency constraints, more diverse features are generated, the generalization of the model is enhanced, and higher classification accuracy is achieved. Other data enhancement schemes directly enhance or generate the original signal, which may destroy category-related features, or fail to take into account the diversity of enhancement and the invariance of sample categories, resulting in category changes in the original signal when the degree of enhancement is large. This scheme splits the signal into a contour signal that is strongly associated with the category information and a detail signal that is weakly associated with the category. Data enhancement is performed on the detail signal, which can achieve a balance between the diversity of enhancement and the category invariance of the enhanced samples, and can well generate correct enhanced samples, thereby improving the generalization ability of the model.
[0124] (2) The present invention uses discrete wavelet transform and inverse transform to split and reconstruct EEG time series signals, splitting the EEG into detail signals and approximate signals, and using different feature extractors to perform feature mining on the two different levels of signals. Existing EEG data is often used as a whole for feature extraction in time series, which ignores the difference in information contained in contour signals and approximate signals. Splitting the signal and using different feature extractors for extraction helps the extractor focus on the unique information of each component and can more effectively mine features at different levels.
[0125] (3) The present invention adjusts the mean and variance of the distribution of the EEG detail time series signal features obtained by splitting to achieve feature enhancement. The distribution of the features of each EEG channel in the time series dimension is modeled using Gaussian distribution, and new detail signal features are synthesized by adjusting the mean variance statistical characteristics of the distribution to achieve feature data enhancement. Most of the existing time series data enhancement methods rely on directly enhancing the data in the data dimension, which may destroy the features of the original data and may also cause changes in the distribution differences of the data. Such problems can be avoided by manipulating the distribution of statistical indicators of the features to achieve data enhancement. In addition, the adjustable distribution amplification parameters can further adjust the intensity of the enhancement to maximize the enhancement effect.
[0126] In general, the advantage of the present invention is that it solves some of the difficulties in current EEG data enhancement and proposes a data enhancement scheme that is easy to train and has little generalization effect on data distribution differences. Taking into account that the signal contains category-related information and category-irrelevant information, the signal is decomposed and then enhanced using discrete wavelet transform to avoid destroying category-related features during enhancement. In the enhancement scheme, a scheme for controlling statistical features is selected to amplify the feature distribution to provide a larger feature sampling space and synthesize more diverse enhanced sample data. Finally, the consistency constraint loss is introduced to fully guide the model's prediction results for the consistency of the enhanced features and the original features output, thereby more effectively improving the generalization ability of the model. The above three modules can greatly improve the EEG signal classification performance of the model and promote the practical application of EEG classification algorithms.
[0127] Example 2
[0128] This embodiment provides an EEG feature enhancement device based on discrete wavelet transform, comprising:
[0129] A data acquisition module is used to acquire EEG data, pre-process the EEG data, and obtain EEG signals;
[0130] The signal decomposition module is used to perform discrete wavelet decomposition on the EEG signal to obtain the approximate signal and the detail signal;
[0131] The feature extraction module is used to perform slicing operations on the approximate signal and the detail signal respectively, and perform feature extraction to obtain the detail signal feature and the approximate signal feature;
[0132] A feature enhancement module is used to perform feature enhancement processing on detail signal features and then concatenate them with approximate signal features to obtain enhanced features;
[0133] The model training module is used to input the original features and the enhanced features into the model respectively to train the model; wherein, the consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
[0134] Since the device is an EEG feature enhancement device based on discrete wavelet transform in an embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0135] Example 3
[0136] An embodiment of the present invention further provides an electronic device, the electronic device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the following Figure 5A method for enhancing EEG features based on discrete wavelet transform is shown in FIG.
[0137] It is understood that the memory may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory may be used to store instructions, programs, codes, code sets, or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data created according to the use of the server, etc.
[0138] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect the various parts of the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or a combination of a central processing unit (CPU) and a modem. Among them, the CPU mainly processes the operating system and application programs; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented separately through a chip.
[0139] Since the electronic device is an electronic device corresponding to the EEG feature enhancement method based on discrete wavelet transform in an embodiment of the present invention, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0140] Example 4
[0141] The embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement the following Figure 5 A method for enhancing EEG features based on discrete wavelet transform is shown in FIG.
[0142] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0143] Since the storage medium is a storage medium corresponding to an EEG feature enhancement method based on discrete wavelet transform in an embodiment of the present invention, and the principle of solving the problem by the storage medium is similar to that of the method, the implementation of the storage medium can refer to the implementation process of the above-mentioned method embodiment, and the repeated parts will not be repeated.
[0144] Example 5
[0145] In some possible implementations, various aspects of the method of the embodiment of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the EEG feature enhancement method based on discrete wavelet transform according to various exemplary embodiments of the present application described above in this specification. Among them, the executable computer program code or "code" for executing each embodiment can be written in a high-level programming language such as C, C++, C#, Smalltalk, Java, JavaScript, Visual Basic, structured query language (e.g., Transact-SQL), Perl, or in various other programming languages.
[0146] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0147] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0148] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable ordinary technicians in the field to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made based on the essence of the content of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for enhancing EEG features based on discrete wavelet transform, characterized in that: The following steps are involved: Acquire EEG data, pre-process the EEG data, and obtain EEG signals; Perform discrete wavelet decomposition on EEG signals to obtain approximate signals and detail signals; Slicing the approximate signal and the detail signal respectively, and extracting features to obtain the detail signal features and the approximate signal features; After the detailed signal features are enhanced, they are concatenated with the approximate signal features to obtain enhanced features; The original features and the enhanced features are input into the model respectively, and the model is trained; wherein, the consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
2. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The step of acquiring EEG data and preprocessing the EEG data to obtain EEG signals includes: The EEG data are uniformly converted into segments of a preset frequency and a preset time length as sample data; Within each sample data, the signal of each channel is normalized according to the 95% percentile of the absolute value of the signal as the maximum value to obtain the EEG signal.
3. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The step of performing discrete wavelet decomposition on the EEG signal to obtain an approximate signal and a detail signal includes: Decompose the EEG signal into approximate signal coefficients and detail signal coefficients through discrete wavelet transform; Based on the corresponding coefficients, the approximate signal and the detail signal are reconstructed using the inverse wavelet transform.
4. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The slicing operation is performed on the approximate signal and the detail signal respectively, and feature extraction is performed to obtain the detail signal feature and the approximate signal feature, including: Slice the approximate signal and the detail signal in the sampling dimension respectively. The length of each segment is t sampling moments, and the two adjacent segments overlap z samples. After obtaining the slice data, each slice time sequence is passed into the feature extraction module to obtain the detail signal feature H d and approximate signal characteristics H a ; The feature extraction module consists of short-time Fourier transform and multi-layer perceptron, which is used to extract features from time series signals.
5. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The detailed signal features are subjected to feature enhancement processing and then spliced with the approximate signal features to obtain enhanced features, including: The detail signal feature H d The signal is passed into the feature enhancement module to generate new enhanced detail signal features, and the enhanced detail signal features are concatenated with the approximate signal features to obtain enhanced features; The feature enhancement module works as follows: First, calculate the mean and variance of the features in each channel and time slice dimension; After obtaining the mean and variance of each channel and time slice dimension, use Gaussian distribution to model the distribution of the mean variance of each channel; Use parameter β to adjust the distribution representing the mean and variance, and then sample new means and variances of each channel and time slice dimension from the new distribution; The original features are renormalized using the new mean coefficient and variance coefficient to synthesize more diverse data and obtain enhanced detail signal features, denoted as 6. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The original features and the enhanced features are input into the model respectively to train the model, including: The original signal features and enhanced features are passed to the encoder respectively; the encoder is composed of N layers of LinearTransformer stacked end to end; The output of the encoder is average pooled in the time dimension and then passed into the classifier to obtain the classification result.
7. The method for enhancing EEG features based on discrete wavelet transform according to claim 1, characterized in that: The total loss of the training model includes consistency loss and classification cross entropy loss; The consistency loss function expression is as follows: In the formula, Θ(H l )and They represent the model output results of the original features and enhanced features respectively, Θ represents the model; p(x l ,τ) is a Softmax operation with a temperature coefficient, and the temperature coefficient τ controls the entropy of the predicted probability result; n is the number of EEG samples in each batch during model training; x l Represents the characteristics of the lth sample.
8. A device for enhancing EEG features based on discrete wavelet transform, characterized in that: include: A data acquisition module is used to acquire EEG data, pre-process the EEG data, and obtain EEG signals; The signal decomposition module is used to perform discrete wavelet decomposition on the EEG signal to obtain the approximate signal and the detail signal; The feature extraction module is used to perform slicing operations on the approximate signal and the detail signal respectively, and perform feature extraction to obtain the detail signal feature and the approximate signal feature; A feature enhancement module is used to perform feature enhancement processing on detail signal features and then concatenate them with approximate signal features to obtain enhanced features; The model training module is used to input the original features and the enhanced features into the model respectively to train the model; wherein, the consistency constraint is used to make the classification results of the original features and the classification results of the enhanced features close to each other.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Generative adversarial network electroencephalogram data amplification method and system based on 2K standard classifier
CN117312949A
Method and apparatus for determining heart rate variability using wavelet transformation
US20120123232A1