Emotion recognition method, system and equipment based on multi-modal fusion and medium

The BERT model, which combines the emotional analysis network model and the word attention mechanism through multi-channel feature enhancement, solves the problems of weak model generalization ability and modal imbalance in multi-modal emotion recognition, achieving more efficient emotional information extraction and more accurate Good generalization ability.

CN118656784APending Publication Date: 2024-09-17XI AN JIAOTONG UNIV

Patent Information

Application Number
CN202410830273.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing multi-modal emotion recognition technology has problems such as weak model generalization ability, large model scale, and unbalanced modalities. As a result, the rich emotional information in a single modality cannot be fully utilized, and the implicit emotional features cannot be extracted and learned. .

Method used

Using multi-channel feature enhancement and fusion sentiment analysis network model, through multi-modal data integration module, multi-feature extraction and parallel interaction module, cross-modal information fusion module, combined with the BERT model of word attention mechanism, a pyramid network structure is designed and optimized Feature encoding and fusion of text modalities, using cross-modal attention mechanism for feature fusion.

Benefits of technology

It improves the emotion recognition performance under mixed voice, text, and image data, overcomes the problems of weak model generalization ability, large model size, and unbalanced modalities, and achieves richer emotional information extraction and higher generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656784A
    Figure CN118656784A
Patent Text Reader

Abstract

The invention discloses an emotion recognition method, system and device based on multi-modal fusion and a medium, and the method comprises the steps: obtaining data of two or more modals, carrying out the preprocessing and feature extraction of the data, and dividing the data into a training set and a test set; and training a pre-established multi-channel feature enhancement fusion sentiment analysis network model by using the training set, and inputting the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain a final sentiment prediction result. According to the invention, the emotion recognition performance under the mixed data of voice, text and image is integrally improved; meanwhile, exploration is carried out in the aspect of overcoming the problems that the model generalization ability is weak, the model scale is large and the modal is unbalanced, and a solution is provided; and reference can be provided for technical research and technical application in subsequent related fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of emotion recognition technology, and specifically relates to an emotion recognition method, system, device and medium based on multimodal fusion. Background Art

[0002] In the process of human expression and interaction, being able to accurately analyze the attitudes of relevant parties through information from multiple modalities has important applications in various fields. For example, when shopping on JD.com or Taobao, collecting users' positive or negative emotions about a certain type of product or design style can effectively help build a recommendation system; when people chat with chatbots, understanding people's emotional states through conversation information can help collect more user emotional information and personality characteristics, providing more help for subsequent communication with customers, thereby improving the communication experience of both parties. In real life and production processes, there are many scenarios and needs to obtain emotional tendencies through videos or other information. At this time, sentiment analysis algorithms provide such a way to extract this key information.

[0003] Multimodal emotion recognition aims to extract and integrate semantic information collected from multiple modalities[1] to identify the emotional information expressed in multimodal data. The main focus of this research field is to develop a superior feature extraction and feature fusion scheme that can extract and integrate the unique key information of each modality from multiple modalities. Using this rich multimodal information to analyze the user's emotions, obtaining high-dimensional features through multimodal feature extraction technology, and sending them to the subsequent analysis layer for analysis, so as to accurately judge the user's emotional tendency, which contains huge practical value and application significance. At present, there are mainly three modalities: vision, audio and text, and these three modalities play an important role. As the most basic and direct carrier of emotional communication, text data is often used as the main information for inferring human emotional state, and vision and audio are important auxiliary modalities to improve accuracy. Identifying emotions in multimodal data is of great significance.

[0004] Emotion recognition can be roughly divided into two categories: unimodal emotion recognition and multimodal emotion recognition. Unimodal emotion recognition is the basis of multimodal emotion recognition and can provide multimodal emotion recognition ideas and methods. The alignment process refers to the process of mapping signals with different sampling rates to the same frequency. Early multimodal alignment methods usually first select a target frequency and then calculate the frames in each modality that need to be mapped to that position. Traditional alignment methods are mainly based on feature extraction and transformation, such as principal component analysis, canonical correlation analysis, local linear embedding, multidimensional scaling, etc. These methods usually need to convert data of different modalities into vectors of the same dimension first, and then use some linear or nonlinear transformations to make the vectors of different modalities maintain similarity or correlation as much as possible in a low-dimensional space. The advantage of these methods is that they are simple and easy to implement, but the disadvantage is that they ignore the complex relationship and dynamic changes between different modalities. In the future, we will explain the existing ideas of using Transformer to solve the above problems in terms of attention mechanism.

[0005] There are three types of methods for unimodal emotion recognition: one is based on sentiment dictionary, the second is based on deep learning, and the third is based on pre-trained models. The three methods are introduced below.

[0006] Based on the sentiment dictionary method, this method matches and calculates each word in the text according to a pre-built dictionary containing sentiment keywords and corresponding sentiment categories or scores to obtain the sentiment tendency of the text, such as word2vec, glove, etc. First, the text is pre-processed by word segmentation and stop word processing. Then, the text is string matched using the sentiment dictionary built in advance to mine positive and negative information. Then, the weight of the sentiment word is adjusted according to the modifying elements such as degree words, negative words, punctuation marks before and after the sentiment word. Finally, the sum or average of all the sentiment words in the text is calculated to obtain the sentiment tendency of the text. The advantage of the sentiment dictionary-based method is that it is simple and easy to implement, and does not require manual annotation of data or training models. The disadvantage is that it depends on the quality and coverage of the sentiment dictionary and is difficult to handle complex language phenomena, such as semantic disambiguation, implicit sentiment, irony, etc.

[0007] Methods based on deep learning: This method uses neural network structures such as recurrent neural networks (RNNs) to encode and extract features from text to obtain a vector representation of the text. For example, in 2017, MIRSAMADI S et al. proposed a method for processing speech and natural language using recurrent neural networks (RNNs). RNNs are a type of neural network structure that memorizes previous inputs and uses them as conditions for current outputs. In this way, RNNs can capture contextual information in text, thereby improving the effect of emotion recognition.

[0008] The last method is based on large pre-trained models. This method uses Transformer-based pre-trained models such as BERT to encode and extract features of the text to obtain a vector representation of the text.

[0009] Multimodal feature fusion refers to the process of combining or converting feature vectors from different modalities to obtain a feature vector that can represent multimodal information. There are two main methods for multimodal feature fusion: deep learning-based methods and attention-based methods, as described below:

[0010] Based on deep learning methods, this method uses linear layers or other neural network structures to encode and fuse features of different modalities to obtain vector representations of multimodal information. For example, EF-LSTM is an early fusion LSTM model that concatenates feature representations of three modalities: text, speech, and image, to obtain a multimodal representation, which is then input into LSTM for encoding. The advantage of EF-LSTM is that it can effectively extract interactive information between modalities, but its disadvantage is that it may ignore interactive information within a single modality. LF-LSTM is the abbreviation of post-fusion LSTM. Its basic idea is to use an LSTM network to extract unimodal features and infer decisions for each modality (audio, vision, text), and then combine the unimodal decision results through a voting mechanism. It differs from other multimodal models in that it does not require alignment of inputs of different modalities, but rather performs fusion in the last step.

