Semi-supervised electroencephalogram emotion recognition system based on data pseudo labels
Through the combination of semi-supervised network and domain adaptive network, data pseudo-labeling technology is used for collaborative training of EEG data, which solves the problem of reduced generalization performance caused by the scarcity of labeled data and individual differences in the EEG emotion recognition system, and significantly improves to ensure identification accuracy and universal applicability.
Patent Information
- Application Number
- CN202410475035.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2024-10-01
AI Technical Summary
Due to the scarcity of labeled data in EEG emotion recognition systems, the generalization performance decreases, and significant individual differences lead to domain mismatch problems, making it difficult to improve recognition performance.
A semi-supervised network is used to collaboratively train labeled and unlabeled data. Features are extracted through a domain adaptive network. Combined with data pseudo-labeling technology, classification loss, adversarial loss and consistency loss are used to update student and teacher network parameters to improve the system's general performance. ization ability.
It significantly improves the accuracy of emotion recognition, solves the over-fitting problem caused by the scarcity of labeled data, extracts potential information in unlabeled data, and improves the system's universal applicability and recognition performance.
Smart Images

Figure CN118734150A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a semi-supervised EEG emotion recognition system based on a data pseudo-label, and belongs to the technical field of EEG emotion recognition. Background Art
[0002] The EEG emotion recognition system is a system that accurately identifies the emotional state of an individual based on the characteristics of EEG signals. The birth and development of EEG emotion recognition technology is closely related to the cross-integration of psychology, neuroscience, and computer science. With the fast-paced development of modern society, people face various pressures and emotional fluctuations in their daily lives. In order to better understand the emotional state of an individual and provide support for personalized services and precision medicine, EEG emotion recognition technology has received widespread attention and application.
[0003] In the EEG emotion recognition task, obtaining a large amount of accurate labeled data is a time-consuming and expensive task. By adopting a semi-supervised learning method, the reliance on labeled data can be reduced to a certain extent, the cost of data labeling can be reduced, and a high recognition performance can be maintained at the same time. Specifically, in EEG data recording, since professional equipment and laboratory environment are required, and the subjects need to accurately maintain positive, neutral, and negative emotions for a long time, EEG data with accurate emotional labels are scarce. When the amount of training data is small, the system may not be able to fit the true distribution of EEG data well due to lack of sufficient information, resulting in poor recognition results. In addition, the individual differences in EEG data are significant, and when common features cannot be extracted, domain mismatch problems will arise, which brings difficulties to the training and performance improvement of EEG emotion recognition systems under the scarcity of labeled data.
[0004] Although some data enhancement methods have made some progress in solving the problem of scarce labeled data, such as the twin neural network-based method that attempts to use machine learning technology to simulate EEG data to generate additional EEG data, this type of method modifies existing data and does not fully utilize the large amount of unlabeled data in practical applications. Summary of the invention
[0005] The present invention provides a semi-supervised EEG emotion recognition system based on data pseudo-labels. In the actual application scenarios of EEG emotion recognition, the training EEG data is often a small amount of labeled data collected by professional laboratories under strict conditions, while the EEG emotion recognition system will encounter subjects with significant individual differences in EEG data during testing, which will lead to a decrease in the generalization performance of the EEG emotion recognition system. The present invention uses a semi-supervised network to collaboratively train labeled data and unlabeled data, and then uses a domain adaptive network to perform domain recognition on the features extracted by the semi-supervised network, thereby solving the problem of poor generalization of the EEG emotion recognition system due to the scarcity of labeled data.
[0006] The use process of the semi-supervised EEG emotion recognition system with pseudo-labeled data provided by the present invention includes the following steps: First, the original EEG data is processed through downsampling, artifact removal, bandpass filtering, differential entropy extraction, and processing to obtain a two-dimensional EEG data containing spatial features S = {S x ,S y}, where S x is the labeled two-dimensional EEG data, S y is unlabeled two-dimensional EEG data; Then the unlabeled two-dimensional EEG data S y Add two different sets of small perturbations to obtain the perturbed unlabeled two-dimensional EEG data S y1 and S y2 , and S x , S y1 and S y2 Divide into n parts, and then S x and S y1 The first data of S is input into the student network and domain adaptation network in the semi-supervised network to obtain the classification loss and adversarial loss; then S y1 and S y2 The first data of is respectively input into the student network and the teacher network in the semi-supervised network to obtain the consistency loss; the student network is updated by the classification loss, adversarial loss and consistency loss to obtain the updated student network parameters; the teacher network is updated by the updated student network parameters to obtain the updated teacher network parameters; the above steps are repeated until S x , S y1 and S y2 All data are involved in training; finally, during the test, the EEG data of the subject is subjected to emotion classification through the teacher network to obtain the emotion classification result of the user to be identified. The technical solution adopted by the present invention can be further refined. The semi-supervised EEG emotion recognition system based on data pseudo-labels is divided into a semi-supervised network and a domain adaptive network, wherein the semi-supervised network includes a student network and a teacher network. In the overall network training, the overall loss consisting of classification loss, adversarial loss and consistency loss is used to constrain the student network in the semi-supervised network, the adversarial loss constrains the domain adaptive network, and the training process of updating the teacher network parameters in the semi-supervised network is carried out through the student network parameters. The calculation method of the overall loss L is: L=L class +L con +λL adv Where L class represents the classification loss of the semi-supervised network, constraining the training process of the student network for sentiment classification of labeled data in the semi-supervised network, L conrepresents the consistency loss of the semi-supervised network, constraining the unlabeled data clustering training process of the semi-supervised network, L adv represents the adversarial loss, constraining the domain adaptation network and the student network training process, and λ represents the adversarial loss weight. Classification loss L class The calculation method is: Where N is S x The number of samples in a data set, S i is a labeled data S x The i-th sample of , C is the number of categories of sentiment labels, is a tuning parameter. If there is a labeled data sample S i The true category is equal to category c and takes 1, otherwise it takes 0, p(S i |c) There are labeled data samples S i The predicted probability of belonging to class c. Consistency loss L con The constraint is calculated as: Where M is S y1 and S y2 The number of samples in a data set, S y1,i and S y2,i Represents the input S of this round respectively y1 and S y2 The i-th sample, f(S y1,i ,θ 1,t ) is the student network for S y1,i The predicted output, f(S y1,i ,θ 1,t ) is the teacher network pair S y2,i The predicted output, θ 1,t and θ 2,t are the network parameters of the student network and teacher network in the tth round respectively. Adversarial loss L adv The constraint is calculated as: Where S k is the input S x and S y1 The i-th sample of the overall data, J is the input S x and S y1 The number of subjects present, For adjusting parameters, if the data S k From the jth subject, The value is 1, otherwise it is 0, logp(S k |j) is the sample Sk The predicted probability of belonging to the jth subject. The teacher network parameter update process is as follows: θ 2,t+1 =αθ 2,t +(1-α)θ 1,t+1 Where α is a smoothing coefficient hyperparameter used to control the rate at which the teacher network weights are updated, and θ 1,t+1 and θ 2,r+1 are the updated student network parameters and the updated teacher network parameters, θ 2,t is the network parameter of the teacher network at the previous moment.
[0007] Compared with the prior art, the present invention has the following advantages: the semi-supervised EEG emotion recognition method based on data pseudo-labels proposed in the present invention makes full use of limited labeled data and fully mines the potential information in unlabeled data, thereby significantly improving the accuracy of emotion recognition. The semi-supervised EEG emotion recognition system based on data pseudo-labels combines a semi-supervised network with a domain adaptive network. While the domain adaptive network suppresses the extraction of individual-specific features, the semi-supervised network promotes the recognition of more generally applicable EEG emotion features, solving the problem of reduced recognition performance caused by overfitting due to the scarcity of labeled data in the field of EEG emotion recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 This is a flow chart of the semi-supervised EEG emotion recognition system based on data pseudo-labels.
[0009] Figure 2 Diagram of the two-dimensional EEG data matrix composition based on the location of brain electrodes. DETAILED DESCRIPTION
[0010] In order to more clearly describe the content of the present invention, further explanation is given below based on examples and drawings of the specification. The embodiments mentioned below are not intended to limit the scope of the present invention. The semi-supervised EEG emotion recognition system based on data pseudo-labels of the present invention comprises the following steps:
[0011] Step 1: All raw EEG data are processed into two-dimensional EEG data containing spatial features through downsampling, artifact removal, bandpass filtering, differential entropy extraction. The two-dimensional EEG data processing process takes a piece of raw EEG data s as an example, as shown in the following steps.
[0012] 1.1 Given a period of T seconds of raw EEG data s, it is necessary to downsample it first, usually downsampled to 128 Hz, to obtain the downsampled EEG data s1.
[0013] 1.2 Obtain the matrix W required to retain the independent components of the downsampled EEG data d1 through independent component analysis m , calculate the EEG data s2 after removing artifacts, which can be expressed by the following equation: d2=W m d1
[0014] 1.3 Perform bandpass filtering on the EEG data d2 = (d2 [0], d2 [1], ... d2 [T-1]) after removing artifacts to obtain the filtered EEG data d3 = (d3 [0], d3 [1], ... d3 [T-1]): where b n is the coefficient of the filter, Z is the length of the filter, and a 0-45Hz bandpass filter is usually used.
[0015] 1.4 The differential entropy features of the filtered EEG data d3 are extracted at a frame of 128 Hz to obtain differential entropy feature data d4, where the differential entropy feature d of the i-th frame is 4,i , the calculation method is: where e is Euler's constant, is the variance of the EEG data d3 in the i-th frame.
[0016] 1.5 The differential entropy feature data d4 is converted into two-dimensional EEG data S = {S x ,S y}, where S x is the labeled two-dimensional EEG data, S y is unlabeled two-dimensional EEG data.
[0017] Step 2: Transform the unlabeled 2D EEG data S y Add two different sets of small perturbations to obtain the perturbed unlabeled two-dimensional EEG data S y1 and S y2 , and S x , S y1 and S y2 Divide into n parts.
[0018] 2.1 Unlabeled 2D EEG data S y Add two sets of noise matrices with Gaussian distribution and mean 0, standard deviation 0.1 and 0.15, and size 9×9 to obtain the perturbed unlabeled two-dimensional EEG data S y1 and S y2 .
[0019] Step 3: S x and Sy1 The first data is input into the student network and domain adaptation network in the semi-supervised network to obtain the classification loss and adversarial loss.
[0020] 3.1: Use S x and S y1 The first data is input into the student network D in the semi-supervised network s . Make students network D s The output of the second Denseblock in is the emotional feature E1. The emotional feature E1 is classified through the fully connected layer. The training process is subject to the classification loss constraint, which is as follows:
[0021] 3.2: Input the emotional feature E1 into the domain adaptation network D a , determine the domain category. Domain Adaptive Network D a Using the structure of gradient reversal and domain classification, the domain adaptation network training process is subject to adversarial loss constraints. The adversarial loss constraints and gradient reversal are as follows: Where τ is equal to 0.5, X represents the output of forward propagation, and Y represents the input of back propagation.
[0022] Step 4: S y1 and S y2 The first data of is input into the student network and teacher network in the semi-supervised network respectively to judge the consistency of the output emotional features, so as to train the student network D s . Teacher network D in semi-supervised network t Network with students s The training process is subject to the consistency loss constraint, which is as follows:
[0023] Step 5: Update the student network through classification loss, adversarial loss and consistency loss. The specific process is to constrain the update of the student network by minimizing the overall loss L. The overall loss is as follows: L=L class +L con +αL adv where λ is equal to 0.7.
[0024] Step 6: After the network is updated, the teacher network parameters are updated according to the student network and teacher network parameters. The updated teacher network parameters are as follows: θ 2,t+1 =αθ2,t +(1-α)θ 1,t+1 Where α is equal to 0.99.
[0025] Step 7: Repeat steps 3 to 6 until S x , S y1 and S y2 All n copies of data are involved in training.
[0026] Step 8: Use the teacher network to perform emotion classification on the EEG data of the subject to obtain the emotion classification result of the user to be identified. The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention. Experimental design
[0027] SEED is an EEG emotion recognition dataset containing 15 subjects (7 males and 8 females) and 3 emotions: positive, neutral, and negative. 62 channels of EEG data were collected from each subject. All EEG data were collected under the same conditions. Each subject had 3 sessions, and each session contained 15 trials. For each experiment, all data from one subject were used as test data, and data from the remaining subjects were used for training. This process was repeated until all subjects were used as test data once. After downsampling, artifact removal, bandpass filtering, and differential entropy extraction of the original EEG data, it was converted into two-dimensional EEG data S according to the EEG signal electrode collection position. The specific conversion process is as follows: Figure 2 The corresponding relationship is shown.
[0028] All algorithm evaluations are based on the average results of the subject-independent test tasks of 15 subjects, and the evaluation index is accuracy. The specific structure of the network is shown in Table 1. The comparison models selected different types of EEG emotion recognition methods that have been popular in recent years, such as DBN and GMSS using unsupervised learning, and DANN, AttentionEEGNet, HSAN, DGCNN and BiDANN using supervised learning. Table 1 Network structures involved in the experiment Experimental Results
[0031] Table 2 Classification accuracy on SEED dataset
Claims
1. A semi-supervised EEG emotion recognition system based on data pseudo-labels, characterized by: The following steps are involved: S1 processes the original EEG data through downsampling, artifact removal, bandpass filtering, differential entropy extraction, and obtains two-dimensional EEG data containing spatial features S = {S x , S y }, where S x is the labeled two-dimensional EEG data, S y is unlabeled two-dimensional EEG data; S2 converts the unlabeled two-dimensional EEG data S y Add two different sets of small perturbations to obtain the perturbed unlabeled two-dimensional EEG data S y1 and S y2 , and S x , S y1 and S y2 Divide into n parts, let S after division x The number of samples in a data set is N, and the divided S y1 and S y2 The number of data samples is M. Complete the following steps: S3 will S x and S y1 The first data is input into the student network and domain adaptation network in the semi-supervised network to obtain the classification loss and adversarial loss; S4 will S y1 and S y2 The first data is input into the student network and teacher network in the semi-supervised network respectively to obtain the consistency loss; S5 updates the student network through classification loss, adversarial loss and consistency loss to obtain updated student network parameters; S6 updates the teacher network through the updated student network parameters to obtain updated teacher network parameters; S7 repeats S3 to S6 until S x , S y1 and S y2 All n copies of data are involved in training; During the S8 test, the EEG data of the subject is subjected to emotion classification through the teacher network to obtain the emotion classification result of the user to be identified.
2. The semi-supervised EEG emotion recognition system based on data pseudo-labels according to claim 1 is characterized in that: The classification loss L described in step S3 class , and its calculation formula is: Where S i is a labeled data S x The i-th sample of , C is the number of categories of sentiment labels, is a tuning parameter. If there is a labeled data sample S i The true category is equal to category c and takes 1, otherwise it takes 0, p(c|S i ) is a labeled data sample S i The predicted probability of belonging to class c.
3. The semi-supervised EEG emotion recognition system based on data pseudo-labels according to claim 1 is characterized in that: The adversarial loss L described in step S3 adv , and its calculation formula is: Where S k is the input S x and S y1 The i-th sample of the overall data, J is the input S x and S y1 The number of subjects from For adjusting parameters, if the data S k From the jth subject, The value is 1, otherwise it is 0, logp(j|S k ) is the sample S k The predicted probability of belonging to the jth subject.
4. The semi-supervised EEG emotion recognition system based on data pseudo-labels according to claim 1 is characterized in that: The consistency loss L described in step S4 con , and its calculation formula is: Where S y1,i Indicates the input S of this round y1 The i-th sample, S y2,i Indicates the input S of this round y2 The i-th sample, f(S y1,i ,θ 1,t ) is the student network for S y1,i The predicted output, f(S y1,i ,θ 1,t ) is the teacher network pair S y2,i The predicted output, θ 1,t and θ 2,t are the network parameters of the student network and teacher network in the tth round respectively.
5. The semi-supervised EEG emotion recognition system based on data pseudo-labels according to claim 1 is characterized in that: The specific process of updating the student network by classification loss, adversarial loss and consistency loss described in step S5 is to constrain the update of the student network by minimizing the overall loss L, and the calculation method is as follows: L=L class +L con +λL adv where λ represents the adversarial loss weight.
6. The semi-supervised EEG emotion recognition system based on data pseudo-labels according to claim 1 is characterized in that: The updating of the teacher network by the updated student network parameters in step S6 is characterized in that the teacher network parameter updating process is as follows: i 2,t+1 =θ 2,t +(1-α)θ 1,t+1 Where α is a smoothing coefficient hyperparameter that controls the rate at which the teacher network weights are updated, and θ 1,t+1 and θ 2,t+1 are the updated student network parameters and the updated teacher network parameters, θ 2,t is the network parameter of the teacher network at the previous moment.
