Electroencephalogram signal denoising method based on double-path convolution denoising network
Through the signal coding, mask generation and information extraction mechanism of the dual-path convolutional denoising network, the problem of difficult to extract short- and long-term information in the existing technology is solved, and efficient denoising of EEG signals is achieved, which significantly improves the noise of significantly Denoising quality and efficiency.
Patent Information
- Application Number
- CN202411370325.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-29
AI Technical Summary
The existing EEG signal denoising method is difficult to take into account the extraction of short-term information and long-term information, resulting in poor information extraction between sampling points with long distances, and traditional methods for noise removal incomplete or effective signals. Cut.
Using a dual-path convolutional denoising network, the EEG signal is converted into time-frequency domain characteristic signals through a signal encoder, and the local information and global information are alternately extracted through the segmenter and the information extractor to generate a mask to remove artifacts. , train the network with Adam optimization method to reduce losses.
It significantly improves the performance of denoising EEG signals, improves the denoising quality and efficiency, and can effectively remove artifact noise while maintaining the nonlinear characteristics of the original signal.
Smart Images

Figure CN119157556A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of medical signal processing, and in particular relates to an electroencephalogram signal denoising method based on a dual-path convolutional denoising network. Background Art
[0002] Electroencephalography (EEG) is a method of 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 in order 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 heart, eye and muscle artifacts, and environmental interference. These ubiquitous noise interferences in 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 are mainly 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 the 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 (blind source separation). The BSS method is a method that uses the independence of source signals to separate independent source signals from the collected signal under the condition of unknown system transfer function, source signal mixing coefficient and probability distribution. The BSS method also includes different variants such as principal component analysis (PCA), independent component analysis (ICA) and canonical correlation analysis (CCA). However, this method cannot effectively separate noise from ideal signals when the number of EEG signal channels is less than the number of separated signal sources. The fourth method is the wavelet transform method, which converts the original signal from the time domain to the time-frequency domain and selects the appropriate mother wavelet to decompose the original signal. However, this method has relatively poor resolution of the frequency domain characteristics of high-frequency signals. However, a single denoising method is usually defective when used, so trying to combine some single denoising methods can fully utilize the advantages of each method. For example, wavelet-ICA, EMD-ICA, and EEMD-CCA, etc., but the key to this type of method is to select a suitable threshold function, and there is a possibility that the noise is not removed cleanly or the effective signal is reduced.
[0004] In recent years, thanks to the rapid development of deep learning, the massive increase in EEG data and the greatly enhanced 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, where global information can help capture the overall trend of these changes, while local information can handle instantaneous changes or abnormal situations in specific time periods. Existing denoising methods that consider the fusion of local and global features of EEG signals can only rely on the model to adaptively learn for information extraction between sampling points that are far apart, and cannot be applied to sampling points that are far apart in practice. Summary of the invention
[0005] In order to solve the problems existing in the background technology, the purpose of the present invention is to provide an EEG signal denoising method based on a dual-path convolutional denoising network. The method of the present invention clearly guides the model to take into account the extraction of short-term information and long-term information, while effectively removing EEG signal artifact noise and maintaining the nonlinear characteristics of the original EEG signal.
[0006] The technical solution adopted by the present invention is as follows:
[0007] 1. A method for denoising EEG signals based on dual-path convolutional denoising network
[0008] The EEG signal denoising method comprises the following steps:
[0009] S1) obtaining a number of EEG signal samples, adding noise with different signal-to-noise ratios to each EEG signal sample, obtaining noisy EEG signal samples 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, thereby obtaining a training set consisting of all normalized signal sample pairs;
[0010] S2) constructing a dual-path convolutional denoising network, and training the dual-path convolutional denoising network using a training set, and after the training is completed, obtaining a trained dual-path convolutional denoising network;
[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 in sequence;
[0012] The signal encoder is used to encode the original EEG signal input into 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 fuser 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 the 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 the original EEG signal, and inputting the original EEG signal into the trained dual-path convolutional denoising network to obtain the denoised EEG signal.
[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 segmenter 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 end of the first dilated convolution layer is used as the input end of the dilated convolution module, and 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 is used as the output end of the dilated convolution module and connected to the input end 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 in sequence.
[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 the 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] The local information extraction is realized by performing feature extraction from the first dimension of the two-dimensional feature vector using the local information extraction unit. The specific process is as follows: after the local 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, 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, 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 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 comprises an acquisition module for acquiring EEG signals;
[0029] The EEG signal denoising system comprises 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. The present invention adopts a dual-path convolutional denoising network, uses a signal encoder to convert the original EEG signal into a characteristic signal in the time-frequency domain, and then divides the time series into blocks, extracts local information of short-distance time and global information of long-distance time from two dimensions, inside the time block and between the time blocks, and iteratively captures local information and global information inside and between blocks respectively, using the extracted local information to enhance the ability to extract global information, and also using global information 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 a mask extraction process of the clean signal in the signal and an 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 technical field of signal denoising processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of the method for denoising an EEG signal in the present invention;
[0035] Figure 2 It is a schematic diagram of the structure of the dual-path convolutional denoising network in the present invention;
[0036] Figure 3 It is a structural schematic diagram of a segmenter of a dual-path convolutional denoising network in the present invention;
[0037] Figure 4 It is a schematic diagram of the structure of the synthesizer of the dual-path convolutional denoising network in the present invention;
[0038] Figure 5 It is a structural schematic diagram of the dilated convolution module of the dual-path convolutional denoising network in the present invention;
[0039] Figure 6It is a waveform comparison diagram of the noisy EEG signal, the clean EEG signal and the denoised EEG signal in Example 1 of the present invention. DETAILED DESCRIPTION
[0040] The present invention is further described below in conjunction with 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 data set EEGDenoiseNet database as an example, and the sampling rate is 512 Hz. Each sample data has a length of 1024 points, 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, divide the network 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, and the signal sample pairs corresponding to all EEG signal samples constitute a 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, and 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] Get noisy EEG signal sample n After that, the noisy EEG signal sample EEG n The input of the dual-path convolutional denoising network, the corresponding 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 A signal sample pair is constructed, and each signal sample pair is normalized. The normalization processing method is to convert the noisy EEG signal sample EEG in each signal sample pair n And clean EEG signal sample EEG 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 to which an EO noise signal sample or an EMG noise signal sample is added, Noise represents a noise sample, and λ represents a noise pollution factor.
[0054] Among them, the noise pollution factor λ is obtained according to the following formula:
[0055]
[0056] In the formula, RMS(EEG c ) represents the RMS of clean EEG signal samples, and RMS(λ·Noise) represents the RMS of noise signal samples.
[0057] S1.3) Divide the network into training set, validation set and test set
[0058] The data set 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, using a training set for training, and after completing the training, obtaining a trained dual-path convolutional denoising network; this step is specifically as follows:
[0060] S2.1) Construct 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 in sequence.
[0062] The signal encoder is used to encode the original EEG signal input into the dual-path convolutional denoising network into a feature vector. The input end of the signal encoder is used as the input end of the dual-path convolutional denoising network and receives the original EEG signal. The output end of the signal encoder is connected to the input end of the mask generator. The output end of the signal encoder is also connected to the input end of the feature fusion device. The signal encoder is mainly composed of a signal encoding one-dimensional convolution layer and a signal encoding ReLU activation function layer connected in series. The output end of the signal encoding one-dimensional convolution layer is connected to the input end 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 fusion device is used to multiply the mask generated by the mask generator and the feature vector output by the signal encoder to obtain a denoised feature vector. The input end of the feature fusion device is respectively connected to the output end of the signal encoder and the output end of the mask generator, and the output end of the feature fusion device is connected to the input end of the signal decoder.
[0065] The signal decoder is used to convert the denoised feature vector output by the feature fusion device into a denoised EEG signal, and output the denoised EEG signal to the dual-path convolutional denoising network. The input end of the signal decoder is connected to the output end of the feature fusion device, and the output end of the signal decoder is used as the output end of the dual-path convolutional denoising network and outputs the denoised EEG signal. The signal decoder is mainly composed of a one-dimensional transposed convolution layer.
[0066] In this embodiment, the convolution kernel size of the one-dimensional transposed convolution layer of the signal decoder is 30, the step size is 15, and the number of channels is 1.
[0067] The mask generator is used to segment and stack the feature vectors to form a two-dimensional feature vector, and then perform multiple local information extraction and global information extraction on the two-dimensional feature vector to generate a mask. The mask generator is mainly composed 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 with a length of K and a hop count of H on the feature vector (a one-dimensional vector with a length of S and a number of channels of F) to obtain P overlapping time segments, and then stack all the overlapping time segments to form a two-dimensional feature vector and output it. Among them, the P overlapping time segments are P one-dimensional vectors with a length of 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 the extracted features. Through this process, it is possible to extract information from two dimensions, i.e., from within the time block and between the time blocks, iteratively and alternately. In each round of iteration, a local information extraction and a global information extraction are performed in sequence; local information extraction refers to the extraction of feature information from the dimension 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 dimension between the 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 is performed in each round of iteration.
[0070] The information extractor is divided into a local information extraction unit for extracting information within a time block and a global information extraction unit for extracting information between time blocks. The local information extraction units and the global information extraction units are connected in series alternately, 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. Specifically: the input of the first local information extraction unit is the two-dimensional feature vector output by the segmenter, 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, and the last global information extraction unit transmits the output extracted features 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 in the process of extracting features, and the more factors are considered. Figure 2 As shown, in the local information extraction unit and the global information extraction unit, each dilated convolution module is connected in series in sequence. Except that the input end of the first dilated convolution module is used as the input end of the local information extraction unit / global information extraction unit, the input end of each dilated convolution module is connected to the output end of the previous dilated convolution module, that is, 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 respectively arranged 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 the 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 the 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 is realized by extracting features from the first dimension of the two-dimensional feature vector using the local information extraction unit. The specific process is as follows: after the local 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, 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 the initialized 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 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, 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 of '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 the initialized two-dimensional feature vector D to be processed inter ”∈R BK×F×P It is input into the continuous expansion convolution module in the global information extraction unit, and then restored to D after multi-scale feature extraction. 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 unrelated, that is, the number of dilated convolution modules in the two units can be equal or unequal. In this embodiment, the accumulation module in the local information extraction unit performs an accumulation operation on the outputs of 6 dilated convolution modules, and the accumulation module in the global information extraction unit performs an accumulation operation on the outputs of 3 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 accumulation operations 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 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 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 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 in sequence. 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 expansion factors of the first one-dimensional convolutional layer c1 and the terminal one-dimensional convolutional layer c3 are both 1, and the expansion factor of the second one-dimensional convolutional layer c2 is related to the position order of the expansion convolutional layer in the signal extractor. In this embodiment, for each local information extraction unit, from the first expansion convolution module to the sixth expansion convolution module, the expansion factors of the second one-dimensional convolutional layer c2 are 1, 2, 4, 6, 8, and 16, respectively; for each global information extraction unit, from the first expansion convolution module to the third expansion convolution module, the expansion factors of the second one-dimensional convolutional layer c2 are 1, 2, and 4, respectively. In all expansion 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 FIG. 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 synthetic PReLU activation layer r1, a two-dimensional convolution layer d1, an overlap-add layer, a first synthetic one-dimensional convolution layer g1, a Sigmoid activation layer r2, a second synthetic one-dimensional convolution layer g2, and a synthetic ReLU activation layer r3 that are connected in sequence.
[0081] The synthesizer is used to integrate and overlap-add the extracted features, thereby generating 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 adjust the negative slope; the two-dimensional convolution layer d1 and the two synthetic one-dimensional convolution layers are 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 vector to a one-dimensional feature vector.
[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 synthetic 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 synthetic 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] The dual-path convolutional denoising network was trained using the network training set divided in step S1.3), using the Adam optimization method, a learning rate of 0.0003, 128 samples for each model training, and the mean square error MSE as the loss function. During the training process, the validation set was used to verify the results of the training network. If the validation results were not updated after 30 times, the training was stopped to prevent overfitting of the training, and a trained dual-path convolutional denoising network was obtained.
[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, 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 in Figure 1, 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 1. Figure 6 The middle picture of .
[0090] It can be seen that the method of the present invention has a good denoising effect.
[0091] Example 2
[0092] This embodiment takes 3400 clean EEG signal sample data selected from the public data set EEGDenoiseNet database as an example, with a sampling rate of 256 Hz. Each sample data has a length of 512 points, representing an EEG signal with a time length 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 the EEG signal samples and the 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 step size 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 an electroencephalogram signal based on a dual-path convolutional denoising network, characterized in that: The following steps are involved: S1) obtaining a number of EEG signal samples, adding noise 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; S2) constructing a dual-path convolutional denoising network, using a training set for training, and after the training is completed, obtaining a trained dual-path convolutional denoising network; 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 perform segmentation and stacking processing on the feature vector, and extract local information and global information from the formed two-dimensional feature vector, thereby generating a mask; the feature fusion device is used to perform 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 the dual-path convolutional denoising network; S3) 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.
2. The method for denoising an EEG signal 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 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 perform a stacking operation on 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; 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 method for denoising an EEG signal 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 one 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 method for denoising an EEG signal 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 is used as the input end of the dilated convolution module, and 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 is used 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 in sequence.
5. The method for denoising an EEG signal 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 all 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.
6. The method for denoising an EEG signal based on a dual-path convolutional denoising network according to claim 3, characterized in that: The local information extraction is realized by performing feature extraction from the first dimension of the two-dimensional feature vector using the local information extraction unit. The specific process is as follows: after the local 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, 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, 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 method for denoising an EEG signal 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 method for denoising an EEG signal based on a dual-path convolutional denoising network according to claim 1, 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 method for denoising an EEG signal based on a dual-path convolutional denoising network according to claim 1, characterized in that: In the 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; A denoising module is included, which is used to denoise the original EEG signal using a pre-trained dual-path convolutional denoising network to obtain a denoised EEG signal.
Citation Information
Patent Citations
Electroencephalogram space-time denoising method fusing dense residual error and attention mechanism
CN115153588A
Electroencephalogram signal denoising method using time-frequency feature multi-scale dense fusion neural network
CN117332208A
Thread twisting device
KR1020240130534A
Method and apparatus for removing the noise of IR image
KR102448498B1
Voice noise reduction method, electronic device, non-transitory computer-readable storage medium
US20230186933A1
Cited By
Electrocardiogram abnormal data analysis method and system based on artificial intelligence
CN119344746A
EEG signal time-frequency domain denoising method based on noise attention mechanism
CN120162529A
An electroencephalogram signal time-frequency domain denoising method based on noise attention mechanism
CN120162529B
