Emotion recognition method, device and electronic device based on multimodal information fusion
Through multi-modal information fusion and feature fusion technology, the problems of low recognition rate and insufficient robustness of traditional single-modal emotion recognition methods are solved, and more accurate emotion recognition results are achieved.
Patent Information
- Application Number
- CN202210534735.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-05-17
AI Technical Summary
Traditional emotion recognition methods are based on single modal information, resulting in low recognition rates and insufficient robustness, and cannot effectively capture the diversity and complexity of human emotions.
An emotion recognition method based on multi-modal information fusion is adopted to generate more accurate emotion recognition results by identifying and preprocessing multiple single-modal information such as speech, images, and text, and using feature extraction and attention mechanisms for feature fusion.
The accuracy and robustness of emotion recognition are improved, and the correlation between multi-modal information can be more comprehensively captured, thereby obtaining more accurate emotion recognition results.
Smart Images

Figure CN114821740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing and emotion computing, and more specifically, to an emotion recognition method, device and electronic equipment based on multimodal information fusion. Background Art
[0002] Emotion recognition has received great attention in the field of artificial intelligence in recent years, and more and more researchers have devoted themselves to the research of emotion recognition.
[0003] At present, due to the subjectivity of humans in analyzing emotions, they often only consider a certain intuitive single modality in the process of analyzing emotions, such as intuitive facial expressions and language text. Traditional emotion recognition is often based on single modality information, such as speech emotion recognition, text emotion recognition and image emotion recognition.
[0004] Although traditional emotion recognition has made great progress in its respective modalities, humans express their emotions in a variety of ways and channels in real life. For example, they make different facial expressions and perform different movements while speaking. Therefore, the information of a single modality is incomplete. Traditional single-modal emotion recognition suffers from low recognition rate and insufficient robustness. Summary of the invention
[0005] In view of this, in order to solve the above problems, the present invention provides an emotion recognition method, device and electronic device based on multimodal information fusion, and the technical solution is as follows:
[0006] An emotion recognition method based on multimodal information fusion, the method comprising:
[0007] Identify at least two unimodal information in the target information to be processed, and retrieve a pre-trained emotion recognition model, wherein the emotion recognition model includes a first model for feature extraction and a second model for feature fusion;
[0008] Preprocessing at least two unimodal information in the target information respectively, and inputting the preprocessed information into the first model, and extracting features of the input unimodal information by the first model to obtain at least two unimodal features corresponding to the target information;
[0009] At least two unimodal features corresponding to the target information are input into the second model, and the second model performs feature fusion based on global and local attention mechanisms on the input unimodal features to obtain the emotion recognition result corresponding to the target information.
[0010] Preferably, the training process of the emotion recognition model includes:
[0011] Identify at least two unimodal information in the multimodal information used for this training, wherein the multimodal information has corresponding emotion annotation results;
[0012] Preprocessing at least two unimodal information in the multimodal information respectively, and inputting them into a first basic model, and extracting features of the input unimodal information by using the first basic model to obtain at least two unimodal features corresponding to the multimodal data set;
[0013] Determining a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal data set, each unimodal feature pair consisting of two unimodal features;
[0014] Input the multiple unimodal feature pairs into the second basic model, perform global attention calculation and local attention calculation on the multiple unimodal feature pairs respectively through the attention mechanism in the second basic model, and concatenate the global features obtained by the global attention calculation and the local features obtained by the local attention calculation to obtain a joint sentiment feature, and divide the joint sentiment feature through the fully connected layer in the second basic model to obtain the sentiment prediction result corresponding to the multimodal information;
[0015] Based on the emotion prediction result and emotion labeling result corresponding to the multimodal information, the model parameters of the first basic model and the second basic model are iteratively adjusted until the emotion prediction result corresponding to the multimodal information is close to its emotion labeling result, and the first basic model is used as the first model and the second basic model is used as the second model, and the emotion recognition model composed of the first model and the second model is output.
[0016] Preferably, the at least two single-modal information include at least two of voice modal information, image modal information and text modal information;
[0017] Correspondingly, the at least two unimodal information in the multimodal information are preprocessed respectively and input into the first basic model, and the input unimodal information is subjected to feature extraction by the first basic model to obtain at least two unimodal features corresponding to the multimodal data set, including:
[0018] In the case where the speech modality information is included in the at least two single-modality information, the speech modality information is pre-emphasized and framed and windowed, and divided into a plurality of continuous speech segment information; the plurality of speech segment information are respectively short-time Fourier transformed to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into a picture, and input into the first basic model corresponding to the speech modality information to obtain the speech emotion feature corresponding to the speech modality information;
[0019] In the case where the at least two single modal information include the image modal information, face detection is performed on the image modal information to obtain a corresponding face picture, the face picture is resized, and is input into a first basic model corresponding to the image modal information to obtain the expression emotion features corresponding to the image modal information;
[0020] In the case where the text modal information is included in the at least two unimodal information, tags for marking the beginning and the end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
[0021] Preferably, the first basic model corresponding to the speech modal information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0022] The first basic model corresponding to the image modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0023] The first basic model corresponding to the text modal information is composed of a corresponding word embedding layer and a bidirectional long short-term memory network.
[0024] Preferably, the at least two single modal information include the voice modal information, the image modal information and the text modal information;
[0025] Accordingly, the determining of a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal data set includes:
[0026] Determine a first unimodal feature pair consisting of the text emotion feature and the voice emotion feature, and a second unimodal feature pair consisting of the text emotion feature and the expression emotion feature;
[0027] Accordingly, performing global attention calculation and local attention calculation on the multiple unimodal feature pairs respectively includes:
[0028] For the first unimodal feature pair, the feature in the text emotion feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the speech emotion feature output by the first basic model corresponding to the speech modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the first target speech emotion feature whose weight satisfies the corresponding condition in the speech emotion feature, and the weight represents the importance of the feature relative to the text emotion feature; weighted sum is performed on the first target speech emotion feature and its weight, and the first target text emotion feature corresponding to the feature obtained by the weighted sum is determined in the text emotion feature;
[0029] The feature outputted by the first basic model corresponding to the text modal information in the last time step in the text sentiment feature is used as the query vector in the attention mechanism, and the feature outputted by the first basic model corresponding to the text modal information in each time step in the text sentiment feature is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target text sentiment feature whose weight in the text sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; the weight of the second target text sentiment feature is increased, and the text sentiment feature after the weight increase is used as the query vector in the attention mechanism, and the feature outputted by the first basic model corresponding to the speech modal information in each time step in the speech sentiment feature is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target speech sentiment feature whose weight in the speech sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature;
[0030] For the second unimodal feature pair, the feature in the text emotion feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the expression emotion feature output by the first basic model corresponding to the image modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the first target expression emotion feature in the expression emotion feature whose weight satisfies the condition, and the weight represents the importance of the feature relative to the text emotion feature; weighted sum is performed on the first target expression emotion feature and its weight, and a third target text emotion feature in the text emotion feature corresponding to the feature obtained by the weighted sum is determined;
[0031] Using the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step as the query vector in the attention mechanism, using the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at each time step as the key vector in the attention mechanism to perform attention calculation, so as to determine the fourth target text sentiment feature whose weight in the text sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; improving the weight of the fourth target text sentiment feature, and using the text sentiment feature after the weight is improved as the query vector in the attention mechanism, using the feature in the expression sentiment feature output by the first basic model corresponding to the expression modal information at each time step as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target expression sentiment feature whose weight in the expression sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature;
[0032] Among them, the first target voice emotion feature, the first target text emotion feature, the first target expression emotion feature, and the third target text emotion feature are used as global features obtained by global attention calculation, and the second target text emotion feature / the fourth target text emotion feature, the second target voice emotion feature, and the second target expression emotion feature are used as local features obtained by local attention calculation.
[0033] An emotion recognition device based on multimodal information fusion, the device comprising:
[0034] A model training module, used for pre-training an emotion recognition model, wherein the emotion recognition model includes a first model for feature extraction and a second model for feature fusion;
[0035] A model retrieval module, used to identify at least two unimodal information in the target information to be processed, and retrieve the emotion recognition model;
[0036] A model recognition module is used to preprocess at least two unimodal information in the target information respectively, and input them into the first model, and perform feature extraction on the input unimodal information through the first model to obtain at least two unimodal features corresponding to the target information; input the at least two unimodal features corresponding to the target information into the second model, and perform feature fusion based on the global and local attention mechanism on the input unimodal features through the second model to obtain the emotion recognition result corresponding to the target information.
[0037] Preferably, the model training module is specifically used for:
[0038] Identify at least two unimodal information in the multimodal information used for this training, wherein the multimodal information has corresponding emotion labeling results; preprocess the at least two unimodal information in the multimodal information respectively, and input them into the first basic model, and extract features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal data set; determine a plurality of unimodal feature pairs for global attention calculation and local attention calculation from the at least two unimodal features corresponding to the multimodal data set, wherein each unimodal feature pair is composed of two unimodal features; input the plurality of unimodal feature pairs into the second basic model, and extract features of the plurality of unimodal feature pairs respectively through the attention mechanism in the second basic model. Global attention calculation and local attention calculation are performed, and the global features obtained by the global attention calculation and the local features obtained by the local attention calculation are concatenated to obtain a joint sentiment feature, and the joint sentiment feature is divided by the fully connected layer in the second basic model to obtain the sentiment prediction result corresponding to the multimodal information; based on the sentiment prediction result and the sentiment labeling result corresponding to the multimodal information, the model parameters of the first basic model and the second basic model are iteratively adjusted until the sentiment prediction result corresponding to the multimodal information approaches its sentiment labeling result, and the first basic model is used as the first model and the second basic model is used as the second model, and the sentiment recognition model composed of the first model and the second model is output.
[0039] Preferably, the at least two single-modal information include at least two of voice modal information, image modal information and text modal information;
[0040] Correspondingly, the model training module preprocesses at least two unimodal information in the multimodal information respectively, and inputs them into the first basic model, and extracts features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal data set, including:
[0041] In the case where the speech modality information is included in the at least two single-modality information, the speech modality information is pre-emphasized and framed and windowed, and divided into a plurality of continuous speech segment information; the plurality of speech segment information are respectively short-time Fourier transformed to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into a picture, and input into the first basic model corresponding to the speech modality information to obtain the speech emotion feature corresponding to the speech modality information;
[0042] In the case where the at least two single modal information include the image modal information, face detection is performed on the image modal information to obtain a corresponding face picture, the face picture is resized, and is input into a first basic model corresponding to the image modal information to obtain the expression emotion features corresponding to the image modal information;
[0043] In the case where the text modal information is included in the at least two unimodal information, tags for marking the beginning and the end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
[0044] Preferably, the first basic model corresponding to the speech modal information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0045] The first basic model corresponding to the image modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0046] The first basic model corresponding to the text modal information is composed of a corresponding word embedding layer and a bidirectional long short-term memory network.
[0047] An electronic device comprises: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used to implement the emotion recognition method based on multimodal information fusion.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] The present invention provides an emotion recognition method, device and electronic device based on multimodal information fusion. By pre-training an emotion recognition model, after obtaining the target information to be processed, at least two unimodal information in the target information can be identified, and input into the first model in the emotion recognition model through pre-processing, and the first model performs feature extraction to obtain at least two unimodal features corresponding to the target information, and then inputs into the second model in the emotion recognition model, and the second model performs feature fusion based on global and local attention mechanisms to obtain the emotion recognition result corresponding to the target information. In this regard, the present invention can comprehensively consider multimodal information, fuse the inherent correlation between multimodal information, and obtain more accurate emotion recognition results. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A flow chart of a method for training an emotion recognition model provided by an embodiment of the present invention;
[0052] Figure 2 An example of spectrogram information provided by an embodiment of the present invention;
[0053] Figure 3 A structural diagram of the VGG-BiLSTM model provided in an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of the structure of an emotion recognition model provided by an embodiment of the present invention;
[0055] Figure 5 A method flow chart of an emotion recognition method based on multimodal information fusion provided by an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of the structure of an emotion recognition device based on multimodal information fusion provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] In people's daily production and life, emotions have always played a pivotal role. Our every move, food, clothing, housing, transportation, and every aspect of communication with others are all related to emotions. Sometimes, we may not know what the other person is saying, but we can roughly judge from the smile on the other person's face that he or she may agree with our current point of view. As the saying goes, a person's words are like his or her character. Sometimes, we may not know the good or evil of a stranger, but we can involuntarily have infinite reverie and goodwill towards the creator just by reading his or her works. Sometimes, we may not know what a person means, but we can still judge the other person's current joy, anger, sorrow, and happiness just by listening, so that we can take corresponding measures, or appease or laugh and play. All of the above illustrate a problem that everyone is accustomed to but often ignores in daily life-the importance of emotions. Imagine if human society had no concept of emotions, perhaps people would become cold, and everyone would be just an independent individual who does not care about anything, then the originally warm human family might lose a little warmth.
[0060] At present, the standard definition of emotion in academia refers to people's positive or negative psychological reactions to external stimuli. With the development of related disciplines (such as psychology, image recognition technology), the foundation for the development of emotion recognition has been laid. The theoretical basis depends on the progress of physiology and psychology, and the technical aspect depends on the continuous innovation of computer technology and pattern recognition algorithms. The earliest research on emotion was proposed by Ekman and Friesen in the 1960s. The authors believed that human basic emotions can be roughly divided into 6 types, namely happiness, fear, surprise, anger, disgust and sadness. The so-called emotion recognition refers to judging the current state of human beings through the relevant information we can observe, and dividing it into the category corresponding to the basic emotion. That is, for the problem of emotion recognition, we can regard it as a classification problem in academia.
[0061] Emotions can express a wealth of information. We can judge a person's current emotional state by observing their voice intonation, words, facial expressions, and body movements. In recent years, with the development of AI, the application of deep learning, and the continuous updating of computer science, more smart terminals have appeared in people's vision, bringing convenient and considerate services to people. However, most so-called smart terminals can only perform simple tasks, cannot understand users' emotions and intentions very well, and cannot achieve true human-computer interaction. The first key point to achieve true human-computer interaction is to enable smart terminals to correctly identify the emotions expressed by people. This is the so-called emotional computing, which can also be called emotion recognition.
[0062] Emotion recognition has received great attention in the field of artificial intelligence in recent years, and more and more researchers have devoted themselves to the research of emotion recognition. Professor Feifei Li, director of the Artificial Intelligence Laboratory at Stanford University, believes that the next step in the development of artificial intelligence is to strengthen the understanding of emotions. In 2018, the Chinese Association for Science released 60 major scientific issues and major engineering and technical issues in 12 fields, among which human-computer emotional interaction is one. As the main challenge of artificial intelligence, emotion recognition is receiving more and more attention from academia and industry. Although since the beginning of the 21st century, more and more smart products have been widely used in daily life, such as emotional companion robots, personal mobile assistant Siri, voice assistants Google Now and Cortana, Xiaobing, an intelligent chat robot launched by Microsoft Research Asia, and Xiaodu Robot launched by Baidu, these smart products can not only communicate with users normally, but also bring a lot of convenience to users' lives, but we can always feel more or less that the so-called artificial intelligence is still a little dull when compared with people, which affects the user experience. Therefore, if the user's emotions can be comprehensively considered in the process of human-computer interaction, it may make artificial intelligence smarter. However, due to the subjectivity of humans when analyzing emotions, they often only consider a certain intuitive single modality in the process of analyzing emotions, such as intuitive facial expressions and language text. Traditional emotion recognition is often based on information from a single modality, such as speech emotion recognition, text emotion recognition, and image emotion recognition.
[0063] Although research on emotion recognition based on single modalities such as speech, text and images has made great progress, due to the variability of natural language and the richness of human emotional expression in the communication process, sometimes relying solely on single information is not enough to accurately analyze the user's emotions. As we know, whether it is facial expressions, text information or voice signals, they are all closely related to emotions. Therefore, how to comprehensively consider these multimodal information in emotion recognition and integrate the inherent correlation between multimodal data to obtain more accurate emotion recognition results is the key issue discussed in this invention.
[0064] In this regard, the present invention comprehensively considers information from multiple different modalities and fully utilizes the complementarity between modal information to construct an emotion recognition model with excellent recognition performance and strong generalization ability. Specifically, the present invention extracts and fuses the potential emotional features of each of the three modalities of speech, text and image, thereby obtaining a robust and highly accurate emotion recognition model. The following first introduces the training process of the emotion recognition model.
[0065] See also Figure 1 , Figure 1The method flow chart of the training process of the emotion recognition model provided by the embodiment of the present invention includes the following steps:
[0066] S101, identifying at least two unimodal information in the multimodal information used for this training, where the multimodal information has corresponding emotion labeling results.
[0067] In an embodiment of the present invention, the multimodal information used for training includes at least two unimodal information, that is, information of at least two modes among the three modes of speech, text and image, and the number of multimodal information used for training each time is multiple. In addition, the emotion annotation result of the multimodal information, that is, the emotion label pre-annotated for the multimodal information, is the classification result of basic human emotions.
[0068] In order to adapt to multimodal sentiment analysis and emotion recognition tasks and meet their related needs, in recent years, more and more researchers have proposed a variety of multimodal datasets (multimodal datasets are collections of multimodal information), including IEMOCAP (Interactive Emotional Dyadic Motion Capture Database), MOSI (Multimodal Corpus of Sentiment Intensity), CMU-MOSEI (CMU Multi-modal Opinion Sentiment and Emotion Intensity), etc. However, most of the current multimodal emotion datasets are foreign language datasets, that is, the performers generally use foreign languages. Although these datasets have promoted the development of multimodal emotion recognition research to a certain extent, due to the large differences in pronunciation characteristics between different languages, when performing Chinese emotion recognition tasks, the above datasets may not be well adapted to the relevant emotion recognition tasks.
[0069] CH-SIMS (Chinese Multimodal Sentiment Analysis Dataset) is the first relatively complete Chinese multimodal sentiment dataset, because compared with unimodal datasets, multimodal datasets have higher requirements, and one of the most important requirements is that the speaker's face and voice must appear in the picture at the same time and remain for a specific time. In the process of constructing the dataset, in order to obtain the corresponding video clips that are as close to our lives as possible, the present invention can collect the initial target clips from TV series, movies and some common Chinese variety shows, and perform frame-level cropping on the target clips on this basis. At the same time, in order to ensure the validity of the dataset, three corresponding constraints are imposed on the final selected video clips: only consider Mandarin video clips and be cautious about the selection of materials with accents; the editing length of each video is greater than one second and less than ten seconds; at the same time, for the characters in the video, except for the speaker, no other characters appear.
[0070] Finally, the CH-SIMS dataset contains a total of 2281 video clips (one video clip is one multimodal information), and each video clip sets a corresponding emotional label for the multimodal information it contains. The categories of emotional labels can be divided into five categories according to the positive or negative emotions of the protagonist: Positive, Weakly Positive, Neatral, Weakly Negative, and Negative. The detailed information of the dataset is shown in the following table:
[0071]
[0072]
[0073] S102, preprocessing at least two unimodal information in the multimodal information respectively, and inputting them into the first basic model, and extracting features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal data set.
[0074] In the embodiment of the present invention, the multimodal dataset selected is the CH-SIMS Chinese multimodal emotion dataset. The purpose of the present invention is to make a correct prediction of the emotion reflected by the characters in each video clip. Because the dataset contains information of at least two of the three modes of speech, text and image, before deep emotional feature extraction is performed on each single modal information, relevant preprocessing work needs to be performed on the original single modal information.
[0075] In a specific implementation process, the at least two single-modal information include at least two of voice modal information, image modal information and text modal information.
[0076] When at least two unimodal information contain speech modal information, the speech modal information is pre-emphasized and frame-windowed, and divided into a plurality of continuous speech segment information; short-time Fourier transform is performed on the plurality of speech segment information respectively to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into an image, and input into a first basic model corresponding to the speech modal information to obtain speech emotion features corresponding to the speech modal information.
[0077] For the information of speech mode in the video clip (i.e., speech mode information), pre-emphasis and frame windowing operations are performed on it, which can improve the resolution of the high-frequency part while maintaining the smoothness of the speech, thereby enhancing the speech information. On this basis, the speech mode information is divided into continuous segments with a duration of 500ms, thereby obtaining multiple speech segment information, and at the same time, an overlap of 100ms is maintained between two consecutive speech segment information to prevent the loss of the cut part of the speech information. Considering the rich information contained in the spectrogram when processing speech emotion problems, the present invention further performs a short-time Fourier transform on each speech segment information, converts it into a spectrogram information containing time domain and frequency domain information, and uses the spectrogram information as input for speech emotion feature extraction. Figure 2 An example of spectrogram information provided by an embodiment of the present invention.
[0078] In the above process of preprocessing the speech modal information, the present invention enhances and segments the speech modal information in each video clip in the CH-SIMS Chinese multimodal emotion data set, and performs short-time Fourier transform on each divided speech segment information to obtain the corresponding spectrogram information. On this basis, the spectrogram information corresponding to each speech segment information is uniformly converted into an RGB image of size 224*224, and used as the input of the first basic model corresponding to the speech modal information. Among them, the first basic model corresponding to the speech modal information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network.
[0079] See also Figure 3 , Figure 3The structure diagram of the VGG-BiLSTM model provided by the embodiment of the present invention. For the selection of the first basic model corresponding to the speech modality information, the inventors conducted comparative experiments on various current convolutional neural network (CNN) structures, and finally selected the best VGG (Visual Geometry Group) network as the feature extraction backbone network for speech emotion features. Figure 3 , the VGG network consists of sequentially connected convolutional layers, pooling layers, and fully connected layers ( Figure 3 The fully connected layer is not shown in the figure). Considering that the last three fully connected layers of VGG occupy almost half of the parameters of the model, the last three fully connected layers can be replaced by one fully connected layer in the present invention, and the output dimension is 512. In addition, a batch normalization layer (BN) can be added after each convolutional layer to prevent overfitting of the model. Figure 3 In order to further capture the temporal information between multiple spectrograms corresponding to the same video clip, the present invention adds a bidirectional long short-term memory network (Bi-directional Long Short-Term Memory, BiLSTM) based on the VGG network output, and the output dimension is 64. Figure 3 , a fully connected layer can be added on the basis of the output of the bidirectional long short-term memory network for dimensionality increase, and the output dimension is 128. The output result of the fully connected layer is used as the speech emotion feature.
[0080] Figure 4 The schematic diagram of the structure of the emotion recognition model provided by the embodiment of the present invention, wherein "Feature Extract" represents feature extraction, "Feature Fusion" represents feature fusion, and "Attention" represents the attention mechanism. In this embodiment, "Audio" represents speech modality information, and the input corresponding feature extraction backbone network outputs features with a dimension of 512, which are further processed by a bidirectional long short-term memory network ( Figure 4 The feature output dimension is 64, which is further passed through the fully connected layer ( Figure 4 The output dimension is 128 (i.e., speech emotion features, Figure 4 not shown) to “Attention”.
[0081] When at least two unimodal information include image modal information, face detection is performed on the image modal information to obtain a corresponding face image, the face image is resized, and input into a first basic model corresponding to the image modal information to obtain the expression and emotion features corresponding to the image modal information.
[0082] For the information of image modality in video clips (i.e., image modality information), which belongs to visual information, the present invention mainly considers the expression of the speaker. This is because in daily life experience, when we are communicating, one of the most direct and effective ways to judge the emotions of the interactive objects is to observe the facial expressions of the other party, so as to judge the other party's joy, anger, sorrow, and happiness, etc. Since the original data in the CH-SIMS Chinese multimodal emotion dataset is a video clip, each video clip is firstly subjected to frame-level extraction. Specifically, for each video clip, ten corresponding frames are first extracted at equal distances, and on this basis, each frame of the picture is subjected to face detection and extraction. Here, the face detection model used in the present invention is PyramidBox, and the face picture output by the face detection model is used as the input for the extraction of expression and emotion features. Finally, the total number of face pictures obtained in the CH-SIMS Chinese multimodal emotion dataset is 2281*10=22810.
[0083] In the above processing, the present invention extracts ten frames of each video clip in the CH-SIMS Chinese multimodal emotion dataset at equal distances, thereby obtaining the image modal information corresponding to the CH-SIMS Chinese multimodal emotion dataset, and uses the face detection model paramidBox to detect the face picture corresponding to each frame. On this basis, the present invention uniformly scales the acquired face pictures into a size of 48*48, and uses this as the input of the first basic model corresponding to the image modal information, thereby completing the facial expression recognition of the face picture. Among them, the first basic model corresponding to the image modal information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network.
[0084] The inventors have conducted a lot of research on the models related to facial expression recognition. Taking the FER2013 public face dataset as an example, the current classification accuracy of a single model is mainly between 65% and 72.7%, while the average level of humans is 65%. For example, Minaee et al. used an attention convolutional network in an end-to-end deep learning framework, and the prediction accuracy of this dataset reached 70.02%. Tang et al. used a support vector machine to replace the softmax layer in a deep neural network and achieved a classification accuracy of 71.2%. Shi et al. proposed a novel modified representation module (ARM) to replace the pooling layer and achieved a test accuracy of 71.38%. Pramerdorfer et al. compared the performance of three different architectures: VGG network, Inception network and ResNet network. Their results showed that the accuracy of the VGG network was 72.7%, followed by the accuracy of the ResNet network at 72.4% and the accuracy of the Inception network at 71.6%.
[0085] By summarizing the current work on facial expression recognition, the inventors found that the VGG network can achieve the best performance in the facial expression recognition task. In this regard, the present invention also uses the VGG network as the backbone network for feature extraction of facial expression and emotional features, and the structure of the first basic model corresponding to the image modality information can also be as follows: Figure 3 As shown in FIG, the VGG network includes a convolutional layer, a pooling layer, and a fully connected layer. Considering that the last three fully connected layers of VGG occupy almost half of the parameters of the model, the last three fully connected layers can be replaced by one fully connected layer in the present invention, and the output dimension is 512. In addition, a BN layer can be added after each convolutional layer ( Figure 3 The BN layer is not shown in Figure 2 to prevent overfitting of the model. Figure 3 In order to further capture the emotional information between different frames of the same video clip, the present invention adds a bidirectional long short-term memory network based on the output of the VGG network, with an output dimension of 64. Figure 3 , a fully connected layer can be added on the basis of the output of the bidirectional long short-term memory network for dimensionality increase, and the output dimension is 128. The output result of the fully connected layer is used as the expression emotion feature.
[0086] Continue to see Figure 4 In this embodiment, “Face” represents image modality information, and the corresponding feature extraction backbone network outputs features with a dimension of 512, which are further extracted through a bidirectional long short-term memory network ( Figure 4 The feature output dimension is 64, which is further passed through the fully connected layer ( Figure 4 The output dimension is 128 (i.e., facial expression features, Figure 4 not shown) to “Attention”.
[0087] When at least two unimodal information include text modal information, tags for marking the beginning and end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
[0088] Regarding the information of text modality in the video clip (i.e., text modality information), considering the characteristics of the present invention, it is only necessary to obtain the corresponding transcribed text from the speech of the video clip to obtain the text modality information, and no further word segmentation related operations are required.
[0089] For text modal information, the present invention can add two unique tags to the text modal information corresponding to each video clip to indicate the start and end of the text, and then input it into the first basic model corresponding to the text modal information, so as to obtain the corresponding text sentiment features. Among them, the first basic model corresponding to the text modal information is composed of a corresponding word embedding layer and a bidirectional long short-term memory network. Specifically, the present invention can use the pre-trained Chinese pre-trained model BERTbase as a word embedding layer to obtain the word vector corresponding to the text. Due to the characteristics of BERT, we did not use the Chinese word segmentation tool, and finally each character in the text modal information can have a corresponding 768-dimensional word vector. At the same time, in order to further analyze the semantic information, the word vector output by the 768-dimensional BERTbase is reduced in dimension. Based on the output of BERTbase, the present invention adds a bidirectional long short-term memory network with an output dimension of 64, and based on the output of the bidirectional long short-term memory network, a fully connected layer can be added for dimensionality increase, and the output dimension is 128. The output result of the fully connected layer is used as the text sentiment feature.
[0090] Continue to see Figure 4 In this embodiment, "Text" represents text modal information, and the word embedding layer corresponding to the input outputs a feature dimension of 768 (i.e., word vector), which is further transformed into a bidirectional long short-term memory network ( Figure 4 The feature output dimension is 64, which is further passed through the fully connected layer ( Figure 4 The output dimension is 128 (i.e., facial expression features, Figure 4 not shown) to “Attention”.
[0091] S103, determining a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal data set, each unimodal feature pair consisting of two unimodal features.
[0092] The present invention takes into account the intrinsic correlation between different modal information in order to combine multimodal information to make a more accurate prediction of the emotion reflected by the current input. Based on the speech emotion features, facial expression emotion features and text emotion features extracted above, a feature fusion scheme based on global and local attention mechanism is proposed. This scheme is used to find the information that different modalities consider important to each other, thereby fully modeling the potential emotional connection between different modalities and improving the final multimodal emotion recognition performance.
[0093] Based on this, at least two unimodal feature pairs can be selected from speech emotion features, facial expression emotion features and text emotion features for global attention calculation and local attention calculation, that is, the unimodal feature pairs can be composed of text emotion features and speech emotion features, or can be composed of text emotion features and facial expression emotion features, or can be composed of speech emotion features and facial expression emotion features. The present invention does not limit this and can be selected according to the actual scenario.
[0094] Studies have shown that emotions can be better analyzed based on text modal information. In fact, this is also the case in unimodal emotion research. Therefore, the feature fusion scheme of the present invention is relatively based on text modal information as the main modal information. Specifically, when at least two unimodal features include speech modal information, image modal information, and text modal information, two unimodal feature pairs for global attention calculation and local attention calculation can be determined, namely, a first unimodal feature pair composed of text emotion features and speech emotion features, and a second unimodal feature pair composed of text emotion features and expression emotion features.
[0095] S104, input multiple unimodal feature pairs into the second basic model, perform global attention calculation and local attention calculation on the multiple unimodal feature pairs respectively through the attention mechanism in the second basic model, and concatenate the global features obtained by the global attention calculation and the local features obtained by the local attention calculation to obtain a joint sentiment feature, and divide the joint sentiment feature through the fully connected layer in the second basic model to obtain the sentiment prediction result corresponding to the multimodal information.
[0096] In the embodiment of the present invention, the feature fusion scheme based on the global and local attention mechanism includes two parts: global attention calculation and local attention calculation. For ease of understanding, the example of the determined unimodal feature pair including the first unimodal feature pair and the second unimodal feature pair is continued for explanation.
[0097] For the first unimodal feature pair, the feature outputted by the first basic model corresponding to the text modal information in the last time step in the text sentiment feature is used as the query vector (i.e., query vector) in the attention mechanism. This is because the feature contains rich, high-level text features after the activation function. At the same time, the feature outputted by the first basic model corresponding to the speech modal information in each time step in the speech sentiment feature is used as the key vector (i.e., key vector) in the attention mechanism for attention calculation to determine the speech sentiment feature that is important relative to the text sentiment feature. After the attention calculation, the speech sentiment feature has a weight, which represents the importance of the speech sentiment feature relative to the corresponding text sentiment feature. Therefore, the speech sentiment feature whose weight meets the corresponding conditions can be used as an important speech sentiment feature, i.e., the first target speech sentiment feature. For the first target speech sentiment feature, it can be weighted and summed based on its weight, and the corresponding feature can be determined from the text sentiment feature using the feature with proper weighted summation as an important text sentiment feature, i.e., the first target text sentiment feature. In this way, the global attention calculation of the first unimodal feature pair is completed.
[0098] Considering that in the global attention mechanism, the query vector used is the feature outputted by the last time step of the text modal information, although the bidirectional long short-term memory network can avoid the gradient vanishing problem to a certain extent compared with the recurrent neural network, as the text sequence grows, some important text information is still easily lost, thus affecting the final sentiment feature fusion performance. Based on this, in order to capture the key information omitted by the global attention mechanism, the present invention applies a local attention mechanism on this basis.
[0099] Continuing with the first unimodal feature pair, the feature outputted by the first basic model corresponding to the text modal information at the last time step in the text sentiment feature is used as the query vector (i.e., query vector) in the attention mechanism, and the self-attention mechanism is used to find important text sentiment features, that is, the feature outputted by the first basic model corresponding to the text modal information at each time step in the text sentiment feature is used as the key vector (i.e., key vector) in the attention mechanism for attention calculation. After the attention calculation, the text sentiment feature itself has a weight, which represents the importance of the text sentiment feature relative to itself, including the importance of different features therein, so the text sentiment feature whose weight meets the corresponding conditions can be used as an important text sentiment feature, i.e., the second target text sentiment feature. For the second target text sentiment feature, its weight can be increased and given a larger weight, and then the text sentiment feature with the increased weight is used as the query vector (i.e., query vector) in the attention mechanism to determine the important speech sentiment feature from the speech sentiment feature, specifically, the feature outputted by the first basic model corresponding to the speech modal information at each time step in the speech sentiment feature is used as the key vector (i.e., key vector) in the attention mechanism for attention calculation, so as to determine the important speech sentiment feature relative to the text sentiment feature with the increased weight. After the attention calculation, the speech emotion feature has a weight, which represents the importance of the speech emotion feature relative to the text emotion feature after the corresponding weight is increased. Therefore, the speech emotion feature whose weight meets the corresponding conditions can be used as an important speech emotion feature, that is, the second target speech emotion feature. In this way, the local attention calculation of the first single modal feature pair is completed.
[0100] The global attention calculation is the same as that of the first unimodal feature pair. For the second unimodal feature pair, the feature outputted by the first basic model corresponding to the text modal information at the last time step in the text sentiment feature is used as the query vector (i.e., query vector) in the attention mechanism, and the feature outputted by the first basic model corresponding to the image modal information at each time step in the expression emotion feature is used as the key vector (i.e., key vector) in the attention mechanism to perform attention calculation, so as to determine the first target expression emotion feature whose weight satisfies the condition in the expression emotion feature, and the weight represents the importance of the feature relative to the text emotion feature; the first target expression emotion feature and its weight are weighted summed, and the third target text emotion feature corresponding to the feature obtained by the weighted sum in the text emotion feature is determined. In this way, the global attention calculation for the second unimodal feature pair is completed. For the specific implementation, please refer to the implementation of the global attention calculation for the first unimodal feature pair, which will not be repeated here.
[0101] The local attention calculation of the first unimodal feature pair is the same, the feature in the text sentiment feature outputted by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the text sentiment feature outputted by the first basic model corresponding to the text modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the fourth target text sentiment feature whose weight meets the corresponding conditions in the text sentiment feature, and the weight represents the importance of the corresponding feature relative to the text sentiment feature; the weight of the fourth target text sentiment feature is increased, and the text sentiment feature after the weight increase is used as the query vector in the attention mechanism, and the feature in the expression sentiment feature outputted by the first basic model corresponding to the expression modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target expression sentiment feature whose weight meets the corresponding conditions in the expression sentiment feature, and the weight represents the importance of the corresponding feature relative to the text sentiment feature. In this way, the local attention calculation of the second unimodal feature pair is completed. The specific implementation can refer to the implementation of the local attention calculation of the first unimodal feature pair, which will not be repeated here.
[0102] Based on this, after global and local attention calculations, seven features can be obtained for the first unimodal feature pair and the second unimodal feature pair, namely, the first target speech emotion feature, the first target text emotion feature, the first target expression emotion feature, and the third target text emotion feature as global features obtained by global attention calculation, and the second target text emotion feature / fourth target text emotion feature, the second target speech emotion feature, and the second target expression emotion feature as local features obtained by local attention calculation. It should be noted that the second target text emotion feature and the fourth target text emotion feature are the same feature.
[0103] Further, see Figure 4 , the global features and local features can be concatenated to obtain a 448-dimensional joint sentiment feature. Further, the 448-dimensional joint sentiment feature can be reduced to 128 dimensions through the fully connected layer, and then the softmax activation function of the fully connected layer ( Figure 4 (not shown in the figure) The 128-dimensional joint sentiment features are divided to obtain the sentiment prediction results.
[0104] S105, based on the emotion prediction results and emotion labeling results corresponding to the multimodal information, iteratively adjust the model parameters of the first basic model and the second basic model until the emotion prediction results corresponding to the multimodal information are close to their emotion labeling results, use the first basic model as the first model and the second basic model as the second model, and output an emotion recognition model composed of the first model and the second model.
[0105] In an embodiment of the present invention, the emotion labeling result is taken as the target, and the model parameters of the first model and the second model are reversely adjusted according to the loss function value between the emotion prediction result and the emotion labeling result. When the loss function value satisfies the condition, that is, when the emotion prediction result is close to its emotion labeling result, the training is terminated, the first basic model is used as the first model, the second basic model is used as the second model, and the emotion recognition model composed of the first model and the second model is output.
[0106] Based on the emotion recognition model trained above, the embodiment of the present invention further provides an emotion recognition method based on multimodal information fusion. The method flow chart of the method is as follows: Figure 5 As shown, the following steps are included:
[0107] S201, identifying at least two unimodal information in the target information to be processed, and retrieving a pre-trained emotion recognition model, where the emotion recognition model includes a first model for feature extraction and a second model for feature fusion.
[0108] In the embodiment of the present invention, the target information is the information to be processed input by the user, and the target information includes at least two single-modal information, namely, at least two of voice modal information, image modal information and text modal information.
[0109] S202, preprocessing at least two unimodal information in the target information respectively, and inputting them into the first model, and extracting features of the input unimodal information through the first model to obtain at least two unimodal features corresponding to the target information.
[0110] In the embodiment of the present invention, the process of separately preprocessing at least two unimodal information in the target information may refer to the above implementation of separately preprocessing at least two unimodal information in the multimodal information, which will not be described in detail here.
[0111] After preprocessing at least two unimodal information in the target information, the preprocessing results of each unimodal information can be input into the first model, and the first model extracts features of each unimodal information to obtain unimodal features corresponding to each unimodal information. That is, if the target information contains voice modal information, the corresponding voice emotion features can be obtained; if the target information contains image modal information, the corresponding expression emotion features can be obtained; if the target information contains text modal information, the corresponding text emotion features can be obtained.
[0112] S203, inputting at least two unimodal features corresponding to the target information into the second model, and performing feature fusion based on the global and local attention mechanism on the input unimodal features through the second model to obtain the emotion recognition result corresponding to the target information.
[0113] In an embodiment of the present invention, a corresponding emotion recognition result can be obtained by performing feature fusion based on global and local attention mechanisms on at least two unimodal features corresponding to the target information through the second model.
[0114] The emotion recognition method based on multimodal information fusion provided by the embodiment of the present invention can comprehensively consider multimodal information, fuse the inherent correlation between multimodal information, and obtain more accurate emotion recognition results.
[0115] Based on the emotion recognition method based on multimodal information fusion provided in the above embodiment, an embodiment of the present invention provides a device for executing the emotion recognition method based on multimodal information fusion. The structural diagram of the device is shown in FIG. Figure 6 As shown, including:
[0116] A model training module 10, used for pre-training an emotion recognition model, wherein the emotion recognition model includes a first model for feature extraction and a second model for feature fusion;
[0117] A model retrieval module 20, used to identify at least two unimodal information in the target information to be processed, and retrieve an emotion recognition model;
[0118] The model recognition module 30 is used to preprocess at least two unimodal information in the target information respectively, and input them into the first model, and perform feature extraction on the input unimodal information through the first model to obtain at least two unimodal features corresponding to the target information; input the at least two unimodal features corresponding to the target information into the second model, and perform feature fusion based on the global and local attention mechanism on the input unimodal features through the second model to obtain the emotion recognition result corresponding to the target information.
[0119] Optionally, the model training module 10 is specifically used for:
[0120] Identify at least two unimodal information in the multimodal information used for this training, where the multimodal information has corresponding sentiment labeling results; preprocess the at least two unimodal information in the multimodal information respectively, and input them into the first basic model, and extract features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal data set; determine multiple unimodal feature pairs for global attention calculation and local attention calculation from the at least two unimodal features corresponding to the multimodal data set, each unimodal feature pair consists of two unimodal features; input the multiple unimodal feature pairs into the second basic model, and extract features of the multiple unimodal features through the attention mechanism in the second basic model. The global attention calculation and the local attention calculation are performed on the features respectively, and the global features obtained by the global attention calculation and the local features obtained by the local attention calculation are concatenated to obtain the joint sentiment features, and the joint sentiment features are divided by the fully connected layer in the second basic model to obtain the sentiment prediction results corresponding to the multimodal information; based on the sentiment prediction results and the sentiment labeling results corresponding to the multimodal information, the model parameters of the first basic model and the second basic model are iteratively adjusted until the sentiment prediction results corresponding to the multimodal information are close to their sentiment labeling results, the first basic model is used as the first model, the second basic model is used as the second model, and the sentiment recognition model composed of the first model and the second model is output.
[0121] Optionally, the at least two single modal information include at least two of voice modal information, image modal information and text modal information;
[0122] Correspondingly, the model training module 10 preprocesses at least two unimodal information in the multimodal information respectively, and inputs them into the first basic model, and extracts features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal data set, including:
[0123] In the case where at least two single-modal information contain speech modal information, the speech modal information is pre-emphasized and framed and windowed, and divided into a plurality of continuous speech segment information; the plurality of speech segment information are respectively short-time Fourier transformed to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into an image, and input into a first basic model corresponding to the speech modal information to obtain speech emotion features corresponding to the speech modal information;
[0124] In the case where at least two single-modal information include image modal information, face detection is performed on the image modal information to obtain a corresponding face image, the face image is resized, and the face image is input into a first basic model corresponding to the image modal information to obtain the expression emotion features corresponding to the image modal information;
[0125] When at least two unimodal information include text modal information, tags for marking the beginning and end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
[0126] Optionally, the first basic model corresponding to the speech modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0127] The first basic model corresponding to the image modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or
[0128] The first basic model corresponding to the text modality information is composed of the corresponding word embedding layer and the bidirectional long short-term memory network.
[0129] Optionally, the at least two single modal information include voice modal information, image modal information and text modal information;
[0130] Accordingly, the model training module 10 determines a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal data set, including:
[0131] Determine a first unimodal feature pair consisting of a text emotion feature and a speech emotion feature, and a second unimodal feature pair consisting of a text emotion feature and an expression emotion feature;
[0132] Accordingly, the model training module 10 performs global attention calculation and local attention calculation on multiple unimodal feature pairs, including:
[0133] For the first unimodal feature pair, the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the speech sentiment feature output by the first basic model corresponding to the speech modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation to determine the first target speech sentiment feature whose weight meets the corresponding conditions in the speech sentiment feature, and the weight represents the importance of the feature relative to the text sentiment feature; the first target speech sentiment feature and its weight are weighted summed, and the first target text sentiment feature corresponding to the feature obtained by the weighted sum is determined; the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step is used as the key vector in the attention mechanism. The query vector in the attention mechanism and the feature in the text sentiment feature outputted by the first basic model corresponding to the text modal information at each time step are used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target text sentiment feature whose weight in the text sentiment feature meets the corresponding conditions, and the weight represents the importance of the corresponding feature relative to the text sentiment feature; the weight of the second target text sentiment feature is increased, and the text sentiment feature after the weight increase is used as the query vector in the attention mechanism, and the feature in the speech sentiment feature outputted by the first basic model corresponding to the speech modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target speech sentiment feature whose weight in the speech sentiment feature meets the corresponding conditions, and the weight represents the importance of the corresponding feature relative to the text sentiment feature;
[0134] For the second unimodal feature pair, the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the expression sentiment feature output by the first basic model corresponding to the image modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation to determine the first target expression sentiment feature in the expression sentiment feature whose weight meets the conditions, and the weight represents the importance of the feature relative to the text sentiment feature; the first target expression sentiment feature and its weight are weighted summed, and the third target text sentiment feature in the text sentiment feature corresponding to the feature obtained by the weighted sum is determined; the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step is used as the attention key vector. The query vector in the attention mechanism is used as the feature in the text sentiment feature outputted by the first basic model corresponding to the text modal information at each time step as the key vector in the attention mechanism to perform attention calculation, so as to determine the fourth target text sentiment feature whose weight in the text sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the corresponding feature relative to the text sentiment feature; the weight of the fourth target text sentiment feature is increased, and the text sentiment feature after the weight increase is used as the query vector in the attention mechanism, and the feature in the expression sentiment feature outputted by the first basic model corresponding to the expression modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target expression sentiment feature whose weight in the expression sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the corresponding feature relative to the text sentiment feature;
[0135] Among them, the first target speech emotion feature, the first target text emotion feature, the first target expression emotion feature, and the third target text emotion feature are used as global features obtained by global attention calculation, and the second target text emotion feature / fourth target text emotion feature, the second target speech emotion feature, and the second target expression emotion feature are used as local features obtained by local attention calculation.
[0136] It should be noted that the detailed functions of each module in the embodiment of the present invention can be found in the corresponding disclosed part of the above method embodiment, and will not be repeated here.
[0137] Based on the emotion recognition method based on multimodal information fusion provided in the above-mentioned embodiment, an embodiment of the present invention correspondingly provides an electronic device, which includes: at least one memory and at least one processor; the memory stores an application, the processor calls the application stored in the memory, and the application is used to implement the emotion recognition method based on multimodal information fusion.
[0138] The above is a detailed introduction to the emotion recognition method, device and electronic device based on multimodal information fusion provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in the field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0139] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0140] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.
[0141] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method of emotion recognition based on multimodal information fusion, It is characterized in that The method comprises: Identify at least two unimodal information in the target information to be processed, and retrieve a pre-trained emotion recognition model, wherein the emotion recognition model includes a first model for feature extraction and a second model for feature fusion; Preprocessing at least two unimodal information in the target information respectively, and inputting the preprocessed information into the first model, and extracting features of the input unimodal information by the first model to obtain at least two unimodal features corresponding to the target information; Inputting at least two unimodal features corresponding to the target information into the second model, and performing feature fusion based on global and local attention mechanisms on the input unimodal features through the second model to obtain an emotion recognition result corresponding to the target information; The training process of the emotion recognition model includes: Identify at least two unimodal information in the multimodal information used for this training, wherein the multimodal information has corresponding emotion annotation results; Preprocessing at least two unimodal information in the multimodal information respectively, and inputting the preprocessed information into a first basic model, and extracting features of the input unimodal information by using the first basic model to obtain at least two unimodal features corresponding to the multimodal information; Determining a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal information, each unimodal feature pair consisting of two unimodal features; Input the multiple unimodal feature pairs into the second basic model, perform global attention calculation and local attention calculation on the multiple unimodal feature pairs respectively through the attention mechanism in the second basic model, and concatenate the global features obtained by the global attention calculation and the local features obtained by the local attention calculation to obtain a joint sentiment feature, and divide the joint sentiment feature through the fully connected layer in the second basic model to obtain the sentiment prediction result corresponding to the multimodal information; Based on the emotion prediction result and emotion labeling result corresponding to the multimodal information, the model parameters of the first basic model and the second basic model are iteratively adjusted until the emotion prediction result corresponding to the multimodal information is close to its emotion labeling result, and the first basic model is used as the first model and the second basic model is used as the second model, and the emotion recognition model composed of the first model and the second model is output.
2. The method according to claim 1, It is characterized in that The at least two single modal information include at least two of voice modal information, image modal information and text modal information; Accordingly, at least two unimodal information in the multimodal information are preprocessed respectively and input into the first basic model, and feature extraction is performed on the input unimodal information by the first basic model to obtain at least two unimodal features corresponding to the multimodal information, including: In the case where the speech modality information is included in the at least two single-modality information, the speech modality information is pre-emphasized and framed and windowed, and divided into a plurality of continuous speech segment information; the plurality of speech segment information are respectively short-time Fourier transformed to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into a picture, and input into the first basic model corresponding to the speech modality information to obtain the speech emotion feature corresponding to the speech modality information; In the case where the at least two single modal information include the image modal information, face detection is performed on the image modal information to obtain a corresponding face picture, the face picture is resized, and is input into a first basic model corresponding to the image modal information to obtain the expression emotion features corresponding to the image modal information; In the case where the text modal information is included in the at least two unimodal information, tags for marking the beginning and the end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
3. The method according to claim 2, It is characterized in that The first basic model corresponding to the speech modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or The first basic model corresponding to the image modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or The first basic model corresponding to the text modal information is composed of a corresponding word embedding layer and a bidirectional long short-term memory network.
4. The method according to claim 2, It is characterized in that The at least two single modal information include the voice modal information, the image modal information and the text modal information; Accordingly, the determining of a plurality of unimodal feature pairs for global attention calculation and local attention calculation from at least two unimodal features corresponding to the multimodal information includes: Determine a first unimodal feature pair consisting of the text emotion feature and the voice emotion feature, and a second unimodal feature pair consisting of the text emotion feature and the expression emotion feature; Accordingly, performing global attention calculation and local attention calculation on the multiple unimodal feature pairs respectively includes: For the first unimodal feature pair, the feature in the text emotion feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the speech emotion feature output by the first basic model corresponding to the speech modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the first target speech emotion feature whose weight satisfies the corresponding condition in the speech emotion feature, and the weight represents the importance of the feature relative to the text emotion feature; weighted sum is performed on the first target speech emotion feature and its weight, and the first target text emotion feature corresponding to the feature obtained by the weighted sum is determined in the text emotion feature; The feature outputted by the first basic model corresponding to the text modal information in the last time step in the text sentiment feature is used as the query vector in the attention mechanism, and the feature outputted by the first basic model corresponding to the text modal information in each time step in the text sentiment feature is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target text sentiment feature whose weight in the text sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; the weight of the second target text sentiment feature is increased, and the text sentiment feature after the weight increase is used as the query vector in the attention mechanism, and the feature outputted by the first basic model corresponding to the speech modal information in each time step in the speech sentiment feature is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target speech sentiment feature whose weight in the speech sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; For the second unimodal feature pair, the feature in the text emotion feature output by the first basic model corresponding to the text modal information at the last time step is used as the query vector in the attention mechanism, and the feature in the expression emotion feature output by the first basic model corresponding to the image modal information at each time step is used as the key vector in the attention mechanism to perform attention calculation, so as to determine the first target expression emotion feature in the expression emotion feature whose weight satisfies the condition, and the weight represents the importance of the feature relative to the text emotion feature; weighted sum is performed on the first target expression emotion feature and its weight, and a third target text emotion feature in the text emotion feature corresponding to the feature obtained by the weighted sum is determined; Using the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at the last time step as the query vector in the attention mechanism, using the feature in the text sentiment feature output by the first basic model corresponding to the text modal information at each time step as the key vector in the attention mechanism to perform attention calculation, so as to determine the fourth target text sentiment feature whose weight in the text sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; improving the weight of the fourth target text sentiment feature, and using the text sentiment feature after the weight is improved as the query vector in the attention mechanism, using the feature in the expression sentiment feature output by the first basic model corresponding to the image modal information at each time step as the key vector in the attention mechanism to perform attention calculation, so as to determine the second target expression sentiment feature whose weight in the expression sentiment feature satisfies the corresponding conditions, and the weight represents the importance of the feature relative to the text sentiment feature; Among them, the first target voice emotion feature, the first target text emotion feature, the first target expression emotion feature, and the third target text emotion feature are used as global features obtained by global attention calculation, and the second target text emotion feature / the fourth target text emotion feature, the second target voice emotion feature, and the second target expression emotion feature are used as local features obtained by local attention calculation.
5. An emotion recognition device based on multimodal information fusion, It is characterized in that The device comprises: A model training module, used for pre-training an emotion recognition model, wherein the emotion recognition model includes a first model for feature extraction and a second model for feature fusion; A model retrieval module, used to identify at least two unimodal information in the target information to be processed, and retrieve the emotion recognition model; A model recognition module, used to pre-process at least two unimodal information in the target information respectively, and input them into the first model, and extract features of the input unimodal information through the first model to obtain at least two unimodal features corresponding to the target information; input the at least two unimodal features corresponding to the target information into the second model, and perform feature fusion based on global and local attention mechanisms on the input unimodal features through the second model to obtain an emotion recognition result corresponding to the target information; Wherein, the model training module is specifically used for: Identify at least two unimodal information in the multimodal information used for this training, wherein the multimodal information has corresponding sentiment labeling results; preprocess the at least two unimodal information in the multimodal information respectively, and input them into the first basic model, and extract features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal information; determine a plurality of unimodal feature pairs for global attention calculation and local attention calculation from the at least two unimodal features corresponding to the multimodal information, wherein each unimodal feature pair is composed of two unimodal features; input the plurality of unimodal feature pairs into the second basic model, and perform global attention on the plurality of unimodal feature pairs respectively through the attention mechanism in the second basic model. Global attention calculation and local attention calculation are performed, and the global features obtained by the global attention calculation and the local features obtained by the local attention calculation are concatenated to obtain a joint sentiment feature, and the joint sentiment feature is divided by the fully connected layer in the second basic model to obtain the sentiment prediction result corresponding to the multimodal information; based on the sentiment prediction result and the sentiment labeling result corresponding to the multimodal information, the model parameters of the first basic model and the second basic model are iteratively adjusted until the sentiment prediction result corresponding to the multimodal information approaches its sentiment labeling result, and the first basic model is used as the first model and the second basic model is used as the second model, and the sentiment recognition model composed of the first model and the second model is output.
6. The device according to claim 5, It is characterized in that The at least two single modal information include at least two of voice modal information, image modal information and text modal information; Correspondingly, the model training module preprocesses at least two unimodal information in the multimodal information respectively, and inputs them into the first basic model, and extracts features of the input unimodal information through the first basic model to obtain at least two unimodal features corresponding to the multimodal information, including: In the case where the speech modality information is included in the at least two single-modality information, the speech modality information is pre-emphasized and framed and windowed, and divided into a plurality of continuous speech segment information; the plurality of speech segment information are respectively short-time Fourier transformed to obtain spectrogram information corresponding to each of the plurality of speech segment information; the spectrogram information corresponding to each of the plurality of speech segment information is converted into a picture, and input into the first basic model corresponding to the speech modality information to obtain the speech emotion feature corresponding to the speech modality information; In the case where the at least two single modal information include the image modal information, face detection is performed on the image modal information to obtain a corresponding face picture, the face picture is resized, and is input into a first basic model corresponding to the image modal information to obtain the expression emotion features corresponding to the image modal information; In the case where the text modal information is included in the at least two unimodal information, tags for marking the beginning and the end of the text are added to the text modal information and input into a first basic model corresponding to the text modal information to obtain text sentiment features corresponding to the text modal information.
7. The device according to claim 6, It is characterized in that The first basic model corresponding to the speech modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or The first basic model corresponding to the image modality information is composed of at least a corresponding feature extraction backbone network and a bidirectional long short-term memory network; and / or The first basic model corresponding to the text modal information is composed of a corresponding word embedding layer and a bidirectional long short-term memory network.
8. An electronic device, It is characterized in that The electronic device includes: at least one memory and at least one processor; the memory stores an application, and the processor calls the application stored in the memory, and the application is used to implement the emotion recognition method based on multimodal information fusion as described in any one of claims 1-4.
Citation Information
Patent Citations
Attention fusion-based online short video multi-modal emotion recognition method
CN111275085A
Multi-modal emotion recognition method based on situational attention neural network
CN112348075A