[0011] The method based on the attention mechanism uses the attention mechanism to weight and select the features of different modalities, extract some important or relevant features, such as self-attention, cross attention, multi-head attention, etc., and use it to solve various downstream tasks. After the widespread application of the attention mechanism, Transformer also has a very outstanding performance in alignment. Unlike the traditional alignment process, the attention mechanism naturally forms a point-to-point mapping between the two modalities, that is, the alignment process is completed by the attention mechanism. And it has been proven to be effective in more general multimodal representation learning and feature fusion. For example, multi-head attention mechanism (MHA), Mult, M2FNet, bimodal fusion network (BBFN), etc., the modal fusion architecture of the present invention is also built on Transformer. These methods usually use neural networks to extract high-level features from data of different modalities, and dynamically adjust the weights and information flows between different modalities through the attention mechanism. The advantage of these methods is that they can better capture the semantic and structural information between different modalities, but the disadvantage is that they require a large amount of data and computing resources, as well as a suitable network structure and loss function.

[0012] There is a new multimodal Transformer model Mult that can learn representations directly from unaligned multimodal streams; this model extends the standard Transformer network, and its core is a cross-modal attention module that focuses on cross-modal interactions at the scale of the entire discourse. The main contribution of this paper is the proposal of a new multimodal learning framework that can learn representations directly from unaligned multimodal streams without the need for additional alignment steps or data. However, this article puts the three modalities on an equal footing for operation, without considering the importance of the text modality. In addition, it also ignores the extraction of unimodal information from multiple perspectives.

[0013] AuxFormer is a multimodal learning framework that can learn representations from unaligned multimodal streams without the need for additional alignment steps or data. The model extends the standard Transformer network, with a cross-modal attention module at its core, which focuses on cross-modal interactions at the scale of the entire utterance. In addition, the paper proposes a novel multi-task learning method that can handle sentiment classification and sentiment regression tasks simultaneously, and can improve the performance of both tasks by sharing features. The model uses Transformer as the main network to combine and align audio-visual features. In addition to the main network, AuxFormer also introduces a unimodal auxiliary network, which is trained simultaneously with the main network to learn the features of a single modality. The core of AuxFormer is a cross-modal attention module, which focuses on cross-modal interactions at the scale of the entire utterance. In AuxFormer, the role of the auxiliary network is to learn the features of a single modality, and the unimodal information is transmitted back to the main network through the back propagation of the loss function for use in the cross-modal attention module. The auxiliary network is trained simultaneously with the main network to learn the features of a single modality, and the auxiliary network is not involved at test time. AuxFormer is a new multimodal learning framework, so it still has some application limitations. For example, it may not be able to handle misaligned multimodal streams, is insufficient in feature extraction, and has a single source of unimodal feature information, so its performance still has room for further improvement.

[0014] In addition, Vishal Chudasama et al. proposed an M2FNet model, which uses a multi-head attention-based fusion mechanism to fuse the latent representations rich in emotional information in the input data. It introduces a new feature extractor for extracting latent features from audio and visual modalities. The feature extractor uses a novel adaptive boundary-based triplet loss function to learn emotion-related features in audio and visual data. However, the disadvantages are that the network size is too large, the feature extraction and processing methods of different modalities are single, and the generalization ability is weak.

[0015] There are two difficulties in the multimodal emotion recognition task: one is how to process the original input data of three modalities to obtain effective high-dimensional feature vectors; the other is how to effectively process and fuse data of different modalities, and how to deal with the alignment and association problems between different modalities.

[0016] In the face of these problems, existing methods have proposed two types of solutions. First, from the perspective of multimodal feature extraction, different technologies can be used to extract features according to the data types and characteristics of different modalities. For example, for image data, convolutional neural networks (CNN) can be used to extract features; for text data, words can be converted into word vectors using technologies such as word embedding; for speech data, acoustic feature extraction technologies such as Mel frequency cepstral coefficients (MFCC) can be used to extract speech features. Secondly, for the problem of feature fusion, different fusion strategies and methods can be used to combine or integrate multimodal features according to different tasks and goals. For example, it can be divided into early fusion, late fusion and model-level fusion according to the different fusion timing. Early fusion is to fuse the features of each modality immediately after extracting them. The most common method is to perform a simple connection operation on the features and then send them to the fully connected layer; late fusion is to perform the fusion operation after each modality outputs the results; model-level fusion combines the output of the early fusion method and the single-modal predictor. All of the above methods provide ideas for solving the problem of feature fusion.

[0017] However, there are some problems with existing methods. First, different feature extractors can potentially generate embedded content with different perspectives, especially for networks with different structures, such as CNN and LSTM. Therefore, when a single feature encoder is used to extract representations, some of the intrinsic information obtained is limited, which may prevent the entire network from fully learning the emotional information of the modality. In the feature extraction process, existing methods often use only a single encoder to generate a single feature. If multiple feature encoders are used to extract diversified representations, it is obvious that they have richer emotional information than a limited single feature. Secondly, different modalities play different roles in the field of sentiment analysis. The text modality has unique advantages in the field of sentiment due to its own modality characteristics. Therefore, it is necessary to fully explore and utilize the text modality, while many existing methods treat all modalities equally, ignoring the differences between modalities, resulting in performance loss. Finally, existing multimodal fusion networks tend to be large-scale and highly complex, and achieve high performance through special fusion strategies and multiple fine-tuning on small data sets, but have weak generalization capabilities. Summary of the invention

[0018] The technical problem to be solved by the present invention is to provide an emotion recognition method, system, device and medium based on multimodal fusion in response to the above-mentioned deficiencies in the prior art, and to explore ways to overcome the problems of weak model generalization ability, large model scale and modal imbalance, in order to solve the technical problem that the rich emotional information in a single modality is not fully utilized, resulting in many implicit emotional features in a single modality not being extracted or learned.

[0019] The present invention adopts the following technical solutions:

[0020] An emotion recognition method based on multimodal fusion includes the following steps:

[0021] Obtain data from two or more modalities, preprocess and extract features from the data, and then divide the data into training sets and test sets;

[0022] The training set is used to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and the test set is input into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

[0023] Preferably, the data of two or more modalities include audio data, visual data and text data; extract the spectrogram, MFCC and Wav2vec2.0 features of the audio data, extract the facial feature information of the visual data, obtain the image features with a length of 2048, use the improved BERT pre-training model based on word attention to extract features of the text data, and then use P2FA to align the data so that the other modal domains of the data set are aligned to the text domain, and then aligned to the label domain; finally, divide the data set.

