Method, system and storage medium for EEG subjective emotion recognition based on dynamic threshold
Through the subjective emotional recognition method of EEG based on dynamic thresholds, the problem of low accuracy caused by understanding bias and ambiguity of emotional labels in emotion recognition is solved, and a higher emotion recognition accuracy is achieved, which is suitable for practical applications.
Patent Information
- Application Number
- CN202111434306.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-11-29
AI Technical Summary
In the prior art, the understanding bias in emotion recognition and the ambiguity of emotion labels lead to low emotional recognition accuracy, and how to improve the accuracy of emotion recognition has become an urgent problem.
The subjective emotional recognition method of EEG-brain based on dynamic thresholds is adopted. By obtaining the subject's EEG data and emotional state scoring data, the EEG emotional recognition characteristics are extracted, and the emotional state is judged through the dynamic thresholds, the emotional state is generated, and the emotional state is trained to improve the accuracy of emotional recognition.
By reducing noise in the data, improving the accuracy of emotional recognition of EEG signals, improving the accuracy of emotional recognition, making the emotional recognition system more suitable for practical applications.
Smart Images

Figure CN114065821B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning and intelligent human-computer interaction, and specifically relates to an electroencephalogram subjective emotion recognition method based on dynamic threshold. Background Art
[0002] Emotions are common in our daily lives, and they always affect our lives, work, and study. As a factor that accompanies people's daily lives in all aspects, emotion recognition has important theoretical significance and practical value for the in-depth study of artificial intelligence, and has received close attention from relevant scholars. In recent years, with the popularization of computers and the improvement of the quality of life, people's demand for more humane computers has increased day by day, which requires computers to have certain emotional interaction capabilities, and the basis of emotional interaction is emotion recognition. In addition, in the fields of medical care, military applications, education, etc., emotion recognition has gradually played a pivotal role. Emotion recognition has become a research hotspot that has attracted much attention in the current fields of machine learning and computer technology.
[0003] A key step in emotion classification is to model emotions. There are two main emotion models that are widely accepted in the industry: one is the basic emotion model, which believes that emotions are composed of multiple different, discrete basic emotions; the other is the dimensional emotion model, which believes that human emotions are a human emotion space composed of multiple continuous dimensional attributes. Compared with the basic emotion model, the continuity and quantification mechanism of the dimensional emotion model enable it to express more emotions, and therefore it is widely adopted.
[0004] The quantifiability of dimensional emotion models provides a new approach to emotion modeling. However, due to the deviations in the understanding of dimensional attributes among different individuals and the ambiguity of emotion labels, subjects cannot accurately quantify their emotional states when receiving stimulation, resulting in a certain amount of label noise in the data used for emotion recognition, which has a great impact on the accuracy of emotion recognition. How to improve the accuracy of emotion recognition has become an urgent problem to be solved in the industry. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an EEG subjective emotion recognition method based on dynamic threshold in view of the deficiencies of the above-mentioned prior art, which solves the problems of understanding bias and ambiguity of emotion labels in emotion recognition and improves the accuracy of emotion recognition.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for EEG subjective emotion recognition based on dynamic threshold, characterized in that it specifically includes the following steps:
[0007] S1. Extraction of EEG emotion recognition features: obtaining EEG data of multiple subjects as samples, extracting EEG emotion recognition features from each sample, the EEG emotion recognition features are used to represent the emotions generated by the subjects after being stimulated by multiple videos; the EEG data is a segment of EEG signals collected when the subjects are stimulated by the videos in a calm state;
[0008] S2. Dynamic threshold to judge emotional state: while obtaining EEG data of multiple subjects as samples, obtain the score that each subject gives to his or her emotional state after video stimulation. Multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained. The emotional state is divided into positive state or negative state. The emotional state corresponding to the scoring score outside the middle area of the scoring standard is defined as an exact sample, and the emotional state corresponding to the scoring score within the middle area of the scoring standard is defined as a fuzzy sample. By judging the emotional state of the exact sample, it is determined whether the emotional state of the fuzzy sample tends to be positive or negative, thereby obtaining a label set of emotional states that correspond one-to-one to the scores in the scoring data set;
[0009] S3. Obtain an emotion recognition classifier: input the EEG emotion recognition features of all subjects and the label set of the corresponding emotional states into the classification model for training to obtain an emotion recognition classifier.
[0010] Preferably, the method further comprises:
[0011] The EEG signal of the individual to be identified is obtained, and the EEG emotion recognition features are extracted from the EEG signal, which are input into the emotion recognition classifier to predict the emotion category of the individual to be identified.
[0012] Preferably, the specific process of extracting EEG emotion recognition features in S1 is:
[0013] Step 101: Separate the s-second long EEG signals collected when the subject is stimulated by multiple videos in a calm state, where the first m seconds of EEG data correspond to the calm state and are recorded as the baseline, and the subsequent n seconds are the emotional EEG signals generated by the subject after being stimulated by the video; where s=m+n, and s, m and n are positive integers;
[0014] Step 102: performing fast Fourier transform on the separated baseline and emotional EEG signals respectively to obtain baseline features and emotional features;
[0015] Step 103: Subtract the baseline feature from the emotion feature obtained in step 102 to obtain the EEG emotion recognition feature.
[0016] Preferably, the specific process of obtaining the baseline feature and the emotion feature in step 102 is as follows: The electroencephalogram (EEG) data in the first m seconds is the baseline, denoted as Base, and the EEG data in the subsequent n seconds after video stimulation is the emotion EEG signal, denoted as Signal. The fast Fourier transform is respectively performed on Base and Signal, and the baseline power spectral density P base and the emotion power spectral density P emo are respectively obtained. The baseline power spectral density P base represents the baseline feature, and the emotion power spectral density P emo represents the emotion feature; in step 103, subtracting the baseline feature from the emotion feature to obtain the optimized EEG emotion recognition feature is specifically implemented by using the formula F = P emo - P base , where F represents the EEG emotion recognition feature.
[0017] Preferably, the specific method for determining whether the emotion state trend of the fuzzy sample is positive or negative by judging the emotion state of the exact sample in S2 is as follows: Using parameters a and b as the thresholds of the middle score for the scoring standard, where a < b. The emotion state of the subject with a scoring score lower than a is the exact negative sample, the emotion state of the subject with a scoring score higher than b is the exact positive sample, and the emotion state of the subject in the interval of a - b is the fuzzy sample. By comparing the number of exact negative samples and exact positive samples, the emotion state trend of the subject is determined. If the number of exact positive samples is relatively large, the fuzzy sample is considered to have the corresponding positive emotion state, and vice versa.
[0018] Preferably, parameters a and b are respectively based on the median of the scoring values, and their values are defined as subtracting 1 and adding 1 on it.
[0019] Preferably, the classification model in S3 includes a naive Bayes model, a random forest model, or a support vector machine model.
[0020] Preferably, the emotion state in S2 is classified based on the Valence dimension or the Arousal dimension.
[0021] The present invention also provides a system for EEG subjective emotion recognition based on a dynamic threshold, including:
[0022] An EEG emotion recognition feature extraction module: used to obtain the EEG data of multiple subjects as samples, and extract the EEG emotion recognition features from each sample. The EEG emotion recognition features are used to represent the emotions generated by the subjects after being stimulated by multiple videos; the EEG data is a segment of EEG signal collected when the subjects are in a calm state and are stimulated by videos.
[0023] Emotional state judgment module: used to obtain the EEG data of multiple subjects as samples and the scores of each subject for his or her own emotional state after video stimulation. Multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained. The emotional state is divided into positive state or negative state. The emotional state corresponding to the scoring score outside the middle area of the scoring standard is defined as an exact sample, and the emotional state corresponding to the scoring score within the middle area of the scoring standard is defined as a fuzzy sample. By judging the emotional state of the exact sample, it is determined whether the emotional state of the fuzzy sample tends to be positive or negative, thereby obtaining a label set of emotional states that correspond one-to-one to the scores in the scoring data set;
[0024] Training classification module: used to input the EEG emotion recognition features of all subjects and the label set of the corresponding emotional states into the classification model for training to obtain the emotion recognition classifier;
[0025] Emotional state prediction module: used to obtain the EEG signal of the individual to be identified, extract the EEG emotion recognition features to be identified, input them into the emotion recognition classifier, and predict the emotional state.
[0026] The present invention also provides a computer storage medium storing computer instructions, wherein the computer instructions are operated to execute the above-mentioned EEG subjective emotion recognition method based on dynamic threshold.
[0027] Compared with the prior art, the present invention has the following advantages:
[0028] 1. Based on the dimensional emotion model, the present invention proposes an EEG subjective emotion recognition method based on dynamic threshold. Aiming at the understanding deviation of dimensional attributes of different individuals and the ambiguity of emotion labels, the method mines the implicit information of the user's existing emotion data, that is, accurately evaluates the user's emotion tendency through the user's existing and determined emotion state, and derives the emotion state represented by the fuzzy emotion information provided by the user, thereby reducing the noise in the data and improving the accuracy of EEG signal emotion recognition.
[0029] 2. The present invention improves the accuracy of emotion recognition, allowing the emotion recognition system to gradually move from the laboratory to practical applications, which is of great significance to the research in the fields of wearable devices and body area networks.
[0030] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 is a flow chart of a method for EEG subjective emotion recognition based on dynamic thresholds provided by an embodiment of the present invention;
[0033] Figure 2 It is a schematic diagram comparing the detailed results provided by the embodiment of the present invention with the detailed results of the traditional method when performing binary classification of emotions on the Arousal dimension;
[0034] Figure 3 It is a schematic diagram comparing the detailed results provided by the embodiment of the present invention with the detailed results of the traditional method when performing binary sentiment classification on the Valence dimension. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0036] In view of the problems existing in the prior art, the present invention provides an EEG subjective emotion recognition method based on dynamic threshold, and the present invention is described in detail below in conjunction with the accompanying drawings.
[0037] like Figure 1 As shown, the method for EEG subjective emotion recognition based on dynamic threshold provided by the present invention comprises the following steps:
[0038] S101, EEG emotion recognition feature extraction: obtaining EEG data of multiple subjects as samples, extracting EEG emotion recognition features from each sample, the EEG emotion recognition features are used to represent the emotions generated by the subject after being stimulated by multiple videos; the EEG data is a segment of EEG signals collected when the subject is stimulated by the video in a calm state;
[0039] S102, dynamic threshold determination of emotional state: while obtaining EEG data of multiple subjects as samples, obtain the score that each subject gives to his or her emotional state after video stimulation, multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained, the emotional state is divided into a positive state or a negative state, the emotional state corresponding to the scoring score outside the middle area of the scoring standard is defined as an exact sample, and the emotional state corresponding to the scoring score within the middle area of the scoring standard is defined as a fuzzy sample, and the emotional state of the fuzzy sample is determined by judging the emotional state of the exact sample to determine whether the emotional state of the fuzzy sample tends to be positive or negative, thereby obtaining a label set of emotional states that correspond one-to-one to the scores in the scoring data set;
[0040] S103, obtaining an emotion recognition classifier: inputting the EEG emotion recognition features of all subjects and the label set of the corresponding emotion states into a classification model for training to obtain an emotion recognition classifier;
[0041] S104, predicting emotional state: obtaining the EEG signal of the individual to be identified, extracting EEG emotion recognition features from the signal, and inputting the signals into the emotion recognition classifier to predict the emotion category of the individual to be identified.
[0042] In this embodiment, the specific process of extracting EEG emotion recognition features in S1 is:
[0043] Step 101: Separate the s-second long EEG signals collected when the subject is stimulated by multiple videos in a calm state, where the first m seconds of EEG data correspond to the calm state and are recorded as the baseline, and the subsequent n seconds are the emotional EEG signals generated by the subject after being stimulated by the video; where s=m+n, and s, m and n are positive integers;
[0044] Step 102: performing fast Fourier transform on the separated baseline and emotional EEG signals respectively to obtain baseline features and emotional features;
[0045] The specific process of obtaining the baseline characteristics and emotional characteristics is as follows: the EEG data of the first m seconds is the baseline, represented by Base, and the EEG data of the subsequent n seconds after video stimulation is the emotional EEG signal, represented by Signal. The Base and Signal are fast Fourier transformed to obtain the baseline power spectrum density P respectively. base and the emotional power spectral density P emo , baseline power spectral density P base Represents baseline characteristics, emotional power spectral density P emo Indicates emotional characteristics;
[0046] Step 103: Subtract the baseline feature from the emotional feature obtained in step 102, using the formula F = P emo -P base Implementation, get the EEG emotion recognition feature F.
[0047] In this embodiment, the specific method for determining whether the emotional state trend of the fuzzy sample is positive or negative by judging the emotional state of the exact sample in S2 is as follows: using parameters a and b as the thresholds of the middle scores of the scoring criteria, where a < b, the emotional state of the subject with a scoring score lower than a is an exact negative sample, the emotional state of the subject with a scoring score higher than b is an exact positive sample, and the emotional state of the subject within the interval a - b is a fuzzy sample. The emotional state trend of the subject is determined by comparing the numbers of the exact negative samples and the exact positive samples. If the number of the exact positive samples is relatively large, the fuzzy sample is considered to have the corresponding positive emotional state, and vice versa. Parameters a and b are respectively based on the median of the scoring values, and their values are defined by subtracting 1 and adding 1 to it.
[0048] In this embodiment, the classification model in S3 includes a Naive Bayes model, a Random Forest model, or a Support Vector Machine model.
[0049] For the method for identifying subjective emotions from EEG based on dynamic thresholds provided in this embodiment, those of ordinary skill in the art can also implement it using other steps. Figure 1 The method for identifying subjective emotions from EEG based on dynamic thresholds provided by the present invention is only a specific embodiment.
[0050] Embodiment 2
[0051] The steps of the present invention will be explained in detail below with specific examples.
[0052] Step 1: Extraction of EEG emotion recognition features
[0053] This embodiment is based on the DEAP preprocessed dataset. After preprocessing, its sampling frequency is 128 Hz, the frequency range is 4 - 45 Hz, and each experiment consists of 3 s of EEG signals in a calm state and 60 s of EEG signals under video stimulation. The physiological signals of 40 channels of the subjects are recorded in the experiment (the first 32 are EEG signals, and the last 8 are peripheral physiological signals). A total of 32 subjects participated, and each subject watched 40 videos, that is, each subject participated in 40 experiments. All the data of each subject is recorded in a file, which includes two parts: emotional data and labels. The emotional data is the sampled data of the EEG signals (matrix 40 * 40 * 8064), and the labels are the scoring scores of the subjects on different emotional dimensions (matrix 40 * 4, value range: continuous values from 1 to 9). There are two emotional dimensions used in the present invention: Valence (pleasure degree) and Arousal (arousal degree).
[0054] The experiment sets the 3s data before the subject watches the video as the EEG data in a calm state, and records it as the baseline. The subsequent 60s are the EEG data recorded after the subject is stimulated by the video, and record it as the emotional EEG data. In order to solve the differences between different individuals and reduce the influence of baseline signals on emotion recognition, the experiment will use fast Fourier transform to solve the features of baseline and emotional EEG signals respectively, and remove the baseline factor from the emotional EEG signal.
[0055] The emotional signal is composed of the power of different frequency bands solved by fast Fourier transform, and band is set to [4, 8, 12, 16, 25, 45]. According to different frequency ranges, the EEG is divided into 5 frequency bands, as shown in Table 1.
[0056] Table 1 Frequency band division of EEG signals
[0057] Theta(θ) Alpha(α) LowBeta HighBeta Gamma 4~8Hz 8~12Hz 12~16Hz 16~25Hz 25~45Hz
[0058] For the DEAP dataset used in this embodiment, the signal time series ξ(t) (t = 1, 2, 3, ..., T) of a certain channel of a subject is transformed into Ξ(t) (t = 1, 2, 3, ..., T) after fast Fourier transformation. Then, the power spectrum intensity is calculated, that is, the amplitude of the frequency domain signal amplitude spectrum is weighted and summed, and f is set s is the sampling frequency, then the power spectrum intensity PSI of frequency band k k The definition is as follows:
[0059]
[0060] The above transformation is applied to the 32 channels of baseline and emotional EEG signals of each subject, and a 160-dimensional EEG feature can be obtained for each sample. The baseline feature is denoted as P base , the emotional feature is P emo .
[0061] Get P base and P emo After that, the baseline is removed from the sentiment feature, and the final input of the classification feature is: F = P emo -P base , F represents the EEG emotion recognition feature.
[0062] Step 2: Dynamic threshold to determine emotional state
[0063] This embodiment uses the DEAP dataset, and the scoring range is a continuous integer from 1 to 9, with a median of 5. Considering that the subjects have a bias in understanding the corresponding scoring labels and are ambiguous in expressing their own emotions, this embodiment sets the range of deviation and ambiguous emotions to 4 to 6. If the subject's score is between 4 and 6, his or her emotional state is not directly determined, but determined by the method proposed in this embodiment. The emotional state of deviation and ambiguous emotions is determined by the following method, which is as follows:
[0064] For each subject, parameters 4 and 6 are used as the thresholds of the middle score of the scoring standard. The emotional state of the subjects with a score lower than 4 is an exact negative sample, and the number of exact negative samples is L; the emotional state of the subjects with a score higher than 6 is an exact positive sample, and the number of exact positive samples is H. The emotional state of the subjects in the range of 4-6 is a fuzzy sample. The emotional tendency of the fuzzy sample of the subject is determined by comparing the size of L and H. If L>H, it is determined that the subject has a negative emotional tendency and the emotional state corresponding to the fuzzy sample belongs to negative emotion. Otherwise, it is determined that the subject has a positive emotional tendency. Specifically, for a fuzzy sample label S, its setting is as shown in the following formula:
[0065]
[0066] Step 3: Classifier training
[0067] The EEG emotion recognition features of all subjects and the label set of the corresponding emotional states are input into the classification model for training to obtain an emotion recognition classifier; this embodiment adopts three classification algorithms: Naive Bayes, Random Forest and Support Vector Machine;
[0068] Step 4: Predict emotional state
[0069] The EEG signal of the individual to be identified is obtained, and the EEG emotion recognition features are extracted from the EEG signal, which are input into the emotion recognition classifier to predict the emotion category of the individual to be identified.
[0070] At the same time, in order to detect the reliability of predicting classified emotional states, the reliability of the emotion recognition classifier obtained by training three classification models was evaluated.
[0071] The accuracy and average F1 score are used as the basis for evaluating the reliability of the method of this embodiment. Accuracy (ACC) is the most common evaluation criterion in machine learning, which is obtained by dividing the number of samples divided by the total number of samples. Generally, the higher the accuracy, the better the classifier performance. The F1 score is an indicator used in statistics to measure the accuracy of a binary classification model. In the case of an imbalanced sample label, the use of the F1 score can effectively evaluate the model effect. The average F1 score used in this embodiment is an improvement of the F1 score. Two F1 scores are obtained by training positive samples and negative samples as positive classes, and then the weighted sum of the two is used to obtain an improved F1 score (AVEF1).
[0072] The technical effect (method reliability) of the present invention is described in detail below in conjunction with experiments.
[0073] Experiment 1: Using this example to perform binary classification of sentiment on the Arousal dimension
[0074] In order to establish a binary classification model on the Arousal dimension, this embodiment extracts data containing Arousal labels from the DEAP dataset.
[0075] First, data feature extraction was performed. After separating the 3s baseline and 60s emotional EEG signals, the PSI features were solved respectively, and then the baseline was subtracted from the emotional features to obtain the final 160 input features. All subject samples were mixed, and the total number of samples in the entire data set was 1280.
[0076] In order to verify the effect of this embodiment, the data labels were binarized using the traditional method and the method proposed in this embodiment, and the same classifier and parameters were used. During the experiment, in order to ensure the robustness of the experimental results, this embodiment used ten-fold cross validation for performance evaluation, that is, all the data were divided into ten parts, nine of which were selected as training sets, and the remaining one was selected as a test set, and repeated ten times, where the training set is the data passed into the classification model for training, and the test set is the data to be predicted.
[0077] The steps of the traditional method are the same as those of the method in this embodiment, and the difference lies in step two, in which the emotional states of samples with scores less than or equal to 5 in the scoring set are marked as negative, and the emotional states of samples with scores greater than 5 are marked as positive, thereby obtaining the emotional state label set of the subject.
[0078] The experiment was conducted using three classification models, with a total of 60 rounds (two label processing methods, three classification models, and ten-fold crossover). Figure 2It is a schematic diagram of the detailed results comparison of the two label processing methods in the Arousal dimension. The three sub-graphs in the first row of the figure are the experimental results of this embodiment, and the second row is the experimental results of the traditional method. In each sub-graph, LA represents Low Arousal and HA represents High Arousal. In each sub-graph, the four cells in the upper left corner represent the specific number of samples, of which the two main diagonal cells represent the number of samples correctly classified in each category, and the two sub-diagonal cells represent the number of samples misclassified. For example, the second cell in the first row represents the number of samples that are actually HA but are misclassified as LA. In each sub-graph, the third column of cells represents the percentage of correct samples in the predicted category, and the third row of cells represents the percentage of samples predicted correctly in the actual category. The overall accuracy is in the lower right corner. It can be seen that the method proposed in this embodiment is superior to the traditional method under the three classifier models, the number of misclassified samples of the three classification methods is significantly reduced, and the number of HA samples classified correctly is greatly increased. Among the three classification models, random forest performed the best, with an average accuracy rate increasing from 62% to 67.1%, and the SVM with sigmoid kernel had the largest performance increase.
[0079] In the Arousal sentiment binary classification, the average accuracy and standard deviation of the three classification models in the ten-fold cross validation, the weighted average F1 score and its standard deviation are shown in Table 2. As can be seen from Table 2, the three classification models all have good results. Compared with the traditional methods, the naive Bayes method has a slight decrease, while the other methods have improved. This proves that this embodiment is effective in the Arousal sentiment binary classification, and the classifier does not ignore the samples of the minority category. Random forest is superior in both average accuracy and average F1 score, which are 67.1% and 62.3% respectively.
[0080] Table 2 Arousal dimension binary classification overall classification results
[0081]
[0082] Experiment 2: Using this example to perform binary sentiment classification on the Valence dimension
[0083] In order to establish a binary classification model on the Valence dimension, this embodiment extracts sample data containing the Valence label from the DEAP dataset.
[0084] First, data feature extraction was performed. After separating the 3s baseline and 60s emotional EEG signals, the PSI features were solved respectively, and then the baseline was subtracted from the emotional EEG features to obtain the final 160 input features. All subject samples were mixed, and the total number of samples in the entire data set was 1280.
[0085] In order to verify the effect of this embodiment, the data labels were binarized using the traditional method and the method proposed in this embodiment, and the same classifier and parameters were used. During the experiment, in order to ensure the robustness of the experimental results, this embodiment used ten-fold cross validation for performance evaluation.
[0086] The experiment was conducted using three classification models, with a total of 60 rounds (two label processing methods, three classification models, and ten-fold crossover). Figure 3 It is a schematic diagram of the detailed results comparison of two label processing methods in the Valence dimension. The three sub-graphs in the first row of the figure are the experimental results of this embodiment, and the second row is the experimental results of the traditional method. In each sub-graph, LV represents Low Valence and HV represents High Valence. In each sub-graph, the four cells in the upper left corner represent the specific number of samples, of which the two main diagonal cells represent the number of samples correctly classified in each category, and the two sub-diagonal cells represent the number of samples misclassified. For example, the second cell in the first row represents the number of samples that are actually HA but are misclassified as LA. In each sub-graph, the third column of cells represents the percentage of correct samples in the predicted category, and the third row of cells represents the percentage of samples predicted correctly in the actual category. The overall accuracy is in the lower right corner. It can be seen that the performance of this embodiment is improved in the Valence dimension, and it has obvious effects on the two models of naive Bayes and support vector machine. The classification accuracy of the support vector machine increased from 53.7% to 63.4%, and the classification accuracy of its minority class samples did not decrease. Random forest achieved an accuracy of 69.8% under the method of this embodiment.
[0087] In the Valence emotion binary classification, the average accuracy and standard deviation, weighted average F1 score and standard deviation of the three classification models in the ten-fold cross validation are shown in Table 3. As can be seen from Table 3, the average accuracy of the random forest has been greatly improved. The performance of the support vector machine in the Valence dimension emotion binary classification is satisfactory, and its average F1 score has increased from 47.2% to 53.2%, indicating that the method proposed in this embodiment guarantees the classification accuracy of a small number of samples.
[0088] Table 3 Valence dimension binary classification overall classification results
[0089]
[0090] Example 3
[0091] This embodiment also provides a system for EEG subjective emotion recognition based on dynamic thresholds, including:
[0092] EEG emotion recognition feature extraction module: used to obtain EEG data of multiple subjects as samples, and extract EEG emotion recognition features from each sample, where the EEG emotion recognition features are used to indicate that the subject has emotions after being stimulated by multiple videos; the EEG data is a segment of EEG signals collected when the subject is stimulated by the video in a calm state;
[0093] Emotional state judgment module: used to obtain the EEG data of multiple subjects as samples and the scores of each subject for his or her emotional state after video stimulation. Multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained. The emotional state is divided into positive state or negative state. The emotional state corresponding to the scoring score outside the middle area of the scoring standard is defined as an exact sample, and the emotional state corresponding to the scoring score within the middle area of the scoring standard is defined as a fuzzy sample. By judging the emotional state of the exact sample, it is determined whether the emotional state of the fuzzy sample tends to be positive or negative, thereby obtaining a label set of emotional states that correspond one-to-one to the scores in the scoring data set;
[0094] Training classification module: used to input the EEG emotion recognition features of all subjects and the label set of the corresponding emotional states into the classification model for training to obtain the emotion recognition classifier;
[0095] Emotional state prediction module: used to obtain the EEG signal of the individual to be identified, extract the EEG emotion recognition features to be identified, input them into the emotion recognition classifier, and predict the emotional state.
[0096] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It will be understood by those skilled in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in processor control codes, such as such codes provided on carrier media such as disks, CDs or DVD-ROMs, programmable memories such as read-only memories (firmware), or data carriers such as optical or electronic signal carriers. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software (such as firmware).
[0097] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent change made to the above embodiment according to the technical essence of the invention still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for EEG subjective emotion recognition based on dynamic threshold, characterized in that: The specific steps include: S1. Extraction of EEG emotion recognition features: obtaining EEG data of multiple subjects as samples, extracting EEG emotion recognition features from each sample, the EEG emotion recognition features are used to represent the emotions generated by the subjects after being stimulated by multiple videos; the EEG data is a segment of EEG signals collected when the subjects are stimulated by the videos in a calm state; S2. Dynamic threshold to judge emotional state: while obtaining EEG data of multiple subjects as samples, obtain the score that each subject gives to his or her emotional state after video stimulation. Multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained. The emotional state is divided into positive state or negative state. The emotional state corresponding to the scoring score outside the middle area of the scoring standard is defined as an exact sample, and the emotional state corresponding to the scoring score within the middle area of the scoring standard is defined as a fuzzy sample. By judging the emotional state of the exact sample, it is determined whether the emotional state of the fuzzy sample tends to be positive or negative, thereby obtaining a label set of emotional states that correspond one-to-one to the scores in the scoring data set; The exact samples include exact positive samples and exact negative samples. The emotional state corresponding to the scores above the middle range of the scoring standard is defined as the exact positive sample, and the emotional state corresponding to the scores below the middle range of the scoring standard is defined as the exact negative sample. The emotional state of the fuzzy sample is considered to be consistent with the emotional state of the exact positive sample or the exact negative sample in the exact sample, whichever has a larger number. S3. Obtain an emotion recognition classifier: input the EEG emotion recognition features of all subjects and the label set of the corresponding emotional states into the classification model for training to obtain an emotion recognition classifier.
2. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 1, characterized in that: The method further comprises: The EEG signal of the individual to be identified is obtained, and the EEG emotion recognition features are extracted from the EEG signal, which are input into the emotion recognition classifier to predict the emotion category of the individual to be identified.
3. A method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 1 or 2, characterized in that: The specific process of extracting EEG emotion recognition features in S1 is as follows: Step 101: Separate the s-second long EEG signals collected when the subject is stimulated by multiple videos in a calm state, where the first m seconds of EEG data correspond to the calm state and are recorded as the baseline, and the following n seconds are the emotional EEG signals generated by the subject after being stimulated by the video; Where s=m+n, and s, m and n are positive integers; Step 102: performing fast Fourier transform on the separated baseline and emotional EEG signals respectively to obtain baseline features and emotional features; Step 103: Subtract the baseline feature from the emotion feature obtained in step 102 to obtain the EEG emotion recognition feature.
4. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 3, characterized in that: The specific process of obtaining the baseline characteristics and emotional characteristics in step 102 is as follows: the EEG data of the first m seconds is the baseline, represented by Base, and the EEG data of the subsequent n seconds after the video stimulation is the emotional EEG signal, represented by Signal. The Base and Signal are respectively subjected to fast Fourier transform to obtain the baseline power spectrum density. P base and the emotional power spectral density P emo , baseline power spectral density P base Represents baseline characteristics, emotional power spectral density P emo Indicates emotional characteristics; In step 103, the baseline feature is subtracted from the emotion feature to obtain the optimized EEG emotion recognition feature, which is specifically formulated using the formula F= P emo - P base Implementation, F represents the EEG emotion recognition feature.
5. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 1, characterized in that: The specific method for determining whether the emotional state of the fuzzy sample tends to be positive or negative by judging the emotional state of the exact sample in S2 is as follows: Using parameters a and b as the thresholds of the middle scores of the scoring criteria, where a < b, the emotional state of the subject with a scoring score lower than a is an exact negative sample, the emotional state of the subject with a scoring score higher than b is an exact positive sample, and the emotional state of the subject within the interval of a - b is a fuzzy sample. By comparing the number of exact negative samples and exact positive samples, the emotional state trend of the subject is determined. If the number of exact positive samples is relatively large, the fuzzy sample is considered to have the corresponding positive emotional state; if the number of exact negative samples is relatively large, the fuzzy sample is considered to have the corresponding negative emotional state.
6. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 4, characterized in that: The parameters a and b are respectively based on the median of the scoring values, and subtracting 1 and adding 1 from it are defined as the values of parameters a and b.
7. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 1, characterized in that: The classification model described in S3 includes a Naive Bayes model, a Random Forest model, or a Support Vector Machine model.
8. The method for EEG subjective emotion recognition based on dynamic threshold as claimed in claim 1, characterized in that: The emotional state described in S2 is classified based on the Valence dimension or the Arousal dimension.
9. A system for EEG subjective emotion recognition based on dynamic threshold, characterized in that: Including: An electroencephalogram (EEG) emotion recognition feature extraction module: used to obtain the EEG data of multiple subjects as samples, and extract EEG emotion recognition features from each sample. The EEG emotion recognition features are used to represent the emotions generated by the subjects after being stimulated by multiple videos; the EEG data is a segment of EEG signal collected when the subject is in a calm state and stimulated by a video. An emotional state judgment module: used to obtain the scores of each subject for their own emotional state after being stimulated by multiple videos while obtaining the EEG data of multiple subjects as samples. Multiple video stimulations correspond to multiple scoring scores, that is, a scoring data set is obtained. The emotional state is divided into a positive state or a negative state. The emotional state corresponding to the scoring scores outside the middle area of the scoring criteria is defined as an exact sample, and the emotional state corresponding to the scoring scores within the middle area of the scoring criteria is defined as a fuzzy sample. By judging the emotional state of the exact sample, it is determined whether the emotional state of the fuzzy sample tends to be positive or negative, so as to obtain a label set of emotional states corresponding one-to-one to the scores in the scoring data set; the exact samples include exact positive samples and exact negative samples. The emotional state corresponding to the scoring scores above the middle area of the scoring criteria is defined as an exact positive sample, and the emotional state corresponding to the scoring scores below the middle area of the scoring criteria is defined as an exact negative sample; the emotional state of the fuzzy sample is considered to be the same as the emotional state of the exact positive sample or exact negative sample in the exact samples, whichever has a relatively larger number. A training classification module: used to input the EEG emotion recognition features of all subjects and the corresponding label set of emotional states into a classification model for training to obtain an emotion recognition classifier. An emotional state prediction module: used to obtain the EEG signal of the individual to be recognized, extract the EEG emotion recognition features to be recognized from it, and input them into the emotion recognition classifier to predict the emotional state.
10. A computer storage medium storing computer instructions, wherein the computer instructions are operated to execute the dynamic threshold-based EEG subjective emotion recognition method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Electroencephalogram emotion recognition method and system, computer equipment and wearable equipment
CN112101152A
Electroencephalogram emotion recognition method and system based on time convolutional neural network
CN113069117A