An EEG emotion recognition method based on attention-based spatiotemporal network
Patent Information
- Application Number
- CN202211072485.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-09-02
AI Technical Summary
Existing technologies lack accuracy when extracting emotional features from EEG signals, making it difficult to effectively identify human emotions and affecting the ability of machines to understand and recognize human emotions.
An attention-based spatiotemporal network model is adopted, including a kernel attention module, a spatial dependency module, and a temporal dependency module. By constructing a kernel attention spatiotemporal convolutional neural network and combining it with a long short-term memory network model, the spatial and temporal features of EEG data are processed for emotion recognition.
The accuracy of EEG emotion recognition has been improved, enabling machines to better understand and identify human emotions and promoting friendliness in human-computer interaction.
Smart Images

Figure CN115422973B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of human-computer interaction and affective computing, and in particular to an EEG emotion recognition method based on an attention-based spatiotemporal network. Background Art
[0002] Emotion is one of the most fundamental components of human experience. In the field of emotional psychology, emotion refers to a subjective psychological activity, the interaction between an individual and various meaningful environmental events. It is a multi-component, multi-dimensional, multi-level integrated psychological process and motivational force that interacts with cognition for organismal survival and interpersonal communication. Humanity strives to make technological applications more user-friendly, and the emergence of affective computing is a natural step forward. It enables machines to recognize and understand human emotions and possess the emotional capacity to express care and concern. Although affective computing is a relatively new branch of artificial intelligence, it is one of the key technologies for machines to possess emotions and ultimately achieve true intelligence.
[0003] Furthermore, emotion recognition can be performed using machine learning and deep learning models to analyze individual biosignals, including facial data, EEG data, and peripheral physiological data. While facial expression data is relatively inexpensive to obtain, research has shown that some people can manipulate their facial expressions to conceal their emotions. Consequently, much research has focused on analyzing physiological signal data. EEG data, as a typical physiological signal, has gained widespread application in recent years.
[0004] When dealing with emotion recognition based on EEG data, a common problem is how to extract distinctive emotion features from EEG signals. Traditional feature extraction methods rely on manual work to extract EEG features from the time domain, frequency domain, and time-frequency domain. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide an EEG emotion recognition method based on an attention-based spatiotemporal network to improve the accuracy of EEG emotion recognition of subjects, thereby enabling machines to acquire the ability to recognize and understand human emotions, giving machines a caring feeling, and promoting friendly communication between humans and machines.
[0006] To solve the above technical problems, an embodiment of the present invention provides an EEG emotion recognition method based on an attention-based spatiotemporal network, comprising the following steps:
[0007] S1. Obtain EEG data and label data of the subject watching the video clip;
[0008] S2, data preprocessing, including: downsampling, removing baseline signals, removing oculoculogram signals and physiological artifacts of blinking, and bandpass filtering to retain 4.0-45.0 Hz EEG signals to divide the data;
[0009] S3. Build a spatiotemporal convolutional neural network model based on kernel attention;
[0010] S4, training the neural network model of step S3, adjusting parameters, and obtaining classification results of EEG emotion recognition;
[0011] S5. Using the set evaluation indicators, taking the SVM model as the baseline, and comparing it with various deep neural network models, the effectiveness of the kernel attention-based spatiotemporal network model is verified.
[0012] Among them, in step S1, the EEG data of each subject watching one end of the video includes a 3-second baseline signal and a 60-second emotional stimulation signal. The 32-channel Biosemi ActiveTwo system with a sampling frequency of 512Hz and the international standard 10 / 20 system are used to obtain the user's EEG data, and different emotional labels are assigned to the user's EEG data in different emotional states; the label data includes arousal and valence, and a 9-point scale is used to measure the level of each dimension of the label data. The larger the value, the higher the degree of emotional activation.
[0013] Wherein, step S2 includes the following steps:
[0014] S2.1. Remove the 3s baseline signal from the EEG data;
[0015] S2.2, downsample the sampling frequency from 512 Hz to 128 Hz;
[0016] S2.3. Use blind source separation to remove oculoculogram (EOG) and blink artifacts from EEG data.
[0017] S2.4. Remove high-frequency noise interference and perform a 4.0-45.0 Hz bandpass filter on the EEG data.
[0018] S2.5. For the class label of each dimension of the EEG data, select 5 as the threshold and project 9 discrete values into the low and high classes of each dimension;
[0019] S2.6, Data expansion: Divide the 60s EEG signal data into smaller non-overlapping 4s segments, and each EEG data is divided into 15 segments.
[0020] In step S3, the spatiotemporal convolutional neural network model based on kernel attention includes a kernel attention module, a spatial dependency module, and a temporal dependency module, and includes the following steps:
[0021] S3.1. Use the kernel attention module to obtain EEG node attributes, use cascaded convolutional layers to obtain strong features, and fuse and splice the EEG features learned by different kernels as node attributes in the EEG representation;
[0022] S3.2, spatial dependency module extracts spatial feature information of EEG data;
[0023] S3.3. The time-dependent module uses a long short-term memory network model to extract the time series data of the EEG data and use historical information to influence the current state.
[0024] Wherein, step S3.1 includes the following steps:
[0025] S3.1.1. The length of the kernel is set to the sampling rate f. s Different ratio settings, the ratio coefficient is recorded as α k ∈R, where k is the number of convolutional layers, k will be from 1 to k, and the size of the T kernel in the kth layer is The formula is as follows:
[0026]
[0027] S3.1.2. The EEG signal data after step S2 is expressed as follows:
[0028] X i ∈R c×l ,i∈[1,...,n];
[0029] Where n represents the sample size of EEG data, c represents the number of channels of EEG signals, and l represents the length of a single sample;
[0030] S3.1.3. The EEG features learned by different kernels are fused and spliced. The final feature representation formula of the attention module is as follows:
[0031]
[0032] Among them, F bn represents the batch normalization function, F avgpool represents the average pooling function, F cat Represents the feature fusion function, F conv Represents the convolution function.
[0033] Wherein, step S3.2 includes the following steps:
[0034] S3.2.1. The spatial dependency module consists of four basic units repeated, namely, the 2D convolutional layer, the batch normal layer, the leaky ReLU layer, and the average pooling layer. The output features obtained by the kernel attention module in step S3.1 are used as input features. The final feature representation formula of the spatial dependency module is as follows:
[0035]
[0036] Among them, F Leakyrelu represents the activation function, F spatial_conv represents the spatial convolution function;
[0037] S3.2.2. The activation function of the convolutional neural network uses the Leaky ReLU activation function. Compared with the traditional ReLU activation function, it can solve the problem of the neuron gradient in the network always being 0 when the learning rate is too large. Its formula is as follows:
[0038] f(x)=max(0,x)+leak*min(0,x);
[0039] The leaky value is 0.01.
[0040] In step S3.3, the long short-term memory network model introduces a gate structure in each LSTM cell state, namely, a sigmoid function and a dot product operation, and the output value of the sigmoid function is in the range [0, 1], which controls the discarding or adding of information to determine forgetting or remembering. Each LSTM cell includes a forget gate, an input gate, and an output gate. The contents are as follows:
[0041] S3.3.1, forget gate: through the output h of the previous unit t-1 and the input of this unit is the input sigmod function, C t-1 Each item in produces a value in [0,1] to control the degree to which the previous unit state is forgotten. The formula is expressed as follows:
[0042]
[0043] Among them, σ represents the sigmoid function, h t-1 represents the hidden node of the previous unit, represents EEG data, W f represents the forget gate weight coefficient, b f represents the forget gate error;
[0044] S3.3.2 Input gate: This gate controls the addition of new information by coordinating with a tanh function, which generates a new candidate input gate i t is the cell state C t Each item in generates a value in [0,1] to update the cell state of the memory unit. The formula is as follows:
[0045]
[0046] Among them, σ represents the sigmoid function, tanh represents the tanh function, W i represents the input gate weight coefficient, b i represents the input gate error, C t Represents the new cell state, W C represents the unit state weight coefficient, b C Indicates the unit state error;
[0047] S3.3.3, output gate: activate the unit state, output gate o t is the cell state C t Each item in generates a value in [0,1] to control the filtering of the current unit state and output the hidden node h of the next unit t The value is expressed as follows:
[0048]
[0049] h t =o t *tanh(C t );
[0050] Among them, W o Represents the output gate weight coefficient, b o represents the output gate error.
[0051] Wherein, step S4 includes the following steps:
[0052] S4.1, cross-validation: Group the EEG data processed in step S2, set training data and validation data respectively, first use the training data to train the network model in step S3, and then use the validation data to test the trained model;
[0053] S4.2. Improve the model effect by adjusting parameters, save the network model, and output the classification results of emotion recognition.
[0054] The specific steps of step S4.1 are as follows:
[0055] In each step of the 10-fold cross-validation, 1 fold was selected as the test data and the remaining 9 folds were used as the training data. In the 9 training folds, the data was randomly divided into 70% training data and 30% validation data.
[0056] Wherein, step S5 includes the following steps:
[0057] S5.1. Performance evaluation: The first metric is selected as the evaluation indicator. It is one of the most commonly used evaluation indicators in classification problems. It can measure the accuracy of the prediction of the class data set. It is the ratio of the number of correctly predicted samples to the total number of samples. For the binary classification problem, the performance evaluation formula is as follows:
[0058]
[0059] Among them, TP is true positive, TN is true negative, FP is false positive, and FN is false negative;
[0060] S5.2. Due to the imbalance of the dataset, the F1 score was used to quantify the EEG emotion recognition results. The F1 score is defined as the harmonic mean of the recall and precision of the classifier, which is calculated as follows:
[0061]
[0062] S5.3. In the model comparison, the traditional machine learning method SVM was selected as the baseline network model and compared with deep learning networks such as DeepConvNet, EEGNet, and TSception.
[0063] The beneficial effects of the above technical solution of the present invention are as follows:
[0064] Based on a deep learning algorithm, this paper proposes a spatiotemporal convolutional neural network method based on kernel attention. Unlike manually extracted feature methods, this method utilizes time and channel dimensions to design multi-scale one-dimensional convolution kernels to form an attention module, which captures EEG node attributes. To effectively learn spatial information for emotion recognition from EEG, a convolutional neural network is used to process EEG spatial dependencies. EEG data is typically time series data, and this data is processed using a long short-term memory network model. This method uses a long short-term memory network model to capture the temporal dependencies of EEG signals, effectively improving the accuracy of EEG emotion recognition and possessing significant application value in the field of human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic flow chart of the method of the present invention;
[0066] Figure 2 It is a schematic diagram of the model structure of the present invention;
[0067] Figure 3 Schematic diagram of the time-dependent module model of the present invention. DETAILED DESCRIPTION
[0068] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0069] like Figure 1 As shown, an embodiment of the present invention provides an EEG emotion recognition method based on an attention-based spatiotemporal network, comprising the following steps:
[0070] S1. Obtain EEG data and label data of the subject watching the video clip;
[0071] S2, data preprocessing, including: downsampling, removing baseline signals, removing oculoculogram signals and physiological artifacts of blinking, and bandpass filtering to retain 4.0-45.0 Hz EEG signals to divide the data;
[0072] S3. Build a spatiotemporal convolutional neural network model based on kernel attention;
[0073] S4, training the neural network model of step S3, adjusting parameters, and obtaining classification results of EEG emotion recognition;
[0074] S5. Using the set evaluation indicators, taking the SVM model as the baseline, and comparing it with various deep neural network models, the effectiveness of the kernel attention-based spatiotemporal network model is verified.
[0075] In step S1, the EEG data of each subject watching one end of the video includes a 3-second baseline signal and a 60-second emotional stimulation signal. The 32-channel Biosemi ActiveTwo system with a sampling frequency of 512Hz and the international standard 10 / 20 system are used to obtain the user's EEG data, and different emotional labels are assigned to the user's EEG data in different emotional states; the label data includes arousal and valence, and a 9-point scale is used to measure the level of each dimension of the label data. The larger the value, the higher the degree of emotional activation.
[0076] S2.2, downsample the sampling frequency from 512 Hz to 128 Hz;
[0077] S2.3. Use blind source separation to remove oculoculogram (EOG) and blink artifacts from EEG data.
[0078] S2.4. Remove high-frequency noise interference and perform a 4.0-45.0 Hz bandpass filter on the EEG data.
[0079] S2.5. For the class label of each dimension of the EEG data, select 5 as the threshold and project 9 discrete values into the low and high classes of each dimension;
[0080] S2.6, Data expansion: Divide the 60s EEG signal data into smaller non-overlapping 4s segments, and each EEG data is divided into 15 segments.
[0081] like Figure 2 As shown, in step S3, the spatiotemporal convolutional neural network model based on kernel attention includes a kernel attention module, a spatial dependency module and a temporal dependency module, and includes the following steps:
[0082] S3.1. Use the kernel attention module to obtain EEG node attributes, use cascaded convolutional layers to obtain strong features, and fuse and splice the EEG features learned by different kernels as node attributes in the EEG representation;
[0083] S3.2, spatial dependency module extracts spatial feature information of EEG data;
[0084] S3.3. The time-dependent module uses a long short-term memory network model to extract the time series data of the EEG data and use historical information to influence the current state.
[0085] Wherein, step S3.1 includes the following steps:
[0086] S3.1.1, enable the network to learn dynamic node representation, and adjust the kernel length by the sampling rate f s Different ratio settings, the ratio coefficient is recorded as α k ∈R, where k is the number of convolutional layers, k will be from 1 to k, and the size of the T kernel in the kth layer is The formula is as follows:
[0087]
[0088] S3.1.2. The EEG signal data after step S2 is expressed as follows:
[0089] X i ∈R c×l ,i∈[1,...,n];
[0090] Where n represents the sample size of EEG data, c represents the number of channels of EEG signals, and l represents the length of a single sample;
[0091] S3.1.3. The EEG features learned by different kernels are fused and spliced. The final feature representation formula of the attention module is as follows:
[0092]
[0093] Among them, F bn represents the batch normalization function, F avgpool represents the average pooling function, F catRepresents the feature fusion function, F conv Represents the convolution function.
[0094] Step S3.2 includes the following steps:
[0095] S3.2.1. The spatial dependency module consists of four basic units repeated, namely, the 2D convolutional layer, the batch normal layer, the leaky ReLU layer, and the average pooling layer. The output features obtained by the kernel attention module in step S3.1 are used as input features. The final feature representation formula of the spatial dependency module is as follows:
[0096]
[0097] Among them, F Leakyrelu represents the activation function, F spatial_conv represents the spatial convolution function;
[0098] S3.2.2. The activation function of the convolutional neural network uses the Leaky ReLU activation function. Compared with the traditional ReLU activation function, it can solve the problem of the neuron gradient in the network always being 0 when the learning rate is too large. Its formula is as follows:
[0099] f(x)=max(0,x)+leak*min(0,x);
[0100] The leaky value is 0.01.
[0101] In step S3.3, EEG data is a typical time series data. The long short-term memory network model (LSTM) can process time series data well and use historical information to influence the current state. Therefore, this project uses this network to obtain the time dependency of EEG. The specific design is as follows: Figure 3 shown.
[0102] In this embodiment, the long short-term memory network model introduces a gate structure in each LSTM unit (cell state), that is, a sigmoid function and a point product operation, and the output value of the sigmoid function is in the range [0, 1], 0 represents complete discard, and 1 represents complete pass, to control the discard or addition of information to determine forgetting or memory. Each of the LSTM units includes a forget gate, an input gate, and an output gate, the contents of which are as follows:
[0103] S3.3.1, forget gate: through the output h of the previous unit t-1 and the input of this unit is the input sigmod function, Ct-1 Each item in produces a value in [0,1] to control the degree to which the previous unit state is forgotten. The formula is expressed as follows:
[0104]
[0105] Among them, σ represents the sigmoid function, h t-1 represents the hidden node of the previous unit, represents EEG data, W f represents the forget gate weight coefficient, b f represents the forget gate error;
[0106] S3.3.2 Input gate: This gate controls the addition of new information by coordinating with a tanh function, which generates a new candidate input gate i t is the cell state C t Each item in generates a value in [0,1] to update the cell state of the memory unit. The formula is as follows:
[0107]
[0108] Among them, σ represents the sigmoid function, tanh represents the tanh function, W i represents the input gate weight coefficient, b i represents the input gate error, C t Represents the new cell state, W C represents the unit state weight coefficient, b C Indicates the unit state error;
[0109] S3.3.3, output gate: activate the unit state, output gate o t is the cell state C t Each item in generates a value in [0,1] to control the filtering of the current unit state and output the hidden node h of the next unit t The value is expressed as follows:
[0110]
[0111] h t =o t *tanh(C t );
[0112] Among them, W o Represents the output gate weight coefficient, b o represents the output gate error.
[0113] Step S4 includes the following steps:
[0114] S4.1. Cross-validation: Using the neural network model in S3, in each of the 10 cross-validation steps, select one as the test data and the remaining 9 as the training data. In the 9 training steps, the data is randomly divided into 70% training data and 30% validation data.
[0115] S4.2. Improve the model effect by adjusting parameters, save the network model, and output the classification results of emotion recognition.
[0116] Step S5 includes the following steps:
[0117] S5.1. Performance evaluation: The first metric is selected as the evaluation indicator. It is one of the most commonly used evaluation indicators in classification problems. It can measure the accuracy of the prediction of a class data set. It is the ratio of the number of correctly predicted samples to the total number of samples. For a binary classification problem, the formula is as follows:
[0118]
[0119] Among them, TP is true positive, TN is true negative, FP is false positive, and FN is false negative;
[0120] S5.2. Due to the imbalance of the dataset, the F1 score was used to quantify the EEG emotion recognition results. The F1 score is defined as the harmonic mean of the recall and precision of the classifier, which is calculated as follows:
[0121]
[0122] S5.3. In the model comparison, the traditional machine learning method SVM was selected as the baseline network model and compared with deep learning networks such as DeepConvNet, EEGNet, and TSception.
[0123] The experimental results show that, compared with method 1 using the traditional machine learning SVM method, method 2 using the EEGNet method, method 3 using the DeepConvNet method, and method 4 using the TSception method, it can be found through analysis of the evaluation indicators that the method of the present invention can effectively improve the accuracy of emotion recognition.
[0124] The kernel attention-based spatiotemporal convolutional neural network EEG emotion recognition method in the present invention has a high recognition accuracy, can enable machines to effectively recognize and understand human emotions, make human-computer interaction more friendly, and has strong application value in the field of human-computer interaction.
[0125] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for EEG emotion recognition based on attention-based spatiotemporal networks, characterized in that: The following steps are involved: S1. Obtain EEG data and label data of the subject watching the video clip; S2, data preprocessing, including: downsampling, removing baseline signals, removing oculoculogram signals and physiological artifacts of blinking, and bandpass filtering to retain 4.0-45.0 Hz EEG signals to divide the data; S3. Build a spatiotemporal convolutional neural network model based on kernel attention; In step S3, the kernel attention-based spatiotemporal convolutional neural network model includes a kernel attention module, a spatial dependency module, and a temporal dependency module, and includes the following steps: S3.1, use the kernel attention module to obtain EEG node attributes; S3.2, spatial dependency module extracts spatial feature information of EEG data; S3.3, the time-dependent module uses the long short-term memory network model to extract the time series data of the EEG data and use the historical information to influence the current state; In step S3.3, the long short-term memory network model introduces a gate structure in each LSTM unit, which consists of a sigmoid function and a dot product operation. The output value of the sigmoid function is in the range [0, 1], which controls the discarding or adding of information to determine whether to forget or remember. Each LSTM unit includes a forget gate, an input gate, and an output gate. The contents are as follows: S3.3.1, forget gate: through the output h of the previous unit t-1 and the input of this unit is the input sigmod function, C t-1 Each item in produces a value in [0,1] to control the degree to which the previous unit state is forgotten. The formula is expressed as follows: Among them, σ represents the sigmoid function, h t-1 represents the hidden node of the previous unit, represents EEG data, W f represents the forget gate weight coefficient, b f represents the forget gate error; S3.3.2 Input gate: By coordinating with a tanh function to control the addition of new information, the tanh function generates a new candidate input gate i t is the cell state C t Each item in generates a value in [0,1] to update the cell state of the memory unit. The formula is as follows: Among them, σ represents the sigmoid function, tanh represents the tanh function, W i represents the input gate weight coefficient, b i represents the input gate error, C t Represents the new cell state, W C represents the unit state weight coefficient, b C Indicates the unit state error; S3.3.3, output gate: activate the unit state, output gate o t is the cell state C t Each item in generates a value in [0,1] to control the filtering of the current unit state and output the hidden node h of the next unit t The value is expressed as follows: h t =o t *fishy(C) t ); Among them, W o Represents the output gate weight coefficient, b o represents the output gate error; S4, training the neural network model of step S3, adjusting parameters, and obtaining classification results of EEG emotion recognition; S5. Using the set evaluation indicators, taking the SVM model as the baseline, and comparing it with various deep neural network models, the effectiveness of the kernel attention-based spatiotemporal network model is verified.
2. The EEG emotion recognition method based on the attention-based spatiotemporal network according to claim 1 is characterized in that: In step S1, the EEG data of each subject watching a video includes a 3-second baseline signal and a 60-second emotional stimulation signal. The 32-channel Biosemi ActiveTwo system with a sampling frequency of 512Hz and the international standard 10 / 20 system is used to obtain the user's EEG data, and different emotion labels are assigned to the EEG data of the user in different emotional states. The label data includes arousal and valence, and a 9-point scale is used to measure the level of each dimension of the label data. The larger the value, the higher the degree of emotional activation.
3. The EEG emotion recognition method based on the attention-based spatiotemporal network according to claim 1, characterized in that: Step S2 includes the following steps: S2.
1. Remove the 3s baseline signal from the EEG data; S2.2, downsample the sampling frequency from 512 Hz to 128 Hz; S2.
3. Use blind source separation to remove oculoculogram (EOG) and blink artifacts from EEG data. S2.
4. Remove high-frequency noise interference and perform a 4.0-45.0 Hz bandpass filter on the EEG data. S2.
5. For the class label of each dimension of the EEG data, select 5 as the threshold and project 9 discrete values into the low and high classes of each dimension; S2.6, Data expansion: Divide the 60s EEG signal data into smaller non-overlapping 4s segments, and each EEG data is divided into 15 segments.
4. The method for EEG emotion recognition based on attention-based spatiotemporal network according to claim 1, characterized in that: Step S3.1 includes the following steps: S3.1.
1. The length of the kernel is set to the sampling rate f. s Different ratio settings, the ratio coefficient is recorded as α k ∈R, where k is the number of convolutional layers, k will be from 1 to k, and the size of the T kernel in the kth layer is The formula is as follows: S3.1.
2. The EEG signal data after step S2 is expressed as follows: X i ∈R c×l ,i∈[1,...,n]; Where n represents the sample size of EEG data, c represents the number of channels of EEG signals, and l represents the length of a single sample; S3.1.
3. The EEG features learned by different kernels are fused and spliced. The final feature representation formula of the attention module is as follows: Among them, F bn represents the batch normalization function, F avgpool represents the average pooling function, F cat Represents the feature fusion function, F conv Represents the convolution function.
5. The method for EEG emotion recognition based on attention-based spatiotemporal network according to claim 1, characterized in that: Step S3.2 includes the following steps: S3.2.
1. The spatial dependency module consists of four basic units repeated, namely, the 2D convolutional layer, the batch normal layer, the leaky relu layer, and the average pooling layer. The output of the kernel attention module in step S3.1 is used as the input feature. The final feature representation formula of the spatial dependency module is as follows: Among them, F Leakyrelu represents the activation function, F spatial_conv represents the spatial convolution function; S3.2.
2. The activation function of the convolutional neural network adopts the Leaky ReLU activation function, and its formula is as follows: f(x)=max(0,x)+leak*min(0,x); The leaky value is 0.
01.
6. The method for EEG emotion recognition based on attention-based spatiotemporal network according to claim 1, characterized in that: Step S4 includes the following steps: S4.1, cross-validation: Group the EEG data processed in step S2, set training data and validation data respectively, first use the training data to train the network model in step S3, and then use the validation data to test the trained model; S4.
2. Improve the model effect by adjusting parameters, save the network model, and output the classification results of emotion recognition.
7. The method for EEG emotion recognition based on attention-based spatiotemporal network according to claim 6, characterized in that: The specific steps of step S4.1 are as follows: In each step of the 10-fold cross-validation, 1 fold was selected as the test data and the remaining 9 folds were used as the training data. In the 9 training folds, the data was randomly divided into 70% training data and 30% validation data.
8. The EEG emotion recognition method based on attention-based spatiotemporal network according to claim 1, characterized in that: Step S5 includes the following steps: S5.
1. Performance evaluation: The first metric is accuracy, which is selected as the evaluation indicator. The performance evaluation formula is as follows: Among them, TP is true positive, TN is true negative, FP is false positive, and FN is false negative; S5.
2. Select the F1 score evaluation indicator to quantify the EEG emotion recognition results. Combined with the recall and precision of the classifier, it is defined as the harmonic mean of the recall and precision of the classifier. The formula is as follows: In S5.3, model comparison, the traditional machine learning method SVM was selected as the baseline network model and compared with deep learning networks including DeepConvNet, EEGNet, and TSception.
Citation Information
Patent Citations
Electroencephalogram signal emotion recognition method under label noise
CN112766355A
Inter-modal dense interaction deep neural network emotion recognition method
CN114091599A