Electroencephalogram signal noise reduction method and system for extracting high-dimensional time sequence characteristics through BiGRU
The EEG signal denoising method that extracts high-dimensional temporal features through BiGRU solves the problem of insufficient temporal dependence in existing technologies and achieves efficient EEG signal denoising. It is suitable for multiple high-growth application fields, especially in real-time monitoring and mobile device deployment scenarios, with the advantages of lightweight and low latency.
Patent Information
- Application Number
- CN202510679085.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-09-05
AI Technical Summary
Existing deep learning-based EEG denoising methods focus too much on local or global features and ignore the temporal dependence of EEG signals. In addition, generative adversarial network training increases system resource overhead, limiting its application in real-time or resource-constrained scenarios.
The EEG signal denoising method uses BiGRU to extract high-dimensional temporal features. By constructing preprocessing, feature extraction and decoding parts, combining parallel CNN and LSHAttention modules, and using BiGRU to capture the temporal dependency of EEG signals, the complexity and resource overhead of the model are reduced.
It significantly improves the ability to suppress complex motion artifacts and electrooculogram artifacts, reduces training resource overhead, and improves the signal-to-noise ratio and noise reduction effect. It is suitable for brain-computer interfaces, medical monitoring, emotion recognition, and smart wearable devices.
Smart Images