[0024] More preferably, COVAREP and Opensmile are used to extract audio data, and VGGFace2 and RetinaFace are used to extract visual data.

[0025] More preferably, the improved BERT pre-training model based on word attention adopts the Encoder of the bidirectional Transformer and loads the word2id dictionary.

[0026] Preferably, the multi-channel feature enhancement fusion sentiment analysis network model includes:

[0027] The multimodal data integration module uses the data preprocessing method or feature extractor in each modality to obtain high-dimensional vectors, and reshapes the feature vectors of each modality through sequence encoders and adapters;

[0028] Multi-feature extraction and parallel interaction module, the video modality uses VGGFace2 and Retinaface to obtain facial features, the audio modality uses MFCC method, Spectrum method and Wav2vec2.0 as feature extractors, and the text modality uses the improved pre-trained BERT model focusing on emotional keywords, and uses the basic modality cross entropy loss to optimize the joint feature representation;

[0029] The cross-modal information fusion module takes the text modality as the core when fusing the network, and selects two cross-modal Transformer modules: text and vision and text and acoustics for operation;

[0030] The prediction module further transforms the fusion features, adjusts the feature map using the fully connected layer, uses the softmax function to achieve classification, and optimizes the prediction process through the cross entropy loss function.

[0031] More preferably, the joint feature representation VF of the video modality is:

[0032]

[0033] Among them, A(x) is the dimensional adaptation function of the input feature x, is the i-th video sample;

[0034] The joint feature representation SF of the audio modality is:

[0035]

[0036] in, It is the audio MFCC feature after 2-layer LSTM coding learning. is the spectrogram feature corresponding to the original audio data, The audio features are processed by wav2vec2.0 and 2-layer LSTM joint encoder;

[0037] The joint feature representation TF of the text modality uses the negative log-likelihood function L Text Make optimizations.

[0038] More preferably, the fused network comprises:

[0039] TRANSFORMER QKV fusion, the text feature TF is used as the query Q input of the two transformer modules, and the sound and visual features SF and VF are used as the key K and value V input; SF and VF are repeatedly used as K and V inputs in the attention mechanism. The attention mechanism calculates the dot product between the K vector and the Q vector, assigns weights to different features, and passes the input through the two transformer encoders to obtain the output feature map representing the fusion of text-sound and text-visual modalities. The dimensions of the acoustic feature input of the left encoder and the text feature input of the right encoder are expanded to SF′∈R respectively. 768 and TF′∈R 2048 , and filled the features with zeros;

[0040] Three-layer Transformer, using three Transformer encoders to encode the joint multi-features of each modality;

[0041] The two-layer Transformer is used as a control group to verify the effectiveness of the fusion structure;

[0042] Layered fusion, the dimensions of multiple features are SF∈R 512 ,TF∈R 768 ,VF∈R 2048 .

[0043] In a second aspect, an embodiment of the present invention provides an emotion recognition system based on multimodal fusion, comprising:

[0044] The data module obtains data from two or more modalities, preprocesses and extracts features from the data, and then divides the data into training sets and test sets;

[0045] The recognition module uses the training set to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and inputs the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

[0046] In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned emotion recognition method based on multimodal fusion when executing the computer program.

[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned emotion recognition method based on multimodal fusion.

[0048] Compared with the prior art, the present invention has at least the following beneficial effects:

[0049] The present invention is a method for emotion recognition based on multimodal fusion. First, a multi-feature extraction parallel interactive network is designed for visual and acoustic modalities. With the independent loss function of each modality, the feature is fully extracted and optimized to mine richer information in the single modal data; then it is sent to the fusion network for further calculation; secondly, the cross-modal fusion module. Considering that the text modality is the most important part of the three modalities, the model adopts a "pyramid" network structure. On the basis of the extraction and enhancement of the three modal features of vision, audio, and text, the other modalities are first fused with the text modality, namely, vision and text and acoustics and text. In addition, the model of the present invention also introduces the BERT feature encoding structure based on the word attention mechanism to better transmit the emotion representation corresponding to the text information to the main network, thereby improving the utilization efficiency of the text information. During the evaluation, a series of experiments were conducted to verify the effect and performance of the model, and experiments and verification were conducted using two commonly used data sets MELD and IEMOCAP in the multimodal field. The experimental results show that the method of the present invention has a certain improvement in performance compared with the selected benchmark model, and the model has great advantages in generalization on other unforeseen data sets. By comparing with other existing methods, the method of the present invention has a smaller number of parameters and scale, and has the unique advantages of low cost and fast training during training; the effectiveness of the multi-feature extraction optimization mechanism is further verified through ablation experiments.

[0050] Furthermore, a spectrogram is a visual representation of the frequency spectrum of a signal over time. When applied to audio signals, spectrograms are also called sonographs, voiceprints or voicegrams. The present invention converts a one-dimensional time domain audio signal into a two-dimensional time domain and frequency domain signal by short-time Fourier transform, and further extracts features using a 2-layer LSTM network;

[0051] When obtaining the MFCC features of audio, the audio signal is first pre-emphasized to reduce the impact of high-frequency attenuation on subsequent analysis; the audio signal is then divided into frames of short time periods, and a window function, usually a Hamming window or a Hanning window, is applied to each frame to reduce spectral leakage. The windowed signal of each frame is then subjected to a fast Fourier transform (FFT) to convert the signal to the frequency domain, and the power spectrum of each frame is calculated. Subsequently, a set of triangular filters are evenly distributed on the Mel frequency scale, and the power spectrum is mapped to the Mel frequency domain. The logarithm of the energy of each filter group is taken, and then the discrete cosine transform (DCT) is applied to obtain the MFCC coefficients of each filter group; finally, usually only the first few MFCC coefficients are retained, and the rest are discarded in order to reduce the dimensionality while retaining important frequency information. The MFCC features obtained in this way are often used in tasks such as speech recognition, speech synthesis, and speaker recognition to help the model better understand and process audio signals;

[0052] The present invention uses a pre-trained wav2vec2.0 model to process audio, and adds an LSTM to further extract deep wav2vec representation embedding, and finally obtains Wav2vec2.0 features;

[0053] Each conversation video is segmented by frame; in order to reduce the influence of irrelevant visual cues and focus on facial expressions as the main source of emotional information, a pre-trained Resnet-based model is used for face detection and cropping. This is often overlooked in previous studies, resulting in the introduction of noticeable noise in the image background. Subsequently, two networks are used for feature extraction: RetinaFace and VGGFace2; they are two state-of-the-art models for facial feature extraction and real-world facial information modeling, and have achieved good results in emotion recognition. The joint feature representation is obtained by concatenating the output features of the two networks; in order to make the output features of RetinaFace compatible with VGGFace2, the output feature dimension of the RetinaFace network is reshaped to 1024 using an adapter. The output feature dimension of VGGFace2 is also 1024, and after splicing, 2048-dimensional image features are obtained.

[0054] Furthermore, it is relatively easy to extract sentiment information from text because sentiment information is concentrated in specific words, such as "haha", while other words such as "I" and "today" generally do not contain sentiment information. BERT and its variant models have achieved outstanding results in text feature extraction; therefore, the present invention uses a word-level attention mechanism to pre-train the BERT model. When calculating the feature vector of the entire sentence during the fine-tuning process, the word-level attention mechanism can add attention weights to each word in the current sentence; this process increases the corresponding weights of words with richer sentiment information, allowing the model to pay more attention to those emotional words. This feature extraction method that emphasizes sentiment can extract richer sentiment features.

[0055] Furthermore, after being optimized by the multimodal data integration module, multi-feature extraction and parallel interaction module, the dimension of the joint representation of multiple features is much larger than the dimension of a single feature. In addition, due to the diversity of feature sources, the difficulty of feature learning and fusion also increases; therefore, the present invention designs a unique cross-modal information fusion module to solve this problem; please note that the method of the present invention does not introduce multiple channels of text modality. This decision was made to fully utilize the unique advantages of text modality in emotion recognition. By utilizing simpler and more recognizable text features, it is possible to guide the learning of other modalities and extract more effective potential representations from visual and acoustic modalities with more complex and richer emotional information; in addition, by using the multi-head mechanism of Transformer, it is ensured that the model learns sufficient complementary information between different modalities.

[0056] The present invention designs two fusion networks, such as Figure 2 (a) and Figure 2 As shown in (b), referring to other fusion strategies, additional comparison structures are set, such as Figure 2 (c) and Figure 2 (d) is shown to highlight the advantage of the fusion strategy.

[0057] Furthermore, considering the importance of text modality, in order to alleviate this problem, the present invention proposes a new end-to-end network, which is more efficient in utilizing text modality, can perform fusion operations on multimodal representations, and extract and encode features through multiple sequence encoders. By introducing a text auxiliary network, the main network is helped to obtain more effective information and reduce the impact of noise and harmful information. Due to the known information imbalance between modalities, the model uses two pairs of modality pairs as input. The attention mechanism in the Transformer architecture is used to further improve the final output.

[0058] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0059] In summary, the present invention improves the overall performance of emotion recognition under mixed speech, text, and image data; at the same time, it explores and provides solutions to overcome the problems of weak model generalization ability, large model scale, and modality imbalance. It can provide a reference for subsequent technical research and technical application in related fields.

