A method for removing artifacts from multi-channel EEG signals
By using the multi-scale attention mechanism module of neural networks in multi-channel EEG signals, combining convolution and fully connected networks to extract morphological and timing features, the dependent reference channels and reference channels for multi-channel artifact removal in the prior art are solved and Manually checking the problem can achieve efficient removal of multiple artifacts and improve signal-to-noise ratio and correlation coefficient.
Patent Information
- Application Number
- CN202410969249.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-19
AI Technical Summary
The prior art has limitations in the removal of multi-channel EEG signal artifacts, which depend on reference channels or require manual inspection, and deep learning-based methods ignore timing characteristics, and only target a single channel artifact removal, and cannot effectively process multi-channels. Scene.
The network removal model of the multi-scale attention mechanism module based on neural network is adopted. Through a convolutional neural network with a dual-branch structure and a fully connected neural network, combined with one-dimensional convolutional module, multi-scale attention mechanism module and pooling module, the network is extracted. Morphological characteristics and strengthen timing characteristics to achieve artifact removal of multi-channel EEG signals.
It realizes the automatic artifact removal of multi-channel EEG signals, and can handle multiple artifacts at the same time, such as electromyography, electrocardiogram, and electroophthalmic artifacts, improving the signal-to-noise ratio, time and frequency domain errors and correlation coefficients. , significantly improves the removal effect.
Smart Images

