A brain electrical signal denoising model training method, a denoising method and a data enhancement method
By combining a hybrid framework of generative adversarial networks and variational autoencoders, along with latent space alignment loss and adversarial training, the robustness and generalization ability of EEG signal denoising technology are addressed. This approach achieves efficient denoising and data augmentation in noisy environments, improving decoding accuracy and stability.
Patent Information
- Application Number
- CN202610308697.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-06-23
Smart Images

Figure CN122262473A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of brain-computer interface and intelligent signal processing technology, and more specifically, relates to a method for training a denoising model of electroencephalogram (EEG) signals, a denoising method, and a data augmentation method. Background Technology
[0002] Brain-computer interface (BCI) technology establishes a direct information exchange channel between the human brain and external devices, playing a crucial role in medical assistance and human-computer interaction. Among various non-invasive signal acquisition methods, electroencephalography (EEG) has been widely studied and applied due to its advantages such as portability, low cost, and high temporal resolution. However, reviews have also pointed out that cross-subject / cross-session distribution differences and noise interference can significantly limit the generalization ability of EEG brain-computer interface models.
[0003] Steady-State Visual Evoked Potential (SSVEP) is one of the more mature paradigms in EEG brain-computer interfaces. A typical SSVEP system presents visual stimuli of different frequencies and phases, inducing a steady-state response in the visual cortex related to the stimulus frequency. Target recognition is achieved by matching the frequency / phase characteristics between the EEG signal and a reference template. Classical SSVEP decoding methods are mostly based on correlation analysis frameworks. For example, Canonical Correlation Analysis (CCA) has been introduced into SSVEP recognition and formed a basic decoding scheme. Building upon this, Filter Bank CCA (FBCCA) improves recognition performance through multi-subband fusion. Furthermore, Task-Related Component Analysis (TRCA) enhances task-related components and suppresses background noise by maximizing repeatability across similar trials, and has been used in SSVEP applications such as high-speed spellers with good results.
[0004] However, EEG signals are weak in amplitude and have a low signal-to-noise ratio, making them susceptible to contamination from multiple sources of noise and artifacts during actual acquisition. These include artifacts caused by eye movements / blinking, electromyography (EMG) artifacts caused by facial muscles, ECG-related artifacts, baseline drift, and electromagnetic interference, all of which significantly degrade data quality and lead to performance degradation in SSVEP decoding. To improve EEG quality, traditional denoising methods primarily process the signal at the signal level. Examples include using independent component analysis combined with multivariate empirical mode decomposition (ECD) to remove ECG artifacts, wavelet transform methods to detect and eliminate eye movement artifacts, and multi-channel ECG / EMG artifact removal methods based on morphological frequency filtering. Additionally, some studies have combined ECD with CCA for EMG artifact suppression in few-channel EEG. However, the aforementioned traditional methods often rely on strong prior assumptions and artificial rules, and are sensitive to parameter settings. When the noise has non-stationary or nonlinear characteristics or overlaps with the task-related frequency band, it is difficult to achieve both "sufficient noise suppression" and "preservation of SSVEP frequency discrimination information" at the same time. Furthermore, they are prone to insufficient robustness under different subjects, different sessions, and different acquisition conditions.
[0005] In recent years, data-driven deep learning denoising methods have attracted attention. Convolutional neural networks (CNNs) have been widely used for EEG artifact removal and denoising reconstruction, with examples including convolutional models for removing EMG artifacts, end-to-end one-dimensional residual convolutional denoising models, and denoising schemes based on convolutional autoencoders. Furthermore, researchers have constructed datasets and benchmarks for evaluating deep denoising algorithms. Further, to enhance the modeling ability for temporal dynamics and long-range dependencies, some works have introduced convolutional-recurrent hybrid structures to achieve stronger artifact suppression and signal reconstruction, or employed Transformer structures for single-channel EEG artifact removal. Meanwhile, generative models have provided new technical pathways for EEG denoising: generative adversarial networks (GANs) achieve distribution-level constraints through adversarial training, used for EMG artifact removal, or for EEG denoising based on Wasserstein GANs.
[0006] However, the EEG signals of steady-state visual evoked potentials (SVPs) acquired in practice are easily affected by multi-source noise, including electrooculography (EOG), electromyography (EMG), power line interference, baseline drift, and environmental electromagnetic noise. Furthermore, different subjects, different conversations, and different devices and scenarios can cause significant distribution shifts. Existing denoising methods are often sensitive to noise conditions and struggle to maintain stable and effective denoising performance under various noise conditions and their combinations in the time, spatial (channel), and frequency domains, leading to decreased downstream decoding accuracy and stability. Existing deep denoising networks may tend to directly copy the input signal during training, resulting in a highly similar output to the input, with noise not being effectively removed. This leads to insignificant denoising effects and limited improvement in decoding. This problem is more likely to occur when ideal clean ground truth values are lacking or reference signals are incomplete, making it difficult for the denoising model to learn the effective representation required for "noise-neural information" decoupling. In practical applications, steady-state visual evoked potential systems often face the problem of both low signal quality and limited available labeled data.
[0007] It is evident that existing EEG signal denoising technologies suffer from technical problems such as insufficient denoising robustness and generalization ability, and decreased decoding accuracy and stability. Summary of the Invention
[0008] In view of the above-mentioned defects or improvement needs of existing technologies, this invention provides a method for training a denoising model of EEG signals, a denoising method, and a data augmentation method, thereby solving the technical problems of insufficient denoising robustness and generalization ability, and decreased decoding accuracy and stability of existing EEG signal denoising technologies.
[0009] To achieve the above objectives, according to a first aspect of the present invention, a method for training a denoising model of electroencephalogram (EEG) signals is provided, comprising: Noise is added to the original EEG signal to obtain a noisy signal. The original EEG signal is then filtered to obtain a reference signal. The true category label of the original EEG signal, the noisy signal, and the reference signal are combined to form a training sample. Multiple training samples are combined to form a training set. A denoising model is trained using a training set. The denoising model includes a generator and a discriminator. The generator includes an encoder, latent space aligned blocks, and a decoder. The discriminator includes a feature extractor and a classifier. The classifier includes a domain classifier and a category classifier. The denoising model is trained in the following manner: The training samples are input into the denoising model. The encoder encodes the noisy signal to obtain the encoded signal. The latent space alignment block calculates the statistical distribution of the noisy signal and the reference signal to obtain the statistics of the noisy signal and the reference signal. The KL divergence between the statistics of the noisy signal and the reference signal is used as the latent space alignment loss. The decoder decodes the encoded signal to obtain the denoised signal. The weighted sum of the latent space alignment loss and the generator loss is used as the generator loss function. The reference signal and the denoised signal are input into the discriminator. The feature extractor extracts features from the reference signal and the denoised signal respectively to obtain reference features and denoised features. The domain classifier performs domain discrimination based on the reference features and denoised features and calculates the domain adversarial loss. The category classifier uses the denoised features to predict the category and calculates the cross-entropy loss with the true category label of the original EEG signal to obtain the category supervision loss. The weighted sum of the domain adversarial loss and the category supervision loss is used as the discriminator loss function. First, fix the parameters of the generator and update the parameters of the discriminator by minimizing the discriminator loss function. Then, fix the parameters of the discriminator and update the parameters of the generator by minimizing the generator loss function. Train the denoising model until it converges or reaches the maximum number of training iterations to obtain the trained denoising model.
[0010] Furthermore, the latent space alignment block calculates the mean and variance of the encoded signal in the channel dimension to obtain the noisy signal statistics in the channel dimension; the latent space alignment block calculates the mean and variance of the output signal after the reference signal is input to the encoder in the channel dimension to obtain the reference signal statistics in the channel dimension; the latent space alignment block calculates the mean and variance of the encoded signal in the time dimension to obtain the noisy signal statistics in the time dimension; the latent space alignment block calculates the mean and variance of the output signal after the reference signal is input to the encoder in the time dimension to obtain the reference signal statistics in the time dimension. The weighted sum of the KL divergence between the noisy signal statistics in the channel dimension and the reference signal statistics, and the KL divergence between the noisy signal statistics in the time dimension and the reference signal statistics, is used as the latent space alignment loss.
[0011] Furthermore, the latent space alignment loss is: ,
[0012] in, Indicates in dimension Latent space alignment loss, and These represent the latent space alignment loss in the channel dimension and the time dimension, respectively. This represents the latent space alignment loss. Indicates channel dimension, Indicates the time dimension. Indicates in dimension The mean in the statistics of noisy signals. Indicates in dimension The variance in the statistics of noisy signals Indicates in dimension The mean in the upper reference signal statistics, Indicates in dimension The variance in the upper reference signal statistics This indicates the expected operation.
[0013] Furthermore, the encoder uses spatial convolutional layers, temporal convolutional layers, and a Transformer encoder to perform spatial convolution, temporal convolution, spatiotemporal feature extraction, and temporal information extraction on the noisy signal to obtain the encoded signal; the decoder uses temporal deconvolutional layers, spatial deconvolutional layers, and depth convolutional layers to perform temporal deconvolution, spatial deconvolution, and depth convolution on the encoded signal to obtain the denoised signal.
[0014] Furthermore, the generator loss includes generator adversarial loss. Generator classification loss and signal reconstruction loss ;in, Represents the denoised signal Reference signal The probability, Indicates in the denoised signal Expectation operation on the distribution Represents the denoised signal The category probability distribution, This indicates the true category label of the raw EEG signal. This represents the cross-entropy loss function.
[0015] Furthermore, the domain adversarial loss The category of supervised loss ,in, Indicates reference signal Reference signal The probability, Indicates reference signal The category probability distribution, Indicates the reference signal Expectation operation on the distribution.
[0016] According to a second aspect of the present invention, a method for denoising electroencephalogram (EEG) signals is provided, comprising: The EEG signal is input into a denoising model trained by an EEG signal denoising model training method, and a generator is used to denoise the signal, outputting a denoised signal.
[0017] According to a third aspect of the present invention, a method for data augmentation of electroencephalogram (EEG) signals is provided, comprising: The noisy signal is input into a denoising model trained by a denoising model training method for EEG signals. The output denoised signal is then concatenated with the noisy signal to obtain a data-augmented training set.
[0018] Furthermore, the augmented training set is used to retrain the feature extractor and class classifier in the denoising model.
[0019] According to a fourth aspect of the present invention, a computer product is provided that, when in operation, enables the computer to perform a method for denoising electroencephalogram (EEG) signals or a method for data augmentation of EEG signals.
[0020] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: (1) Traditional signal denoising methods typically employ an end-to-end mapping approach, directly inputting the noisy signal into the denoising model and obtaining the denoising result by minimizing the signal reconstruction error. In this type of method, model training mainly relies on signal-level reconstruction constraints to make the output signal as close as possible to the reference signal in terms of numerical or waveform. However, this type of method only focuses on signal reconstruction error and is prone to degradation phenomena such as identity mapping during training, i.e., the model tends to simply replicate the structure of the input signal, thus limiting the denoising capability. Furthermore, the model's generalization ability and robustness are weak when the noise distribution changes or complex noise conditions exist. Unlike traditional methods, the proposed DenoNet constructs a denoising model within a generative adversarial learning framework. By introducing an adversarial training mechanism between the generator and the discriminator, the authenticity of the generated signal is constrained. At the same time, a latent space alignment constraint is designed during model training to ensure that the latent representation output by the generator is consistent with the latent representation of the reference signal in terms of statistical properties. In this way, the generated signal is made closer to the real signal at the level of high-level semantic features or structural representation, thereby effectively alleviating the training degradation problem and improving the model's adaptability to different noise distributions. Furthermore, latent space alignment constraints can enhance the stability of the model at the feature representation level, enabling the denoising results to maintain good robustness when facing distribution shifts or complex noise environments (electroencephalogram signals of steady-state visual evoked potentials that are easily affected by multi-source noise such as electrooculogram, electromyogram, power frequency interference, baseline drift and environmental electromagnetic noise, and which can cause significant distribution shifts due to different subjects, different conversations, different devices and scenarios), thereby improving the downstream decoding accuracy and stability.
[0021] (2) The latent space alignment block of this invention calculates the statistics of the noisy signal and the reference signal in the channel and time dimensions respectively, realizing the alignment of the channel and time dimensions. Without increasing the complexity of the model, it significantly improves the convergence, stability and output quality of the generated model. In the latent space alignment loss, the KL divergence between the statistics of the noisy signal and the statistics of the reference signal is used as the optimization objective. KL divergence (Kullback-Leibler Divergence) is an asymmetric information entropy measure that measures the difference between two probability distributions. In latent space alignment, KL divergence is not a simple "distance metric" but a mathematical carrier of structured prior constraints. It has the characteristics of asymmetry, high computational efficiency and strong channel / time decoupling ability. This invention uses a simplified calculation form of KL divergence under Gaussian distribution. By minimizing this loss, the distribution of the noisy signal can be forced to align with the reference signal, realizing the regularization of the latent space, avoiding mode collapse, and improving the stability and output quality of the denoising model.
[0022] (3) In this invention, the generator adopts an encoder-decoder architecture. Spatial convolution can effectively learn spatial patterns in EEG signals, and temporal convolution can learn key temporal patterns in EEG signals. The Transformer encoder introduces multi-head attention on the low-resolution time axis to capture long-range dependencies and effectively utilizes the long-range temporal information extraction capability of Transformer. This module is added after convolution to extract local spatiotemporal features and long-range temporal information at the same time.
[0023] (4) In this invention, the generator adversarial loss is used to measure the degree of authenticity of the generated samples in the discriminator. By minimizing this loss function, the generator can be prompted to generate samples that are closer to the real data distribution, making it difficult for the discriminator to distinguish their authenticity. The generator classification loss is used to constrain the consistency of the generated samples in the class space. Through this loss function, the samples generated by the generator can be prompted to maintain the correct class semantic information. The signal reconstruction loss is used to measure the difference between the generated samples and the real samples. By minimizing this loss function, the generated samples can be made closer to the real samples in terms of numerical value.
[0024] (5) In this invention, the domain classifier calculates the adversarial loss to confuse the generated signal and the reference signal, helping to align the two when they cannot be distinguished, thus realizing adversarial training based on GAN; the category classifier uses the real category label to calculate the cross-entropy loss between the predicted value (denoised signal) and the real category label, so that the generated signal has good discriminativeness and task relevance. The domain adversarial loss is used to measure the discriminator's ability to distinguish between real samples and generated samples, and the discriminator network parameters are optimized by minimizing this loss function. By minimizing the adversarial loss function, the discriminator can continuously improve its ability to distinguish between real samples and generated samples, thereby promoting the generation model to generate samples that are closer to the real data distribution during adversarial training. The category supervision loss is used to measure the discriminator's prediction error on the category recognition task. Through this loss function, the discriminator's classification ability on real samples and generated samples can be constrained at the same time.
[0025] (6) Existing methods typically design denoising and data augmentation separately. Denoising alone may not alleviate the generalization problem caused by insufficient samples, while simple augmentation may introduce distortion or destroy the key frequency discrimination information of steady-state visual evoked potentials, thus affecting the decoding effect. The method of this invention has been experimentally proven to be applicable to various noise environments, including: temporal noise, spatial noise, frequency noise, random noise, and fused noise formed by the superposition of multiple noises. Therefore, this invention has good noise adaptability and can be widely applied to signal processing and signal decoding tasks in complex environments. In this invention, the denoised output can be further used as augmented samples to participate in the training of downstream classifiers, thereby improving the robustness and generalization ability of signal classification or decoding tasks, and realizing the integrated improvement of "denoising + augmentation". Attached Figure Description
[0026] Figure 1 This is a schematic diagram of the overall framework of the denoising model provided in the embodiments of the present invention; Figure 2 This is a detailed diagram of the model architecture of the generator and discriminator provided in the embodiments of the present invention; Figure 3 (a) is a schematic diagram of the time-domain noise model provided in an embodiment of the present invention; Figure 3 (b) is a schematic diagram of the spatial noise model provided in an embodiment of the present invention; Figure 3 (c) is a schematic diagram of the frequency domain noise model provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of frequency domain noise injection provided in an embodiment of the present invention; Figure 5 (a) is a schematic diagram of the traditional noise reduction method provided in the embodiment of the present invention; Figure 5(b) is a schematic diagram of the noise reduction method provided in an embodiment of the present invention; Figure 6 (a) is a comparison chart of the model hyperparameter sensitivity analysis in the noisy and denoised stages provided in the embodiments of the present invention; Figure 6 (b) is a comparison chart of the hyperparameter sensitivity analysis of the model in the noisy and enhancement stages provided in the embodiments of the present invention; Figure 7 (a) is a comparison of the time-domain waveforms before and after SSVEP denoising under time-domain noise provided in the embodiment of the present invention; Figure 7 Figure (b) shows a comparison of the time-domain waveforms before and after SSVEP denoising under spatial noise provided in the embodiments of the present invention; Figure 7 (c) is a comparison of the time-domain waveforms before and after SSVEP denoising under frequency-domain noise provided in the embodiment of the present invention; Figure 8 This is a comparison diagram of the spectral features before and after denoising provided in an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0028] To address the shortcomings of existing technologies, this invention proposes a steady-state visual evoked potential EEG denoising and data augmentation method based on a GAN-VAE hybrid generation framework. By fusing distribution matching ability and stable representation learning ability, and introducing latent spatial statistical alignment constraint to suppress identity mapping, noise and effective neural information are decoupled. At the same time, denoised signals are output under a unified framework, and data augmentation samples that can be used for training are provided, thereby improving the decoding accuracy and practicality under multiple noise conditions and distribution offset scenarios.
[0029] The overall architecture of the denoising model DenoNet proposed in this invention is as follows: Figure 1As shown, the model mainly consists of two modules: a generator and a discriminator. The generator comprises an encoder and a decoder. The encoder maps the signal to feature vectors in the latent space, while the decoder maps these vectors back to the signal form, obtaining the generated signal (i.e., the denoised signal). An alignment loss is designed in the latent space to perform the corresponding alignment operation, making the denoised signal closer to the reference signal. The discriminator mainly consists of a feature extractor, a domain classifier, and a category classifier. The feature extractor network maps the generated and reference signals to decodeable features. Two classifiers then distinguish the domain (reference domain / generated domain) and the category, respectively, optimized by classification loss and adversarial loss. The reconstruction loss is used to reduce the difference between the generated and reference signals at the signal level.
[0030] The model architecture details of the generator and discriminator are as follows: Figure 2 As shown, the generator mainly consists of an encoder and a decoder. The encoder comprises temporal convolution, spatial convolution, and a Transformer encoder, with latent space alignment blocks used on the subsequently obtained feature vectors. The decoder consists of temporal deconvolution, spatial deconvolution, and depthwise convolution, used to restore the features to the signal form. The discriminator consists of a feature extractor and two classifiers. The feature extractor consists of spatial convolution, temporal convolution, and LSTM blocks; the domain classifier and the category classifier are both composed of fully connected layers.
[0031] Example 1 A method for training a denoising model of electroencephalogram (EEG) signals, comprising: raw EEG signals Adding noise yields a noisy signal. The noise can be time-domain noise, spatial (channel) noise, frequency-domain disturbance, or a combination thereof. Figure 3 (a) Figure 3 (c) shows a schematic diagram of three types of noise modes: time domain, spatial domain, and frequency domain. The horizontal axis represents the number of signal sampling points, and the vertical axis represents the channels. Figure 4 This diagram illustrates frequency domain noise injection, where the horizontal axis represents frequency values, the vertical axis represents voltage values, the black line represents the original signal, and the red area represents the range where noise is added.
[0032] For the original signal Applying a filter bank (e.g., bandpass / notch filter, etc.) yields the reference signal. The original EEG signal is filtered to obtain a reference signal. The true category label of the original EEG signal, the noisy signal and the reference signal are combined to form a training sample. Multiple training samples are combined to form a training set. A denoising model is trained using a training set. The denoising model includes a generator and a discriminator. The generator includes an encoder, latent space aligned blocks, and a decoder. The discriminator includes a feature extractor and a classifier. The classifier includes a domain classifier and a category classifier. The denoising model is trained in the following manner: The training samples are input into the denoising model. The encoder encodes the noisy signal to obtain the encoded signal. The latent space alignment block calculates the statistical distributions of the noisy signal and the reference signal to obtain the statistics of the noisy signal and the reference signal. The KL divergence between the statistics of the noisy signal and the reference signal is used as the latent space alignment loss. The decoder decodes the encoded signal to obtain the denoised signal (i.e., the generated signal). The weighted sum of the latent space alignment loss and the generator loss is used as the generator loss function. The reference signal and the denoised signal are input into the discriminator. The feature extractor extracts features from the reference signal and the denoised signal respectively to obtain reference features and denoised features. The domain classifier performs domain discrimination based on the reference features and denoised features and calculates the domain adversarial loss. The category classifier uses the denoised features to predict the category and calculates the cross-entropy loss with the true category label of the original EEG signal to obtain the category supervision loss. The weighted sum of the domain adversarial loss and the category supervision loss is used as the discriminator loss function. First, fix the parameters of the generator and update the parameters of the discriminator by minimizing the discriminator loss function. Then, fix the parameters of the discriminator and update the parameters of the generator by minimizing the generator loss function. Train the denoising model until it converges or reaches the maximum number of training iterations to obtain the trained denoising model.
[0033] Specifically, the discriminator consists of a shared feature extractor and two output heads: a domain discriminant head. Used to distinguish Category discrimination head Used to predict SSVEP stimulus categories (frequency categories) and maintain task-related discriminative information.
[0034] Generate through adversarial training The distribution approximates At the same time, for Applying category supervision and latent spatial statistical alignment constraints prevents the generator output from degenerating into an identity mapping and ensures that the denoised signal retains the critical frequency discrimination information of SSVEP. (Denoising output) It can be further used as an enhancement sample to participate in the training of downstream classifiers, achieving an integrated improvement of "denoising + enhancement".
[0035] The generator employs an encoder-decoder architecture, which mainly includes the following parts: (1) Spatial convolution: with Convolutional kernels model channel correlations, effectively learning spatial patterns in EEG signals; (2) Multi-level temporal convolution / deconvolution: Convolutional kernels, combined with stride downsampling / upsampling, learn key temporal patterns in EEG signals; (3) Transformer encoder: Multi-head attention is introduced on the low-resolution time axis to capture long-range dependencies, effectively utilizing the long-range temporal information extraction capability of the Transformer module. This module is added after the convolutional block to extract local spatiotemporal features and long-range temporal information simultaneously. (4) Skip-connected and depthwise separable convolution: Reduces the loss of usable information while effectively reducing the number of model parameters. The output of this module is the denoised generated signal. .
[0036] The discriminator comprises a feature extractor and two classifiers. The feature extractor uses spatially separable convolutional + temporal convolutional bidirectional LSTM blocks to extract discriminative features. Then, an adversarial loss is calculated using a domain classifier to confuse the generated and reference signals, aligning them. The predicted labels are calculated using the classifiers, and the cross-entropy loss is calculated using the true labels. Specifically, the two classifiers are: (1) Domain classifier: Calculate the adversarial loss to confuse the generated signal and the reference signal in the model. When the two cannot be distinguished, it helps to align the two and realize adversarial training based on GAN. (2) Class classifier: Using the real class labels, calculate the cross-entropy loss between the predicted value (denoised signal) and the real class labels to make the generated signal have good discriminativeness and task relevance.
[0037] Specifically, the following loss term is designed to optimize the overall DenoNet framework proposed in this invention: Discriminator domain adversarial loss: , represents the adversarial loss function of the discriminator, which is used to measure the discriminator's ability to distinguish between real samples and generated samples, and the discriminator network parameters are optimized by minimizing this loss function. This represents the adversarial branch of the discriminator, used to determine the probability that an input sample is a true sample (i.e., the reference signal). The output of the discriminator is a value ranging from... The probability values are between 1 and 0, where the closer the value is to 1, the more likely the input sample is to be a real sample, and the closer the value is to 0, the more likely the input sample is to be a generated sample. This represents the expectation operation on the real sample distribution, used to calculate the average loss value of the real samples on the discriminator output. This represents the expectation operation on the generated sample distribution, used to calculate the average loss value of the generated samples on the discriminator output. The logarithmic function is used to construct the log-likelihood loss, thereby improving the discriminator's ability to distinguish between real and generated samples. In the aforementioned adversarial loss function, the first term... This is used to constrain the discriminator to classify real samples as real, so that the discriminator outputs a probability value close to 1 when a real sample is input; the second term This is used to constrain the discriminator to classify generated samples as generated data, ensuring that the discriminator outputs a probability value close to 0 when a generated sample is input. By minimizing the aforementioned adversarial loss function, the discriminator can continuously improve its ability to distinguish between real and generated samples, thereby promoting the generative model to generate samples that more closely resemble the real data distribution during adversarial training.
[0038] Discriminator category supervision loss: This loss is used to measure the discriminator's prediction error on the category recognition task. This represents the class classifier branch in the discriminator, which is used to predict the class of the input sample and output the probability distribution of the corresponding class. This represents the true category label corresponding to the sample. This represents the cross-entropy loss function, used to measure the difference between the predicted class distribution and the true class label. This loss function can simultaneously constrain the discriminator's classification ability on both real and generated samples.
[0039] Generator-versus-loss: It is used to measure the degree of authenticity of generated samples in the discriminator. This represents the adversarial discriminant branch of the discriminator, used to output the probability that the input sample is a real sample. This represents the expectation operation on the generated sample distribution. By minimizing this loss function, the generator can be prompted to generate samples that more closely resemble the real data distribution, making it difficult for the discriminator to distinguish them from the real data.
[0040] Generator classification loss: This is used to constrain the consistency of generated samples in the class space. This represents the classifier branch in the discriminator. This loss function helps the generator produce samples that retain the correct class semantic information.
[0041] Signal reconstruction loss: It is used to measure the difference between generated samples and real samples. express The norm is used to calculate the sum of the element-wise absolute differences between two signals. By minimizing this loss function, the generated samples can be made to more closely approximate the real samples in terms of numerical values.
[0042] Latent space alignment loss: in the channel dimension With the time dimension Calculate the statistics of noisy signals With reference signal statistics ,definition: ,
[0043] in: Indicates in dimension Latent space alignment loss. This represents the overall latent space alignment loss. Denotes the dimension of the computation, where These correspond to the channel dimension and the time dimension, respectively. Indicates in dimension The mean value in the statistics of noisy signals. Indicates in dimension The variance in the statistics of the noisy signal. Indicates in dimension The mean in the upper reference signal statistics. Indicates in dimension The variance in the statistics of the upper reference signal. This represents the expectation operation. This loss function improves the stability and expressive power of the generative model's latent space by constraining the statistical distribution of latent variables to approximate a reference distribution.
[0044] In summary, the total loss of the discriminator is The total loss of the generator is . , , Reconstruction losses Latent space alignment loss and cross-entropy loss The training weight coefficients. and They are respectively and The training weight coefficients.
[0045] Example 2 A method for denoising and data augmentation of electroencephalogram (EEG) signals, comprising: Operation S1: Data Input and Model Initialization Input noisy signal , corresponding reference signal and its real label .in, This represents input signal data that is affected by noise. This represents a reference signal or high-quality signal sample corresponding to the noisy signal. This indicates the true category label corresponding to the signal. The generator network is then initialized. Discriminator Network The parameters, where the generator Discriminator used to recover or generate a denoised signal from a noisy signal. Used to determine the authenticity of the input signal and perform category prediction.
[0046] Operation S2: Forward computation Noisy signal Input generator The denoised signal output by the generator is obtained. ;in, This represents the denoised signal generated by the generator. The actual reference signal is then used. With the generated signal Input discriminator respectively Calculate the adversarial discriminant branch of the discriminator and classification branches The output results. Among them, Used to output the probability that the input sample is a real sample. Used to output the predicted probability distribution of the corresponding category of the input sample.
[0047] Operation S3: Discriminator parameter update In this step, the generator is fixed. Network parameters, only for the discriminator Optimize accordingly. Based on the discriminator loss function. The discriminator parameters are updated by minimizing the loss function, enabling the discriminator to more accurately distinguish the real reference signal. With the generated signal At the same time, it improves the discriminator's ability to identify sample category labels. Its recognition capabilities.
[0048] Operation S4: Generator parameter update In this step, the discriminator is fixed. Network parameters, only for the generator Optimize based on the generator loss function. Update the generator parameters by minimizing the generator loss function to improve the signal generated by the generator. It is closer to the real reference signal in terms of statistical properties and structural characteristics. This allows the model to achieve a higher probability of being classified as true in the discriminator while maintaining the correct category label features. Repeat steps S2 to S4 until the model training reaches the preset convergence condition or the predetermined number of training rounds.
[0049] Operation S5: Signal Denoising After the model training is complete, only the generator is retained in the practical application stage. As a denoising model. When a new noisy signal is input. When that happens, input it into the generator. This yields the corresponding denoised signal output, which can be used for subsequent signal analysis or signal decoding tasks.
[0050] Operation S6: Data Augmentation After denoising the signal, the original noisy signal can be... Denoising signal from generator output By splicing or combining the data, a set of data-augmented training samples can be formed. The augmented training sample set is used to train downstream signal decoding models, thereby improving the robustness and generalization ability of signal classification or decoding tasks.
[0051] This invention proposes DenoNet, a framework for SSVEP EEG denoising and data augmentation based on adversarial generation and probabilistic latent variable modeling. The framework consists of a generator G and a discriminator D, and introduces latent spatial statistical alignment constraints and signal reconstruction constraints. It simultaneously improves denoising quality at both the signal and representation layers, suppresses identity mappings in the denoising network, and outputs data-augmented samples that can be used for downstream decoding training, thereby enhancing decoding robustness and accuracy under various noise conditions and distribution variations.
[0052] The method proposed in this invention is applicable to various noise environments, including but not limited to: time-domain noise, spatial-domain noise, frequency-domain noise, random noise, and fused noise formed by the superposition of multiple noises. Therefore, this invention has good noise adaptability and can be widely used in signal processing and signal decoding tasks in complex environments.
[0053] Figure 5 (a) and Figure 5 Figure (b) illustrates the differences in overall structure between traditional denoising paradigms and the method of this invention. Traditional signal denoising methods typically employ an end-to-end mapping approach, directly inputting the noisy signal into the denoising model and obtaining the denoising result by minimizing the signal reconstruction error (such as L1 or L2 loss). In this type of method, model training mainly relies on signal-level reconstruction constraints to make the output signal as close as possible to the reference signal in terms of numerical or waveform levels. However, this type of method only focuses on signal reconstruction error and is prone to degradation phenomena such as identity mapping during training. That is, the model tends to simply replicate the input signal structure, resulting in limited denoising capability. Furthermore, the model's generalization ability and robustness are weak when noise distribution changes or complex noise conditions exist.
[0054] Unlike traditional methods, the proposed DenoNet constructs a signal denoising model within a generative adversarial learning framework. It constrains the realism of the generated signal by introducing an adversarial training mechanism between the generator and discriminator. Furthermore, during model training, in addition to signal-level reconstruction loss constraints, a latent space alignment constraint is designed to ensure that the latent representation output by the generator maintains statistical consistency with the latent representation of the reference signal. This approach maintains signal reconstruction accuracy while making the generated signal closer to the real signal in terms of high-level semantic features or structural representation, effectively mitigating training degradation and improving the model's adaptability to different noise distributions. Moreover, the latent space alignment constraint enhances the model's stability at the feature representation level, ensuring good robustness of the denoising results even in the face of distributional shifts or complex noise environments. Therefore, compared to traditional denoising paradigms, the proposed structure exhibits significant advantages in signal reconstruction quality, feature consistency, and model generalization ability.
[0055] Tables 1 and 2 present the classification accuracy comparison results of each base classifier on two SSVEP datasets under different noise conditions, with reference signal, noisy signal, and denoised signal. The tables show experimental results under various noise scenarios, including time domain noise, spatial domain noise, frequency domain noise, random noise, and fusion noise, with the accuracy improvement value Δ representing the performance change before and after denoising. As can be seen from the experimental results in Tables 1 and 2, under all noise conditions, applying the proposed DenoNet to signal denoising improves the classification accuracy of the downstream signal decoding model to varying degrees. For example, under time domain noise and spatial domain noise conditions, the average decoding accuracy of various base classifiers is significantly higher than the performance level when using noisy signal input after denoising. In more challenging and complex noise environments such as frequency domain noise and fusion noise, the performance difference before and after denoising is even more pronounced, indicating that the proposed method can effectively suppress the influence of frequency perturbations and multi-source noise superposition on signal features. Further analysis of the overall average results shows that, under all five noise types, the average decoding accuracy of each base classifier is significantly improved after denoising using the method of this invention, with the improvement being more pronounced in frequency domain noise and fused noise scenarios. This indicates that the method proposed in this invention is applicable to various noise environments, including but not limited to: time domain noise, spatial domain noise, frequency domain noise, random noise, and fused noise formed by the superposition of multiple noises. Therefore, this invention can not only improve signal quality under single noise environments but also maintain stable performance under complex noise and multiple noise superposition conditions.
[0056] Tables 3 and 4 present the results of data augmentation using DenoNet on two SSVEP datasets under different noise conditions, before (Noisy) and after (Aug.). The tables show experimental results under various noise scenarios, including time-domain noise, spatial-domain noise, frequency-domain noise, random noise, and fusion noise, with the accuracy improvement value Δ representing the performance change before and after augmentation. The experimental results show that, under all noise conditions, applying the signal generated by the proposed DenoNet to data augmentation improves the classification accuracy of the downstream signal decoding model to varying degrees. For example, when using FBCCA as the base classifier, significant improvements are seen in all five noise scenarios, reaching a maximum performance improvement of 14.89% and 17.61% on the two datasets, respectively. Improvements are also observed to varying degrees for other base classifiers. This demonstrates that the method of this invention can improve signal quality while increasing the amount of trainable data in noisy environments, thereby significantly improving decoding performance.
[0057] Tables 5 and 6 compare the overall performance of DenoNet on two SSVEP datasets and under five noise categories, as well as with six existing denoising models. The CNN generator consists only of convolutional layers and is optimized using classification and reconstruction losses. The CNN-Trans generator integrates the proposed convolutional blocks with a Transformer encoder and is optimized using classification and reconstruction losses. The CNN-LSTM generator combines convolutional blocks with LSTM layers and is optimized using classification and reconstruction losses. EEGDNet is a denoising network based on an attention mechanism, utilizing both non-local and local self-similarity. This network uses self-attention blocks to capture long-range dependencies and models local structures through feedforward blocks, achieving end-to-end artifact suppression with good efficiency. GCTNet is a GAN-guided parallel CNN-Transformer EEG artifact removal network. The generator combines CNN and Transformer modules to learn local and global temporal features, while the discriminator forces the distribution alignment between the denoised EEG signal and the clean EEG signal. CT-DCENet is a two-stage CNN-Transformer ensemble model for EEG denoising. This model first integrates multiple learners to coarsely reconstruct low-frequency morphology, and then uses residual information to refine high-frequency details. The results show that the proposed method achieves the best and most stable overall average accuracy on both datasets, outperforming the six baseline denoising models, and exhibiting less performance fluctuation. This demonstrates that the proposed method not only works in a single noise domain but also adapts to fused noise, possessing versatility and effectiveness.
[0058] Table 1
[0059] Table 2
[0060] Table 3
[0061] Table 4
[0062] Table 5
[0063] Table 6
[0064] Figure 6 (a) and Figure 6Figure (b) illustrates the sensitivity analysis results of key hyperparameters in the method of this invention, used to evaluate the model's performance under different parameter settings. By adjusting the weights of the three loss functions, the stability of the model's performance under different parameter combinations is observed. , , Reconstruction losses Latent space alignment loss and cross-entropy loss The training weight coefficients were determined. The results show that, under various parameter settings, the method of this invention maintains high decoding accuracy with minimal overall performance fluctuation and no significant performance degradation. This indicates that the proposed method is not highly sensitive to hyperparameter selection; parameter adjustments within a reasonable range do not significantly affect model performance, thus demonstrating good training stability and parameter robustness, which is beneficial for promotion and deployment in different application scenarios.
[0065] Table 7 presents the ablation experiment results, used to verify the role of each component module in the framework of this invention and its contribution to the overall performance. In this experiment, by removing key components from the model and comparing the corresponding changes in decoding performance, the necessity of each module in the overall system can be evaluated. Specifically, the ablation experiment considers the following cases: removal of the adversarial distribution matching mechanism, removal of class supervision constraints, removal of signal reconstruction constraints, and removal of latent space statistical alignment constraints. The results show that when any of the above key modules is removed, the overall decoding performance of the model decreases to varying degrees, with the performance degradation being more significant under complex noise conditions such as frequency domain noise and fused noise. This indicates that each module plays an important role in the model. Among them, the adversarial distribution matching mechanism helps to make the generated signal approximate the real signal in terms of overall distribution; the class supervision constraints can maintain the task-related discriminative information of the signal; the signal reconstruction constraints are used to ensure the authenticity of the generated signal at the waveform level; and the latent space statistical alignment constraints further improve the consistency of latent feature representation. Through the synergistic optimization of the above mechanisms, the denoising effect can be improved while avoiding training degradation problems such as identity mapping, thereby obtaining a more stable and reliable performance improvement.
[0066] Table 7
[0067] Figure 7 (a) Figure 7 (c) By showing a comparison of time-domain signal waveforms under different noise conditions, the changes in signal morphology before and after denoising can be observed intuitively. Figure 7 (a) Figure 7As can be seen in (c), there are obvious noise disturbances and artifacts in the noisy signal. After processing by the method of this invention, the relevant noise interference is significantly reduced, and the overall waveform of the signal is smoother and closer to the shape of the reference signal, indicating that the method can effectively suppress time-domain noise components. Furthermore, Figure 8 The denoising effect is analyzed from the perspective of spectral characteristics. By comparing the amplitude spectrum and key frequency energy distribution of the signal before and after denoising, the changes in the signal's frequency domain structure can be observed. Experimental results show that the method of this invention can effectively suppress the energy of noise interference frequency bands while better preserving the key frequency components and their harmonic structures related to the SSVEP task, making the energy distribution near the target frequency more concentrated and clear. Since the SSVEP signal decoding task mainly relies on specific stimulus frequencies and their harmonic structure information, the effective preservation of this spectral structure is an important reason for improving decoding accuracy.
[0068] In summary, the present invention demonstrates consistent and stable performance improvement under conditions of multiple noise types, multiple noise intensities, and cross-datasets; sensitivity analysis proves the robustness of the method to key parameters; ablation experiments verify the contribution of each module to the performance improvement; and time-domain and frequency-domain visualization further confirms its effectiveness in preserving SSVEP frequency discrimination information while suppressing noise, thereby significantly improving the decoding accuracy and engineering practicality of the SSVEP brain-computer interface system.
[0069] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for training a denoising model of electroencephalogram (EEG) signals, characterized in that, include: Noise is added to the original EEG signal to obtain a noisy signal. The original EEG signal is then filtered to obtain a reference signal. The true category label of the original EEG signal, the noisy signal, and the reference signal are combined to form a training sample. Multiple training samples are combined to form a training set. A denoising model is trained using a training set. The denoising model includes a generator and a discriminator. The generator includes an encoder, latent space aligned blocks, and a decoder. The discriminator includes a feature extractor and a classifier. The classifier includes a domain classifier and a category classifier. The denoising model is trained in the following manner: The training samples are input into the denoising model. The encoder encodes the noisy signal to obtain the encoded signal. The latent space alignment block calculates the statistical distribution of the noisy signal and the reference signal to obtain the statistics of the noisy signal and the reference signal. The KL divergence between the statistics of the noisy signal and the reference signal is used as the latent space alignment loss. The decoder decodes the encoded signal to obtain the denoised signal. The weighted sum of the latent space alignment loss and the generator loss is used as the generator loss function. The reference signal and the denoised signal are input into the discriminator. The feature extractor extracts features from the reference signal and the denoised signal respectively to obtain reference features and denoised features. The domain classifier performs domain discrimination based on the reference features and denoised features and calculates the domain adversarial loss. The category classifier uses the denoised features to predict the category and calculates the cross-entropy loss with the true category label of the original EEG signal to obtain the category supervision loss. The weighted sum of the domain adversarial loss and the category supervision loss is used as the discriminator loss function. First, fix the parameters of the generator and update the parameters of the discriminator by minimizing the discriminator loss function. Then, fix the parameters of the discriminator and update the parameters of the generator by minimizing the generator loss function. Train the denoising model until it converges or reaches the maximum number of training iterations to obtain the trained denoising model.
2. The method for training a denoising model of electroencephalogram (EEG) signals as described in claim 1, characterized in that, The latent space alignment block calculates the mean and variance of the encoded signal in the channel dimension to obtain the noisy signal statistics in the channel dimension. The latent space alignment block calculates the mean and variance of the output signal after the reference signal is input to the encoder in the channel dimension to obtain the reference signal statistics in the channel dimension. The latent space alignment block calculates the mean and variance of the encoded signal in the time dimension to obtain the noisy signal statistics in the time dimension. The latent space alignment block calculates the mean and variance of the output signal after the reference signal is input to the encoder in the time dimension to obtain the reference signal statistics in the time dimension. The weighted sum of the KL divergence between the noisy signal statistics in the channel dimension and the reference signal statistics, and the KL divergence between the noisy signal statistics in the time dimension and the reference signal statistics, is used as the latent space alignment loss.
3. The method for training a denoising model of electroencephalogram (EEG) signals as described in claim 2, characterized in that, The latent space alignment loss is: , in, Indicates in dimension Latent space alignment loss, and These represent the latent space alignment loss in the channel dimension and the time dimension, respectively. This represents the latent space alignment loss. Indicates channel dimension, Indicates the time dimension. Indicates in dimension The mean in the statistics of noisy signals. Indicates in dimension The variance in the statistics of noisy signals Indicates in dimension The mean in the upper reference signal statistics, Indicates in dimension The variance in the upper reference signal statistics This indicates the expected operation.
4. A method for training a denoising model of electroencephalogram (EEG) signals as described in any one of claims 1-3, characterized in that, The encoder uses spatial convolutional layers, temporal convolutional layers, and a Transformer encoder to perform spatial convolution, temporal convolution, spatiotemporal feature extraction, and temporal information extraction on the noisy signal to obtain the encoded signal. The decoder uses temporal deconvolution layers, spatial deconvolution layers, and depth convolution layers to perform temporal deconvolution, spatial deconvolution, and depth convolution on the encoded signal, respectively, to obtain the denoised signal.
5. A method for training a denoising model of electroencephalogram (EEG) signals as described in any one of claims 1-3, characterized in that, The generator loss includes generator adversarial loss. Generator classification loss and signal reconstruction loss ;in, Represents the denoised signal Reference signal The probability, Indicates in the denoised signal Expectation operation on the distribution Represents the denoised signal The category probability distribution, This indicates the true category label of the raw EEG signal. This represents the cross-entropy loss function.
6. The method for training a denoising model of electroencephalogram (EEG) signals as described in claim 5, characterized in that, The domain adversarial loss The category of supervised loss ,in, Indicates reference signal Reference signal The probability, Indicates reference signal The category probability distribution, Indicates the reference signal Expectation operation on the distribution.
7. A method for denoising electroencephalogram (EEG) signals, characterized in that, include: The EEG signal is input into the denoising model trained by the EEG signal denoising model training method according to any one of claims 1-6, and the generator is used to denoise the signal to output the denoised signal.
8. A method for data augmentation of electroencephalogram (EEG) signals, characterized in that, include: The noisy signal is input into the denoising model trained by the denoising model training method of the EEG signal according to any one of claims 1-6, and the output denoised signal is concatenated with the noisy signal to obtain the data-enhanced training set.
9. The data augmentation method for electroencephalogram (EEG) signals as described in claim 8, characterized in that, The augmented training set is used to retrain the feature extractor and class classifier in the denoising model.
10. A computer product, characterized in that, When the product is running, it enables the computer to execute the denoising method for EEG signals as described in claim 7 or the data enhancement method for EEG signals as described in claim 8.