[0060] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 It is the model structure diagram;

[0062] Figure 2 Figure 2 is a cross-modal information fusion layer diagram, where (a) is TRANSFORMER QKV fusion, (b) is a three-layer Transformer, (c) is a two-layer Transformer, and (d) is a layered fusion;

[0063] Figure 3 is the dimension of the original data;

[0064] Figure 4 for the data alignment process;

[0065] Figure 5 Process the generated files for the dataset;

[0066] Figure 6It is the output of the model feature extraction and preprocessing process;

[0067] Figure 7 The following are the train loss graphs, where (a) is 120 epochs and (b) is 100 epochs.

[0068] Figure 8 The accuracy change diagram of the training set, where (a) is 120 epochs and (b) is 100 epochs;

[0069] Fig. 9 A schematic diagram of a computer device provided by an embodiment of the present invention;

[0070] Fig.10 The block diagram of a chip provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0071] 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 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.

[0072] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0073] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0074] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.

[0075] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0076] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0077] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0078] The present invention provides an emotion recognition method based on multimodal fusion, which adopts a multi-feature encoder structure and an auxiliary fusion network structure of text modality. Firstly, a variety of feature encoders with large differences can fully obtain deeper emotion information in a single modality. Secondly, the auxiliary fusion network of the text modality can ensure that the information of the text modality is transmitted back to the main network through the back propagation process of the loss function; the fusion part of the main network is realized through a cross-modal attention mechanism, which can well learn the synchronization relationship and correlation between the modalities.

[0079] Inspired by multimodal feature extraction, in a single modality, the emotional information contained in the features obtained by different feature extractors covers a more comprehensive angle. However, the models in existing research do not pay much attention to the effective use of existing single-modal information and features, nor do they pay enough attention to the role of effective multi-angle single-modal feature extraction in mining the rich emotional information implicit in multimodal features. The performance of the model still has room for improvement. Multimodal fusion can achieve higher performance than single modality. Inspired by the extraction and interaction process of different modal information in multimodal tasks, it can be concluded that in a certain modality, using different feature extractors to obtain multiple features and achieve appropriate interaction can obtain richer emotional information than limited single features.

[0080] In addition, the relationship between the three modalities is not equal. According to existing experience, the text modality is the most important part of the three modalities. Previous models such as Mult put the three modalities in an equal state during the feature fusion stage, but ignored the importance of the text modality.

[0081] The present invention provides an emotion recognition method based on multimodal fusion, comprising the following steps:

[0082] S1. Data preprocessing

[0083] The multimodal sentiment analysis task is mainly aimed at input data of two or more modes, such as text information, audio content and video images, etc. After preprocessing and feature extraction of these raw data, the initial coding features are obtained, and these initial coding features are sent to the feature fusion module for further processing to obtain deep high-dimensional representation vectors. The deep high-dimensional representation vectors are then input into the prediction layer to obtain the final sentiment prediction results.

[0084] Specifically speaking of the dataset, given a short video clip, the video clip corresponds to a sentence. The task to be done is to predict its emotional tendency based on the image, audio and corresponding text in the video clip. The prediction task is essentially a classification task. The IEMOCAP dataset and the MELD dataset correspond to 6-classification and 7-classification tasks respectively. The modal data in the dataset has been pre-processed before being sent to the fusion layer. The specific processing method will be introduced below.

[0085] Audio data processing, the official SDK of some data sets provides audio data processed by COVAREP and Opensmile. COVAREP can extract audio features such as fundamental frequency, vocal tract model, vocal cord closure rate, vocal cord vibration parameters, harmonic noise ratio, phase distortion, etc., while Opensmile is an open source audio feature extraction and classification tool that can process speech and music signals, and is particularly suitable for automatic emotion recognition in emotional computing. Opensmile can also extract audio features, and can extract features from audio to obtain features such as MFCC, LPC, frame energy, etc. In addition, Wav2vec2.0 also provides a feature extraction solution for raw audio. The features obtained by this extractor have excellent recognition and prediction effects. This method extracts acoustic spectrogram, MFCC and Wav2vec2.0 features.

[0086] Visual data processing includes two submodules, VGGFace2 and RetinaFace, which perform feature extraction to obtain feature vectors. VGGFace2 is an analysis toolkit based on the VGG architecture, which is used to extract facial feature information. RetinaFace is an open source facial behavior analysis toolkit that can perform several complex facial analysis tasks, including facial landmark detection, eye-to-eye estimation, head posture prediction, and facial action unit recognition. It can process video, static images, and real-time camera input, and can recognize multiple faces, light changes, and interference conditions. For the images in the dataset, this method uses frame processing, using VGGFace2 and RetinaFace to better extract facial feature information. The final extracted result vector is interactively merged through the adapter to form an image feature with a length of 2048.