Figure CN118503686B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for removing artifacts of multi-channel electroencephalogram signals. Background Art
[0002] Traditional methods for removing physiological artifacts include regression, filtering, wavelet transform decomposition, blind source separation, and hybrid methods. The regression method mainly relies on setting a reference channel and using linear transformation to estimate the artifacts from the EEG signal contaminated by the artifact, thereby obtaining a pure EEG signal. If there is no reference signal, the performance of artifact removal will be significantly reduced. The filtering method has two limitations. One is that the spectrum of the part of interest in the EMG signal overlaps greatly, and the other is that the artifact signal needs to be set as a reference. Blind source separation methods include principal component analysis, independent component analysis, empirical mode decomposition, canonical correlation analysis, etc. These methods and wavelet transform decomposition map the signal contaminated by the artifact to another new data space through a certain transformation, use some established standards or manual inspection to remove the artifact component, and then reconstruct the unremoved component into a pure EEG signal. Even if combining multiple blind source separation methods can improve some performance, it still cannot avoid the shortcomings of the blind source separation algorithm, that is, it requires a large number of channels, sufficient prior knowledge, and manual inspection and elimination.
[0003] The Chinese invention patent application with application number 202211690128.6 discloses an EEG artifact removal method, system and device based on ICA and outlier detection (publication date is 2023.05.05). It uses the independent component analysis (ICA) technology in the blind source separation method to decompose the EEG into multiple independent estimated source signals, retrieve outliers according to the set threshold, and remove the outliers; this method has low complexity and good robustness, but the accuracy is related to the selected threshold and requires a lot of prior knowledge. The Chinese invention patent application with application number 202210203921.2 discloses a method for removing electrooculogram artifacts in multi-channel EEG signals (publication date is September 12, 2023). It uses fast independent component analysis (FastICA) and empirical wavelet transform (EWT) to remove electrooculogram artifacts. This method converts EEG signals into independent component components, finds components containing electrooculogram artifacts through adaptive sample entropy, and uses empirical wavelet transform and autocorrelation technology to find empirical mode components containing electrooculogram artifacts. After removing the electrooculogram artifacts, the EEG is reconstructed. This method does not require human intervention and has high computational efficiency, but it is only for single artifact electrooculograms and has a relatively narrow application field.
[0004] With the huge improvement in the performance of deep learning neural network models and the significant improvement in generalization ability, people began to use deep learning-based methods to remove EEG artifacts. The one-dimensional residual convolutional neural network (1D-ResCNN) uses three convolution kernels of different scales to extract features from the original EEG signal, thereby achieving artifact removal of the EEG signal. Then a semi-simulated benchmark dataset EEGdenoiseNet for EMG and EOG artifact removal appeared. At the same time, EEGdenoiseNet used four networks with different architectures, namely a fully connected network (FC), a single-channel simple convolutional neural network without residual connection (SimpleCNN), a multi-branch complex convolutional neural network with residual connection (ComplexCNN), and a recurrent neural network (RNN) for artifact removal. Later, a new convolutional neural network (NovelCNN) was designed specifically for the removal of EMG artifacts; the Transformer-based EEGDNet was designed specifically for the removal of EOG artifacts, which can focus on both local and non-local features for artifact removal. The Chinese invention patent application with application number 202310198897.2 discloses an EEG signal artifact removal method based on a multi-module neural network (publication date is 2023.05.30), and uses a multi-module neural network combined with the residual network idea to design an EEG artifact removal model, which can effectively distinguish EEG from artifacts. However, during the training process, only a single-channel EEG signal is used, and only electromyography artifacts are used for training and testing. How it performs in the multi-channel EEG artifact removal task is still unknown; the Chinese invention patent application with application number 202310171586.7 discloses an EEG artifact removal method based on a segmentation-denoising network (publication date is 2023.02.22), and designs a segmentation-denoising model SDNet, which can remove multiple artifacts without prior knowledge, but the data used is artificially synthesized EEG data with artifacts, and has not been tested on a real data set.
[0005] The deep learning-based method overcomes the limitations of traditional methods that require setting reference channels or manual inspection, and realizes automated artifact removal. EEG signals are recorded as time series signals, but the above neural network ignores the time series characteristics of EEG signals, only extracts morphological features, and only targets a single channel. Therefore, there are more possibilities for the design of network structure for multi-channel EEG signal artifact removal. Summary of the invention
[0006] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for removing artifacts from multi-channel EEG signals.
[0007] In order to achieve the purpose of the present invention, the present invention will be implemented by adopting the technical solution described below.
[0008] A method for removing artifacts from multi-channel electroencephalogram signals comprises the following steps:
[0009] S1, obtain EEG data contaminated by artifacts;
[0010] S2, inputting the EEG data contaminated by the artifacts into the removal network model to obtain the EEG data after the artifacts are removed;
[0011] The removal network model is based on a neural network and is established by introducing a multi-scale attention mechanism module; the removal network model is obtained by training and testing EEG data samples contaminated by artifacts with identification labels;
[0012] The neural network includes a convolutional neural network and a fully connected neural network connected in series with the convolutional neural network, wherein the convolutional neural network adopts a dual-branch structure, each branch includes a plurality of morphological feature extraction and temporal feature enhancement modules connected in series, and each of the morphological feature extraction and temporal feature enhancement modules includes a one-dimensional convolution module, a multi-scale attention mechanism module and a pooling module connected in series, wherein the one-dimensional convolution module is used to extract morphological features; the multi-scale attention mechanism module is used to retain and enhance temporal features; and the pooling module is used to reduce the dimension of EEG data while retaining temporal features;
[0013] The backbone network of the fully connected neural network adopts a dual-branch structure, and a long short-term memory layer is added after the last fully connected layer of each branch to form a temporal feature extraction module for extracting the temporal features of EEG data;
[0014] Among them, the multi-scale attention mechanism module is responsible for feature grouping of the input feature map to obtain the grouped feature map, and then adopts dual parallel paths to encode the channel information of the grouped feature map and fuse and capture the multi-scale feature representation. Through cross-space learning, the channel relationship after batch normalization is encoded into global spatial information. At the same time, the multi-scale feature representation is directly converted into dimensional shape, the global spatial information is fused, and a multi-scale spatial attention weight map with the same size as the input feature map is output.
[0015] As a preferred solution of the present invention, the multi-scale attention mechanism module includes a grouped convolutional layer, a dual parallel path of a left scale branch and a right scale branch, cross-space learning and weight fusion, wherein:
[0016] The grouped convolution layer is used to group the channels of the input feature map, each group learns the features of different regions, and outputs the grouped feature map after feature enhancement;
[0017] The right scale branch is used to extract the global features of the grouped feature map to obtain a global feature map. Specifically, information of different scales is fused through convolution and average pooling to obtain a feature representation from a global perspective.
[0018] The left scale branch is responsible for using the grouped feature map to focus on the dependencies between different channels, and by establishing a channel attention mechanism, obtains a local attention weight map, and fuses the local attention weight map and the grouped feature map into a local fused feature map;
[0019] The cross-space learning encodes the local fusion feature map output by the left scale branch and the global feature map output by the right scale branch into global spatial information after standardization, and at the same time, adjusts the shape of the channel fusion feature map and the global feature map, and obtains two multi-scale spatial attention feature maps of different granularities containing global and local information through matrix dot product operations respectively;
[0020] The weight fusion is used to fuse the two multi-scale spatial attention feature maps of different granularities into a multi-scale spatial attention weight map through a Sigmoid function, and integrate it into the grouping feature map. As a preferred embodiment of the present invention, the method for obtaining EEG data samples includes the following steps:
[0021] S31. When performing the task, collect the EEG data of the test subject and label it;
[0022] S32, preprocessing the collected EEG data;
[0023] S33, segmenting the preprocessed EEG data according to the task labels;
[0024] S34. Independent component analysis was used to separate and eliminate poor quality and unusable EEG data;
[0025] S35, performing data amplification on the separated and eliminated EEG data, and randomly generating a training set, a validation set and a test set according to a certain ratio based on the amplified EEG data.
[0026] As a preferred solution of the present invention, the weight parameters and bias parameters of the neural network are randomly initialized, and the learning rate, the amount of loaded data and the number of training rounds are set.
[0027] As a preferred solution of the present invention, the weight parameters and bias parameters are updated using an Adam optimizer until the training round is completed.
[0028] As a limiting scheme of the present invention, the artifact removal method also includes a method for verifying the effectiveness of the multi-scale attention mechanism, and the method is verified based on evaluation indicators.
[0029] As a preferred solution of the present invention, the evaluation index includes the signal-to-noise ratio SNR, the relative root mean square error RRMSE in the time domain t , the relative root mean square error RRMSE in the frequency domain f And the average correlation coefficient CC, where:
[0030] ,
[0031] ,
[0032] ,
[0033] ,
[0034] In the formula, Represents a pure collection of brain waves, It represents the EEG data reconstructed by the network model, RMS is the root mean square function, PSD is the power spectral density calculation function, Cov and Var are the covariance function and variance function respectively.
[0035] The beneficial effects of the technical solution of the present invention are as follows:
[0036] 1. Use a dual-branch parallel one-dimensional convolution module. The convolution module containing convolution kernels of different sizes can effectively distinguish EEG signals from physiological artifacts and extract the morphological features of EEG signals. Since the temporal characteristics of EEG signals may be destroyed during the morphological feature extraction process, the present invention uses a designed efficient multi-scale attention module to maintain the temporal characteristics of EEG signals after the convolution module and strengthen them for subsequent extraction. Use a pooling module to reduce the dimensionality of the data, reduce the amount of calculation, and increase the calculation speed.
[0037] 2. Use the long short-term memory network to extract the time series features of the data. The time series features have been strengthened in the previous step, so it is easier to extract at this time, and only the long short-term memory network layer needs to be used once.
[0038] 3. The entire network can achieve multi-channel EEG signal artifact removal, not just limited to a single channel. At the same time, the present invention is not designed for a particular physiological artifact, it can achieve simultaneous removal of multiple artifacts, including myoelectric artifacts, electrocardiographic artifacts, electrooculographic artifacts, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is the overall network structure diagram adopted by the present invention;
[0040] Figure 2 It is a structural diagram of the morphological feature extraction and temporal feature enhancement module of the present invention;
[0041] Figure 3is a structural diagram of the efficient multi-scale attention module of the present invention;
[0042] Figure 4 It is a structural diagram of the timing feature extraction module of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described in conjunction with the accompanying drawings and embodiments.
[0044] As an embodiment of the present invention, Figures 1 to 4 As shown, a method for removing artifacts from multi-channel EEG signals comprises the following steps:
[0045] Step 1: Collect data
[0046] This embodiment collects EEG signals from 11 healthy adult college students. The male-female ratio of the subjects is 4:7, and the average age is 21.6 years old. The EEG acquisition rate is set to 1kHz, and the number of channels is 32. During the acquisition process, the subjects are required to complete a 2-back task. Each stimulus is presented for 300ms, with an interval of 3000ms. The interval time is a black screen state. The subjects need to judge whether two stimuli separated by one stimulus are the same, for example, whether the second and fourth stimuli are consistent, and a total of 64 judgments are required. The correct answer is marked with a label 10, and the wrong answer is marked with a label 11.
[0047] Step 2: Data Processing:
[0048] Step 2-1: Preprocess the collected data. First, remove useless electrodes and reduce the number of electrodes to 30. Then use the whole brain average as a reference. Then perform a bandpass filter from 0.1 to 40 Hz on the data. In order to ensure that the power frequency interference is effectively removed, perform an additional notch filter from 48 Hz to 52 Hz. According to the task labels 10 and 11, take the 1000ms before the label and the 3000ms after the label for segmentation. Each subject obtains 64 segments of data. The data segments with poor quality and unusable are eliminated. A total of 436 segments of data are obtained for the 11 subjects.
[0049] Step 2-2: Use independent component analysis (ICA) to separate data components, and experts visually remove artifact components to obtain pure EEG signals.
[0050] Step 2-3: Amplify the data. This embodiment uses sliding window interface technology to amplify the data, and the window size is set to 512. The overlap rate is set to 6.25%, and the data before and after step 2-2 are matched one by one, and a total of 47,960 pairs of EEG data are obtained.
[0051] Step 2-4: Divide the data set into training set, validation set and test set in a ratio of 8:1:1.
[0052] Step 3: Algorithm for automatic removal of multi-channel EEG signal artifacts based on efficient multi-scale attention mechanism neural network:
[0053] Step 3-1: The weight parameter W and bias parameter b of the entire network are randomly initialized, and the learning rate lr, the amount of data loaded batch_size, and the training round epoch are set.
[0054] Step 3-2: Input the training set divided in step 2 into the neural network model, and use (x, y) to represent a bunch of contaminated EEG signals and pure EEG signals in the training set.
[0055] Step 3-3: Vector x, which represents the contaminated EEG signal data that conforms to the distribution, the dimension of this vector is Here, T represents the length of the sample, that is, the length of a single segment of the EEG signal. The goal of this invention is to design a function , that is, a neural network that can project x into another vector Above, the vector y represents the distribution The dimension of this vector is Through the neural network, the projected vector Comply with the distribution .
[0056] The above neural network includes a morphological feature extraction and temporal feature enhancement module and a temporal feature extraction module. The morphological feature extraction and temporal enhancement module consists of a one-dimensional convolution module, a multi-scale attention mechanism module and a pooling module. At the same time, a two-branch neural network is adopted. The two branches are divided into an upper branch and a lower branch. The size of the convolution kernel in the one-dimensional convolution module of the upper branch is 3; the size of the convolution kernel in the one-dimensional convolution module of the lower branch is 7. The two-branch one-dimensional convolution module is used to extract the morphological features of the EEG signal. In this process, in order to retain the temporal features of the EEG signal, an efficient multi-scale attention module is used after each convolution module to enhance the temporal features. Next to the efficient multi-scale attention module is a pooling module, which retains the features while reducing the data dimension, reducing the amount of calculation and increasing the calculation speed. In the temporal feature extraction module, a long short-term memory network is used to extract the temporal features of the EEG signal. After the input data x passes through the above modules, the reconstructed pure EEG data y is output.
[0057] In the multi-scale attention mechanism module, C is defined to represent the number of EEG signal channels, T to represent the number of EEG signal time points, and G to represent the number of groups. In the first step, the input EEG data is grouped in the channel dimension. The shape of the original input data is C×T. After the channels are grouped, the data shape changes to C / / G×T (" / / " means discarding the remainder and returning the quotient). By grouping, different features are learned for different groups, and the feature representation of the region of interest in each sub-feature is enhanced without losing generality. In the second step, a dual parallel structure is adopted. The left branch uses the channel attention mechanism to perform global average pooling on the grouped data in the dimension of T to obtain a feature map with a shape of C / / G×1. A one-dimensional convolution with a convolution kernel size of 1 is used to fuse and share the feature map information. A Sigmoid activation function is then used to convert the feature map into an attention weight map to embed the information into the grouped input. The left branch captures the dependencies between all channels and reduces the amount of parameter calculation. Finally, a local fusion feature map is obtained; the right branch uses a one-dimensional convolution with a convolution kernel size of 3 to focus on the global feature space to obtain a global feature map. In the third step, the present invention uses cross-space learning. Batch normalization is performed on the local fusion feature map to complete the standardization operation on the data. Then, the local fusion feature map obtained by the left and right branches and the global feature map are respectively subjected to global average pooling in the dimension of T to obtain the global spatial information encoding. The shapes of the local fusion feature map and the global feature map are adjusted, and two multi-scale spatial attention feature maps of different granularities containing global and local information are obtained through matrix dot product operations. In the fourth step, the two multi-scale spatial attention feature maps of different granularities are fused into a multi-scale spatial attention weight map through a Sigmoid function. The fusion of the two multi-scale spatial attention feature maps realizes the connection of contextual information while paying attention to local features, and retains the entire precise spatial position information. Then it is integrated into the grouped feature map and the data shape is adjusted to C×T. In this way, the purpose of retaining and strengthening the temporal features is achieved.
[0058] Step 3-4: Use the Adam optimizer to update the weight parameter W and bias parameter b of the neural network until the epoch training is completed.
[0059] Step 4: Verify the effectiveness of the algorithm based on the evaluation indicators.
[0060] The present invention uses four objective evaluation indicators to verify the artifact removal ability of the present invention in multi-channel EEG signals, namely, signal-to-noise ratio (SNR), relative root mean square error (RRMSE) in the time domain, and t , the relative root mean square error RRMSE in the frequency domain f and the average correlation coefficient CC.
[0061] , , , .
[0062] in Represents a pure collection of brain waves, It represents the EEG data reconstructed by the network model, RMS is the root mean square function, PSD is the power spectral density calculation function, Cov and Var are the covariance function and variance function respectively.
[0063] The algorithm designed in this invention is trained and verified on data together with the existing EEG artifact denoising models 1D-ResCNN and NovelCNN to compare performance, as shown in the following table:
[0064]
[0065] In the performance comparison process, it can be seen that compared with 1D-ResCNN, the signal-to-noise ratio of the present invention is improved by 20.39%, the relative root mean square error in the time domain is improved by 29.53%, the relative root mean square error in the frequency domain is improved by 21.43%, and the average correlation coefficient is improved by 3.70%. Compared with NovelCNN, the four indicators are improved by 5.48%, 10.74%, 6.05% and 2.92% respectively.
Claims
1. A method for removing artifacts from multi-channel EEG signals, comprising the following steps: S1, obtain EEG data contaminated by artifacts; S2, inputting the EEG data contaminated by the artifacts into the removal network model to obtain the EEG data after the artifacts are removed; in, The removal network model is based on a neural network and is established by introducing a multi-scale attention mechanism module; the removal network model is obtained by training and testing EEG data samples contaminated by artifacts with identification labels; Features: The neural network includes a convolutional neural network and a fully connected neural network connected in series with the convolutional neural network, wherein the convolutional neural network adopts a dual-branch structure, each branch includes a plurality of morphological feature extraction and temporal feature enhancement modules connected in series, and each of the morphological feature extraction and temporal feature enhancement modules includes a one-dimensional convolution module, a multi-scale attention mechanism module and a pooling module connected in series, wherein the one-dimensional convolution module is used to extract morphological features; the multi-scale attention mechanism module is used to retain and enhance temporal features; and the pooling module is used to reduce the dimension of EEG data while retaining temporal features; The backbone network of the fully connected neural network adopts a dual-branch structure, and a long short-term memory layer is added after the last fully connected layer of each branch to form a temporal feature extraction module for extracting the temporal features of EEG data; The multi-scale attention mechanism module includes a grouped convolutional layer, a dual parallel path of a left scale branch and a right scale branch, cross-space learning and weight fusion, wherein: The grouped convolution layer is used to group the channels of the input feature map, each group learns the features of different regions, and outputs the grouped feature map after feature enhancement; The right scale branch is used to extract the global features of the grouped feature map to obtain a global feature map, that is, to fuse information of different scales through convolution and average pooling to obtain a feature representation from a global perspective; The left scale branch is responsible for using the grouped feature map to focus on the dependencies between different channels, and by establishing a channel attention mechanism, obtains a local attention weight map, and fuses the local attention weight map and the grouped feature map into a local fused feature map; The cross-space learning encodes the local fusion feature map output by the left scale branch and the global feature map output by the right scale branch into global spatial information after standardization, and at the same time, adjusts the shape of the local fusion feature map and the global feature map, and obtains two multi-scale spatial attention feature maps of different granularities containing global and local information through matrix dot product operations respectively; The weight fusion is used to fuse the two multi-scale spatial attention feature maps of different granularities into a multi-scale spatial attention weight map through a Sigmoid function, and integrate it into the grouping feature map.
2. A method for removing artifacts from multi-channel EEG signals according to claim 1, It is characterized in that The method for obtaining EEG data samples comprises the following steps: S31. When performing the task, collect the EEG data of the test subject and label it; S32, preprocessing the collected EEG data; S32, segmenting the preprocessed EEG data according to the task labels; S33, remove poor quality and unusable EEG data, and use independent component analysis to separate artifact components; S34, performing data amplification on the EEG data after separation and elimination, and randomly generating a training set, a validation set and a test set according to a certain ratio based on the EEG data after data amplification.
3. A method for removing artifacts from multi-channel EEG signals according to claim 1, It is characterized in that The weight parameters and bias parameters of the neural network are randomly initialized, and the learning rate, the amount of loaded data and the number of training rounds are set.
4. A method for removing artifacts from multi-channel EEG signals according to claim 3, It is characterized in that The weight parameters and bias parameters are updated using the Adam optimizer until the training round is completed.
5. A method for removing artifacts from multi-channel EEG signals according to claim 1, It is characterized in that The artifact removal capability is verified by evaluation indicators.
6. A method for removing artifacts from multi-channel EEG signals according to claim 5, It is characterized in that The evaluation indicators include signal-to-noise ratio (SNR), relative root mean square error (RRMSE) in the time domain t , the relative root mean square error RRMSE in the frequency domain f And the average correlation coefficient CC, where: , , , , In the formula, Represents a pure collection of brain waves, It represents the EEG data reconstructed by the network model, RMS is the root mean square function, PSD is the power spectral density calculation function, Cov and Var are the covariance function and variance function respectively.
