A Denoising Method for EEG Data Based on Neuronal Firing Correlation
By designing a multi-branch neural network to learn the correlation of neuronal firing in EEG data and using a multi-branch attention mechanism network to remove noise correlation, the problem of noise correlation in neural decoding is solved, thereby improving the decoding accuracy and information content of EEG data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2024-07-23
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies struggle to effectively remove noise correlations in neural signals, resulting in limited neural decoding performance. In particular, the correlation patterns between neuronal firing patterns under the same task are masked by noise correlations, affecting information differentiation.
We designed a multi-branch neural network based on contrastive learning, which uses a multi-branch attention mechanism to learn the correlation patterns between neurons. We then denoise the network by calculating the correlation noise vector and incorporate constraints on the correlation of neurons during training. We also optimize the intra-class and inter-class correlation loss functions to improve the denoising effect.
It significantly improves the classification performance and information content of EEG data, reduces intra-class correlation noise, preserves inter-class correlation patterns, and improves the accuracy of neural decoding.
Smart Images

Figure CN118939942B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electroencephalogram (EEG) data analysis, and in particular relates to a method for denoising EEG data based on the correlation of neuronal firing. Background Technology
[0002] Recent advances in brain-computer interfaces (BCIs), particularly clinical decoding, have shown great potential in restoring motor or language abilities in paralyzed individuals. However, stable and high-performance neural decoding remains a challenge in BCI systems. Noise in neural signals is a key challenge in neural decoding, thus requiring noise removal. For example, Chinese patent document CN117668552A discloses an EEG decoding system that uses a temporal convolutional layer to extract task-related temporal signals and filter out noise interference aliased within the signals. Chinese patent document CN113378737A discloses a method for classifying neuronal spike potentials in implantable BCIs, using a bandpass elliptic filter to filter the original signal, removing low-frequency local field potentials and some high-frequency background noise.
[0003] However, noise in neural signals is highly complex, and can originate from environmental factors, muscle activity artifacts, unstable signal recording, interchannel crosstalk, and other sources. When this noise affects only a portion of the neural signal channels, it can lead to correlations between neuronal responses, thereby limiting the information contained in the neural signal.
[0004] Existing research has shown that noise or functional interactions between neurons lead to rich correlations between neuronal activities, and these correlations directly affect the information encoded in a neuronal population. From a neural decoding perspective, these correlations can be divided into signal correlations and noise correlations. Signal correlations indicate the true connectivity relationships between different neurons in response to different tasks. Noise correlations refer to the correlations between neurons, which can limit information. Ideally, neuronal responses should not exhibit noise-related patterns across different tasks. However, with the presence of neural correlations, correlation patterns under the same task propagate along similarity axes (noise correlations). Once the correlation axis approaches the discriminative axis of the task, signal correlations are masked by noise correlations, thus limiting information and causing task confusion. This type of noise is usually not independently and identically distributed, but it has not yet been well addressed in existing neural decoders.
[0005] In summary, noise correlation primarily describes the correlation between the firing variances of different neurons under the same task. Normally, there is no correlation between variances, but due to the unique characteristics of neural signals, this correlation is prevalent. When the variation pattern of variance is very similar to the information variation of neural signals, variance and information become mixed together and difficult to distinguish. More importantly, there has been no research or application of denoising algorithms specifically for this type of noise. How to design a good denoising network to address the unique characteristics of neuronal firing correlation and achieve end-to-end EEG data denoising remains a blank slate. Summary of the Invention
[0006] This invention provides a method for denoising EEG data based on neuronal firing correlation, which can alleviate the inhibitory effect of correlation noise on the information content of EEG data to a certain extent, and effectively improve the quality and decoding effect of EEG data.
[0007] A method for denoising EEG data based on neuronal firing correlation includes the following steps:
[0008] (1) Obtain EEG data, extract data segments corresponding to different labels according to the labeled timestamps, standardize the data, and obtain preprocessed EEG data as a noise reduction training set;
[0009] (2) Design a multi-branch neural network model based on contrastive learning, use a multi-branch attention mechanism network to learn the correlation pattern between different neurons, calculate the correlation noise vector, and then subtract the noise vector from the EEG data to obtain the denoised EEG data.
[0010] (3) The multi-branch neural network model is trained using the denoised training set. During the training process, constraints on neuron firing correlation are added, including minimizing intra-class neuron firing correlation and maximizing inter-class neuron firing correlation. The intra-class and inter-class neuron correlations of the denoised data are calculated and added to the overall loss function to be optimized with certain weights.
[0011] (4) During the application process, the EEG data is input into the trained model to obtain the denoised EEG data.
[0012] This invention addresses the correlation patterns between different neuronal firing patterns and the impairment of EEG data information caused by these correlations under specific patterns. It constructs a multi-branch denoising network to better capture the characteristics of these correlation patterns and predict the corresponding noise vectors. After subtracting the noise vector from the original data, the model constrains the intra-class neuronal firing correlations while preserving the inter-class neuronal firing correlations. This encourages the model to better learn the balance between the two correlations, thereby denoising the data and improving the information content and data quality of the EEG data.
[0013] In step (2), the correlation noise vector is calculated, and then the EEG data is subtracted from the noise vector to obtain the denoised EEG data. The specific formula is as follows:
[0014]
[0015] S denoising =S-Norm(X`)
[0016] Where X` represents the noise vector, Q, K, and V represent the results obtained from EEG data through three different linear layer networks in a multi-branch neural network model, respectively, and d k S represents the vector dimension, Softmax(·) represents the normalization exponential function, and S denoising The denoised EEG data represents the original EEG data, S represents the original EEG data, the dimension of the linear layer is the same as the dimension of the original EEG data, and Norm(·) represents the standardization function.
[0017] In step (3), the overall loss function that needs to be optimized is as follows:
[0018] L joint =L NC -L SC
[0019] Among them, L NC L represents the loss of intraclass neuron firing correlation. SC This represents the loss of inter-class neuron firing correlation.
[0020] The correlation of intra-class neuron firing is considered noise. The overall intra-class correlation is measured by calculating the covariance of different neurons within the same class. The loss from the intra-class neuron firing correlation is calculated as follows:
[0021] L NC =p1NC1+p2NC2+…+p t NC t
[0022] Where p1,…,p t The values represent trainable weight parameters; NC1 represents the overall intra-class correlation for category 1, which calculates the correlation between all neurons; and t represents t different categories.
[0023] The overall intra-class correlation is calculated as follows:
[0024] NC = Sum(Cov(s1,s2) 2 +Cov(s1,s3) 2 +…Cov(s n-1 ,s n ) 2 ) / 2
[0025] Where s1,…,s n The EEG data represents n neurons, Sum(·) represents the summation function, and Cov(·) represents the covariance function.
[0026] Given the firing of two neurons, their covariance is calculated as follows:
[0027]
[0028] Where s1 and s2 represent the EEG data of neuron 1 and neuron 2, and T represents the time of EEG data transmission. and The mean of the EEG data representing neuron 1 and neuron 2.
[0029] In step (3), the loss of inter-class neuron firing correlation is calculated as follows:
[0030] L SC =p t+1 SC
[0031] Where, p t+1 Represents the trainable weight parameters, and SC represents the overall inter-class neuron firing correlation among t classes.
[0032] The overall inter-class correlation is calculated as follows:
[0033] SC = Sum(Cov(sc1,sc2) 2 +Cov(sc1,sc3) 2 +…Cov(sc n-1 ,sc n ) 2 ) / 2
[0034] Where sc1,…,sc n This represents EEG data spliced from n neurons across multiple categories. Before splicing, the mean of each category is calculated.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] This invention, based on the unique intra-class and inter-class correlations between neurons, specifically designs a neural network and training loss to minimize unnecessary intra-class correlations while preserving inter-class correlations that express information. It utilizes a multi-branch attention mechanism network to learn correlation patterns between neurons. Results demonstrate that removing noise learned from EEG signals significantly improves the classification performance of EEG data and increases the information content of the data. Attached Figure Description
[0037] Figure 1 This is a flowchart of an EEG data denoising method based on neuronal firing correlation according to an embodiment of the present invention;
[0038] Figure 2 A schematic diagram illustrating the impact of intraclass firing correlation of neurons on classification;
[0039] Figure 3 For different categories, multiple neurons emit correlation pattern diagrams;
[0040] Figure 4 A comparison chart showing the classification accuracy of data processed using the method of this invention versus data not processed using the method of this invention;
[0041] Figure 5 This is a comparison chart of neuron correlation matrices obtained using the method of the present invention and those obtained without using the method of the present invention. Detailed Implementation
[0042] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the embodiments described below are intended to facilitate the understanding of the present invention and do not constitute any limitation thereof.
[0043] This example uses datasets including the handwriting dataset from the 2021 Nature paper "High-performance brain-to-text communication via handwriting" and the speech dataset from the 2023 Nature paper "A high-performance speech neuroprosthesis". The handwriting dataset contains 31 motor imagery tasks where participants handwrite English letters. Specifically, the data collection process for the handwriting dataset was as follows: During the experiment, participants sat comfortably in front of a screen displaying English letters that they needed to imagine writing. After 2-3 seconds, a green square appeared on the screen, indicating that the participant could perform the corresponding motor imagery task based on the previously displayed letter. The task imagery time was 1 second. Afterwards, there was a short rest period to prepare for the next experiment. All data was collected within one day, and the handwriting dataset contains a total of 837 samples. The speech dataset contains 40 speech tasks where participants read English letters or words aloud. The data acquisition process for the speech dataset is similar to that for the handwriting dataset: During the experiment, the participants sat in front of a screen that displayed the English letters that the participants were required to read; after 2-3 seconds, a green square appeared on the screen, indicating that the participants could make the corresponding speech based on the English letters that had just appeared.
[0044] like Figure 1 As shown, a method for denoising EEG data based on neuronal firing correlation includes the following steps:
[0045] (1) Preprocessing of EEG data.
[0046] The EEG data to be processed is acquired, and data segments corresponding to different labels are extracted according to the labeled timestamps. The data is standardized to obtain preprocessed EEG data. The data is then divided into a denoised training set, a denoised validation set, and a test set according to a reasonable ratio.
[0047] This embodiment divides the data into three different sets: a denoised training set for neural network training, a denoised validation set for selecting the optimal neural network, and a denoised test set for final performance evaluation. Specifically, the different data sets are divided in a 2:2:6 ratio, all data are arranged according to different categories, and data is randomly selected from different categories according to the proportions. Due to the limited amount of EEG signal data, a small amount of data is selected for denoising training while ensuring performance.
[0048] When standardizing data, the original value is subtracted from the mean and then divided by the standard deviation, so that the resulting data follows a normal distribution with a mean of 0 and a standard deviation of 1.
[0049] Finally, from the standardized data, the data segment 500ms after the marked timestamp start point is extracted as the data segment for subsequent training and testing.
[0050] (2) Construct a reasonable neural network.
[0051] Based on the characteristics of EEG data, a multi-branch neural network structure based on contrastive learning was designed. This example selects an attention mechanism network for modeling multivariate correlation patterns. Furthermore, to simultaneously model information from multiple categories, the multi-branch network allows for simultaneous input of multiple categories. The attention mechanism network consists of three linear layers. Considering the input EEG data matrix X, after passing through three linear layers, three matrices are obtained: Q, K, and V.
[0052] X = [x1, x2, ..., x n ]
[0053] Q = [q1, q2, ..., q n ]
[0054] K = [k1,k2,…,k n ]
[0055] V = [v1, v2, ..., v n ]
[0056]
[0057] Where n represents the number of neurons, X' represents the noise vector, and d kRepresents the vector dimension. Softmax(·) represents the normalization exponential function.
[0058] The three linear layers here correspond to the query network, key network, and value network, respectively. The parameters of each network are randomly initialized, and the random inactivation rate is 0.5.
[0059] (3) The neural network generates the corresponding noise vector, and the noise vector is subtracted from the EEG data to obtain the denoised EEG data.
[0060] It's important to note that the linear layer's dimension is consistent with the original data dimension so that the noise vector can be directly subtracted from the original data later. Before input, the EEG data is flattened, and after passing through the attention mechanism network, the original dimensions are restored. Subsequent subtraction of the noise vector yields the denoised EEG data:
[0061] S denoising =S-Norm(X`)
[0062] Where S represents the raw EEG data, and S denoising This represents the denoised EEG data, and Norm(·) represents the standardization function.
[0063] (4) Add constraints on the firing correlation of neurons during the training process.
[0064] 4-1. Minimize intra-class neuron firing correlation: Intra-class neuron firing correlation is considered noise. This is because these intra-class correlations are unrelated to the class information itself, are redundant and unnecessary, and may even impair performance. Figure 2 As shown, when intra-class correlation and inter-class correlation are aligned, the distance between classes is shortened, thus increasing inter-class confusion. The overall intra-class correlation is measured by calculating the covariance of different neurons within a class.
[0065] L NC =p1NC1+p2NC2+…+p t NC t
[0066] Considering that manually set parameters often cannot accurately measure the proportion of intra-class and inter-class correlations, and require a significant amount of time for parameter tuning, we use p1,…,p t As trainable weight parameters, the true weights are learned through the neural network. NC1 represents the overall intra-class correlation for category 1, which is calculated based on the correlations between all neurons. t represents t different categories.
[0067] To measure the overall intra-class correlation for a single category, we treat the correlation between all neurons as a whole. Therefore, we calculate the covariance matrix between the firing rates of different neurons and sum the squares of the upper triangular elements of the matrix (excluding diagonal elements). The specific calculation method is as follows:
[0068] NC = Sum(Cov(s1,s2) 2 +Cov(s1,s3) 2 +…Cov(s n-1 ,s n ) 2 ) / 2
[0069] Where s1,…,s n The EEG data represents n neurons, Sum(·) represents the summation function, and Cov(·) represents the covariance function.
[0070] Given the firing of two neurons, their covariance is calculated as follows:
[0071]
[0072] 4-2. Maximizing Interclass Neuron Fire Correlation: Interclass neuron firing correlation is considered to be information about the firing of neuron populations related to class, such as... Figure 3 As shown, similar correlation patterns exist in EEG data from different categories. To avoid removing information-related correlations when minimizing intraclass neuron firing correlations, we need to explicitly maximize interclass neuron firing correlations.
[0073] L SC =p t+1 SC
[0074] Where, p t+1 Represents the trainable weight parameters, and SC represents the overall inter-class neuron firing correlation among t classes.
[0075] To determine the overall inter-class correlation across multiple categories, we first calculate the mean firing time of neurons in each category, then concatenate the means from different tasks. Next, we calculate the covariance matrix between different neurons, summing the squares of the upper triangular elements (excluding diagonal elements). The specific calculation method is as follows:
[0076] SC = Sum(Cov(cs1,sc2) 2 +Cov(sc1,sc3) 2 +…Cov(sc n-1 ,sc n ) 2 ) / 2
[0077] Where sc1,…,sc n This represents EEG data spliced from n neurons across multiple categories. Before splicing, the mean of each category is calculated.
[0078] Considering t inputs to tasks, we sample them uniformly and randomly in each iteration.
[0079] t0∈[5,t]
[0080] Then the intra-class correlation noise of the t0 categories can be calculated as follows:
[0081]
[0082] The summation of these values serves as the loss term for intra-class neuron firing correlation. The loss for inter-class neuron firing correlation can also be calculated based on these t0 classes.
[0083] (5) During the testing process, the trained network was used to denoise the validation and test sets. Classification performance was evaluated on the validation and test sets. Considering the small amount of EEG signal data, leave-one-out method was used to calculate the final classification accuracy.
[0084] To demonstrate the effectiveness of the proposed denoising learning framework, experiments were conducted on the same dataset using the same network structure without the denoising learning framework. The comparison results are as follows. Figure 4 As shown in the figure, the horizontal axis represents the number of neurons added to the data, while the vertical axis represents the corresponding decoding performance. Different subplots represent experiments on different datasets. It can be seen that through our denoising learning framework, the decoding accuracy of EEG data is significantly improved on different datasets and with different numbers of neurons.
[0085] To illustrate that this learning framework can learn neuronal firing correlation patterns that better match prior knowledge, correlation analysis was performed on the denoised EEG data from the network, and a correlation matrix was plotted, such as... Figure 5 As shown, the first row contains the undenoised inter-class correlation matrix (left) and the denoised inter-class correlation matrix (right), and the last row contains the undenoised intra-class correlation matrix (left) and the denoised intra-class correlation matrix (right). Different colors represent different degrees of correlation. It can be seen that by denoising through our neural network, the intra-class correlation of EEG data is significantly reduced, while the inter-class correlation patterns are preserved.
[0086] The embodiments described above provide a detailed explanation of the technical solutions and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for denoising electroencephalogram (EEG) data based on neuronal firing correlation, characterized in that, Includes the following steps: (1) Obtain EEG data, extract data segments corresponding to different labels according to the labeled timestamps, standardize the data, and obtain preprocessed EEG data as a noise reduction training set; (2) Design a multi-branch neural network model based on contrastive learning, use a multi-branch attention mechanism network to learn the correlation pattern between different neurons, calculate the correlation noise vector, and then subtract the noise vector from the EEG data to obtain the denoised EEG data. (3) Use the denoised training set to train the multi-branch neural network model. During the training process, add constraints on the firing correlation of neurons, including minimizing intra-class neuron firing correlation and maximizing inter-class neuron firing correlation. Calculate the intra-class and inter-class correlations of neurons in the denoised data and add them to the overall loss function that needs to be optimized with certain weights; (4) During the application process, the EEG data is input into the trained model to obtain the denoised EEG data.
2. The EEG data denoising method based on neuronal firing correlation according to claim 1, characterized in that, In step (2), the correlation noise vector is calculated, and then the EEG data is subtracted from the noise vector to obtain the denoised EEG data. The specific formula is as follows: S denoising =S-Norm(X`) Among them, X ` The noise vector represents the EEG data, and Q, K, and V represent the results obtained by passing the EEG data through three different linear layers in a multi-branch neural network model. k S represents the vector dimension, Softmax(·) represents the normalization exponential function, and S denoising The denoised EEG data represents the original EEG data, S represents the original EEG data, the dimension of the linear layer is the same as the dimension of the original EEG data, and Norm(·) represents the standardization function.
3. The EEG data denoising method based on neuronal firing correlation according to claim 1, characterized in that, In step (3), the overall loss function that needs to be optimized is as follows: L joint L NC -L SC Among them, L NC L represents the loss of intraclass neuron firing correlation. SC This represents the loss of interclass neuron firing correlation.
4. The EEG data denoising method based on neuronal firing correlation according to claim 3, characterized in that, The correlation of intra-class neuron firing is considered noise. The overall intra-class correlation is measured by calculating the covariance of different neurons within the same class. The loss from the intra-class neuron firing correlation is calculated as follows: L NC =p1NC1+p2NC2+…+p t NC t Where p1,…,p t The values represent trainable weight parameters; NC1 represents the overall intra-class correlation for category 1, which calculates the correlation between all neurons; and t represents t different categories.
5. The EEG data denoising method based on neuronal firing correlation according to claim 4, characterized in that, The overall intra-class correlation is calculated as follows: NC=Sum(Cov(s1,s2) 2 +Cov(s1,s3) 2 +…The n-1 ,s n ) 2 ) / 2 Where s1,…,s n The EEG data represents n neurons, Sum(·) represents the summation function, and Cov(·) represents the covariance function.
6. The EEG data denoising method based on neuronal firing correlation according to claim 5, characterized in that, Given the firing of two neurons, their covariance is calculated as follows: Where s1 and s2 represent the EEG data of neuron 1 and neuron 2, and T represents the time of EEG data transmission. and The mean of the EEG data representing neuron 1 and neuron 2.
7. The EEG data denoising method based on neuronal firing correlation according to claim 3, characterized in that, In step (3), the loss of inter-class neuron firing correlation is calculated as follows: L SC =p t+1 SC Where, p t+1 Represents the trainable weight parameters, and SC represents the overall inter-class neuron firing correlation among t classes.
8. The EEG data denoising method based on neuronal firing correlation according to claim 7, characterized in that, The overall inter-class correlation is calculated as follows: SC=Sum(COv(sc1,sc2) 2 +COv(sc1,sc3) 2 +…Cov(sc n-1 ,sc n ) 2 ) / 2 Where sc1,…,sc n This represents EEG data spliced from n neurons across multiple categories. Before splicing, the mean of each category is calculated.