[0087] Text data processing, in order to facilitate the use of Word2vec, glove or BERT for feature extraction, select the preprocessed data set file for processing. Word2vec is a method for learning word vectors. It can capture the semantic and grammatical information of words from a large amount of text data and represent the words as a vector of fixed length. Word2vec has two main model structures, CBOW and Skip-gram. The CBOW model predicts the central word based on the context words, while the Skip-gram model predicts the context words based on the central word. Word2vec also uses some optimization techniques, such as negative sampling and hierarchical softmax, to improve training efficiency and accuracy. The advantages of Word2vec are simplicity, efficiency, and easy expansion. The disadvantages are that it ignores word order and global information, and has difficulty in dealing with problems such as polysemous words and new words.

[0088] BERT is a pre-trained language model that uses a bidirectional Transformer encoder. It is a natural language processing technology based on deep learning and was released by Google in October 2018. The innovation of BERT lies in the use of pre-training methods and the use of MLM and NSP methods to capture word and sentence level representations respectively. BERT is one of the most commonly used text modality feature extraction models, and it has achieved very good results in many downstream tasks, such as question answering, text classification, named entity recognition, etc. This method uses an improved BERT pre-training model based on word attention to complete the text feature extraction process.

[0089] Next is the data alignment process, which aligns the other modal domains of the data set to the text domain using an average function. Then align to the label domain. Since P2FA is more commonly used, the present invention also chooses it to align visual and acoustic signals to text. P2FA is a tool for automatically annotating voice files, which can generate time alignment information containing phonemes, words, or states based on the voice and the corresponding text. P2FA is implemented based on the acoustic model and algorithm of HTK, and HTK and SOX need to be installed before it can be used. P2FA can process voice files in different languages ​​​​such as English and Chinese, which is convenient for subsequent voice analysis and processing.

[0090] After that, the data is divided. The training set can be divided by the default division method in the official data set. Similarly, the development set and test set can also be divided. Then, the three modes of video, audio and text of each data are standardized, the mean is subtracted and then divided by the variance to facilitate subsequent processing.

[0091] At the same time, for text data, the word2id dictionary is loaded into the pre-trained BERT embedding, so as to facilitate subsequent processing through the BERT dictionary. Finally, the dataloader is built to complete the data set setting and set the collection function. In the process, pay attention to filling the data of the three modes so that the feature dimensions within the mode are consistent.

[0092] S2. Build the overall architecture of the network model

[0093] Introduce the model structure and define the problem. The goal of the task is to determine the emotional tendency of a given multimodal data, including images, text, and audio.

[0094] The overall architecture of the model proposed in this invention includes the following four parts:

[0095] (1) Multimodal data integration module;

[0096] In the process of processing multimodal data, because the original input data structure is quite different, such as the difference between text and image data, the original data is not convenient for subsequent cross-modal attention calculation, so it needs to be processed by a multimodal data integration module. It has the following two main functions. First, the relatively mature data preprocessing methods or feature extractors in each modality can be used to obtain reliable and information-rich high-dimensional vectors. Secondly, the feature vectors of each modality can be shaped through sequence encoders and adapters to obtain a shape that is easy to process, which facilitates the subsequent feature fusion steps.

[0097] (2) Multi-feature extraction and parallel interaction module;

[0098] Multiple features in a single modality contain more comprehensive sentiment information, providing a basis for more effective learning of the mapping between sentiment information and labels. Its multi-domain characteristics also enhance its potential for better generalization. In a single modality, select extractors whose methods are widely used and have significant differences from other methods in the same modality. In order to better learn modality-related knowledge, choose to use a modality-specific loss function to optimize the joint representation of multiple features.

[0099] See also Figure 1 ,Except for the text modality, the model uses a variety of feature extractors in other modalities. The sequence encoder selects CNN, Transformer or LSTM structure when used. In the video modality, VGGFace2 and Retinaface are used to obtain facial features. The audio modality uses MFCC method, Spectrum method and Wav2vec2.0 as feature extractors, while the text modality uses the improved pre-trained BERT model focusing on emotional keywords.

[0100] The reasons for choosing BERT instead of using Transformer directly in the first place are as follows. The encoder part of Transformer is very similar to BERT, but the decoder part is used for tasks such as machine translation or text generation, and its output is also a sequence. BERT is bidirectional, while Transformer is unidirectional. This means that BERT can process the input text from left to right and from right to left, capturing the context from both sides of a word. On the other hand, Transformer can only process the input text from left to right (or right to left). The most important point is that BERT is pre-trained on a large text corpus using two tasks, MLM and NSP. This enables BERT to learn general language representations that can be fine-tuned for specific tasks with minimal data and effort. Transformer is not pre-trained for any specific task, but is trained from scratch for each task, which requires a lot of computing power and data.

[0101] Secondly, the reason for not choosing word2vec and GloVe is that the main advantage of BERT is that it can produce contextualized word embeddings, which means that the same word can have different embeddings depending on the surrounding words in the sentence. This allows BERT to capture the phenomenon of polysemous words, or words with multiple meanings. Secondly, Word2vec and GloVe produce static word embeddings, which means that each word has only one fixed embedding and ignores contextual information. When dealing with polysemous words, the expressive power will decrease. Another advantage of BERT is that it is based on the Transformer architecture and uses an attention mechanism to learn the relationship between words and sentences. This makes BERT more powerful and expressive than word2vec and GloVe, which are based on simpler models with limited expressive power.

[0102] This method innovatively adds a word vector attention mechanism to the BERT pre-training model. Through the fine-tuning process, the feature extraction module of the text modality pays more attention to emotional keywords that contain more potential emotional information and extracts more emotional information.

[0103] It is relatively easier to extract sentiment information from text because sentiment information is concentrated in specific words, while words like I and today usually do not contain such information. BERT and its variants have achieved outstanding results in text feature extraction. Therefore, the word-level attention mechanism is applied to the pre-trained BERT model. Fine-tune the pre-trained BERT model. During the fine-tuning process, attention weights are added to each word in the current sentence to calculate the feature vector of the entire sentence. During the fine-tuning process, when calculating the feature vector of the entire sentence, attention weights are added to each word in the current sentence, so that the feature extraction module of the text modality can pay more attention to these emotional words and extract richer sentiment features. The obtained text feature is TF, which is composed of the negative log-likelihood function L in BERT. Text Make optimizations.