Figure CN120596795A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of EEG noise reduction, and in particular relates to an EEG signal noise reduction method and system using BiGRU to extract high-dimensional temporal features. Background Art
[0002] With the increasing popularity of brain-computer interfaces (BCIs), electroencephalograms (EEGs), as an important tool for implementing BCIs, have become an indispensable component of BCI research. However, the actual EEG sampling process is easily affected by motion artifacts caused by environmental factors and the physiological conditions of the individual being measured. Therefore, minimizing or eliminating noise in EEG signals has become a key issue in contemporary research. In recent years, EEG signal denoising technology based on deep learning has made significant progress and has surpassed traditional methods in terms of noise reduction efficiency. In the process of EEG signal processing, the self-similarity of data is often used in the EEG denoising process. For deep learning-based methods, Yang et al. proposed a deep learning network to automatically remove electrooculogram artifacts from EEG signals; Nagar et al. used a fractionally compressed autoencoder to achieve EEG denoising. This architecture uses fractional calculus to calculate the gradient in the back-propagation process and introduces a new hyperparameter fractional order to adjust for optimal denoising performance; Sawangjai et al. proposed EEGANet and introduced generative adversarial networks (GANs) to remove electrooculogram artifacts from EEG signals; Sun et al. proposed an end-to-end one-dimensional residual convolutional neural network (1D-ResCNN) model to map noisy EEG signals to clean EEG signals. Compared with previous traditional methods, this model can produce clearer EEG waveforms and is more accurate. A benchmark EEG dataset was provided, and the performance of four networks (fully connected networks, simple and complex convolutional networks, and recurrent neural networks) were tested on this dataset. The analysis results show that the deep learning-based method is effective for EEG denoising even under high noise pollution. Noise still has great potential; Zhang et al. found in the experiment that a single CNN may have the problem of overfitting when performing EEG denoising on electromyographic artifacts. In order to optimize the denoising ability of electromyographic artifacts, a new convolutional neural network NovelCNN was proposed; Wang et al. introduced BiGRU into the EEG denoising task, and captured the past and future information of the EEG sequence to reconstruct a clean EEG signal; Pu et al. comprehensively considered the non-local and local self-similarity of EEG signals and proposed a Transformer-based denoising network; Gao et al. proposed a method called DuoCL for deep artifact removal, which used a dual-scale convolutional neural network (CNN)-long short-term memory (LSTM) model to process the original EEG; Yin et al. proposed a parallel CNN and Transformer denoising network to extract global features and local features, optimize the effect of the denoising network, and proposed a new EEG denoising network GCTNet in subsequent work, introduced generative adversarial networks (GANs) for data enhancement, and achieved better denoising effect.It is not difficult to find from the development of the above-mentioned deep learning-based EEG signal denoising methods that current deep learning-based EEG denoising research often pays too much attention to local or global features. Even if both are taken into account, the processing of the temporal dependence of EEG signals is also weak. Although the method of using generative adversarial networks to train EEG denoising models has achieved good results, this method undoubtedly increases the system resource overhead during training.
[0003] Among existing technologies, Chen Xun et al. from the University of Science and Technology of China proposed a deep learning EEG signal denoising method, device, and medium using a dual-branch fusion approach. This method establishes a dual-branch fusion network model, using two branches to model clean EEG signals and artifact signals, respectively. An interaction mechanism is introduced during the modeling process to enhance the features of both. A fusion module is designed to adaptively fuse the results of the two branches to further restore the clean EEG signal. Finally, a loss function is constructed and trained to obtain the optimal denoising model. However, this model only uses a convolutional neural network to process EEG signals. While it has some EEG denoising capabilities, it focuses only on local features and ignores the temporal dependencies and global characteristics of the EEG signals. Later, Chen Xun et al. proposed an EEG signal denoising method based on a generative adversarial parallel neural network. This method preprocesses the EEG and artifact signals in the dataset and establishes an EEG denoising network based on a generative adversarial parallel neural network. The network consists of a generator and a discriminator. The generator is composed of parallel CNN blocks and Transformer blocks, which are used to capture local and global temporal dependencies. The discriminator is used to constrain the global inconsistency between the clean EEG signal and the generated denoised EEG signal. The discriminator and generator are trained alternately to obtain the optimal denoising model. This method has a good ability to extract local and global features of EEG signals, but still has shortcomings in extracting temporal dependency features of EEG signals. At the same time, this method uses a generative adversarial network for data augmentation in the EEG denoising process, which improves the training cost of the EEG denoising network.
[0004] Through the above analysis, the problems and defects of the existing technology are as follows:
[0005] Current EEG denoising research based on deep learning often focuses too much on local or global features. Even if both are taken into account, the processing of the temporal dependence of EEG signals is also weak. Although the method of using generative adversarial networks to train EEG denoising models has achieved good results, this method undoubtedly increases the system resource overhead during training. Summary of the Invention
[0006] In response to the problems existing in the prior art, the present invention provides an EEG signal denoising method that extracts high-dimensional temporal features using BiGRU.
[0007] The present invention is implemented as follows: a method for denoising an EEG signal by extracting high-dimensional temporal features using BiGRU includes:
[0008] Step 1: Construct the preprocessing part;
[0009] The initial EEG signal input to the model is subjected to preliminary feature extraction for further processing in the subsequent part. In this part, there are two one-dimensional convolutional layers with a convolution kernel of 1*3, a stride of 1, and an activation function of LReLU, and a maximum pooling layer. The output channels of each convolutional layer are 32, and batch normalization is used.
[0010] Step 2: Construct the feature extraction part;
[0011] The feature extraction part is divided into five submodules, each of which contains a parallel CNN and LSHAttention layer, and a CNN layer to fuse the features extracted by the CNN and LSHAttention layers. After the CNN in the fifth submodule fuses the features, a BiGRU unit is added to capture high-level feature representations. After passing through these five modules, the tensor size is converted from the initial input (128, 32, 256) to (128, 1024, 8) before being input into the decoding part of step 3.
[0012] Step 3: Construct the decoding part;
[0013] The decoding part is a sequence of two one-dimensional convolutional layers. After each convolutional layer is completed, the tensor is passed to the batch normalization layer and the LeakyReLU activation function for processing. A dropout layer is added after the last convolutional layer, which can randomly drop some neurons during training to prevent overfitting. The convolutional layer expands the input feature map into a two-dimensional tensor with a tensor dimension of (128, 8192). The last layer of the decoding part is a fully connected layer that flattens the input into one dimension and feeds it into a linear layer, which maps the output of the model back to (128, 512) to form the reconstructed EEG signal.
[0014] Step 4: The experiment uses five indicators to evaluate the semi-simulated data set.
[0015] Furthermore, the construction preprocessing part:
[0016] Step 1.1: Use the EEGDenoiseNet dataset to train the model and set the input signal-to-noise ratio to -5dB to 5dB, with an interval of 1dB. According to these different signal-to-noise ratios, the clean EEG signals and artifact signals are mixed to form contaminated EEG signals. In the experiment, the contaminated EEG signals are divided into three categories: EEG contaminated by EOG, EMG contaminated by EMG, and EEG contaminated by both EOG and EMG.
[0017] The formula for input signal-to-noise ratio when processing EEG signals is shown in formula (1), where y t Represents a clean EEG signal, n t Represents the artifact signal, and the subscript t represents the sampling point. Since the EEG signal sampling rate in this dataset is 256 Hz and the EEG signal segment length is 2 seconds, there are 512 sampling points in a EEG signal segment, that is, T = 512, t∈[1,512] in the following formula;
[0018]
[0019] Because the input signal-to-noise ratio is set to -5dB to 5dB in the experiment, λ can be inferred from the above formula according to different SNR requirements. It is used to adjust the influence of artifact signals on clean EEG signals according to different signal-to-noise ratios when mixing clean EEG signals and artifact signals. The specific formula is shown in formula (2), where x t represents the generated contaminated semi-simulated EEG signal;
[0020] x t =y t + λ n t (2)
[0021] Step 1.2: Input the EEG signal sequence with a dimension of (128, 1, 512) obtained by the preprocessing in step 1.1 into the preprocessing part constructed in step 1. After two convolutional layers, the dimension is expanded to (128, 32, 512). Then, a pooling layer with a pooling kernel of 2 and a stride of 2 is used for average pooling to obtain a tensor of (128, 32, 256), which is passed to the feature extraction part of step 2.
[0022] Furthermore, the feature extraction part is constructed:
[0023] Step 2.1: Input the EEG sequence preprocessed in step 1.2 into the feature extraction part, and perform feature extraction through four parallel CNN and LSHAttention modules and one BiGRU fusion parallel CNN and LSHAttention module; among them, the number of attention heads of the LSHAttention part is set to 4, the number of hash buckets is set to 256, and the number of local sensitive hashes is set to 4. First, as shown in formula (3), the input tensor X is mapped to the key (K), value (V), and query (Q) space respectively through linear transformation:
[0024] K=Linear(X), V=Linear(X), Q=Linear(X) (3)
[0025] Then, as shown in formula (4), the key (K) and query (Q) are hashed and mapped into multiple hash buckets:
[0026] HashedKeys=Hash(K),HashedQueries=Hash(Q) (4)
[0027] Then, as shown in formula (5), the attention score is calculated using the hashed key and query, where E is the attention scaling factor, and the attention score tensor A is obtained:
[0028]
[0029] Afterwards, the normalized attention scores are used to perform weighted summation on the values according to formula (6) and formula (7) to obtain the final output tensor O, and the output tensor O is projected to obtain the final output tensor;
[0030] O=AV(6)
[0031] Output=Linear(O) (7)
[0032] Step 2.2: In the BiGRU fusion module of parallel CNN and LSHAttention, after completing the feature merging of parallel CNN and LSHAttention, BiGRU will extract the bidirectional temporal dependency features of the EEG signal. After performing the convolution kernel batch normalization operation, the final feature map is obtained and input into the decoding part of step 3.
[0033] Furthermore, the five indicators:
[0034] Relative Root Mean Square Error (RRMSE), Correlation Coefficient (CC), Signal-to-noise ratio (SNR), Weighted Signal-to-Noise Ratio (WSNR) and Wavelet cross-correlation coefficient (WCC).
[0035] Another object of the present invention is to provide an EEG denoising system for extracting high-dimensional temporal features using BiGRU, comprising:
[0036] The preprocessing module is used to build the preprocessing part; it performs preliminary feature extraction on the initial EEG signal input to the model for further processing in the subsequent part. In this part, there are two one-dimensional convolutional layers with a convolution kernel of 1*3, a stride of 1, and an activation function of LReLU, and a maximum pooling layer. The output channels of each convolutional layer are 32, and batch normalization is used;
[0037] The feature extraction module is used to build the feature extraction part. The feature extraction part is divided into five submodules. Each submodule contains a parallel CNN and LSHAttention, and a CNN layer to fuse the features extracted by the CNN and LSHAttention. After the CNN in the fifth submodule fuses the features, a BiGRU unit is added to capture high-level feature representations. After passing through these five modules, the tensor size is converted from the initial input (128, 32, 256) to (128, 1024, 8) before being input into the decoding part of step 3.
[0038] The decoding module is used to build the decoding part. The decoding part is a sequence of two one-dimensional convolutional layers. After each convolutional layer is completed, the tensor is passed to the batch normalization layer and the LeakyReLU activation function for processing. A dropout layer is added after the last convolutional layer, which can randomly drop some neurons during training to prevent overfitting. The convolutional layer expands the input feature map into a two-dimensional tensor after convolution, and the tensor dimension becomes (128, 8192). The last layer of the decoding part is a fully connected layer, which flattens the input into one dimension and inputs it to a linear layer. The output of the model is mapped back to (128, 512) to form the reconstructed EEG signal.
[0039] The evaluation module is used to evaluate the semi-simulated dataset using five indicators.
[0040] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the BiGRU method for extracting high-dimensional time series features from the EEG signal denoising method.
[0041] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the BiGRU method for extracting high-dimensional time series features from the EEG signal denoising method.
[0042] Another object of the present invention is to provide an information data processing terminal, which is used to implement the BiGRU EEG denoising system for extracting high-dimensional time series features.
[0043] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0044] While existing technologies have made some progress in EEG signal denoising, significant technical bottlenecks remain. Most current deep learning-based EEG signal denoising methods focus primarily on local or global feature extraction, insufficiently considering the inherently strong temporal dependence of EEG signals and struggling to adequately model their long-term dependencies. Furthermore, while some methods have introduced structures such as generative adversarial networks (GANs) to enhance denoising capabilities, these often lead to a sharp increase in model complexity and system resource overhead during training, limiting their application in real-time or resource-constrained scenarios.
[0045] The proposed BiGRU-based EEG signal denoising method extracts high-dimensional temporal features. This method, built around a bidirectional gated recurrent unit (BiGRU) as its core, constructs a denoising neural network structure. This method fully considers the temporal dependencies of EEG signals, effectively modeling and extracting their high-dimensional temporal features. Compared to traditional convolutional or Transformer architectures, this method significantly improves the ability to suppress noise interference, such as complex motion artifacts and electrooculographic artifacts, while maintaining network lightweight.
[0046] During the research and development process, the method of the present invention was systematically experimentally evaluated on multiple public EEG datasets such as EEGDenoiseNet, CHB-MIT dataset, and Dr.S.VanHuffel dataset. The denoised EEG signals outperformed existing mainstream models such as CNN, 1D-ResCNN, EEGANet, and GAN-based GCTNet methods in key indicators such as signal-to-noise ratio (SNR) and mean square error (MSE). Among them, based on the GCTNet, which currently has the best denoising effect, the present invention has excellent performance in removing various motion artifacts, and the processing effect on EOG artifacts is even more significant. In addition, the present invention does not require data enhancement processing, which reduces the resource overhead of the training model while ensuring the denoising effect, and reduces the requirements for data preprocessing and dependence on data enhancement. In particular, the present invention reduced the RRMSE under EOG artifacts by 3.4%, increased the SNR by 2.9%, and increased the training speed by 20%, fully verifying the comprehensive advantages of the technical solution of the present invention in terms of denoising performance, training efficiency, and deployment feasibility.
[0047] By introducing the BiGRU structure to model the timing characteristics of EEG signals and combining it with a customized loss function optimization strategy, the present invention not only effectively makes up for the shortcomings of the existing technology in timing modeling, but also achieves the precise extraction and reconstruction of high-dimensional dynamic EEG features without the need to introduce high-complexity adversarial training, and has outstanding technological innovation and application promotion value.
[0048] The specific description is as follows:
[0049] This paper presents a novel EEG denoising network, GCLSHNet, which integrates BiGRU with a parallel convolutional neural network (CNN) and a locality-sensitive hashing attention mechanism (LSH-Attention). GCLSHNet enhances the model's ability to extract local features through parallel CNN units and LSH-Attention units, and improves feature extraction by combining these units with BiGRU. Specifically, the network extracts local features using parallel CNN units and LSH-Attention units, and then integrates these features with BiGRU to capture temporal dependencies in EEG signals.
[0050] The overall process of this invention is divided into three main parts: preprocessing, feature extraction, and decoding. The feature extraction part consists of four CNN fusion parallel CNN and LSHAttention modules and one BiGRU+CNN fusion parallel CNN and LSHAttention module. The preprocessing module encodes the initial EEG signal, then passes the encoded features to the feature extraction part to extract global and local features. Finally, the decoding part maps the features back to the original dimension to form the noise-reduced EEG.
[0051] The present invention has greatly improved the processing of electrooculogram artifacts. In a semi-simulated data set, the correlation coefficient (CC) between the EEG signal after removing the electrooculogram artifacts and the clean EEG signal can reach 0.949±0.003, achieving the best effect so far.
[0052] The present invention realizes an EEG denoising network that combines the local features, global features and timing dependency features of EEG signals. It optimizes the previous EEG signal denoising method based on deep learning, which lacks the processing of timing dependency. After adding the processing of timing dependency, the denoising effect of the model is greatly improved without the need for data enhancement, thereby reducing the overhead required for model training.
[0053] The proposed BiGRU EEG signal denoising method for extracting high-dimensional temporal features not only accurately extracts the temporal features of EEG signals, but also significantly improves the denoising effect and reduces the resource overhead of model training and operation. This technical solution can be widely used in multiple high-growth application fields such as brain-computer interfaces, medical monitoring, emotion recognition, and smart wearable devices, and has significant application prospects and commercial value. In particular, in real-time monitoring and mobile device deployment scenarios, the lightweight and low-latency advantages of this method will provide technical support for EEG product development and market promotion, helping related companies to form technical barriers and enhance their competitiveness.
[0054] Currently, most existing EEG signal denoising methods, both domestically and internationally, fail to strike a balance between temporal feature extraction and network model complexity. This paper, for the first time, fuses the BiGRU, CNN, and LSHAttention modules to construct an EEG denoising framework that simultaneously models local and global features and bidirectional temporal dependencies. This framework achieves denoising performance superior to existing mainstream models without the need for data augmentation, effectively filling the gap in research on in-depth EEG temporal modeling and improving the accuracy and practicality of the denoising system.
[0055] Current deep learning EEG noise reduction research generally favors the use of complex convolutional structures or generative adversarial networks to extract features, believing that performance can be improved simply by increasing the complexity of the network structure, while ignoring the time series characteristics inherent in EEG signals. The technical solution of this invention breaks through the technical bias of "the more complex the structure, the better the effect" and uses the BiGRU structure to efficiently model time series information. This achieves excellent noise reduction results without relying on adversarial training, proving that "rational structural combination and time series modeling" is more practical and scientific than "simply increasing model complexity." BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 This is a flow chart of the EEG signal denoising method using BiGRU to extract high-dimensional temporal features provided by an embodiment of the present invention.
[0057] Figure 2 This is a structural block diagram of the EEG denoising system for extracting high-dimensional temporal features using BiGRU provided in an embodiment of the present invention.
[0058] Figure 3 This is a model structure diagram provided by an embodiment of the present invention.
[0059] Figure 4 This is a structural diagram of the BiGRUCNN-LSHAttention module provided by an embodiment of the present invention.
[0060] Figure 5 The light gray signal provided by the embodiment of the present invention is the original noisy signal, and the dark gray signal is the EEG signal image after noise reduction. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0062] Example 1: Application of EEG signal processing for sleep disorders
[0063] In this example, nocturnal polysomnographic EEG signals were collected from 20 patients with chronic insomnia at a sampling rate of 512 Hz and 128 channels. A semi-simulated dataset was constructed by adding synthetic electrooculogram (EOG) and electromyography (EMG) artifacts, and noise reduction was performed using the methods described in Claims 1 to 8. Model training was fine-tuned using the pre-trained parameters from the EEGDenoiseNet dataset.
[0064] Comparative analysis before and after noise reduction showed that the reconstructed EEG signals using this method achieved an average improvement of 4.2dB in signal-to-noise ratio (SNR), and significantly outperformed traditional ICA and Wavelet methods in terms of weighted SNR and wavelet cross-correlation coefficient. The processed signals were used for automatic sleep stage classification, with the accuracy increasing from 78.6% of the original data to 90.3%, validating the method's applicability and stability in clinical auxiliary diagnosis.
[0065] Example 2: Real-time EEG cleaning for driver fatigue recognition system
[0066] In this example, real-time EEG signals collected from a driver wearing a portable EEG headset are captured in actual road driving scenarios. These signals are subject to significant environmental interference and are often accompanied by mixed myoelectric and oculoscopic artifacts. The system deploys the method described in this paper in real time, exports the model in the ONNX format, and integrates it into edge computing devices, enabling rapid EEG signal preprocessing, feature extraction, and cleaning.
[0067] Evaluations show that the recognition accuracy of fatigue detection models using noise-reduced EEG signals increased from 72.4% to 88.1%, while latency was kept below 300ms, meeting the operational requirements of in-vehicle embedded platforms. This method demonstrates excellent online real-time processing capabilities, making it suitable for cognitive status monitoring and intelligent traffic safety warning systems in high-noise environments.
[0068] like Figure 1 As shown, the embodiment of the present invention provides a method for extracting high-dimensional time series features from an EEG signal using BiGRU, which includes the following steps:
[0069] S1, construct the preprocessing part;
[0070] The initial EEG signal input to the model is subjected to preliminary feature extraction for further processing in the subsequent part. In this part, there are two one-dimensional convolutional layers with a convolution kernel of 1*3, a stride of 1, and an activation function of LReLU, and a maximum pooling layer. The output channels of each convolutional layer are 32, and batch normalization is used.
[0071] S2, construct the feature extraction part;
[0072] The feature extraction part is divided into five submodules, each of which contains a parallel CNN (Convolutional Neural Network) and LSHAttention (Locality Sensitive Hashing Attention) layer, and a CNN layer to fuse the features extracted by the CNN and LSHAttention. After the CNN in the fifth submodule fuses the features, a BiGRU unit is added to capture high-level feature representations. After passing through these five modules, the tensor size is converted from the initial input (128, 32, 256) to (128, 1024, 8) before being input into the decoding part of S3.
[0073] S3, construct the decoding part;
[0074] The decoding part is a sequence of two one-dimensional convolutional layers. After each convolutional layer is completed, the tensor is passed to the batch normalization layer and the LeakyReLU activation function for processing. A dropout layer is added after the last convolutional layer, which can randomly drop some neurons during training to prevent overfitting. The convolutional layer expands the input feature map into a two-dimensional tensor with a tensor dimension of (128, 8192). The last layer of the decoding part is a fully connected layer that flattens the input into one dimension and feeds it into a linear layer, which maps the output of the model back to (128, 512) to form the reconstructed EEG signal.
[0075] S4. The experiment uses five indicators to evaluate the semi-simulated dataset.
[0076] The embodiment of the present invention provides a construction preprocessing part:
[0077] Step 1.1: Use the EEGDenoiseNet dataset to train the model and set the input signal-to-noise ratio to -5dB to 5dB, with an interval of 1dB. According to these different signal-to-noise ratios, the clean EEG signals and artifact signals are mixed to form contaminated EEG signals. In the experiment, the contaminated EEG signals are divided into three categories: EEG contaminated by EOG (electrooculograph), EMG contaminated by EMG, and EEG contaminated by both EOG and EMG.
[0078] The formula for input signal-to-noise ratio when processing EEG signals is shown in formula (1), where y t Represents a clean EEG signal, n t Represents the artifact signal, and the subscript t represents the sampling point. Since the EEG signal sampling rate in this dataset is 256 Hz and the EEG signal segment length is 2 seconds, there are 512 sampling points in a EEG signal segment, that is, T = 512, t∈[1,512] in the following formula;
[0079]
[0080] Because the input signal-to-noise ratio is set to -5dB to 5dB in the experiment, λ can be inferred from the above formula according to different SNR requirements. It is used to adjust the influence of artifact signals on clean EEG signals according to different signal-to-noise ratios when mixing clean EEG signals and artifact signals. The specific formula is shown in formula (2), where x t represents the generated contaminated semi-simulated EEG signal;
[0081] x t =y t + λ n t (2)
[0082] Step 1.2: Input the EEG signal sequence with a dimension of (128, 1, 512) obtained by step 1.1 into the preprocessing part constructed by S1. After two convolutional layers, the dimension is expanded to (128, 32, 512). Then, a pooling layer with a pooling kernel of 2 and a stride of 2 is used for average pooling to obtain a tensor of (128, 32, 256), which is passed to the feature extraction part of S2.
[0083] The feature extraction part provided in the embodiment of the present invention is as follows:
[0084] Step 2.1: Input the EEG sequence preprocessed in step 1.2 into the feature extraction part, and perform feature extraction through four parallel CNN and LSHAttention modules and one BiGRU fusion parallel CNN and LSHAttention module; among them, the number of attention heads of the LSHAttention part is set to 4, the number of hash buckets is set to 256, and the number of local sensitive hashes is set to 4. First, as shown in formula (3), the input tensor X is mapped to the key (K), value (V), and query (Q) space respectively through linear transformation:
[0085] K=Linear(X), V=Linear(X), Q=Linear(X) (3)
[0086] Then, as shown in formula (4), the key (K) and query (Q) are hashed and mapped into multiple hash buckets:
[0087] HashedKeys=Hash(K),HashedQueries=Hash(Q) (4)
[0088] Then, as shown in formula (5), the attention score is calculated using the hashed key and query, where E is the attention scaling factor, and the attention score tensor A is obtained:
[0089]
[0090] Afterwards, the normalized attention scores are used to perform weighted summation on the values according to formula (6) and formula (7) to obtain the final output tensor O, and the output tensor O is projected to obtain the final output tensor;
[0091] O=AV(6)
[0092] Output=Linear(O)(7)
[0093] Step 2.2: In the BiGRU module that integrates parallel CNN and LSHAttention, after completing the feature merging of parallel CNN and LSHAttention, the BiGRU extracts the bidirectional temporal dependency features of the EEG signal. After performing batch normalization on the convolution kernel, the final feature map is obtained and input into the decoding part of S3.
[0094] The five indicators provided by the embodiment of the present invention are:
[0095] Relative Root Mean Square Error (RRMSE), Correlation Coefficient (CC), Signal-to-noise ratio (SNR), Weighted Signal-to-Noise Ratio (WSNR) and Wavelet cross-correlation coefficient (WCC).
[0096] like Figure 2 As shown, an embodiment of the present invention provides a BiGRU EEG denoising system for extracting high-dimensional temporal features, including:
[0097] The preprocessing module is used to build the preprocessing part; it performs preliminary feature extraction on the initial EEG signal input to the model for further processing in the subsequent part. In this part, there are two one-dimensional convolutional layers with a convolution kernel of 1*3, a stride of 1, and an activation function of LReLU, and a maximum pooling layer. The output channels of each convolutional layer are 32, and batch normalization is used;
[0098] The feature extraction module is used to build the feature extraction part. The feature extraction part is divided into five submodules. Each submodule contains a parallel CNN and LSHAttention, and a CNN layer to fuse the features extracted by the CNN and LSHAttention. After the CNN in the fifth submodule fuses the features, a BiGRU unit is added to capture high-level feature representations. After passing through these five modules, the tensor size is converted from the initial input (128, 32, 256) to (128, 1024, 8) before being input into the decoding part of step 3.
[0099] The decoding module is used to build the decoding part. The decoding part is a sequence of two one-dimensional convolutional layers. After each convolutional layer is completed, the tensor is passed to the batch normalization layer and the LeakyReLU activation function for processing. A dropout layer is added after the last convolutional layer, which can randomly drop some neurons during training to prevent overfitting. The convolutional layer expands the input feature map into a two-dimensional tensor after convolution, and the tensor dimension becomes (128, 8192). The last layer of the decoding part is a fully connected layer, which flattens the input into one dimension and inputs it to a linear layer. The output of the model is mapped back to (128, 512) to form the reconstructed EEG signal.
[0100] The evaluation module is used to evaluate the semi-simulated dataset using five indicators.
[0101] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the BiGRU method for extracting high-dimensional time series features from the EEG signal denoising method.
[0102] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the steps of the BiGRU method for extracting high-dimensional time series features from the EEG signal denoising method.
[0103] Another object of the present invention is to provide an information data processing terminal, which is used to implement the BiGRU EEG denoising system for extracting high-dimensional time series features.
[0104] The present invention is specifically implemented:
[0105] The overall process of this invention is divided into three main parts: preprocessing, feature extraction, and decoding. The feature extraction part consists of four CNN fusion parallel CNN and LSHAttention modules and one BiGRU+CNN fusion parallel CNN and LSHAttention module. The preprocessing module encodes the initial EEG signal, then passes the encoded features to the feature extraction part to extract global and local features. Finally, the decoding part maps the features back to the original dimension to form the noise-reduced EEG.
[0106] Step 1: Construct the preprocessing layer. This layer performs preliminary feature extraction on the initial EEG input signal to facilitate further processing. This layer includes two one-dimensional convolutional layers with a 1x3 kernel, a stride of 1, and an LReLU activation function, and one max pooling layer. Each convolutional layer has 32 output channels and uses batch normalization.
[0107] Step 1.1: Use the EEGDenoiseNet dataset to train the model and set the input signal-to-noise ratio to -5dB to 5dB, with an interval of 1dB. According to these different signal-to-noise ratios, the clean EEG signals and artifact signals are mixed to form contaminated EEG signals. In the experiment, the contaminated EEG signals are divided into three categories: EOG-contaminated EEG signals, EMG-contaminated EEG signals, and EEG signals contaminated by both EOG and EMG.
[0108] The formula for input signal-to-noise ratio when processing EEG signals is shown in formula (1), where y t Represents a clean EEG signal, n t Denotes artifact signal, and subscript t denotes sampling point. Since the EEG signal sampling rate in this dataset is 256 Hz and the EEG signal segment length is 2 seconds, there are 512 sampling points in a EEG signal segment, that is, T = 512, t∈[1,512] in the following formula.
[0109]
[0110] Because the input signal-to-noise ratio is set to -5dB to 5dB in the experiment, λ can be inferred from the above formula according to different SNR requirements. It is used to adjust the influence of artifact signals on clean EEG signals according to different signal-to-noise ratios when mixing clean EEG signals and artifact signals. The specific formula is shown in formula (2), where x t Represents the generated contaminated semi-simulated EEG signal.
[0111] x t =y t +λ n t (2)
[0112] Step 1.2: Input the EEG signal sequence with a dimension of (128, 1, 512) obtained by the preprocessing in step 1.1 into the preprocessing part constructed in step 1. After two convolutional layers, the dimension is expanded to (128, 32, 512). Then, a pooling layer with a pooling kernel of 2 and a stride of 2 is used for average pooling to obtain a tensor of (128, 32, 256). This is passed to the feature extraction part of step 2.
[0113] Step 2: Construct the feature extraction component. The feature extraction component can be divided into five submodules, each of which contains a parallel CNN and LSHAttention layer, and a CNN layer to fuse the features extracted by the CNN and LSHAttention layers. To avoid overfitting and a significant decrease in training efficiency, this model only adds BiGRU units to the fifth submodule, after the CNN fuses the features, to capture high-level feature representations. After passing through these five modules, the tensor size is converted from the initial input (128, 32, 256) to (128, 1024, 8) before being input into the decoding component in Step 3. Previous work has shown that both simple and complex convolutional networks suffer from severe overfitting, which to some extent limits the generalization ability of the neural network on the test data. Therefore, in this part, each parallel CNN unit adds a layer of max pooling on top of the two convolutional layers to reduce the risk of overfitting and thereby improve the model's generalization ability.
[0114] Step 2.1: Input the EEG sequence preprocessed in step 1.2 into the feature extraction part. Feature extraction is performed through four parallel CNN and LSHAttention modules and one BiGRU fusion parallel CNN and LSHAttention module. The number of attention heads in the LSHAttention part is set to 4, the number of hash buckets is set to 256, and the number of local sensitive hashes is set to 4. The LSHAttention part uses local sensitive hashing attention, calculates the attention score through hash bucket mapping, and finally obtains the output tensor. First, as shown in Equation (3), the input tensor X is mapped to the key (K), value (V), and query (Q) spaces through linear transformation:
[0115] K=Linear(X), V=Linear(X), Q=Linear(X) (3)
[0116] Then, as shown in formula (4), the key (K) and query (Q) are hashed and mapped into multiple hash buckets:
[0117] HashedKeys=Hash(K),HashedQueries=Hash(Q) (4)
[0118] Then, as shown in formula (5), the attention score is calculated using the hashed key and query, where E is the attention scaling factor, and the attention score tensor A is obtained:
[0119]
[0120] Afterwards, the normalized attention scores are used to perform weighted summation on the values according to formula (6) and formula (7) to obtain the final output tensor O, and the output tensor O is projected to obtain the final output tensor.
[0121] O=AV(6)
[0122] Output=Linear(O) (7)
[0123] Step 2.2: In the BiGRU fusion module of parallel CNN and LSHAttention, after completing the feature merging of parallel CNN and LSHAttention, BiGRU will extract the bidirectional temporal dependency features of the EEG signal. After performing the convolution kernel batch normalization operation, the final feature map is obtained and input into the decoding part of step 3.
[0124] Step 3: Construct the decoding part. The decoding part is a sequence of two one-dimensional convolutional layers. After each convolutional layer completes processing, the tensor is passed to the batch normalization layer and the LeakyReLU activation function for processing. A dropout layer is added after the last convolutional layer to randomly drop some neurons during training to prevent overfitting. The convolutional layer convolves the input feature map and expands it into a two-dimensional tensor with a dimension of (128, 8192). The last layer of the decoding part is a fully connected layer that flattens the input to one dimension and feeds it into a linear layer. The output of the model is mapped back to (128, 512) to form the reconstructed EEG signal.
[0125] Step 4. The experiment uses five metrics to evaluate the semi-simulated dataset: relative root mean square error (RRMSE), correlation coefficient (CC), signal-to-noise ratio (SNR), weighted signal-to-noise ratio (WSNR), and wavelet cross-correlation coefficient (WCC). A smaller RRMSE, larger CC and WCC, and larger SNR and WSNR indicate a better noise reduction effect.
[0126] The present invention can be integrated into a BCI system based on non-invasive EEG acquisition, and is used to perform real-time noise reduction preprocessing during the original signal acquisition stage, thereby improving the accuracy and response efficiency of subsequent tasks (such as intention recognition, brain-controlled interaction, etc.). Combined with lightweight design, this method can be applied to consumer-grade brain-controlled devices, such as brain-controlled toys, brain-controlled wheelchairs, brain-controlled exoskeletons, etc. In addition, the present invention can be used in emotion recognition systems to obtain more stable feature extraction input signals after removing interference such as electrooculography and electromyography, thereby improving the accuracy of emotion classification models. This application can be expanded to fields such as online mental health assessment, attention monitoring, and anxiety prediction.
[0127] Relevant evidence of the technical effects achieved by the embodiments of the present invention.
[0128] Table 1. EMG denoising results (mean ± standard deviation)
[0129]
[0130]
[0131] Table 2. EOG denoising results (mean ± SD)
[0132]
[0133] Table 3. EOG+EMG mixed artifact denoising results (mean ± SD)
[0134]
[0135] EMG artifact removal: Table 1 shows the effectiveness of different EEG signal denoising methods for EEG artifact removal in EEGDenoiseNet. Comparing the RRMSE, CC, and SNR of each method in the table shows that the two traditional denoising methods, EMD-ICA and EMD-CCA, are far less effective at removing EMG artifacts than methods based on deep neural networks. Compared with other deep neural network-based methods, this method outperforms other deep neural network-based methods in various evaluation indicators of signal quality after removing EMG artifacts. Compared with the best-performing GCTNet, this method shows slight improvements, with CC increased by 0.005 and SNR increased by 0.111dB. The standard deviation of each indicator is smaller than that of GCTNet.
[0136] Table 2 shows the effectiveness of different denoising models for removing oculoculographic artifacts on the EEGDenoiseNet dataset. This method performs better than other denoising models. The average RRMSE (Rearness Residual Sequence) of this method is 0.253, the CC (Correlation Reduction) is 0.949, and the SNR (Signal Noise Reduction) is 14.088. Compared to other denoising methods, GCLSHNet significantly improves oculoculographic artifact removal, reduces the standard deviation, and achieves more stable denoising across different signal-to-noise ratios. Compared to GCTNet, the most effective method among all, this method reduces the RRMSE by 3.4% and improves the SNR by 2.9%.
[0137] Effect of removing mixed electromyographic and electrooculographic artifacts: The model's effect on removing mixed artifacts is shown in Table 3. Compared with other deep learning methods, this method has less fluctuation in denoising performance under different signal-to-noise ratios, with SNRs comparable to the optimal GCTNet, and a slight improvement in CC. However, it is worth noting that the removal effect of mixed artifacts by all denoising networks is somewhat reduced compared to the denoising effects on either electrooculographic or electromyographic artifacts alone. While GCLSHNet is superior to other neural networks in removing both electrooculographic and electromyographic artifacts individually, it is essentially on par with GCTNet in removing mixed artifacts, which may be related to the increased complexity of the task.
[0138] like Figure 5 As shown, the light gray signal is the original noisy signal, and the dark gray signal is the denoised EEG signal. This method effectively denoised most eye movements in both real datasets. In particular, in the real dataset provided by Dr. S. Van Huffel on the left, the EEG artifacts between 7 and 8 seconds were significantly reduced in channels like FP1, FP2, and F3.
[0139] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0140] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.
Claims
1. A method for reducing noise of an EEG signal, characterized in that: include: The EEG signal is input into a preprocessing module comprising two one-dimensional convolutional layers and a maximum pooling layer, wherein the convolution kernel size is 1×3, the stride is 1, the number of output channels is 32, the activation function is LeakyReLU, the pooling kernel size is 2, and the stride is 2.
2. The method according to claim 1, wherein The preprocessing module outputs a tensor as input, which is sequentially input into five feature extraction submodules. Each of the submodules includes a set of parallel structures, including a convolutional neural network branch and a local sensitive hashing attention mechanism branch, and the output is integrated through a fusion convolution layer.
3. The method according to claim 2, wherein The fused features are input into a BiGRU unit. The BiGRU structure is a bidirectional recurrent unit and extracts forward and reverse sequence features in parallel.
4. The method according to any one of claims 1 to 3, wherein The decoding module includes two one-dimensional convolutional layers, two batch normalization layers, two LeakyReLU activation functions, a Dropout layer and a fully connected layer, and the Dropout layer is located after the second convolutional layer.
5. The method according to claim 1, wherein The input signal dimension is 128×1×512, the data used is the EEGDenoiseNet training set, the signal-to-noise ratio of the training signal is set to -5dB to 5dB, with an interval of 1dB, and the training data is semi-simulated EEG signals.
6. The method according to claim 5, wherein The semi-simulated EEG signal includes an electrooculogram (EOG) artifact contamination signal, an electromyography (EMG) artifact contamination signal, and a mixed signal containing both EOG and EMG artifacts.
7. The method according to claim 2, wherein The locality-sensitive hashing attention mechanism includes a key, value, and query matrix generated based on a linear transformation, and a hash function for hashing the keys and queries into multiple hash buckets.
8. The method according to claim 7, wherein The attention mechanism is equipped with 4 attention heads, 4 locality-sensitive hash functions and 256 hash buckets.
9. An EEG signal denoising system for implementing the method according to any one of claims 1 to 8, characterized in that: include: A preprocessing module, a feature extraction module, a decoding module and an evaluation module, wherein the feature extraction module comprises at least five groups of CNN and LSH attention submodules and a BiGRU structure.
10. The system according to claim 9, wherein: The evaluation module includes a calculation unit for outputting relative root mean square error, correlation factor, signal-to-noise ratio, weighted signal-to-noise ratio and wavelet cross-correlation coefficient.