EEG signal denoising method based on dual-path convolutional denoising network
By using a method based on a dual-path convolutional denoising network and utilizing local and global information extraction, the problem of EEG signal denoising that is difficult to take into account both short-term and long-term information in existing technologies is solved, and efficient denoising and nonlinear feature preservation are achieved.
Patent Information
- Application Number
- CN202411370325.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-09-29
AI Technical Summary
Existing EEG signal denoising methods are unable to effectively balance the extraction of short-term and long-term information, resulting in difficulty in effectively removing noise when extracting local and global information while maintaining the nonlinear characteristics of EEG signals.
A method based on a dual-path convolutional denoising network is adopted. The EEG signal is converted into time-frequency domain features through a signal encoder and divided into blocks. The EEG signal is encoded into a one-dimensional feature vector through a signal encoder using a convolutional denoising network method with local and global information. A mask generator is used to extract local and global information, and denoising is performed in combination with a feature fuser and a signal decoder.
The performance of EEG signal denoising is significantly improved, the denoising quality and efficiency are improved, and it can effectively remove artifact noise while maintaining the nonlinear characteristics of EEG signals.
Smart Images

Figure CN119157556B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical signal processing, and in particular relates to an electroencephalogram (EEG) signal denoising method based on a dual-path convolutional denoising network. Background Art
[0002] Electroencephalography (EEG) is a method for recording and measuring the electrical activity of the brain. EEG captures electrical signals generated by neuronal activity by placing electrodes on the scalp. These signals are amplified and recorded to analyze brain function and activity. EEG has the advantages of high temporal resolution and non-invasiveness, but its spatial resolution is low and the signal is susceptible to interference, such as cardiac, eye, and muscle artifacts, as well as environmental interference. These ubiquitous noise interferences during the acquisition process seriously hinder the acquisition of pure EEG signals, greatly limiting the development of related research and practical applications. Therefore, we urgently need an efficient EEG denoising technology that can significantly reduce noise without compromising key information.
[0003] There are many traditional methods and deep learning-based methods for EEG signal denoising. The traditional methods mainly include the following: the first is a regression-based method, which assumes that the EEG of each channel is the accumulation of clean EEG data and a certain proportion of artifacts, and then estimates and subtracts the artifacts from the original signal to obtain a pure EEG, but this method is sensitive to outliers; the second is an adaptive filtering-based method, which iteratively adjusts weights according to optimization algorithms such as least mean square and recursive least squares algorithm, quantizes the noise in the input signal, and filters it out, but this method requires an additional reference input and has a slow convergence speed and a large amount of calculation; the third is blind source separation (BLS). The basic sources separation (BSS) method is a method that uses the independence of source signals to separate independent source signals from the acquired signal, without knowing the system transfer function, source signal mixing coefficients, and probability distribution. BSS methods also include variations such as principal component analysis (PCA), independent component analysis (ICA), and canonical correlation analysis (CCA). However, this method cannot effectively separate noise from the desired signal when the number of EEG signal channels is less than the number of signal sources being separated. The fourth method is the wavelet transform method, which converts the original signal from the time domain to the time-frequency domain and selects an appropriate mother wavelet to decompose the original signal. However, this method has relatively poor resolution of the frequency domain features of high-frequency signals. However, single denoising methods often have limitations when used, so combining several single denoising methods can leverage the strengths of each method. Examples include wavelet-ICA, EMD-ICA, and EEMD-CCA. However, the key to these methods is selecting an appropriate threshold function, which can lead to incomplete noise removal or attenuation of the desired signal.
[0004] In recent years, thanks to the rapid development of deep learning, the massive increase in EEG data and the significant increase in computing power, deep learning methods have been used to denoise EEG signals and achieve better denoising performance. EEG signals are non-stationary signals, that is, their statistical characteristics change over time, which means that the characteristics of the signal may change in different time periods. Therefore, when the model denoises EEG signals, it is necessary to take into account the extraction of global information and local information. Global information can help capture the overall trend of these changes, while local information can handle instantaneous changes or abnormalities in specific time periods. Existing denoising methods that consider the fusion of local and global features of EEG signals can only rely on adaptive learning of the model to extract information between sampling points that are far apart, and are not applicable to sampling points that are actually far apart. Summary of the Invention
[0005] To address the problems in the background art, the present invention aims to provide an EEG signal denoising method based on a dual-path convolutional denoising network. The method explicitly guides the model to extract both short-term and long-term information, effectively removing artifacts and noise from the EEG signal while maintaining the nonlinear characteristics of the original EEG signal.
[0006] The technical solutions adopted in the present invention are as follows:
[0007] 1. An EEG signal denoising method based on a dual-path convolutional denoising network
[0008] The EEG signal denoising method comprises the following steps:
[0009] S1) obtaining a plurality of EEG signal samples, adding noise of different signal-to-noise ratios to each EEG signal sample, obtaining a noisy EEG signal sample corresponding to each EEG signal sample, constructing each EEG signal sample and the corresponding noisy EEG signal sample into a pair of signal sample pairs, and normalizing each signal sample pair to obtain a training set consisting of all normalized signal sample pairs;
[0010] S2) constructing a dual-path convolutional denoising network, training the dual-path convolutional denoising network using a training set, and obtaining a trained dual-path convolutional denoising network after the training is completed;
[0011] The dual-path convolutional denoising network includes a signal encoder, a mask generator, a feature fusion device and a signal decoder connected in series;
[0012] The signal encoder is used to encode the original EEG signal input to the dual-path convolutional denoising network into a one-dimensional feature vector;
[0013] The mask generator is used to perform segmentation and stacking processing on the feature vector to form a two-dimensional feature vector, and extract local information and global information from the two-dimensional feature vector to generate a mask;
[0014] The feature fusion device is used to perform a multiplication operation on the mask and the feature vector to obtain a denoised feature vector, and the signal decoder is used to convert the denoised feature vector into a denoised EEG signal and output the denoised EEG signal to a dual-path convolutional denoising network;
[0015] In step S2), the dual-path convolutional denoising network is trained using the Adam optimization method, and the mean square error (MSE) is used as the loss function during the training process.
[0016] S3) collecting original EEG signals, and inputting the original EEG signals into the trained dual-path convolutional denoising network to obtain denoised EEG signals.
[0017] In the dual-path convolutional denoising network, the signal encoder is mainly composed of a one-dimensional convolutional layer and a ReLU activation function connected in series; the signal decoder is mainly composed of a one-dimensional transposed convolutional layer.
[0018] In the dual-path convolutional denoising network, the mask generator is mainly composed of a segmenter, an information extractor and a synthesizer connected in series.
[0019] The splitter is used to perform an overlapping cutting operation with a length of K and a hop number of H on the feature vector output by the signal encoder to obtain P overlapping time periods, and then stack the P overlapping time periods to form a two-dimensional feature vector and output it; the length of the first dimension of the two-dimensional feature vector is K, and the length of the second dimension of the two-dimensional feature vector is P.
[0020] The information extractor is used to iteratively process the two-dimensional feature vector to generate extracted features. In each round of iteration, a local information extraction and a global information extraction are performed. The information extractor is mainly composed of a local information extraction unit and a global information extraction unit alternately connected in series. The local information extraction unit is used for local information extraction, and the global information extraction unit is used for global information extraction. The local information extraction unit and the global information extraction unit are alternately connected in series, the input end of the first local information extraction unit is connected to the output end of the segmenter, and the output end of the last global information extraction unit is connected to the input end of the synthesizer. The local information extraction is achieved by using the local information extraction unit to extract features from the first dimension of the two-dimensional feature vector, and the global information extraction is achieved by using the global information extraction unit to extract features from the second dimension of the two-dimensional feature vector.
[0021] The local information extraction unit and the global information extraction unit are mainly composed of at least one continuous dilated convolution module and an accumulation module, and the accumulation module is used to perform an accumulation operation on all its own inputs; in each local information extraction unit / global information extraction unit, the input end of the first dilated convolution module is the input end of the local information extraction unit / global information extraction unit, and except for the first dilated convolution module, the input end of each dilated convolution module is connected to the output end of the previous dilated convolution module, and the output ends of all dilated convolution modules in the same information extraction unit are simultaneously connected to the input end of the accumulation module to perform an accumulation operation, and the output end of the accumulation module is the output end of the local information extraction unit / global information extraction unit.
[0022] The dilated convolution module is mainly composed of X dilated convolution layers, a terminal one-dimensional convolution layer, and an accumulation layer. The input of the first dilated convolution layer serves as the input of the dilated convolution module. Except for the first dilated convolution layer, the input of each dilated convolution layer is connected to the output of the previous dilated convolution layer. The output of the last dilated convolution layer is connected to the input of the terminal one-dimensional convolution layer. The input of the accumulation layer is respectively connected to the output of the terminal one-dimensional convolution layer and the output of the previous level of the dilated convolution module. The output of the accumulation layer serves as the output of the dilated convolution module and is connected to the input of the next level. Each dilated convolution layer is mainly composed of a one-dimensional convolution layer, a PReLU activation layer, and a GroupNorm normalization layer connected in series.
[0023] The dilated convolution module is mainly composed of a first one-dimensional convolution layer, a first PReLU activation layer, a first GroupNorm normalization layer, a second one-dimensional convolution layer, a second PReLU activation layer, a second GroupNorm normalization layer, a terminal one-dimensional convolution layer and an accumulation layer connected in series in sequence; the convolution kernel and step size of the first one-dimensional convolution layer, the second one-dimensional convolution layer and the terminal one-dimensional convolution layer are both 1, the dilation factors of the first one-dimensional convolution layer and the terminal one-dimensional convolution layer are both 1, and the dilation factor of the second one-dimensional convolution layer increases exponentially with the position order of the dilated convolution module in the information extraction unit to which it belongs.
[0024] Local information extraction is achieved by using a local information extraction unit to extract features from the first dimension of the two-dimensional feature vector. The specific process is as follows: after receiving the two-dimensional feature vector to be processed, the local information extraction unit first adds a preset batch dimension B to the two-dimensional feature vector to be processed, then multiplies the second dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then performs feature extraction on the initialized two-dimensional feature vector to be processed;
[0025] The process of realizing global information extraction by performing feature extraction from the second dimension of the two-dimensional feature vector using the global information extraction unit is as follows: after the global information extraction unit receives the two-dimensional feature vector to be processed, it first adds a preset batch dimension B to the two-dimensional feature vector to be processed, and then multiplies the first dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then performs feature extraction on the initialized two-dimensional feature vector to be processed.
[0026] The synthesizer is used to integrate and overlap-add the extracted features output by the information extractor to generate a mask. The synthesizer mainly consists of a synthesized PReLU activation layer, a two-dimensional convolution layer, an overlap-add layer, a first synthesized one-dimensional convolution layer, a synthesized Sigmoid activation layer, a second synthesized one-dimensional convolution layer, and a synthesized ReLU activation layer, which are connected in sequence.
[0027] 2. An EEG signal denoising system for implementing an EEG signal denoising method based on a dual-path convolutional denoising network
[0028] The EEG signal denoising system includes an acquisition module for acquiring EEG signals;
[0029] The EEG signal denoising system includes a denoising module, which is used to denoise the original EEG signal using a pre-trained dual-path convolutional denoising network to obtain a denoised EEG signal.
[0030] Compared with the prior art, the present invention has the following advantages:
[0031] 1. This invention uses a dual-path convolutional denoising network, using a signal encoder to convert the original EEG signal into a characteristic signal in the time-frequency domain. It then divides the time series into blocks, extracting local information at short distances and global information at long distances from both within the time block and between the time blocks. It then iteratively captures local information and global information within and between blocks, respectively. The extracted local information is used to enhance the ability to extract global information, and the global information is used to optimize the extraction process of local information. This method significantly improves the performance of the model in EEG signal denoising.
[0032] 2. The method of the present invention divides the signal denoising process into the extraction process of the mask of the clean signal in the signal and the artifact removal process, thereby improving the quality of the EEG signal after the network model removes the artifacts.
[0033] 3. The present invention has the advantages of good denoising quality and high denoising efficiency, and can be applied to the preprocessing process of EEG signal processing and the field of signal denoising processing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of the EEG signal denoising method of the present invention;
[0035] Figure 2 Schematic diagram of the structure of the dual-path convolutional denoising network in the present invention;
[0036] Figure 3 Schematic diagram of the structure of the segmenter of the dual-path convolutional denoising network in the present invention;
[0037] Figure 4 Schematic diagram of the structure of the synthesizer of the dual-path convolutional denoising network in the present invention;
[0038] Figure 5 Schematic diagram of the structure of the dilated convolution module of the dual-path convolutional denoising network in the present invention;
[0039] Figure 63 is a waveform comparison diagram of a noisy EEG signal, a clean EEG signal, and a denoised EEG signal in Example 1 of the present invention. DETAILED DESCRIPTION
[0040] The present invention will be further described below with reference to the accompanying drawings and examples, but the present invention is not limited to the following embodiments.
[0041] Example 1
[0042] In this embodiment, 5598 EEG sample data are selected from the public dataset EEGDenoiseNet database as an example, with a sampling rate of 512 Hz. Each sample data is 1024 points long, representing an EEG signal with a time length of 2 seconds.
[0043] The process of this embodiment is as follows Figure 1 As shown, the following steps are included:
[0044] S1) Select EEG signal samples, construct noisy EEG signal samples and obtain signal sample pairs, and divide the network into training set, validation set and test set: obtain several EEG signal samples, add noise with different signal-to-noise ratios to each EEG signal sample, obtain noisy EEG signal samples corresponding to each EEG signal sample, construct each EEG signal sample and its corresponding noisy EEG signal sample into a signal sample pair and perform normalization processing to obtain a signal sample pair corresponding to each EEG signal sample. The signal sample pairs corresponding to all EEG signal samples constitute the data set. This step is specifically as follows:
[0045] S1.1) Select EEG signal samples
[0046] 4514 clean EEG signal samples were selected from the public dataset EEGDenoiseNet c ,4514 EMG signals are also selected from the public dataset EEGDenoiseNet. Each EMG signal is used as a noise signal sample Noise to form a noise signal sample set. The number of sampling points of EEG signal samples and noise signal samples is 1024.
[0047] S1.2) Construct noisy EEG signal samples and obtain signal sample pairs
[0048] For any EEG signal sample c , randomly select a noise signal sample Noise from the noise signal sample set, and randomly generate an SNR value in the range of -7dB to 2dB, and then perform an EEG signal analysis based on the SNR value. c Linearly mix it with the EMG noise signal sample Noise to obtain the noisy EEG signal sample EEG n ;
[0049] Obtain noisy EEG signal samples n After that, the noisy EEG signal sample EEG n The input of the dual-path convolutional denoising network corresponds to the clean EEG signal sample EEG c As a label, each noisy EEG signal sample EEG n And the corresponding clean EEG signal sample EEG c Construct a signal sample pair and perform normalization on each signal sample pair. The normalization process is to convert the noisy EEG signal sample EEG in each signal sample pair into n and clean EEG signal samples c At the same time, divide the noisy EEG signal sample EEG n The standard deviation of
[0050] All normalized signal sample pairs constitute a data set.
[0051] The specific method of linearly mixing clean EEG signal samples and noise signal samples to construct noisy EEG signal samples is as follows:
[0052] EEG n =EEG c +λ*Noise
[0053] Where, EEG n represents a noisy EEG signal sample with an electro-oculographic noise signal sample or an electromyographic noise signal sample added, Noise represents a noise sample, and λ represents the noise pollution factor.
[0054] Among them, the noise pollution degree factor λ is obtained according to the following formula:
[0055]
[0056] Where, RMS(EEG c ) represents the root mean square of the clean EEG signal samples, and RMS(λ·Noise) represents the root mean square of the noise signal samples.
[0057] S1.3) Divide the network into training set, validation set and test set
[0058] The dataset obtained in step S1.2) is divided into 80% as a network training set, 10% as a validation set, and 10% as a test set, and it is ensured that there is no overlap between the test set, validation set, and training set.
[0059] S2) Constructing a dual-path convolutional denoising network and training the dual-path convolutional denoising network: Constructing a dual-path convolutional denoising network and training it using a training set. After the training is completed, a trained dual-path convolutional denoising network is obtained. This step is specifically as follows:
[0060] S2.1) Constructing a dual-path convolutional denoising network
[0061] like Figure 2 The dual-path convolutional denoising network shown in the figure mainly consists of a signal encoder, a mask generator, and a feature fusion device (see Figure 2 in ) and the signal decoder are connected in series.
[0062] The signal encoder is used to encode the raw EEG signal input to the dual-path convolutional denoising network into a feature vector. The input of the signal encoder serves as the input of the dual-path convolutional denoising network and receives the raw EEG signal. The output of the signal encoder is connected to the input of the mask generator and the input of the feature fusion layer. The signal encoder is primarily composed of a signal encoding one-dimensional convolutional layer and a signal encoding ReLU activation function layer connected in series. The output of the signal encoding one-dimensional convolutional layer is connected to the input of the signal encoding ReLU activation function layer.
[0063] In the signal encoder of this embodiment, the convolution kernel size of the signal encoding one-dimensional convolution layer is 30, the step size is 15, and the number of channels is 256.
[0064] The feature fuser multiplies the mask generated by the mask generator with the feature vector output by the signal encoder to obtain a denoised feature vector. The input of the feature fuser is connected to the output of the signal encoder and the output of the mask generator, and the output of the feature fuser is connected to the input of the signal decoder.
[0065] The signal decoder converts the denoised feature vectors output by the feature fusion unit into denoised EEG signals and then feeds the denoised EEG signals into the dual-path convolutional denoising network. The input of the signal decoder is connected to the output of the feature fusion unit, and the output of the signal decoder serves as the output of the dual-path convolutional denoising network, outputting the denoised EEG signals. The signal decoder primarily consists of a one-dimensional transposed convolutional layer.
[0066] In this embodiment, the convolution kernel size of the one-dimensional transposed convolution layer of the signal decoder is 30, the stride is 15, and the number of channels is 1.
[0067] The mask generator segments and stacks feature vectors to form two-dimensional feature vectors. It then performs multiple rounds of local and global information extraction on these two-dimensional feature vectors to generate a mask. The mask generator primarily consists of a segmenter, an information extractor, and a synthesizer connected in series.
[0068] In the mask generator, the segmenter is used to perform overlapping cutting operations of length K and number of hops H on the feature vector (a one-dimensional vector with a length of S and a number of channels F) to obtain P overlapping time segments. All overlapping time segments are then stacked to form a two-dimensional feature vector and output. Among them, the P overlapping time segments are P one-dimensional vectors of length K. Figure 3 As shown, the length of the first dimension of the two-dimensional feature vector is K, and the length of the second dimension of the two-dimensional feature vector is P. In this embodiment, K=30, and H=15.
[0069] In the mask generator, the information extractor is used to iteratively process the two-dimensional feature vector output by the segmenter to obtain extracted features. This process enables the iterative and alternating extraction of information from two dimensions: within the time block and between time blocks. In each round of iteration, local information extraction and global information extraction are performed in sequence; local information extraction refers to the extraction of feature information from the dimensions within the time block, which is achieved by extracting features from the first dimension K of the two-dimensional feature vector; global information extraction refers to the extraction of feature information from the dimensions between time blocks, which is achieved by extracting features from the second dimension P of the two-dimensional feature vector. In this embodiment, local information extraction is performed first and then global information extraction in each round of iteration.
[0070] The information extractor is divided into local information extraction units for extracting information within a time block and global information extraction units for extracting information between time blocks. The local information extraction units and the global information extraction units are alternately connected in series, with the input of the first local information extraction unit connected to the output of the segmenter, and the output of the last global information extraction unit connected to the input of the synthesizer. Specifically, the input of the first local information extraction unit is the two-dimensional feature vector output by the segmenter, and the input of the local information extraction units other than the first local information extraction unit is the output of the previous global information extraction unit. The last global information extraction unit transmits the extracted features output to the synthesizer.
[0071] The information extractor is mainly composed of a series of dilated convolution modules. The more modules there are in the dilated convolution module, the wider the field of view of the feature extractor is and the more factors it considers during feature extraction. Figure 2 As shown, in the local information extraction unit and the global information extraction unit, the dilated convolution modules are connected in series. Except for the input of the first dilated convolution module, which serves as the input of the local information extraction unit / global information extraction unit, the input of each dilated convolution module is connected to the output of the previous dilated convolution module. In other words, the input of the first dilated convolution module is the input of the local information extraction unit / global information extraction unit, and the input of each subsequent dilated convolution module is the output of the previous dilated convolution module.
[0072] In this embodiment, the local information extraction unit includes 6 dilated convolution modules connected in series, the global information extraction unit includes 3 dilated convolution modules connected in series, and the overall number of iterations is 4.
[0073] In addition, the information extractor also includes an accumulation module. An accumulation module is provided at the end of each local information extraction unit and the end of the global information extraction unit (see Figure 2 Symbols in In each local information extraction unit / global information extraction unit, the output ends of all dilated convolution modules are simultaneously connected to the input end of the accumulation module to perform an accumulation operation, and the output end of the accumulation module is used as the output end of the local information extraction unit / global information extraction unit. In other words, the outputs of all dilated convolution modules in the local information extraction unit / global information extraction unit are the inputs of the accumulation module, and the output of the accumulation module is the output of the local information extraction unit / global information extraction unit.
[0074] The local information extraction unit is used to extract features from the first dimension of the two-dimensional feature vector to achieve local information extraction. The specific process is as follows: after receiving the two-dimensional feature vector to be processed, the local information extraction unit first adds a preset batch dimension B to the two-dimensional feature vector to be processed, then multiplies the second dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then extracts features from the initialized two-dimensional feature vector to be processed. Figure 3 As shown, the two-dimensional feature vector to be processed is represented as D intra ∈R F×K×P , to D intra After adding a batch size dimension, we get D intra '∈R B×F×K×P , where B represents the batch dimension. Then D intra The second dimension P of ' is multiplied by the batch dimension B to obtain the initialized two-dimensional feature vector D to be processed intra ”∈R BP×F×K , and then initialize the two-dimensional feature vector D to be processed intra ”∈R BP×F×K Input it into the continuous expansion convolution module in the local information extraction unit, perform multi-scale feature extraction and then restore it to D intra ”'∈R B×F×K×P In this process, the input and output data sizes of each local information extraction unit are consistent.
[0075] The process of extracting global information by using the global information extraction unit to extract features from the second dimension of the two-dimensional feature vector is as follows: after receiving the two-dimensional feature vector to be processed, the global information extraction unit first adds a preset batch dimension B to the two-dimensional feature vector to be processed, then multiplies the first dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then extracts features from the initialized two-dimensional feature vector to be processed. Figure 3 As shown, the two-dimensional feature vector to be processed is represented as D inter ∈R F×K×P , to D inter After adding a batch size dimension, we get D inter '∈R B×F×K×P , where B represents the batch dimension. Then D inter The first dimension K is multiplied by the batch dimension B to obtain the initialized two-dimensional feature vector D to be processed inter ”∈R BK×F×P , and then initialize the two-dimensional feature vector D to be processed inter ”∈R BK×F×P Input it into the continuous expansion convolution module in the global information extraction unit, perform multi-scale feature extraction and then restore it to D inter ”'∈R B×F×K×P In this process, the input and output data sizes of each global information extraction unit are consistent.
[0076] The number of dilated convolution modules in the local information extraction unit and the global information extraction unit is independent of each other, that is, the number of dilated convolution modules in the two units can be equal or different. In this embodiment, the accumulation module in the local information extraction unit performs an accumulation operation on the outputs of six dilated convolution modules, and the accumulation module in the global information extraction unit performs an accumulation operation on the outputs of three dilated convolution modules.
[0077] The structure of the dilated convolution module is as follows Figure 5 The dilated convolution module mainly consists of X dilated convolution layers, a terminal one-dimensional convolution layer and an accumulation layer (see Figure 5 Symbols in ); the accumulation layer performs an accumulation operation on its two inputs. The input end of the first dilated convolution layer is used as the input end of the dilated convolution module and is connected to the output end of the previous level of the dilated convolution module. Except for the first dilated convolution layer, the input end of each dilated convolution layer is connected to the output end of the previous dilated convolution layer, and the output end of the last dilated convolution layer is connected to the input end of the terminal one-dimensional convolution layer. The output end of the terminal one-dimensional convolution layer is connected to the input end of the accumulation layer. The input end of the accumulation layer is also connected to the output end of the previous level of the dilated convolution module. The output end of the accumulation layer is used as the output end of the dilated convolution module and is connected to the input end of the next level of the dilated convolution module. Each dilated convolution layer is mainly composed of a one-dimensional convolution layer, a PReLU activation layer and a GroupNorm normalization layer connected in series. The PReLU activation layer is mainly composed of a PReLU activation function.
[0078] In this embodiment, the number X of dilated convolutional layers is 2. Figure 5 As shown, the dilated convolution module in this embodiment includes a first one-dimensional convolution layer c1, a first PReLU activation layer a1, a first GroupNorm normalization layer n1, a second one-dimensional convolution layer c2, a second PReLU activation layer a2, a second GroupNorm normalization layer n2, a terminal one-dimensional convolution layer c3 and an accumulation layer (see Figure 5 Symbols in )composition.
[0079] More specifically, the convolution kernel and stride of the three one-dimensional convolutional layers are both 1, the dilation factor of the first one-dimensional convolutional layer c1 and the terminal one-dimensional convolutional layer c3 are both 1, and the dilation factor of the second one-dimensional convolutional layer c2 is related to the position order of the dilated convolutional layer in the signal extractor. In this embodiment, for each local information extraction unit, from the first dilated convolution module to the sixth dilated convolution module, the dilation factor of the second one-dimensional convolutional layer c2 is 1, 2, 4, 6, 8, and 16, respectively; for each global information extraction unit, from the first dilated convolution module to the third dilated convolution module, the dilation factor of the second one-dimensional convolutional layer c2 is 1, 2, and 4, respectively. In all dilated convolution modules, the number of channels of the first one-dimensional convolutional layer c1 and the second one-dimensional convolutional layer c2 is 1024, and the number of channels of the terminal one-dimensional convolutional layer c3 is 256.
[0080] like Figure 4 As shown in Figure 1, the synthesizer is used to integrate and overlap-add the extracted features to generate a mask that matches the shape of the feature vector. The synthesizer mainly consists of a synthesized PReLU activation layer r1, a two-dimensional convolutional layer d1, an overlap-add layer, a first synthesized one-dimensional convolutional layer g1, a Sigmoid activation layer r2, a second synthesized one-dimensional convolutional layer g2, and a synthesized ReLU activation layer r3, connected in sequence.
[0081] The synthesizer is used to integrate and overlap-add the extracted features to generate a mask that matches the shape of the feature vector. Among them, the purpose of the synthetic PReLU activation layer r1 and the synthetic ReLU activation layer r3 is to introduce nonlinearity into the network to help the model more effectively capture and learn long-term dependencies and more complex data patterns in the data. The difference is that the synthetic ReLU activation layer r3 changes the negative slope to 0, that is, all negative numbers are changed to 0, while the synthetic PReLU activation layer r1 uses trainable parameters to dynamically control the negative slope; the two-dimensional convolution layer d1 and the two synthetic one-dimensional convolution layers are both used to integrate and process the extracted features. The difference is that the two-dimensional convolution layer d1 is used for two-dimensional feature vectors, while the first synthetic one-dimensional convolution layer g1 is used for one-dimensional feature vectors after overlap-addition, and the second synthetic one-dimensional convolution layer g2 is used for one-dimensional feature vectors processed by the Sigmoid activation layer r2; the Sigmoid activation layer r2 is used to map the range of variables to between 0 and 1 to facilitate subsequent multiplication operations with feature vectors; the overlap-addition layer is used to restore the two-dimensional feature vectors to one-dimensional feature vectors.
[0082] In the synthesizer of this embodiment, the convolution kernel size of the two-dimensional convolution layer d1 is 1, the step size is 1, and the number of channels is 256; the convolution kernel size of the first synthesized one-dimensional convolution layer g1 is 1, the step size is 1, and the number of channels is 256; the convolution kernel size of the second synthesized one-dimensional convolution layer g2 is 1, the step size is 1, and the number of channels is 256.
[0083] S2.2) Training dual-path convolutional denoising network
[0084] Use the network training set divided in step S1.3) to train the dual-path convolutional denoising network. Use the Adam optimization method, a learning rate of 0.0003, 128 samples per model training, and the mean squared error (MSE) as the loss function. During training, use the validation set to verify the results of the trained network. If the results do not update after 30 validation runs, stop training to prevent overfitting. This results in a trained dual-path convolutional denoising network.
[0085] The above mean square error function MSE is obtained according to the following formula:
[0086]
[0087] Among them, x i Represents clean EEG signal sample data, Represents the denoised EEG signal sample data output by the model.
[0088] S3) Reconstructing the denoised EEG signal: collecting the original EEG signal and inputting the original EEG signal into the trained dual-path convolutional denoising network to obtain the denoised EEG signal.
[0089] like Figure 6 As shown, the noisy EEG signal in the test set (left one) is input into the trained dual-path convolutional denoising network, and the denoised EEG signal is output (right one). The clean EEG signal is shown in Figure 6 The middle picture.
[0090] It can be seen that the method of the present invention has a good denoising effect.
[0091] Example 2
[0092] This example uses 3400 clean EEG signal samples from the public dataset EEGDenoiseNet as an example, with a sampling rate of 256 Hz. Each sample is 512 points long, representing an EEG signal with a duration of 2 seconds.
[0093] The steps of Example 2 are basically the same as those of Example 1, except that:
[0094] In step S1.1), 3400 electrooculogram (EOG) signals are selected from the public dataset EEGDenoiseNet as noise signal samples, and the number of sampling points of both EEG signal samples and noise signal samples is 512.
[0095] In the dual-path convolutional denoising network constructed in step S2.1):
[0096] In the signal encoder, the convolution kernel size of the signal encoding one-dimensional convolution layer is 30, the stride is 15, and the number of channels is 256;
[0097] In the splitter, K = 20, H = 10;
[0098] In the information extractor, the number of iterations is 3;
[0099] In the signal decoder, the convolution kernel size of the one-dimensional transposed convolution layer is 10, the stride is 5, and the number of channels is 1.
Claims
1. A method for denoising EEG signals based on a dual-path convolutional denoising network, characterized by: The following steps are involved: S1) obtaining a plurality of EEG signal samples, adding noise to each EEG signal sample to obtain a noisy EEG signal sample corresponding to each EEG signal sample, constructing each EEG signal sample and the corresponding noisy EEG signal sample into a pair of signal sample pairs, and performing normalization processing on each signal sample pair to obtain a training set; S2) constructing a dual-path convolutional denoising network, training it using the training set, and obtaining a trained dual-path convolutional denoising network after the training is completed; The dual-path convolutional denoising network includes a signal encoder, a mask generator, a feature fusion device, and a signal decoder connected in series in sequence; the signal encoder is used to encode the original EEG signal into a feature vector; the mask generator is used to segment and stack the feature vector, and extract local information and global information from the formed two-dimensional feature vector to generate a mask; the feature fusion device is used to multiply the mask and the feature vector to obtain a denoised feature vector, and the signal decoder is used to convert the denoised feature vector into a denoised EEG signal, and output the denoised EEG signal to the dual-path convolutional denoising network; S3) collecting original EEG signals, and inputting the original EEG signals into the trained dual-path convolutional denoising network to obtain denoised EEG signals.
2. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 1, characterized in that: The mask generator is mainly composed of a segmenter, an information extractor and a synthesizer connected in series; The segmenter is configured to perform an overlapping segmentation operation with a length of K and a hop count of H on the feature vector output by the signal encoder to obtain P overlapping time segments, and then perform a stacking operation on the P overlapping time segments to form and output a two-dimensional feature vector; the length of the first dimension of the two-dimensional feature vector is K, and the length of the second dimension of the two-dimensional feature vector is P; The information extractor is used to iteratively process the two-dimensional feature vector to generate extracted features. In each round of iteration, a local information extraction and a global information extraction are performed. The local information extraction is achieved by extracting features from the first dimension of the two-dimensional feature vector, and the global information extraction is achieved by extracting features from the second dimension of the two-dimensional feature vector. The synthesizer is used to perform integration processing and overlap-addition processing on the extracted features output by the information extractor, thereby generating a mask.
3. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 2, characterized in that: The information extractor is mainly composed of a local information extraction unit and a global information extraction unit, the local information extraction unit and the global information extraction unit are alternately connected in series, the input end of the first local information extraction unit is connected to the output end of the segmenter, and the output end of the last global information extraction unit is connected to the input end of the synthesizer; The local information extraction unit and the global information extraction unit are mainly composed of at least one dilated convolution module and an accumulation module; in the local information extraction unit / global information extraction unit, except for the first dilated convolution module, the input end of each dilated convolution module is connected to the output end of the previous dilated convolution module, and the output ends of all dilated convolution modules are simultaneously connected to the input end of the accumulation module to perform an accumulation operation.
4. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 3, characterized in that: The dilated convolution module is mainly composed of X dilated convolution layers, a terminal one-dimensional convolution layer and an accumulation layer; the input end of the first dilated convolution layer serves as the input end of the dilated convolution module. Except for the first dilated convolution layer, the input end of each dilated convolution layer is connected to the output end of the previous dilated convolution layer, the output end of the last dilated convolution layer is connected to the input end of the terminal one-dimensional convolution layer, the input end of the accumulation layer is respectively connected to the output end of the terminal one-dimensional convolution layer and the output end of the previous level of the dilated convolution module, and the output end of the accumulation layer serves as the output end of the dilated convolution module; each dilated convolution layer is mainly composed of a one-dimensional convolution layer, a PReLU activation layer and a GroupNorm normalization layer connected in series.
5. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 3, characterized in that: The dilated convolution module is mainly composed of a first one-dimensional convolution layer, a first PReLU activation layer, a first GroupNorm normalization layer, a second one-dimensional convolution layer, a second PReLU activation layer, a second GroupNorm normalization layer, a terminal one-dimensional convolution layer and an accumulation layer connected in series in sequence; The convolution kernel and stride of the first one-dimensional convolution layer, the second one-dimensional convolution layer and the terminal one-dimensional convolution layer are all 1. The dilation factors of the first one-dimensional convolution layer and the terminal one-dimensional convolution layer are both 1. The dilation factor of the second one-dimensional convolution layer increases exponentially with the position order of the dilated convolution module in the information extraction unit to which it belongs.
6. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 3, characterized in that: Local information extraction is achieved by using a local information extraction unit to extract features from the first dimension of the two-dimensional feature vector. The specific process is as follows: after receiving the two-dimensional feature vector to be processed, the local information extraction unit first adds a preset batch dimension B to the two-dimensional feature vector to be processed, then multiplies the second dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then performs feature extraction on the initialized two-dimensional feature vector to be processed; The process of realizing global information extraction by performing feature extraction from the second dimension of the two-dimensional feature vector using the global information extraction unit is as follows: after the global information extraction unit receives the two-dimensional feature vector to be processed, it first adds a preset batch dimension B to the two-dimensional feature vector to be processed, and then multiplies the first dimension by the batch dimension B to generate an initialized two-dimensional feature vector to be processed, and then performs feature extraction on the initialized two-dimensional feature vector to be processed.
7. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 1, characterized in that: The signal encoder is mainly composed of a one-dimensional convolution layer and a ReLU activation function connected in series; the signal decoder is mainly composed of a one-dimensional transposed convolution layer.
8. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 2, characterized in that: The synthesizer mainly consists of a synthetic PReLU activation layer, a two-dimensional convolution layer, an overlap-addition layer, a first synthetic one-dimensional convolution layer, a synthetic Sigmoid activation layer, a second synthetic one-dimensional convolution layer and a synthetic ReLU activation layer connected in sequence.
9. The EEG signal denoising method based on a dual-path convolutional denoising network according to claim 1, characterized in that: In step S2), the dual-path convolutional denoising network is trained using the Adam optimization method, and the mean square error (MSE) is used as the loss function during the training process.
10. An EEG signal denoising system based on a dual-path convolutional denoising network, used to implement the EEG signal denoising method based on a dual-path convolutional denoising network according to any one of claims 1 to 9, characterized in that: It includes an acquisition module for acquiring EEG signals; It includes a denoising module for denoising the original EEG signal using a pre-trained dual-path convolutional denoising network to obtain a denoised EEG signal.
Citation Information
Patent Citations
Voice noise reduction method, electronic device, non-transitory computer-readable storage medium
US20230186933A1
KR20230023888A