[0104] Each conversation video is segmented frame by frame. In order to reduce the influence of irrelevant visual cues and focus on facial expressions as the main source of emotional information, a pre-trained model based on Resnet is used for face detection and cropping. Previous studies often ignored this point, resulting in the introduction of a lot of noise in the image background. Subsequently, two networks are used for feature extraction: RetinaFace and VGGFace2. They are two of the most advanced facial feature extraction and real-world facial information modeling models, and have achieved good results in emotion recognition. The joint feature representation VF is formed by connecting the output features of the two networks. In order to make the output features of RetinaFace compatible with VGGFace2, an adapter is used to reshape the output feature dimension of the RetinaFace network to 1024. Then, the basic modal cross entropy loss is used to optimize the joint feature representation. VF is expressed as:

[0105]

[0106] Here, A(x) represents the dimensional adaptation function of the input feature x. The sentiment prediction result is defined as The loss function of the visual modality is L Visual .

[0107] In this module, a conversation is divided into multiple segments, and the speech processing module is used to extract the MFCC features of the corresponding audio segments. Spectrum features and the original audio wave In order to extract rich emotional information from different acoustic features and make full use of feature complementarity, different types of networks are used to encode various features.

[0108] Specifically, a two-layer bidirectional LSTM network is used to encode the MFCC features, and a VGG16 structure network is used to encode the spectrogram features because the spectrogram has image-like properties. For the original audio wave, a pre-trained 960h-wav2vec2.0-based model is used, which performs well in speech feature encoding. The obtained feature representation is

[0109] To further enhance the representation capability of wav2vec2 features, a 2-layer bidirectional LSTM is appended after a linear layer. After dimensioning the adapter, the joint speech feature SF is obtained, which is then optimized using the cross entropy loss.

[0110] Mathematically, SF is expressed as:

[0111]

[0112] The sentiment prediction result is defined as The loss function is L Acoustic express.

[0113] (3) Cross-modal information fusion module;

[0114] In the multimodal field, the first problem is how to fuse multiple different modalities so that the emotional information of these modalities can be better learned through the fusion process. The second problem is that the text modality is more important and accurate than the visual modality and the audio modality, but this problem is not considered in the existing model, which adopts a ternary symmetric structure and treats all modalities equally. Considering the particularity and importance of the text modality, the text modality is chosen as the core during fusion, and two cross-modal Transformer modules, text and vision and text and acoustic, are selected for operation, which can better improve the prediction performance of the model.

[0115] The dimension of the optimized joint representation of multiple features is much larger than that of a single feature. In addition, due to the diversity of feature sources, the difficulty of feature learning and fusion is also increased. Please note that the method of the present invention does not introduce multiple features in the text mode. This decision is made to fully utilize the unique advantages of the text mode in emotion recognition. By utilizing simpler and more recognizable text features, it is possible to guide the learning of other modalities and extract more effective potential representations from other modalities, which are richer in emotional information. In addition, by using the multi-head attention mechanism of Transformer, it is ensured that the model learns sufficient correlations between different modalities. Two fusion networks are designed, such as Figure 2 (a) and Figure 2 (b) As shown. Based on other fusion strategies, additional comparison structures are set up, such as Figure 2 (c) and Figure 2 (d) shows the advantages of the fusion strategy.

[0116] A unified training process is adopted, and weighted parameters α, β, γ are used to alleviate the imbalance between different modalities. They are temporarily initialized to equivalent values. The fusion module uses L Fu To measure the difference between the predicted result and the true value.

[0117] The converged network includes:

[0118] 1TRANSFORMER QKV Fusion

[0119] One of the main features of Transformer is its ability to use a multi-head attention mechanism, which enables the model to focus on multiple parts of the input at the same time and capture more complex relationships in the data, thus being successfully applied to various tasks such as machine translation and sentiment analysis. The multi-head attention mechanism allows features from different modalities to be used as separate inputs, thereby achieving modal fusion. To guide the learning process, the text feature TF is used as the query (Q) input of the two transformer modules, while the sound and visual features SF and VF are used as the key (K) and value (V) inputs. SF and VF are repeatedly used as K and V inputs in the attention mechanism, which helps the model learn the mapping relationship between features and labels more comprehensively. The attention mechanism calculates the dot product between the K vector and the Q vector to assign weights to different features. In this way, the model can pay more attention to the intra-modal correlations between different features, thereby fusing sentiment information more effectively and robustly. After passing the input through the two transformer encoders, the output feature maps representing the fusion of text-sound and text-visual modalities are obtained. As shown in the attached figure, the text feature TF is used as the query (Q) input of the two transformer modules, while the sound and visual features SF and VF are used as the key (K) and value (V) inputs. Figure 2 (a) shown.

[0120] It is worth noting that in order to ensure the compatibility between the input features, the dimensions of the acoustic feature input of the left encoder and the text feature input of the right encoder are expanded to SF′∈R 768 and TF′∈R 2048 , and the features are filled with zeros.

[0121] 2 Three-layer Transformer

[0122] Considering the complexity brought by multiple joint features in a single modality, we attempt to enhance the network's encoding ability for complex feature distributions and strengthen cross-domain interactions.

[0123] To this end, a three-layer fusion structure with stronger modeling and learning capabilities is proposed based on Transformer. Figure 2 (b) In order to capture more detailed multi-feature distribution, three Transformer encoders are used to encode the joint multi-features from each modality. The different modal features are gradually merged after being processed by two layers of transformers. The concatenation method is used to preserve the original sentiment information as much as possible. In addition, feature complexity and noise are alleviated by selecting a larger and more powerful network. It is worth noting that there is no need to expand the dimension of the input features.

[0124] 3. Two-layer Transformer

[0125] This network is mainly used as a control group to verify the effectiveness of the fusion structure. Figure 2The two-layer transformer structure in (c) replaces the Q, K, and V inputs with a single input consisting of the concatenation of features from the corresponding modalities (audio and text, vision and text). However, its scale and learning ability are far inferior to those of the Figure 2 (b) The three-layer transformer.

[0126] 4 Layered Fusion

[0127] The differences between modalities are not balanced because each modality has unique inherent characteristics, such as the form and distribution of signal data. However, some modalities (such as acoustic and visual modalities) have similar characteristics, including data form, processing methods, and temporality, so it is more natural and effective to fuse them together. Therefore, a fusion network is constructed. The dimensions of the multiple features are SF∈R 512 ,TF∈R 768 ,VF∈R 2048 .

[0128] (4) Prediction module.

[0129] The loss function L of the entire model is defined as follows:

[0130] L=αL Visual +βL Acoustic +γL Text +L Fu

[0131] Among them, L Visual , L Acoustic and L Fu The form of the cross entropy loss function is

[0132] In yet another embodiment of the present invention, a system for designing an emotion recognition model based on multimodal fusion is provided. The system can be used to implement the above-mentioned emotion recognition method based on multimodal fusion. Specifically, the system for designing an emotion recognition model based on multimodal fusion includes a data module and a recognition module.

[0133] Among them, the data module obtains data of two or more modes, preprocesses and extracts features of the data, and then divides the data into training sets and test sets;

[0134] The recognition module uses the training set to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and inputs the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

