Emotional brain signal identification method and system based on improved time sequence convolutional neural network
By combining Bayesian neural network and temporal convolutional neural network, using variational inference and Bayesian backpropagation, the problem of small sample classification and high time complexity in emotional brain signal recognition is solved, achieving high accuracy and low cost. Complexity of emotional brain signal recognition.
Patent Information
- Application Number
- CN202410706073.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-10
AI Technical Summary
Existing technologies have problems with small sample classification, easy overfitting, high time complexity, exploding or disappearing gradients, and large memory usage in emotional brain signal recognition. Traditional temporal neural networks cannot effectively process long-term sequence signals.
Combining Bayesian neural networks and temporal convolutional neural networks, improve the temporal convolutional neural network through variational inference and Bayesian backpropagation training, use dilated causal convolution and residual blocks to extract temporal features, and use weight distribution and uncertainty estimation to optimize the network structure and reduce time complexity and memory usage.
It achieves accurate recognition of emotional brain signals, improves recognition accuracy and robustness, reduces time complexity, and improves the reliability of the emotional brain-computer interface system.
Smart Images

Figure CN118614925A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of brain signal classification, and in particular to an emotional brain signal recognition method and system based on an improved temporal convolutional neural network. Background Art
[0002] Compared with non-physiological signals, brain signals are non-anonymous and highly reliable, and emotion recognition based on brain signals has attracted widespread attention from researchers. At present, most of the emotion recognition methods based on brain signals are based on traditional time series neural networks using point estimation. These methods have some limitations: First, emotional brain signal recognition is a small sample classification problem, and point estimation neural networks are prone to overfitting, and point estimation neural networks do not touch on the assessment of neural network uncertainty. Second, traditional time series neural networks, such as RNN, LSTM, GRU, etc., need to wait until all the data before this data sequence is processed before processing a certain data of the time series signal, so the time complexity is high, and traditional time series neural networks have the problem of gradient explosion or gradient disappearance. In addition, gated recurrent neural networks such as LSTM and GRU will also occupy a lot of memory to store the intermediate results of each gate of the gated unit when processing long time series.
[0003] The Bayesian neural network distributes the weights of the neural network, which is equivalent to the integration of multiple point estimation neural networks. The regularization effect it brings can reduce overfitting. At the same time, it can also bring more regularization effects by setting a priori functions for the weight distribution. Therefore, applying Bayesian neural networks to deal with small sample classification problems such as emotional brain signal classification can solve the difficulty of easy overfitting. Furthermore, the weight distribution of the Bayesian neural network can be used to calculate the uncertainty estimate of the weight. By replacing the weights with small means and high uncertainty with 0 values, the network pruning can be optimized and a lightweight emotional brain signal classification neural network can be deployed. Furthermore, in the testing phase of the Bayesian neural network, the distribution of the prediction results is obtained by sampling the weight distribution multiple times, and the uncertainty estimate of the prediction results is measured by using the variance of the prediction result distribution. By refusing to classify samples with large uncertainty in the prediction results, the reliability of the emotional brain-computer interface system can be improved.
[0004] The time series convolutional neural network is a new type of time series model, which is composed of continuous residual blocks stacked together. Each residual block consists of causal convolution, dilated convolution and other parts. Causal convolution is a strict time constraint model. The output of the next layer at time t only depends on the input of the previous layer at time t and before time t. Dilated convolution can expand the receptive field under the premise of the same number of hidden layers. Residual connections enable the network to transfer information across layers, which can effectively improve the performance of the model in deep neural networks. Compared with traditional time series models such as RNN, LSTM, etc., the time series convolutional neural network has the advantages of being able to process data in parallel, no gradient explosion or disappearance, and low memory requirements. It is suitable for processing emotional brain signals, which are time series signals.
[0005] Based on this, the present invention combines the Bayesian neural network with the temporal convolutional neural network, and proposes an emotional brain signal recognition method and system based on the improved temporal convolutional neural network. Summary of the invention
[0006] The first purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide an emotional brain signal recognition method based on an improved temporal convolutional neural network, which can effectively realize the accurate recognition of emotional brain signals and has the advantages of high accuracy, strong robustness, and low time complexity.
[0007] The second object of the present invention is to provide an emotional brain signal recognition system based on an improved temporal convolutional neural network.
[0008] The first object of the present invention is achieved by the following technical solution: an emotional brain signal recognition method based on an improved temporal convolutional neural network comprises the following steps:
[0009] 1) Using an electrode cap to collect emotional brain signals, and calculating the subjects' self-evaluation scores on the emotional dimension as emotional labels of emotional brain signals;
[0010] 2) Preprocessing the collected emotional brain signals with emotional labels to obtain emotional brain signals with noise removed, and dividing them into training sets and test sets;
[0011] 3) Inputting the data in the training set into the constructed improved time series convolutional neural network for training, using variational inference and Bayesian back propagation to train the parameters of the improved time series convolutional neural network, and obtaining a trained improved time series convolutional neural network with optimal performance; wherein the improvement of the improved time series convolutional neural network is to distribute the weights of the time series convolutional neural network formed by stacking four residual blocks, and the residual block is based on the void causal convolution;
[0012] 4) Call the trained improved temporal convolutional neural network to identify the data in the test set and obtain the emotional brain signal classification results.
[0013] Furthermore, in step 1), an electrode cap of a 10-20 standard lead system is used, and its 32 electrode channels collect the subject's emotional brain signals at a sampling rate of 512 Hz, and another 8 electrode channels collect EOG signals. The subject makes a self-evaluation of 1-9 points on the two emotional dimensions of valence and arousal.
[0014] Further, in step 2), the collected emotional brain signals are downsampled to 128 Hz, EOG artifacts are removed, 4.0-45.0 Hz bandpass filters are filtered, the electrode order is adjusted to Geneva order, normalized, and baseline signals are removed;
[0015] The implementation method of baseline signal removal is as follows: baseline data and experimental data are recorded in each experiment. The baseline data are brain signals without emotion induction, and the experimental data are emotional brain signals. The baseline data are divided into m segments using a 1-second non-overlapping window. Each segment of baseline data is represented by a matrix with the shape of the number of electrode channels * the number of sampling points. The baseline data BaseMean is defined as:
[0016]
[0017] The experimental data is divided into small segments of Raw EEG signal using a 1-second non-overlapping window, and BaseMean is subtracted from each segment to obtain the final emotional brain signal BRi after data preprocessing and noise removal:
[0018] BRi=RawEEGsignal-BaseMean.
[0019] Further, in step 3), four consecutive residual blocks are used to build a temporal convolutional neural network, each residual block is composed of two consecutive modules of the same structure, each module is composed of a void causal convolution layer, a Weight Normalization layer, a ReLU layer and a Dropout layer, and a fully connected layer and a Softmax layer are connected after the last residual block; wherein, the void causal convolution layer uses a one-dimensional convolution with 32 convolution kernels of size 7×32 and a convolution step of 1, the void rate of the void causal convolution layer of the first residual block is 1, the second residual block is 2, the third residual block is 4, and the fourth residual block is 8, and the feature output of the last neuron of the last residual block is input into the fully connected layer and the Softmax layer;
[0020] Assume that the true posterior distribution of the weights of the improved time series convolutional neural network is p(w|D), w is the weight of the improved time series convolutional neural network, D is the training sample, and define the variational posterior distribution q(w|θ) as a skew Gaussian distribution N(μ, σ) which is simpler than the true posterior distribution. 2), θ is a set of parameters for the variational posterior distribution of the control weight w, μ is the mean of the skew Gaussian distribution, σ is the standard deviation of the skew Gaussian distribution, and the training samples in the training set are used to train the improved temporal convolutional neural network. θ = (μ, σ) is iteratively updated through Bayesian back propagation to minimize the KL divergence between the variational posterior distribution and the true posterior distribution, so that the variational posterior distribution continuously approaches the true posterior distribution, and the trained improved temporal convolutional neural network is obtained; among them, the KL divergence formula between the true posterior distribution p(w|D) and the variational posterior distribution q(w|θ) is:
[0021]
[0022] Where p(w|D) is the posterior distribution function of the weight w given the training sample D; q(w|θ) is the variational posterior distribution function of the weight w given the parameter θ; p(D) is the boundary function of the training sample D, p(D|w) is the likelihood function, and p(w) is the prior distribution function of the weight w;
[0023] Minimizing the KL divergence between the true posterior distribution and the variational posterior distribution is equivalent to minimizing the following loss function and using Monte Carlo sampling to approximate the loss function:
[0024]
[0025] Where F(D, θ) is the loss function of the improved temporal convolutional neural network given the training sample D and parameter θ during training, and w (i) is the i-th Monte Carlo sample of the weight w on its variational posterior distribution, and n is the total number of Monte Carlo samples of the weight w;
[0026] The weights of the improved time series convolutional neural network are sampled n times, and the losses of the generated n point estimation neural networks are calculated respectively, and then their average value is taken as the final loss; among them, the loss function Loss of one sampling is as follows:
[0027]
[0028] Where out is the output of the improved temporal convolutional neural network, y is the label of the training sample, CrossEntropy(out, y) is the cross entropy of out and y, corresponding to the likelihood cost logp(D|w) in F(D, θ), M represents the number of training batches, that is, the number of training data or batch size, and q(w|θ) is a skew Gaussian distribution N(μ, σ) that is simpler than the true posterior distribution. 2 ), the prior distribution p(w) of the weight w uses a mixed Gaussian prior:
[0029]
[0030] In the formula, σ1, σ2, π are the hyperparameters of the improved temporal convolutional neural network, w j is the jth weight, N(w j |0,σ1 2 ) is w j The Gaussian distribution with mean 0 and standard deviation σ1 is N(w j |0,σ2 2 ) is w j Gaussian distribution with mean 0 and standard deviation σ2;
[0031] Reparameterization is used to solve the problem that sampling directly from the variational posterior distribution will lead to non-differentiable μ and σ. 2 ) is regarded as the result of the unit Gaussian distribution N(0,1) being translated by μ and scaled by σ, that is, q(w|θ)~N(μ,σ 2 ) is transformed into q(w|θ)=σε+μ,ε~N(μ,σ 2 ), ε is a variable that obeys the unit Gaussian distribution. By sampling from the unit Gaussian distribution and then transforming it, the derivable introduction of μ and σ is realized. Among them, the σ value marks the size of the uncertainty of the weight. The larger the σ value, the greater the uncertainty. When σ=0, the improved time series convolutional neural network is no different from the original time series convolutional neural network. To ensure σ>0, set:
[0032] σ=log(1+e ρ )
[0033] In the formula, ρ is the standard deviation parameter, and the result after reparameterization of the weights is:
[0034] w=μ+log(1+e ρ )*ε,ε~N(0,1)
[0035] From this, we calculate the gradient Δ of the mean μ μ for:
[0036]
[0037] Among them, f(w, θ) represents the loss function Loss of the improved temporal convolutional neural network;
[0038] The gradient Δ of the standard deviation parameter ρ ρ for:
[0039]
[0040] Through gradient descent, μ and ρ are updated, thereby updating w to achieve training and improve the parameters of the temporal convolutional neural network:
[0041] μ←μ-αΔ μ
[0042] ρ←ρ-αΔ ρ
[0043] In the formula, α is the learning rate and ← represents the update iteration.
[0044] The second object of the present invention is achieved through the following technical solutions: an emotional brain signal recognition system based on an improved temporal convolutional neural network, used to implement the above-mentioned emotional brain signal recognition method based on an improved temporal convolutional neural network, which includes:
[0045] The data acquisition module uses an electrode cap to collect emotional brain signals and calculates the subjects' self-evaluation scores on the emotional dimension as emotional labels of emotional brain signals;
[0046] A data processing module is used to perform data preprocessing on the collected emotional brain signals with emotional labels to obtain emotional brain signals with noise removed, and divide them into a training set and a test set;
[0047] A training module is used to input the data in the training set into the constructed improved time series convolutional neural network for training, and use variational inference and Bayesian back propagation to train the parameters of the improved time series convolutional neural network to obtain a trained improved time series convolutional neural network with optimal performance;
[0048] The recognition module calls the trained improved temporal convolutional neural network to recognize the data in the test set and obtain the emotional brain signal classification results.
[0049] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0050] 1. The present invention introduces Bayesian uncertainty estimation into emotional brain signal recognition, which makes up for the shortcomings of point estimation neural network in emotional brain signal recognition, improves the recognition accuracy and robustness, and the reliability of the emotional brain-computer interface system.
[0051] 2. The present invention utilizes an improved time series convolutional neural network to extract the time series features of emotional brain signals, making up for the shortcomings of traditional time series models that cannot process data in parallel and are prone to gradient explosion or disappearance, reducing time complexity and improving recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a flowchart of the method of the present invention.
[0053] Figure 2This is a structural diagram of an improved temporal convolutional neural network; in the figure, Residual block is the residual block, k is the convolution kernel step size of the atrous causal convolution layer in the residual block, d is the dilation rate of the atrous causal convolution layer in the residual block, Dilatedcasual convolution is the dilated causal convolution, Weight normalization is weight normalization, ReLU is the activation function, Dropout is random inactivation, and the "+" circle represents the residual connection.
[0054] Figure 3 It is a schematic diagram of a Bayesian neural network; in the figure, input is input data, feature maps are feature maps, pooled feature maps are feature maps after pooling convolution, fully-connected is a fully connected operation, and outputs are output results.
[0055] Figure 4 Schematic diagram of the system of the present invention. DETAILED DESCRIPTION
[0056] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0057] Example 1
[0058] like Figure 1 As shown, this embodiment discloses a method for identifying emotional brain signals based on an improved temporal convolutional neural network, the details of which are as follows:
[0059] 1) Collect emotional brain signals. The experimental data of this embodiment uses the DEAP data set, and the data comes from 32 physically and mentally healthy subjects. Each subject watched 40 1-minute emotionally stimulating music videos in the music library, and used the 32 electrode channels in the 10-20 standard lead system electrode cap to record EEG signals at a sampling rate of 512Hz. Before each music video is played, an additional 3 seconds of non-stimulating baseline signal is recorded. The total length of the EEG signal corresponding to each music video for each person is 63 seconds. After each music video is played, the subject makes a self-evaluation of 1-9 points on the two emotional dimensions of valence and arousal.
[0060] 2) Perform data preprocessing on the collected brain signals.
[0061] For the subject's self-evaluation score, 5 is used as the dividing line, less than or equal to 5 points is low, and greater than 5 points is high. The EEG signal is marked as high valence or low valence, high arousal or low arousal as the label of the EEG signal segment.
[0062] The collected EEG signal was downsampled to 128Hz, EOG artifacts were removed, 4.0-45.0Hz bandpass filter was used, the electrode order was adjusted to Geneva order, normalized, and the 3-second baseline signal was removed. The specific implementation method of the 3-second baseline signal removal is as follows: Each experimental record contains 3 seconds of baseline data and 60 seconds of experimental data. We divide the 3-second baseline data into 3 segments with a 1-second non-overlapping window. Each segment of baseline data is a matrix of 32 electrode channels * 128 sampling points. The BaseMean of the 3-second baseline data is defined as:
[0063]
[0064] The 60-second experimental data is divided into 60 segments of Raw EEG signal using a 1-second non-overlapping window. BaseMean is subtracted from each segment to obtain the final emotional brain signal BRi after data preprocessing and noise removal:
[0065] BRi=RawEEGsignal-BaseMean
[0066] After processing, 40 music pieces*60 seconds=2400 BRi samples were obtained for each subject. In this embodiment, independent experiments were conducted on subjects, and samples were divided into 2160 training set samples and 240 test set samples using a 10-fold cross validation method.
[0067] 3) Build an improved time series convolutional neural network and train the parameters of the improved time series convolutional neural network. First, Figure 2 As shown in , based on the dilated causal convolution, a temporal convolutional neural network with 4 stacked residual blocks is built. Each residual block consists of 2 consecutive modules of the same structure. Each module consists of a dilated causal convolution layer, a Weight Normalization layer, a ReLU layer, and a Dropout layer. The fully connected layer and the Softmax layer are connected after the last residual block. Among them, the dilated causal convolution layer uses 32 one-dimensional convolutions with a kernel size of 7×32 and a convolution step of 1. The dilation rate of the dilated causal convolution layer of the first residual block is 1, the second residual block is 2, the third residual block is 4, and the fourth residual block is 8. The features of the last neuron output of the last residual block are input into the fully connected layer and the Softmax layer. Then, as shown in Figure 3 As shown, the weights of the time series convolutional neural network are distributed to obtain an improved time series convolutional neural network.
[0068] Assume that the true posterior distribution of the weights of the improved time series convolutional neural network is p(w|D), w is the weight of the improved time series convolutional neural network, D is the training sample, and define the variational posterior distribution q(w|θ) as a skew Gaussian distribution N(μ,σ 2 ), θ is a set of parameters for controlling the variational posterior distribution of the weight w, μ is the mean of the skew Gaussian distribution, σ is the standard deviation of the skew Gaussian distribution, and the training samples in the training set are used to train the improved temporal convolutional neural network. θ=(μ,σ) is iteratively updated through Bayesian back propagation to minimize the KL divergence between the variational posterior distribution and the true posterior distribution, so that the variational posterior distribution continuously approaches the true posterior distribution, and the trained improved temporal convolutional neural network is obtained; among them, the KL divergence formula between the true posterior distribution p(w|D) and the variational posterior distribution q(w|θ) is:
[0069]
[0070] Where p(w|D) is the posterior distribution function of the weight w given the training sample D; q(w|θ) is the variational posterior distribution function of the weight w given the parameter θ; p(D) is the boundary function of the training sample D, p(D|w) is the likelihood function, and p(w) is the prior distribution function of the weight w;
[0071] Minimizing the KL divergence between the true posterior distribution and the variational posterior distribution is equivalent to minimizing the following loss function and using Monte Carlo sampling to approximate the loss function:
[0072]
[0073] Where F(D, θ) is the loss function of the improved temporal convolutional neural network given the training sample D and parameter θ during training, and w (i) is the i-th Monte Carlo sample of the weight w on its variational posterior distribution, and n is the total number of Monte Carlo samples of the weight w;
[0074] In this embodiment, in a batch of training, the number of Monte Carlo sampling is set to 3, that is, when training each batch of data, the weights of the improved time series convolutional neural network need to be sampled 3 times, and the losses of the generated 3 point estimation neural networks are calculated respectively, and their average value is taken as the final loss. The loss function Loss of one sampling is as follows:
[0075]
[0076] Where out is the output of the improved temporal convolutional neural network, y is the label of the training sample, CrossEntropy(out, y) is the cross entropy of out and y, corresponding to the likelihood cost logp(D|w) in F(D, θ). M represents the number of training batches, that is, the number of training data or the batch size. In this embodiment, the batch size is 64 and the number of iterations is 20. q(w|θ) is a skew Gaussian distribution N(μ, σ) that is simpler than the true posterior distribution. 2 ). The prior distribution of weights p(w) uses a mixed Gaussian prior:
[0077]
[0078] Wherein, σ1, σ2, and π are the hyperparameters of the improved temporal convolutional neural network. In this embodiment, σ1=0.1, σ2=0.0005, π=0.5, and w j is the jth weight, N(w j |0,σ1 2 ) is w j The Gaussian distribution with mean 0 and standard deviation σ1 is N(w j |0,σ2 2 ) is w j Gaussian distribution with mean 0 and standard deviation σ2;
[0079] Reparameterization is used to solve the problem that sampling directly from the variational posterior distribution will lead to non-differentiable μ and σ. 2 ) is regarded as the result of the unit Gaussian distribution N(0,1) being translated by μ and scaled by σ, that is, q(w|θ)~N(μ,σ 2 ) is transformed into q(w|θ)=σε+μ,ε~N(μ,σ 2 ), ε is a variable that obeys the unit Gaussian distribution. By sampling from the unit Gaussian distribution and then transforming it, the derivable introduction of μ and σ is realized. Among them, the σ value marks the size of the uncertainty of the weight. The larger the σ value, the greater the uncertainty. When σ=0, the improved time series convolutional neural network is no different from the original time series convolutional neural network. To ensure σ>0, set:
[0080] σ=log(1+e ρ )
[0081] In the formula, ρ is the standard deviation parameter, and the result after reparameterization of the weights is:
[0082] w=μ+log(1+e ρ )*ε,ε~N(0,1)
[0083] From this, we calculate the gradient Δ of the mean μ μ for:
[0084]
[0085] Among them, f(w, θ) represents the loss function Loss of the improved temporal convolutional neural network;
[0086] The gradient Δ of the standard deviation parameter ρ ρ for:
[0087]
[0088] Through gradient descent, μ and ρ are updated, thereby updating w to achieve training and improve the parameters of the temporal convolutional neural network:
[0089] μ←μ-αΔ μ
[0090] ρ←ρ-αΔ ρ
[0091] In the formula, α is the learning rate, and ← represents the update iteration. In this embodiment, α=2e-3 is taken.
[0092] 4) Call the trained improved time series convolutional neural network to identify the data in the test set to obtain the classification results of emotional brain signals. This embodiment conducts independent experiments on 32 subjects, and takes the average classification accuracy of all independent experiments as the evaluation index of the improved time series convolutional neural network. Experiments show that compared with the corresponding point estimation neural network, the method provided by the present invention, the improved time series convolutional neural network can effectively improve the classification accuracy of emotional brain signals, and is worthy of promotion.
[0093] Example 2
[0094] This embodiment discloses an emotional brain signal recognition system based on an improved temporal convolutional neural network, which is used to implement the emotional brain signal recognition method based on an improved temporal convolutional neural network described in Example 1. Figure 4 As shown, the system includes the following functional modules:
[0095] The data acquisition module uses an electrode cap to collect emotional brain signals and calculates the subjects' self-evaluation scores on the emotional dimension as emotional labels of emotional brain signals;
[0096] A data processing module is used to perform data preprocessing on the collected emotional brain signals with emotional labels to obtain emotional brain signals with noise removed, and divide them into a training set and a test set;
[0097] A training module is used to input the data in the training set into the constructed improved time series convolutional neural network for training, and use variational inference and Bayesian back propagation to train the parameters of the improved time series convolutional neural network to obtain a trained improved time series convolutional neural network with optimal performance;
[0098] The recognition module calls the trained improved temporal convolutional neural network to recognize the data in the test set and obtain the emotional brain signal classification results.
[0099] The above-described embodiments are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. The emotional brain signal recognition method based on improved temporal convolutional neural network is characterized by: The following steps are involved: 1) Using an electrode cap to collect emotional brain signals, and calculating the subjects' self-evaluation scores on the emotional dimension as emotional labels of emotional brain signals; 2) Preprocessing the collected emotional brain signals with emotional labels to obtain emotional brain signals with noise removed, and dividing them into training sets and test sets; 3) Inputting the data in the training set into the constructed improved time series convolutional neural network for training, using variational inference and Bayesian back propagation to train the parameters of the improved time series convolutional neural network, and obtaining a trained improved time series convolutional neural network with optimal performance; wherein the improvement of the improved time series convolutional neural network is to distribute the weights of the time series convolutional neural network formed by stacking four residual blocks, and the residual block is based on the void causal convolution; 4) Call the trained improved temporal convolutional neural network to identify the data in the test set and obtain the emotional brain signal classification results.
2. The method for identifying emotional brain signals based on an improved temporal convolutional neural network according to claim 1, characterized in that: In step 1), an electrode cap of a 10-20 standard lead system was used, with 32 electrode channels collecting emotional brain signals of the subjects at a sampling rate of 512 Hz, and another 8 electrode channels collecting EOG signals. The subjects made self-evaluations of 1 to 9 points on the two emotional dimensions of valence and arousal.
3. The emotional brain signal recognition method based on improved temporal convolutional neural network according to claim 1 is characterized in that: In step 2), the collected emotional brain signals were downsampled to 128 Hz, EOG artifacts were removed, 4.0-45.0 Hz bandpass filters were used, the electrode order was adjusted to Geneva order, normalized, and baseline signals were removed; The implementation method of baseline signal removal is as follows: baseline data and experimental data are recorded in each experiment. The baseline data are brain signals without emotion induction, and the experimental data are emotional brain signals. The baseline data are divided into m segments using a 1-second non-overlapping window. Each segment of baseline data is represented by a matrix with the shape of the number of electrode channels * the number of sampling points. The baseline data BaseMean is defined as: The experimental data is divided into small segments of Raw EEG signal using a 1-second non-overlapping window, and BaseMean is subtracted from each segment to obtain the final emotional brain signal BRi after data preprocessing and noise removal: BRi=RawEEGsignal-BaseMean.
4. The emotional brain signal recognition method based on improved temporal convolutional neural network according to claim 1 is characterized in that: In step 3), four consecutive residual blocks are used to build a temporal convolutional neural network. Each residual block consists of two consecutive modules of the same structure. Each module consists of a dilated causal convolution layer, a Weight Normalization layer, a ReLU layer, and a Dropout layer. A fully connected layer and a Softmax layer are connected after the last residual block. The dilated causal convolution layer uses 32 one-dimensional convolutions with a kernel size of 7×32 and a convolution step of 1. The dilated rate of the dilated causal convolution layer of the first residual block is 1, the second residual block is 2, the third residual block is 4, and the fourth residual block is 8. The feature output of the last neuron of the last residual block is input into the fully connected layer and the Softmax layer. Assume that the true posterior distribution of the weights of the improved time series convolutional neural network is p(w|D), w is the weight of the improved time series convolutional neural network, D is the training sample, and define the variational posterior distribution q(w|θ) as a skew Gaussian distribution N(μ, σ) which is simpler than the true posterior distribution. 2 ), θ is a set of parameters for the variational posterior distribution of the control weight w, μ is the mean of the skew Gaussian distribution, σ is the standard deviation of the skew Gaussian distribution, and the training samples in the training set are used to train the improved temporal convolutional neural network. θ = (μ, σ) is iteratively updated through Bayesian back propagation to minimize the KL divergence between the variational posterior distribution and the true posterior distribution, so that the variational posterior distribution continuously approaches the true posterior distribution, and the trained improved temporal convolutional neural network is obtained; among them, the KL divergence formula between the true posterior distribution p(w|D) and the variational posterior distribution q(w|θ) is: Where p(w|D) is the posterior distribution function of the weight w given the training sample D; q(w|θ) is the variational posterior distribution function of the weight w given the parameter θ; p(D) is the boundary function of the training sample D, p(D|w) is the likelihood function, and p(w) is the prior distribution function of the weight w; Minimizing the KL divergence between the true posterior distribution and the variational posterior distribution is equivalent to minimizing the following loss function and using Monte Carlo sampling to approximate the loss function: Where F(D, θ) is the loss function of the improved temporal convolutional neural network given the training sample D and parameter θ during training, and w (i) is the i-th Monte Carlo sample of the weight w on its variational posterior distribution, and n is the total number of Monte Carlo samples of the weight w; The weights of the improved time series convolutional neural network are sampled n times, and the losses of the generated n point estimation neural networks are calculated respectively, and then their average value is taken as the final loss; among them, the loss function Loss of one sampling is as follows: Where out is the output of the improved temporal convolutional neural network, y is the label of the training sample, CrossEntropy(out, y) is the cross entropy of out and y, corresponding to the likelihood cost log p(D|w) in F(D, θ), M represents the number of training batches, that is, the number of training data or batch size, and q(w|θ) is a skew Gaussian distribution N(μ, σ) that is simpler than the true posterior distribution. 2 ), the prior distribution p(w) of the weight w uses a mixed Gaussian prior: In the formula, σ1, σ2, π are the hyperparameters of the improved temporal convolutional neural network, w j is the jth weight, N(w j |0,σ1 2 ) is w j The Gaussian distribution with mean 0 and standard deviation σ1 is N(w j |0,σ2 2 ) is w j Gaussian distribution with mean 0 and standard deviation σ2; Reparameterization is used to solve the problem that sampling directly from the variational posterior distribution will lead to non-differentiable μ and σ. 2 ) is regarded as the result of the unit Gaussian distribution N(0,1) being translated by μ and scaled by σ, that is, q(w|θ)~N(μ,σ 2 ) is transformed into q(w|θ)=σε+μ,ε~N(μ,σ 2 ), ε is a variable that obeys the unit Gaussian distribution. By sampling from the unit Gaussian distribution and then transforming it, the derivable introduction of μ and σ is realized. Among them, the σ value marks the size of the uncertainty of the weight. The larger the σ value, the greater the uncertainty. When σ=0, the improved time series convolutional neural network is no different from the original time series convolutional neural network. To ensure σ>0, it is assumed that: σ=log(1+e ρ ) In the formula, ρ is the standard deviation parameter, and the result after reparameterization of the weights is: w=μ+log(1+e ρ )*ε,ε~N(0,1) From this, we calculate the gradient Δ of the mean μ μ for: Among them, f(w, θ) represents the loss function Loss of the improved temporal convolutional neural network; The gradient Δ of the standard deviation parameter ρ ρ for: Through gradient descent, μ and ρ are updated, thereby updating w to achieve training and improve the parameters of the temporal convolutional neural network: μ←μ-αΔ μ ρ←ρ-αΔ ρ In the formula, α is the learning rate and ← represents the update iteration.
5. Emotional brain signal recognition system based on improved temporal convolutional neural network, characterized in that: The method for identifying emotional brain signals based on an improved temporal convolutional neural network according to any one of claims 1 to 4 comprises: The data acquisition module uses an electrode cap to collect emotional brain signals and calculates the subjects' self-evaluation scores on the emotional dimension as emotional labels of emotional brain signals; A data processing module is used to perform data preprocessing on the collected emotional brain signals with emotional labels to obtain emotional brain signals with noise removed, and divide them into a training set and a test set; A training module is used to input the data in the training set into the constructed improved time series convolutional neural network for training, and use variational inference and Bayesian back propagation to train the parameters of the improved time series convolutional neural network to obtain a trained improved time series convolutional neural network with optimal performance; The recognition module calls the trained improved temporal convolutional neural network to recognize the data in the test set and obtain the emotional brain signal classification results.
Citation Information
Patent Citations
Electroencephalogram emotion recognition method and system based on time convolutional neural network
CN113069117A
Electroencephalogram signal classification method based on model uncertainty learning
CN114841216A
Electroencephalogram signal depression recognition method based on improved time sequence convolutional network
CN115813410A
Uncertainty processing method and device based on Bayesian convolution, equipment and medium
CN116012597A
Brain electrical emotion recognition method based on deep residual convolutional neural network
CN116049636A
Cited By
Emotion recognition method and system based on dynamic clustering and variational Bayesian element learning
CN119366920A
Electrocardiosignal noise reduction method based on deep convolution and sequential network
CN120873563A
