Emotional data labeling method, device, computer equipment and storage medium
By extracting image and audio data from the video stream, using pre-trained models for emotional annotation, and comparing and synthesis of results, the problems of low efficiency and low accuracy of emotional data annotation in the prior art are solved, and more efficient and accurate emotional data annotation.
Patent Information
- Application Number
- CN202110266550.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-10
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-03-10
AI Technical Summary
In the prior art, emotional data labeling is inefficient and has low accuracy, especially due to the lack of training data with emotional annotations, which leads to subjectivity and difficulty in manual annotation.
By obtaining video streams, extracting video frame image data and audio data, using pre-trained face emotion recognition model and semantic emotion recognition model, emotional labeling of face images and sentences, and comparing and synthesizing the annotation results to determine the video The emotional data of the stream marks the results.
It improves the efficiency and accuracy of emotional data annotation, reduces the subjectivity of manual annotation, and improves the reliability of the annotation results through the comprehensive results of multiple models.
Smart Images

Figure CN112990301B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of biometric technology, and in particular to a method, apparatus, computer device and storage medium for labeling emotion data. Background Art
[0002] Emotion is a comprehensive subjective cognitive experience, a person's attitude experience and behavioral response to objective things, and plays an important role in communication between people. With the development of biometric technology, the recognition and analysis of emotional data has become an important interdisciplinary research topic in the fields of neuroscience, cognitive science, computer science, psychology and artificial intelligence.
[0003] Traditional methods for analyzing and identifying emotions are mainly based on physiological signals and non-physiological signals. Physiological signals are mainly based on the autonomic nervous system and the central nervous system, and the corresponding emotions are obtained by measuring heart rate, body impedance, breathing, cerebral cortex signals, etc. Non-physiological signals are mainly based on face and audio data, and the corresponding emotions are inferred by building functional relationships through deep learning.
[0004] However, obtaining physiological signals requires specific instruments and equipment. When analyzing and identifying emotions corresponding to speech data, there is a lack of training data with emotion annotations when performing deep learning through non-physiological signals. Manual annotation is required based on speech data, but it is very difficult to directly annotate the corresponding emotions based on speech data, which leads to low efficiency in emotion data annotation. In addition, the subjectivity of manual annotation also leads to low accuracy in emotion data annotation. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for emotion data labeling that can improve the efficiency and accuracy of emotion data labeling in response to the above technical problems.
[0006] A method for labeling emotional data, the method comprising:
[0007] Get the video stream;
[0008] Extracting each video frame image data of the video stream, marking the emotion corresponding to the face image in each video frame image data, and obtaining the face emotion marking result;
[0009] Extracting audio data corresponding to each video frame image data, annotating the emotion corresponding to the audio data, and obtaining a semantic emotion annotation result;
[0010] The facial emotion annotation result is compared with the semantic emotion annotation result, and the emotion data annotation result corresponding to the video stream is determined according to the comparison result.
[0011] In one embodiment, the step of labeling the emotion corresponding to the face image in each of the video frame image data includes:
[0012] Extracting facial features from each of the video frame image data, wherein the facial features include at least one of facial geometric features and facial representation features;
[0013] A pre-trained facial emotion recognition model is used to label the emotion corresponding to the facial image in each of the video frame images according to the facial features.
[0014] In one embodiment, labeling the emotion corresponding to the audio data to obtain a semantic emotion labeling result includes:
[0015] A pre-trained sentence conversion model is used to convert each of the audio data into each sentence, and the emotion corresponding to each of the sentences is labeled to obtain a semantic emotion labeling result.
[0016] In one embodiment, the training process of the sentence conversion model includes:
[0017] Acquire a training sample set, the training sample set comprising: original audio data, and sentences obtained by converting the original audio data;
[0018] Feature extraction is performed on the training sample set to obtain the sentence conversion model through training. The sentence conversion model is used to convert the input audio data and output it into sentences.
[0019] In one embodiment, the tagging of the emotion corresponding to each of the sentences includes:
[0020] Extracting semantic features of each of the sentences, wherein the semantic features include at least one of tone, context, and semantic elements;
[0021] A pre-trained semantic emotion recognition model is used to label the emotion corresponding to each of the sentences based on the semantic features.
[0022] In one embodiment, determining the emotion data labeling result corresponding to the video stream according to the comparison result includes:
[0023] When the facial emotion annotation result is consistent with the semantic emotion annotation result, the facial emotion annotation result or the semantic emotion annotation result is used as the emotion data annotation result corresponding to the video stream;
[0024] When the facial emotion annotation result is inconsistent with the semantic emotion annotation result, the confidence of the facial emotion annotation result and the semantic emotion annotation result is calculated, and the emotion data annotation result corresponding to the video stream is determined according to the confidence.
[0025] In one embodiment, the calculating the confidence of the facial emotion annotation result and the semantic emotion annotation result, and determining the emotion data annotation result corresponding to the video stream according to the confidence, includes:
[0026] Obtaining each emotion weight and each confidence level in the facial emotion labeling result and the semantic emotion labeling result;
[0027] According to each of the emotion weights and each of the confidence levels, respectively calculating the confidence levels of different emotion annotation results present in the facial emotion annotation results and the semantic emotion annotation results;
[0028] Adding the confidences of the same emotion annotation results in the facial emotion annotation results and the semantic emotion annotation results to obtain a comprehensive confidence of the emotion annotation results;
[0029] The emotion annotation result with the highest comprehensive confidence is used as the emotion data annotation result corresponding to the video stream.
[0030] An emotion data labeling device, the device comprising:
[0031] A video stream acquisition module, used to acquire video stream;
[0032] A facial emotion labeling module is used to extract each video frame image data of the video stream, label the emotion corresponding to the face image in each video frame image data, and obtain the facial emotion labeling result;
[0033] A semantic emotion annotation module is used to extract the audio data corresponding to each video frame image data, annotate the emotion corresponding to the audio data, and obtain a semantic emotion annotation result;
[0034] The labeling result determination module is used to compare the facial emotion labeling result with the semantic emotion labeling result, and determine the emotion data labeling result corresponding to the video stream according to the comparison result.
[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0036] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0037] The above-mentioned emotion data labeling method, device, computer equipment and storage medium obtain a video stream; extract the image data of each video frame of the video stream, label the emotion corresponding to the face image in each video frame image data, and obtain the face emotion labeling result; extract the audio data corresponding to each video frame image data, label the emotion corresponding to the audio data, and obtain the semantic emotion labeling result; compare the face emotion labeling result with the semantic emotion labeling result, and determine the emotion data labeling result corresponding to the video stream according to the comparison result. By adopting the above-mentioned embodiment method, by adopting multiple pre-trained emotion data labeling models, and finally determining the emotion data labeling result of the video stream through multiple emotion data labeling results, the efficiency of emotion data labeling can be effectively improved, the subjectivity of manual labeling can be avoided, and the accuracy of emotion data labeling can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A diagram of an application environment of a method for labeling emotion data in an embodiment;
[0039] Figure 2 A schematic diagram of a flow chart of a method for labeling emotion data in one embodiment;
[0040] Figure 3 is a structural block diagram of an emotion data labeling device in one embodiment;
[0041] Figure 4 is an internal structure diagram of a computer device in one embodiment;
[0042] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0044] In one embodiment, the emotion data annotation method provided by the present application can be applied to Figure 1In the application environment shown. The application environment may involve a terminal 102 and a server 104 at the same time, and the terminal 102 communicates with the server 104 through a network. Specifically, the server 104 obtains a video stream through the terminal 102; extracts image data of each video frame of the video stream, annotates the emotion corresponding to the face image in each video frame image data, and obtains a face emotion annotation result; extracts audio data corresponding to each video frame image data, annotates the emotion corresponding to the audio data, and obtains a semantic emotion annotation result; compares the face emotion annotation result with the semantic emotion annotation result, and determines the emotion data annotation result corresponding to the video stream according to the comparison result.
[0045] In one embodiment, the application environment may involve both the terminal 102 and the server 104. The server 104 may pre-train to obtain the emotion data annotation model, and the terminal 102 obtains the emotion data annotation model from the server 104. The terminal 102 obtains the video stream and determines the emotion data annotation result corresponding to the video stream.
[0046] In one embodiment, the application environment may only involve the server 104, and the emotion data annotation model may be pre-trained by the server 104. The server 104 obtains the video stream and determines the emotion data annotation result corresponding to the video stream.
[0047] In one embodiment, the application environment may only involve the terminal 102, and the emotion data annotation model may be pre-trained by the terminal 102. The terminal 102 obtains the video stream and determines the emotion data annotation result corresponding to the video stream.
[0048] The video stream may be a real-time video stream or a historical video stream, the terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0049] In one embodiment, if Figure 2 As shown in the figure, a method for labeling emotional data is provided, which is applied to Figure 1 Taking the terminal 102 and / or the server 104 for determining the emotion data annotation result corresponding to the video stream as an example, the method includes the following steps:
[0050] Step S202, obtaining a video stream.
[0051] Among them, streaming media technology refers to compressing a series of media data and transmitting them in segments in the form of streams in the network, which can realize real-time transmission of video data on the network. Video streaming is the transmission of video data using streaming media technology. The video stream can be generated by a camera, and the camera can be but not limited to a surveillance camera, an infrared camera, a charge-coupled camera, a network camera, etc. The video stream can be a real-time video stream or a historical video stream. The video format of the video stream can be any one of the following formats: Audio Video Interleaved (AVI), Real Media Variable Bitrate (RMVB), MP4 (Moving Picture Experts Group 4, MP4), etc.
[0052] In one embodiment, the video stream can be obtained from various video websites or video platforms. In order to obtain the emotion data labeling result corresponding to the video stream, the obtained video stream needs to be cached offline.
[0053] Specifically, video streams are obtained from various video websites or video platforms.
[0054] Step S204, extracting the image data of each video frame of the video stream, annotating the emotion corresponding to the face image in each video frame image data, and obtaining the face emotion annotation result.
[0055] The video stream includes image data. To extract the image data of each video frame of the video stream, any video editing software such as Adobe Premiere or a script tool written in a computer programming language may be used to extract the image data of each frame of the video stream. Specifically, the computer programming language may include any one of Python, C language, C++, etc.
[0056] Among them, emotion is a comprehensive subjective cognitive experience, which is a person's attitude experience and behavioral response to objective things. The types of emotions generally include four basic emotions, namely happiness, anger, fear and sadness, which can be further divided into grief, fear, surprise, acceptance, rage, vigilance, hatred, etc. When emotions occur, they are always accompanied by certain observable behavioral characteristics, such as facial expressions, posture expressions, and intonation expressions. Among them, facial expressions refer to the expression of various emotional states through changes in eye muscles, facial muscles, and oral muscles. Posture expressions can include body expressions and hand gestures. Facial expressions, posture expressions, and intonation expressions can be collectively referred to as body language.
[0057] In one embodiment, in order to obtain the emotion data labeling result corresponding to the video stream, the emotion corresponding to the face image in each video frame image data of the video stream can be labeled. Specifically, a pre-trained face emotion recognition model can be used to label the emotion corresponding to the face image in each video frame image data.
[0058] Specifically, each video frame image data of the video stream is extracted, and the emotion corresponding to the face image in each video frame image data is labeled to obtain the face emotion labeling result.
[0059] Step S206, extracting audio data corresponding to each video frame image data, annotating the emotion corresponding to the audio data, and obtaining a semantic emotion annotation result.
[0060] The video stream includes audio data. After extracting the image data of each video frame of the video stream, the audio data corresponding to each video frame image data is extracted. To extract the audio data corresponding to each video frame image data, any video editing software such as Adobe Premiere or a script tool written in a computer programming language can be used to extract the audio data corresponding to each video frame image data. Specifically, the computer programming language can include any one of Python, C language, C++, etc.
[0061] In one embodiment, in order to obtain the emotion data annotation result corresponding to the video stream, the emotion of the audio data corresponding to each video frame image data of the video stream can be annotated. Specifically, the emotion corresponding to the audio data can be annotated using a pre-trained semantic emotion recognition model.
[0062] Specifically, the audio data corresponding to each video frame image data is extracted, and the emotions corresponding to the audio data are annotated to obtain semantic emotion annotation results.
[0063] Step S208, comparing the facial emotion annotation result with the semantic emotion annotation result, and determining the emotion data annotation result corresponding to the video stream according to the comparison result.
[0064] In order to improve the accuracy of the emotion data annotation results corresponding to the video stream, the obtained facial emotion annotation results are compared with the semantic emotion annotation results, and the emotion annotation results corresponding to the video stream are determined according to the comparison results. Specifically, when the facial emotion annotation results are inconsistent with the semantic emotion annotation results, the emotion data annotation results are corrected to obtain the emotion data annotation results corresponding to the video stream with high accuracy.
[0065] In the above-mentioned emotion data labeling method, a video stream is obtained; image data of each video frame of the video stream is extracted, and the emotion corresponding to the face image in each video frame image data is labeled to obtain the face emotion labeling result; audio data corresponding to each video frame image data is extracted, and the emotion corresponding to the audio data is labeled to obtain the semantic emotion labeling result; the face emotion labeling result is compared with the semantic emotion labeling result, and the emotion data labeling result corresponding to the video stream is determined according to the comparison result. By adopting the above-mentioned embodiment method, by adopting multiple pre-trained emotion data labeling models, and finally determining the emotion data labeling result of the video stream through multiple emotion data labeling results, the efficiency of emotion data labeling can be effectively improved, the subjectivity of manual labeling can be avoided, and the accuracy of emotion data labeling can be effectively improved.
[0066] In one embodiment, step S204 of labeling the emotion corresponding to the face image in each video frame image data includes:
[0067] Step S302: extracting facial features from the image data of each video frame, where the facial features include at least one of facial geometric features and facial representation features.
[0068] Among them, facial features can include facial geometric features and facial representation features. Facial geometric features refer to the geometric relationship between facial features such as the facial features, such as distance, area and angle. When the facial expression of a person changes, the facial geometric features will change accordingly. Facial representation features refer to the use of grayscale information of a face image to extract global or local features of the face through an algorithm. For example, a face image can be divided into several regions, and the central value is used as a threshold in the pixel neighborhood of each region. The result is regarded as a binary number to obtain a grayscale histogram, and subsequent matching and calculation are performed according to the grayscale histogram.
[0069] Specifically, facial features are extracted from the image data of each video frame, where the facial features include at least one of facial geometric features and facial representation features.
[0070] Step S304: using a pre-trained facial emotion recognition model, annotating the emotion corresponding to the facial image in each video frame image according to facial features.
[0071] The facial emotion recognition model is obtained by pre-training. When training the model, the training method may be a convolutional neural network (CNN) or a recursive neural network (RNN), etc. The training sample set used to train the facial emotion recognition model may include original facial images and facial images after the original facial images are annotated with emotions. The emotion annotations of the original facial images may be manually annotated, and public data sets may be obtained through the Internet. The public data sets mainly include the CK+ data set and the Oulu-CASIA data set.
[0072] Among them, the Cohn-Kanade (CK+) database contains 123 subjects aged between 18 and 30 years old and from different races. The image sequences in the database were captured from the front using a Panasonic AG-7500 camera. A total of 593 image sequences with frames ranging from 10 to 60 frames were collected. The expression sequences were labeled with expressions, including anger, disgust, happiness, sadness, surprise, fear, and contempt. The Oulu-CASIA database includes 80 subjects of different nationalities aged between 23 and 58 years old. Six basic expressions were collected for each subject, including surprise, happiness, sadness, anger, fear, and disgust.
[0073] Specifically, the image data of each video frame is imported into the facial emotion recognition model, and the facial emotion recognition model labels the emotion corresponding to the facial image in each video frame image according to facial features.
[0074] In one embodiment, when the emotions corresponding to the audio data are annotated, since the audio data may be affected by external environmental factors, each audio data can be converted into each sentence, and the emotion corresponding to each sentence is annotated, so that the accuracy of the emotion annotation result is higher. Among them, a sentence is composed of a word or a group of syntactically related words, which represents a sentence.
[0075] Specifically, a sentence conversion model obtained through pre-training can be used to convert each audio data into each sentence, and the emotion corresponding to each sentence is labeled to obtain a semantic emotion labeling result.
[0076] In one embodiment, the training process of the sentence conversion model includes:
[0077] Step S402: obtaining a training sample set, where the training sample set includes: original audio data, and sentences obtained by converting the original audio data.
[0078] Specifically, the training sample set of the sentence conversion model may include original audio data and sentences obtained after converting the original audio data, where the sentences are presented in text form.
[0079] Step S404: extract features from the training sample set and obtain a sentence conversion model through training. The sentence conversion model is used to convert the input audio data and output it as a sentence.
[0080] The feature extraction is performed on the training sample set, and the audio features may include MFCC features (Mel-frequency cepstral coefficients, MFCC) and Fbank (Filter bank, Fbank) features of the audio data.
[0081] Specifically, feature extraction is performed on the training sample set, and a sentence conversion model is obtained through training. The sentence conversion model is used to convert the input audio data and output it as a sentence.
[0082] In one embodiment, the emotion corresponding to each sentence is labeled, including:
[0083] Step S502: extracting semantic features of each sentence, where the semantic features include at least one of tone, context and semantic elements.
[0084] Among them, semantic features can include tone, context and semantic elements. Semantic elements, also known as semantic elements, refer to the units of meaning or content in language. Tone refers to the sound form of a specific sentence under the control of a certain specific emotion. The nature of each sentence is different, and the language environment is different. Each sentence must present the corresponding specific emotional color and weight, which is manifested in a variety of sound forms. Context refers to the language environment, which is the situation and state of a person when speaking. It can include the natural language environment, the local language environment and the artificial language environment created by oneself.
[0085] Specifically, the semantic features of each sentence are extracted, and the semantic features include at least one of tone, context and semantic elements.
[0086] Step S504: using a pre-trained semantic emotion recognition model, annotating the emotion corresponding to each sentence based on the semantic features.
[0087] In one embodiment, the semantic emotion recognition model is obtained by pre-training. When training the semantic emotion recognition model, the training sample set used for training may include original sentence data and sentence data after emotion annotation of the original sentence data. Among them, the emotion annotation of the original sentence data may be manually annotated, and a public data set may be obtained through the Internet. Avoid selecting training samples whose accurate emotions cannot be determined in the training sample set.
[0088] In one embodiment, in step S208, the facial emotion annotation result is compared with the semantic emotion annotation result, and the emotion data annotation result corresponding to the video stream is determined according to the comparison result, including:
[0089] Step S602: When the facial emotion annotation result is consistent with the semantic emotion annotation result, the facial emotion annotation result or the semantic emotion annotation result is used as the emotion data annotation result corresponding to the video stream.
[0090] Specifically, when the facial emotion annotation result is consistent with the semantic emotion annotation result, either the facial emotion annotation result or the semantic emotion annotation result can be used as the emotion data annotation result corresponding to the video stream.
[0091] Step S604, when the facial emotion labeling result and the semantic emotion labeling result are inconsistent, the confidence of the facial emotion labeling result and the semantic emotion labeling result is calculated, and the emotion data labeling result corresponding to the video stream is determined according to the confidence.
[0092] Among them, the confidence interval of a probability sample is an interval estimate of a population parameter of the sample. The confidence interval shows the degree to which the true value of the parameter has a certain probability of falling around the measurement result, and the confidence level is the degree of trust in the confidence interval.
[0093] Specifically, when the facial emotion annotation result is inconsistent with the semantic emotion annotation result, the confidence of the facial emotion annotation result and the semantic emotion annotation result is calculated, and the emotion annotation result with high confidence is determined as the emotion data annotation result corresponding to the video stream.
[0094] In one embodiment, the confidence of the facial emotion annotation result and the semantic emotion annotation result is calculated in step S604, and the emotion data annotation result corresponding to the video stream is determined according to the confidence, including:
[0095] Step S702, obtaining the emotion weights and confidence levels in the facial emotion labeling results and the semantic emotion labeling results.
[0096] Specifically, there are multiple types of emotions in the facial emotion labeling results and the semantic emotion labeling results. The confidence level can be calculated by obtaining the weight of each emotion in the facial emotion labeling results and the semantic emotion labeling results, as well as the trust level of the facial emotion labeling results and the semantic emotion labeling results.
[0097] Step S704, calculating the confidences of different emotion annotation results in the facial emotion annotation results and the semantic emotion annotation results according to the emotion weights and the confidences.
[0098] The confidence of the emotion annotation result is the product of the corresponding emotion weight and the confidence. Specifically, according to each emotion weight and each confidence, the confidence of different emotion annotation results in the face emotion annotation result and the semantic emotion annotation result are respectively calculated.
[0099] Step S706, adding the confidences of the same emotion annotation results in the facial emotion annotation results and the semantic emotion annotation results to obtain a comprehensive confidence of the emotion annotation results.
[0100] The comprehensive confidence of the emotion annotation result is the sum of the confidences of the emotion annotation results. Specifically, the confidences of the same emotion annotation results in the face emotion annotation results and the semantic emotion annotation results are added together to obtain the comprehensive confidence of the emotion annotation result.
[0101] Step S708: taking the emotion annotation result with the highest comprehensive confidence as the emotion data annotation result corresponding to the video stream.
[0102] Specifically, for example, a video stream is obtained. In the facial emotion annotation results of the video stream, there is a 60% chance of happiness, a 20% chance of anger, a 10% chance of sadness, and a 10% chance of surprise; in the semantic emotion annotation results of the video stream, there is a 60% chance of anger, a 20% chance of happiness, a 10% chance of sadness, and a 10% chance of surprise. The trust in the facial emotion annotation results is 60%, and the trust in the semantic emotion annotation results is 40%.
[0103] At this time, the calculated comprehensive confidence of the emotion of happiness is 60%*60%+20%*40%=44%, the comprehensive confidence of the emotion of anger is 20%*60%+60%*40%=36%, and the comprehensive confidence of the emotion of sadness or surprise is 10%*60%+10%*40%=10%. Among them, the comprehensive confidence of the emotion of happiness is the highest, so the emotion with high comprehensive confidence is labeled as happy, which is determined as the emotion data labeling result corresponding to the video stream.
[0104] In order to make the purpose, technical solution and advantages of the present application more clear, the present application is further described in detail below in conjunction with one of the specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0105] In one specific embodiment, the steps of a method for labeling emotion data are as follows:
[0106] 1. Pre-acquisition and labeling of training sample sets
[0107] 1.1. Obtain facial data and corresponding emotion annotations;
[0108] 1.2. Obtain audio data and the corresponding sentences after the audio data is converted into text;
[0109] 1.3. Obtain sentence data and the emotion annotations corresponding to the sentences;
[0110] The above training sample set can be obtained by manual annotation or by obtaining a public data set.
[0111] 2. Pre-training to obtain the model
[0112] 2.1. Based on face data and corresponding emotion annotations, train and obtain a face emotion recognition model;
[0113] 2.2. Based on the audio data and the corresponding sentences, train and obtain the sentence conversion model;
[0114] 2.3. Based on the sentence data and the corresponding emotion annotations, a semantic emotion recognition model is trained.
[0115] 3. Labeling the emotional data corresponding to the video stream
[0116] 3.1. Obtain a large number of video streams;
[0117] 3.2. Extract the image data of each video frame of the video stream, and use the pre-trained facial emotion recognition model to label the emotion corresponding to the facial image in each video frame image data to obtain the facial emotion labeling result;
[0118] 3.3. Extract the audio data corresponding to each video frame image data, convert each audio data into each sentence using a pre-trained sentence conversion model, and annotate the emotion corresponding to each sentence using a pre-trained semantic emotion recognition model to obtain a semantic emotion annotation result;
[0119] 3.4. Compare the facial emotion labeling results with the semantic emotion labeling results. When the facial emotion labeling results are inconsistent with the semantic emotion labeling results, calculate the confidence of different emotion labeling results in the facial emotion labeling results and the semantic emotion labeling results according to the emotion weights and trusts in the facial emotion labeling results and the semantic emotion labeling results, add the confidences of the same emotion labeling results in the facial emotion labeling results and the semantic emotion labeling results to obtain the comprehensive confidence of the emotion labeling results, and determine the emotion labeling result with the highest comprehensive confidence as the emotion data labeling result corresponding to the video stream.
[0120] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0121] In one embodiment, if Figure 3 As shown, an emotion data labeling device is provided, including: a video stream acquisition module 810, a face emotion labeling module 820, a semantic emotion labeling module 830 and a labeling result determination module 840, wherein:
[0122] The video stream acquisition module 810 is used to acquire the video stream.
[0123] The facial emotion labeling module 820 is used to extract each video frame image data of the video stream, label the emotion corresponding to the facial image in each video frame image data, and obtain the facial emotion labeling result.
[0124] The semantic emotion labeling module 830 is used to extract the audio data corresponding to the image data of each video frame, label the emotion corresponding to the audio data, and obtain the semantic emotion labeling result.
[0125] The labeling result determination module 840 is used to compare the facial emotion labeling result with the semantic emotion labeling result, and determine the emotion data labeling result corresponding to the video stream according to the comparison result.
[0126] In one embodiment, the facial emotion labeling module 820 includes the following units:
[0127] The facial feature extraction unit is used to extract facial features from each of the video frame image data, wherein the facial features include at least one of facial geometric features and facial representation features.
[0128] The facial emotion labeling unit is used to use a pre-trained facial emotion recognition model to label the emotion corresponding to the facial image in each of the video frame images according to the facial features.
[0129] In one embodiment, the semantic emotion tagging module 830 includes the following units:
[0130] The semantic emotion labeling unit is used to convert each of the audio data into each sentence by using a pre-trained sentence conversion model, label the emotion corresponding to each of the sentences, and obtain a semantic emotion labeling result.
[0131] In one embodiment, the semantic emotion labeling unit includes the following units:
[0132] A sentence conversion model acquisition unit is used to acquire the sentence conversion model; wherein the training process of the sentence conversion model includes: acquiring a training sample set, the training sample set includes original audio data, and sentences obtained after converting the original audio data; performing feature extraction on the training sample set, and training to obtain the sentence conversion model, wherein the sentence conversion model is used to convert the input audio data and output it as a sentence.
[0133] The semantic feature extraction unit is used to extract the semantic features of each of the sentences, wherein the semantic features include at least one of tone, context and semantic elements.
[0134] The semantic emotion labeling unit is used to use a pre-trained semantic emotion recognition model to label the emotion corresponding to each of the sentences based on the semantic features.
[0135] In one embodiment, the annotation result determination module 840 includes the following units:
[0136] The first annotation result determination unit is used to use the facial emotion annotation result or the semantic emotion annotation result as the emotion data annotation result corresponding to the video stream when the facial emotion annotation result is consistent with the semantic emotion annotation result.
[0137] The second annotation result determination unit is used to calculate the confidence of the facial emotion annotation result and the semantic emotion annotation result when the facial emotion annotation result is inconsistent with the semantic emotion annotation result, and determine the emotion data annotation result corresponding to the video stream according to the confidence.
[0138] In one embodiment, the second annotation result determination unit includes the following units:
[0139] The weight and confidence acquisition unit is used to acquire the weights and confidences of each emotion in the facial emotion annotation result and the semantic emotion annotation result.
[0140] A confidence calculation unit, used to calculate the confidence of different emotion annotation results in the facial emotion annotation results and the semantic emotion annotation results according to each emotion weight and each trust degree;
[0141] A comprehensive confidence calculation unit, used for adding the confidences of the same emotion annotation results in the facial emotion annotation results and the semantic emotion annotation results to obtain a comprehensive confidence of the emotion annotation results;
[0142] The comprehensive confidence result determination unit is used to use the emotion annotation result with the highest comprehensive confidence as the emotion data annotation result corresponding to the video stream.
[0143] For the specific definition of the emotion data labeling device, please refer to the definition of the emotion data labeling method above, which will not be repeated here. Each module in the above-mentioned emotion data labeling device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0144] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store emotion data annotation data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for annotating emotion data is implemented.
[0145] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for labeling emotion data is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0146] Those skilled in the art will understand that Figure 4-5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned emotion data labeling method when executing the computer program.
[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned emotion data labeling method are implemented.
[0149] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0150] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0151] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for labeling emotion data, the method comprising: Get the video stream; Extracting image data of each video frame of the video stream, and extracting facial features in each of the video frame image data, wherein the facial features include at least one of facial geometric features and facial representation features; Using a pre-trained facial emotion recognition model, the emotion corresponding to the facial image in each of the video frame images is labeled according to the facial features; Extracting audio data corresponding to each video frame image data, converting each audio data into each sentence using a pre-trained sentence conversion model, annotating the emotion corresponding to each sentence, and obtaining a semantic emotion annotation result; Comparing the facial emotion labeling result with the semantic emotion labeling result; When the facial emotion annotation result is consistent with the semantic emotion annotation result, the facial emotion annotation result or the semantic emotion annotation result is used as the emotion data annotation result corresponding to the video stream; When the facial emotion annotation result is inconsistent with the semantic emotion annotation result, obtaining the emotion weight and trust of each emotion type respectively included in the facial emotion annotation result and the semantic emotion annotation result; For each of the emotion types, the product of the emotion weight and the confidence of the emotion type in the target emotion annotation result is determined as the confidence of the emotion type corresponding to the target emotion annotation result; the target emotion annotation result includes at least one of the facial emotion annotation result or the semantic emotion annotation result; Adding the confidences of the same emotion type in the facial emotion labeling result and the semantic emotion labeling result to obtain a comprehensive confidence of the emotion type; The emotion type with the highest comprehensive confidence is used as the emotion data labeling result corresponding to the video stream.
2. The method according to claim 1, characterized in that The training process of the sentence conversion model includes: Acquire a training sample set, the training sample set comprising: original audio data, and sentences obtained by converting the original audio data; Feature extraction is performed on the training sample set to obtain the sentence conversion model through training. The sentence conversion model is used to convert the input audio data and output it into sentences.
3. The method according to claim 1, characterized in that The step of labeling the emotion corresponding to each of the sentences includes: Extracting semantic features of each of the sentences, wherein the semantic features include at least one of tone, context, and semantic elements; A pre-trained semantic emotion recognition model is used to label the emotion corresponding to each of the sentences based on the semantic features.
4. The method according to claim 1, characterized in that: The face characterization feature refers to the use of grayscale information of the face image to extract global or local features of the face through an algorithm.
5. The method according to claim 1, characterized in that: The face geometric features refer to the geometric relationship between the facial features of the face.
6. An emotion data labeling device, characterized in that: The device comprises: A video stream acquisition module, used to acquire video stream; A facial emotion labeling module, used to extract the image data of each video frame of the video stream, and extract the facial features in each of the video frame image data, wherein the facial features include at least one of facial geometric features and facial representation features; Using a pre-trained facial emotion recognition model, the emotion corresponding to the facial image in each of the video frame images is labeled according to the facial features; A semantic emotion annotation module is used to extract the audio data corresponding to each video frame image data, convert each audio data into each sentence using a pre-trained sentence conversion model, annotate the emotion corresponding to each sentence, and obtain a semantic emotion annotation result; A labeling result determination module, used for comparing the facial emotion labeling result with the semantic emotion labeling result, and when the facial emotion labeling result is consistent with the semantic emotion labeling result, using the facial emotion labeling result or the semantic emotion labeling result as the emotion data labeling result corresponding to the video stream; when the facial emotion labeling result is inconsistent with the semantic emotion labeling result, obtaining the emotion weight and trust of each emotion type respectively contained in the facial emotion labeling result and the semantic emotion labeling result; For each of the emotion types, the product of the emotion weight and the confidence of the emotion type in the target emotion annotation result is determined as the confidence of the emotion type corresponding to the target emotion annotation result; the target emotion annotation result includes at least one of the facial emotion annotation result or the semantic emotion annotation result; Adding the confidences of the same emotion type in the facial emotion labeling result and the semantic emotion labeling result to obtain a comprehensive confidence of the emotion type; The emotion type with the highest comprehensive confidence is used as the emotion data labeling result corresponding to the video stream.
7. The emotion data labeling device according to claim 6, characterized in that: The semantic emotion labeling module includes the following units: The sentence conversion model acquisition unit is used to acquire the sentence conversion model; wherein the sentence conversion model training process includes: Acquire a training sample set, the training sample set comprising: original audio data, and sentences obtained by converting the original audio data; Feature extraction is performed on the training sample set to obtain the sentence conversion model through training. The sentence conversion model is used to convert the input audio data and output it into sentences.
8. The emotion data labeling device according to claim 6, characterized in that: The semantic emotion labeling module includes the following units: A semantic feature extraction unit, used to extract the semantic features of each of the sentences, wherein the semantic features include at least one of tone, context and semantic elements; The semantic emotion labeling unit is used to use a pre-trained semantic emotion recognition model to label the emotion corresponding to each of the sentences based on the semantic features.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
A method and system for adjusting learning conditions based on emotion
CN109446968A