[0135] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the emotion recognition method based on multimodal fusion, including:

[0136] Acquire data from two or more modes, preprocess and extract features from the data, and then divide the data into a training set and a test set; use the training set to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and input the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

[0137] See also Fig. 9 , the terminal device is a computer device. The computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the fluid composition in the reservoir transformation wellbore in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the emotion recognition model design system based on multimodal fusion in the embodiment are implemented. To avoid repetition, it is not described one by one here.

[0138] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Fig. 9This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.

[0139] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0140] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.

[0141] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.

[0142] See also Fig.10 , the terminal device is a chip, and the chip 600 of this embodiment includes a processor 622, which may be one or more, and a memory 632 for storing a computer program executable by the processor 622. The computer program stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 622 may be configured to execute the computer program to perform the above-mentioned emotion recognition method based on multimodal fusion.

[0143] In addition, the chip 600 may further include a power supply component 626 and a communication component 650, wherein the power supply component 626 may be configured to perform power management of the chip 600, and the communication component 650 may be configured to implement communication, for example, wired or wireless communication, of the chip 600. In addition, the chip 600 may further include an input / output (I / O) interface 658. The chip 600 may operate based on an operating system stored in the memory 632.

[0144] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.

[0145] The processor may load and execute one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the emotion recognition method based on multimodal fusion in the above embodiment; the processor may load and execute the following steps:

[0146] Acquire data from two or more modes, preprocess and extract features from the data, and then divide the data into a training set and a test set; use the training set to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and input the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

[0147] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0148] Experiments were conducted on benchmark multimodal datasets for ER tasks: MELD and IEMOCAP. MELD poses a great challenge for emotion recognition due to its real-life scenarios, which include 7 emotions: neutral, joy, sadness, anger, surprise, fear, and disgust. The training set, development set, and test set of MELD consist of 9980, 1109, and 2610 samples, respectively.

[0149] IEMOCAP has 9 emotion types: excitement, happiness, anger, sadness, frustration, neutral, fear, surprise, and other states. The training set, development set, and test set of IEMOCAP contain 4830, 980, and 1623 sets of samples, respectively. In order to comprehensively analyze the performance of the method, accuracy, Micro-F1, and weighted F1 are used as evaluation indicators, and imbalanced label classification is considered.

[0150] First, experiments were conducted on a single modality without the fusion module. Subsequently, the entire model was evaluated using the proposed fusion method. The number of layers of each Transformer encoder was normalized to 3. In addition, an ablation study was performed to examine the impact of multi-feature extraction. Finally, cross-validation experiments were performed on two datasets to evaluate the generalizability of MMFER. The three-layer Transformer fusion model and Transformer QKV fusion model were pre-trained for 100 epochs on MELD or IEMOCAP, and their performance was subsequently evaluated on the other dataset. As a control group, the other two fusion networks were used with a single feature as input.

[0151] (I) Experimental results and analysis

[0152] The experimental results on MELD and IEMOCAP are listed in Tables 1 and 2, respectively. On the same dataset, the performance of our model is compared with various baseline models for unimodal, bimodal, and multimodal emotion recognition.

[0153] Table 1

[0154]

[0155] Table 2

[0156]

[0157] The performance of different fusion networks is consistent on both datasets. The performance of the hierarchical fusion model is poor. Although the fusion network adopts a hierarchical strategy, its structure is relatively simple and a rigid concatenation method is used, which may be the reason for its poor performance. Therefore, this method is not enough to effectively integrate multiple features. The QKV fusion method achieves significant improvements due to its unique fusion mode, with an increase of 4.25% and 4.39% in accuracy and weighted F1 score respectively compared with the hierarchical fusion method. For the two-layer Transformer, replacing QKV fusion with this fusion method leads to a 1% to 2% decrease in all indicators compared with MMFER-QKV. The results show the adaptability of the QKV fusion mechanism to joint multi-features. MMFER-TRI obtains the highest F1 score, emphasizing the importance of the capacity and learning ability of the fusion network for joint learning of multiple features. It has better robustness on imbalanced datasets.

[0158] Judging from the results of the unimodal experiments, the model of the present invention outperforms the baseline model in multi-feature extraction, as shown in Table 1. In addition, the word-level attention mechanism also improves the performance of the text module, which outperforms most of the same type of baseline models in a single text modality and is close to the best text model. In view of the lack of comparability on the same dataset, no comparison was made on the visual modality. As far as the entire model is concerned, the framework of obtained the best weighted F1 and micro F1 scores on MELD, and the accuracy is basically equivalent to the SOTA results of M2FNet. On IEMOCAP, the model of also achieved competitive baseline performance. Compared with models such as M2FNet, the model of the present invention is smaller in scale and has fewer parameters. The experimental data on IEMOCAP are shown in Table 2.

[0159] (II) Ablation experiment

[0160] The present invention conducts an ablation study on each component of the model on the MELD dataset to evaluate the impact of the multi-channel method on the model performance. Specifically, the present invention only extracts the VGGFace2 features of the visual modality and the Wav2vec2 features of the acoustic modality for fusion. As shown in Table 3, the multi-channel feature enhancement method of the present invention contributes to the improvement of model performance on several fusion structures of HF, BI, QKV and TRI. The use of a single feature will lead to a decrease in the performance of each fusion network. The weighted F1 score of the three-layer fusion network has the largest decrease, reaching 6.8%, which is worse than the two-layer fusion. Considering the high complexity of the three-layer fusion network and the difficulty of effectively modeling a single feature, this reduction may be attributed to overfitting.

[0161] Table 3

[0162]

[0163] When the three-layer Transformer fusion and Transformer QKV fusion pretrained on MELD were ported to IEMOCAP, the performance of both models dropped rapidly, by 11.68% and 17.19%, respectively. These results show that the generalization ability of the model is proportional to its learning ability and the size of the model. In the control group, the model was pretrained only on the MELD dataset, which is the same as the ablation study. During the cross-validation process, a significant drop in the performance of the single feature combination model for QKV fusion and three-layer fusion was observed, by 20.37% and 19.05%, respectively. The drop is much larger than that observed in the proposed multi-feature learning MMFER scenario, which proves that multi-features have excellent generalization capabilities beyond the boundaries of the training dataset. The results are shown in Table 4.

[0164] Table 4

[0165]

[0166] The reason why the proposed method has excellent generalization ability is mainly because it utilizes multiple features, which can more comprehensively capture the potential emotional content inherent in a specific modality. The method effectively retains different aspects of emotional features, thereby increasing the amount of emotional information. This in turn helps to better learn the mapping related to the modality. In addition, the fusion network plays an important auxiliary role in enhancing the generalization ability of the model.

[0167] The running results during the experiment are shown as follows:

[0168] (1) The dimensions of the original data are as follows: Figure 3 As shown, the initial data formats of the three modalities of the dataset;

[0169] (2) Data alignment process: The alignment process is performed for each video vid, such as Figure 4 As shown;

[0170] (3) The pkl file and embedding generated by the data set processing, here we use the Bert dictionary, and generate the following four files, such as Figure 5 As shown;

[0171] (4) The output of the model feature extraction and preprocessing process is as follows Figure 6 shown.

[0172] The first is the feature vector of feature extraction, such as Figure 6 As shown in the figure, taking the text domain [46,24,40] as an example, 24 is the batchsize, 46 is the maximum text length, that is, the length of the longest text in this batch, and 40 is the hidden dimension, which is a hyperparameter; then the result of masked average pooling is obtained, and the dimension is Batch size*Emb dim.

[0173] Table 5

[0174] Hyperparameters value Learning rate 1e-4 Optimizer Adam Optimizer batch size 24 N layers 3 num_heads 5 attn_hidden_size 40 epochs 200

[0175] After training for 100 to 120 epochs, we get Figure 7 ,from Figure 7 The experimental parameter settings are shown in Table 5. Figure 8 The accuracy of the model changes during the training process, where (a) is the accuracy change of each epoch in 120 epochs, and (b) is the accuracy change of each epoch in 100 epochs. The accuracy increases with the increase of epochs, reaches the optimal value around the 60th epoch and tends to be stable.

[0176] The multi-channel feature enhancement fusion sentiment analysis model was experimented on the MELD and IEMOCAP datasets. The experimental results verified that the multi-channel feature enhancement fusion sentiment analysis model has excellent performance. The seven-category accuracy index reached 66.98%, and the six-category accuracy index reached 70.87%, surpassing the existing benchmark model.

[0177] In summary, the present invention provides an emotion recognition method, system, device and medium based on multimodal fusion, which improves the emotion recognition performance under mixed data of speech, text and image. At the same time, it explores and provides solutions to overcome the problems of weak model generalization ability, large model scale and modality imbalance. It can provide reference for subsequent technical research and technical application in related fields.

[0178] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0179] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0180] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0181] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0184] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0185] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0186] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0188] The above contents are only for explaining the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.

Claims

1. A method for emotion recognition based on multimodal fusion, characterized in that: The following steps are involved: Obtain data from two or more modalities, preprocess and extract features from the data, and then divide the data into training and test sets; The training set is used to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and the test set is input into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

2. The emotion recognition method based on multimodal fusion according to claim 1 is characterized in that: Data from two or more modalities includes audio data, visual data, and text data. The spectrogram, MFCC, and Wav2vec2.0 features of the audio data are extracted, and the facial feature information of the visual data is extracted to obtain image features of length 2048. The improved BERT pre-training model based on word attention is used to extract features from the text data. The data is then aligned using P2FA so that the other modal domains of the dataset are aligned to the text domain and then to the label domain. Finally, the dataset is divided.

3. The emotion recognition method based on multimodal fusion according to claim 2 is characterized in that: in, COVAREP and Opensmile are used to extract audio data, and VGGFace2 and RetinaFace are used to extract visual data.

4. The emotion recognition method based on multimodal fusion according to claim 2, characterized in that: The improved BERT pre-training model based on word attention uses the encoder of the bidirectional Transformer and loads the word2id dictionary.

5. The emotion recognition method based on multimodal fusion according to claim 1 is characterized in that: The multi-channel feature enhancement fusion sentiment analysis network model includes: The multimodal data integration module uses the data preprocessing method or feature extractor in each modality to obtain high-dimensional vectors, and reshapes the feature vectors of each modality through sequence encoders and adapters; Multi-feature extraction and parallel interaction module: VGGFace2 and Retinaface are used to obtain facial features in the video modality; MFCC method, Spectrum method and Wav2vec2.0 are used as feature extractors in the audio modality; and an improved pre-trained BERT model focusing on emotional keywords is used in the text modality. The basic modality cross-entropy loss is used to optimize the joint feature representation; The cross-modal information fusion module takes the text modality as the core when fusing the network, and selects two cross-modal Transformer modules: text-to-vision and text-to-acoustic. The prediction module further transforms the fusion features, adjusts the feature map using the fully connected layer, uses the softmax function to achieve classification, and optimizes the prediction process through the cross entropy loss function.

6. The emotion recognition method based on multimodal fusion according to claim 5 is characterized in that: The joint feature representation VF of the video modality is: Among them, A(x) is the dimensional adaptation function of the input feature x, is the i-th video sample; The joint feature representation SF of the audio modality is: in, It is the audio MFCC feature after 2-layer LSTM coding learning. is the spectrogram feature corresponding to the original audio data, The audio features are processed by wav2vec2.0 and a 2-layer LSTM joint encoder; The joint feature representation TF of the text modality uses the negative log-likelihood function L Text Optimize.

7. The emotion recognition method based on multimodal fusion according to claim 5, characterized in that: The converged network includes: TRANSFORMER QKV fusion, the text feature TF is used as the query Q input of the two transformer modules, and the sound and visual features SF and VF are used as the key K and value V input; SF and VF are repeatedly used as the K and V inputs in the attention mechanism. The attention mechanism calculates the dot product between the K vector and the Q vector, assigns weights to different features, and passes the input through the two transformer encoders to obtain the output feature map representing the fusion of text-sound and text-visual modalities. The dimensions of the acoustic feature input of the left encoder and the text feature input of the right encoder are expanded to SF′∈R 768 and TF′∈R 2048 , and filled the features with zeros; Three-layer Transformer, which uses three Transformer encoders to encode the joint multiple features of each modality; The two-layer Transformer is used as a control group to verify the effectiveness of the fusion structure; Layered fusion, the dimensions of multiple features are SF∈R 512 ,TF∈R 768 ,VF∈R 2048 .

8. An emotion recognition system based on multimodal fusion, characterized in that: include: The data module obtains data from two or more modalities, preprocesses and extracts features from the data, and then divides the data into training and test sets; The recognition module uses the training set to train the pre-established multi-channel feature enhancement fusion sentiment analysis network model, and inputs the test set into the trained multi-channel feature enhancement fusion sentiment analysis network model to obtain the final sentiment prediction result.

9. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 7.

10. A computing device, characterized in that include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for executing the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-modal emotion recognition method and device and storage medium

    CN116612541A

  • AR (Augmented Reality) interactive emotion recognition method and system based on multi-modal information double fusion

    CN116975602A

  • Multi-modal sentiment analysis method and system fusing image subtitles and BERT

    CN117115516A

Cited By

  • Emotion recognition method, device and equipment based on multi-modal information fusion of fuzzy brain and mixed experts and medium

    CN118861652A

  • Ship trajectory prediction method and system, computer equipment and storage medium

    CN119066373A

  • Smart home equipment control method, device, medium and system

    CN119270668A

  • Psychological condition identification method based on multi-modal data

    CN119337094A

  • Method and device for realizing remote video mediation based on big data

    CN119380248A