A hierarchical multimodal sentiment analysis method based on multi-task learning

Through multi-task learning and hierarchical processing, single-modal features in videos are extracted and a dual-modal multi-task learning framework is constructed, which solves the problem of difficulty in extracting modal interaction information in the existing technology and improves the accuracy and accuracy of sentiment analysis. The adaptability of the model reduces the consumption of computing resources.

CN114973045BActive Publication Date: 2024-09-24SHANGHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110195692.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-22
Publication Date
2024-09-24
Estimated Expiration
2041-02-22

AI Technical Summary

Technical Problem

Existing multi-modal emotion analysis methods are difficult to fully extract the interactive information within and between modalities. Especially in complex video scenes, the model generalization is poor and the time overhead is high.

Method used

A hierarchical multi-modal sentiment analysis method based on multi-task learning is adopted to extract single-modal features by preprocessing the video, and build a dual-modal multi-task learning framework, combined with neural networks for dual-modal feature fusion and classification prediction, using LSTM, BERT and deep neural networks extract deep features of text, audio and video, and perform dual-modal multi-task learning and multi-modal fusion.

Benefits of technology

It improves the generalization of the model and the accuracy of emotion analysis, reduces time overhead and computing resources, is suitable for different video scenarios, and achieves rich bimodal feature extraction and accurate multimodal emotion classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973045B
    Figure CN114973045B
Patent Text Reader

Abstract

The present invention relates to a multimodal sentiment analysis method based on multi-task learning, comprising: preprocessing a video; obtaining unimodal original features from the preprocessed data; further obtaining unimodal deep features from the unimodal original features; constructing a bimodal multi-task learning framework based on a neural network model according to the unimodal deep features; using the values ​​of the hidden layer in the bimodal multi-task learning framework as bimodal features, and saving the bimodal features locally; and performing multimodal fusion and classification prediction on the locally saved bimodal features or the values ​​of the hidden layer in the bimodal multi-task learning framework according to user needs to obtain corresponding sentiment analysis results. Compared with the prior art, the present invention uses modality-level fine-grained annotation information for multi-task learning to fully obtain modality internal information and inter-modality interaction information, and performs hierarchical processing to realize the modularization of the model, thereby reducing the time overhead and computing resources of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a hierarchical multimodal sentiment analysis method based on multi-task learning. Background Art

[0002] Sentiment analysis is a basic task in the field of natural language processing. Traditional sentiment analysis methods are mainly based on text. As people's expressions become more diverse, a large amount of non-static data such as voice and video is generated. These data contain rich emotional information, which can help computers better learn and understand people's psychological states and emotional tendencies. Multimodal sentiment analysis methods are derived from this. At present, sentiment analysis technology based on single modality has been widely studied and applied, such as in intelligent customer service and recommendation systems; sentiment analysis based on multimodal data needs further research. The main difficulties it faces are the extraction of internal information within the modality and the extraction of interactive information between modalities, that is, single-modal feature extraction and multimodal fusion.

[0003] Sentiment analysis of text can be divided into three methods: methods based on sentiment dictionaries, machine learning methods, and deep learning methods. The method based on sentiment dictionaries uses the corresponding dictionary suitable for the data set to classify text. This method relies on manual work, and the classification performance depends on the quality of the dictionary; the method based on machine learning includes the use of some supervised or unsupervised machine learning classification algorithms, such as naive Bayes, support vector machine, decision tree, random forest, etc. These two methods rely on feature engineering to a certain extent, and are inefficient when the amount of data is large, while the method based on deep learning can better apply to situations with large amounts of data. For example, LSTM, CNN, attention mechanism, Transformer, BERT, etc. are widely used in text, and BERT's performance in many natural language processing tasks is also SOTA.

[0004] Sentiment analysis of speech first requires the extraction of speech features, among which spectral features, prosodic features and sound quality features are the most commonly used. There are also some open source libraries that can extract these emotion-related features, such as openSMILE, LibROSA, COVAREP, etc., which mainly perform deep learning on the extracted features by designing neural networks.

[0005] Sentiment analysis for videos not only includes text and speech recognition, but also facial expression recognition. When recognizing facial expressions, the conventional approach is to first extract single-modal features. For facial features, you can use open source libraries such as OpenFace2.0, or neural networks such as 3D-CNN and VGG; then consider how to extract interactive features between modalities. At present, some existing fusion methods are mainly feature layer fusion and decision layer fusion. There are many methods based on feature layer fusion, but they cannot fully extract the interactive information within the modality, while the methods based on late fusion cannot fully extract the interactive information between modalities. Therefore, some researchers have proposed tensor fusion, dynamic memory network, and attention mechanism-based methods, but these methods are limited to simple video scenes. In complex video scenes (such as rainy and snowy weather), the background is chaotic and the modality is missing. The modal data cannot be strictly aligned in time, so it is impossible to fully obtain the interactive information within and between modalities, and the generalization of the model needs to be strengthened. In addition, most of the current multimodal sentiment analysis methods are based on end-to-end models, so that the model is relatively complex, not plastic, and has a large time cost. Summary of the invention

[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a multimodal sentiment analysis method and system based on multi-task learning, so as to fully obtain the internal information of the modalities and the interactive information between the modalities, thereby ensuring the accuracy of the analysis results.

[0007] The purpose of the present invention can be achieved by the following technical solution: A multimodal sentiment analysis method based on multi-task learning, comprising the following steps:

[0008] S1. Preprocess the video: separate the audio from the video and transcribe the audio to obtain the corresponding text, then divide the video into frames, perform face detection and alignment on the video frames;

[0009] S2. Obtain unimodal raw features from preprocessed data: Use the BERT model to obtain sentence vectors from text, and use third-party tools to extract audio and video features;

[0010] S3. Based on the unimodal original features, further obtaining unimodal deep features, wherein the unimodal deep features include text deep features, audio deep features and video deep features;

[0011] S4. According to the single-modal deep features, a dual-modal multi-task learning framework based on the neural network model is constructed;

[0012] S5. Use the value of the hidden layer in the bimodal multi-task learning framework as the bimodal feature, and save the bimodal feature locally;

[0013] S6. According to user needs, the locally saved bimodal features or the values ​​of the hidden layer in the bimodal multi-task learning framework are subjected to multimodal fusion and classification prediction to obtain the corresponding sentiment analysis results.

[0014] Furthermore, the step S3 specifically includes the following steps:

[0015] S31. Based on the sentence vectors, the lengths of all sentences are adjusted to be consistent, so as to obtain sentence representations with uniform lengths.

[0016] The sentences with uniform length are input into LSTM (Long Short-Term Memory) to obtain the deep features of the text that extract the contextual relationship.

[0017] S32, in the feature dimension, averaging all frame vectors of the audio feature to obtain an averaged audio feature;

[0018] The averaged audio features are input into a three-layer deep neural network to obtain the audio deep features;

[0019] S33, in the feature dimension, averaging all frame vectors of the video feature to obtain an averaged video feature;

[0020] The averaged video features are input into a three-layer deep neural network to obtain the deep features of the video.

[0021] Furthermore, the deep features of the text are specifically:

[0022]

[0023] Among them, t i is the deep feature of the text, is a sentence representation of uniform length, W i It is the weight parameter used in the process of text deep feature extraction.

[0024] Furthermore, the audio deep features are specifically:

[0025]

[0026] Among them, a i is the deep audio feature, is the averaged audio feature, W i ' is the weight parameter used in the process of audio deep feature extraction.

[0027] Furthermore, the video deep features are specifically:

[0028]

[0029] Among them, vi is the deep feature of the video, is the averaged video feature, W″ i It is the weight parameter used in the process of extracting deep features of the video.

[0030] Furthermore, the step S4 specifically includes the following steps:

[0031] S41, based on the single-modal deep features, perform two-to-two modal fusions to obtain corresponding dual-modal fusion information;

[0032] S42, input each bimodal fusion information and the corresponding two unimodal deep features into the corresponding three-layer deep neural network, use the unimodal task as the auxiliary task and the bimodal task as the main task, and perform learning and training in combination with the pre-set bimodal annotation information.

[0033] Furthermore, the bimodal fusion information is specifically:

[0034]

[0035] R T ={t1,t2,...,t N}

[0036] R A ={a1,a2,...,a N}

[0037] R V ={v1,v2,...,v N}

[0038] α,β∈{A,V,T}

[0039] γ∈{AV,AT,VT}

[0040] Among them, R T is the deep feature set of the text, R A is the audio deep feature set, R V is the deep feature set of the video, R α and R β are different single-modal deep feature information, R γ is the dual-modal fusion information, A is the audio modality, V is the video modality, T is the text modality, AV is the audio and video fusion modality, AT is the audio and text fusion modality, and VT is the video and text fusion modality.

[0041] Furthermore, the optimization goal of the learning training in step S42 is specifically:

[0042]

[0043]

[0044]

[0045]

[0046] Where N is the number of videos, ω α ,ω β are the hyperparameters of different unimodal task losses, ω γ is the hyperparameter corresponding to the bimodal task loss, are the training loss functions for different unimodal tasks, is the training loss function corresponding to the bimodal task, are the predicted sentiment labels for different unimodal tasks, is the predicted sentiment label corresponding to the bimodal task, y α,i ,y β,i are the true sentiment labels of different unimodal tasks, y γ,i is the true sentiment label corresponding to the bimodal task, C α , C β , C γ Sentiment analysis classifiers are α, β and γ respectively.

[0047] Furthermore, the step S6 specifically includes the following steps:

[0048] S61, fusing all the bimodal features to obtain multimodal fusion features;

[0049] S62: Input the multimodal fusion features into a multimodal sentiment classifier to obtain corresponding sentiment analysis results.

[0050] Furthermore, the sentiment analysis result is specifically:

[0051]

[0052] in, is the sentiment analysis result, C M is a multimodal sentiment classifier, F is a fusion function, H AV is the audio and video dual-modal feature, H AT is the audio and text bimodal feature, H VT It is a dual-modal feature of video and text.

[0053] Compared with the prior art, the present invention has the following advantages:

[0054] 1. The present invention extracts different unimodal features from the video, fuses the different unimodal features in pairs, and combines the corresponding unimodal features for multi-task learning. It can fully extract the interactive information between modalities while obtaining the internal features of the unimodality, thereby improving the generalization of the model. In addition, the use of bimodal granular supervision information makes bimodal sentiment analysis more accurate, thereby obtaining rich bimodal features, which is conducive to improving the accuracy of the subsequent classification prediction results after multimodal fusion.

[0055] 2. The present invention adopts a hierarchical approach, that is, bimodal sentiment analysis is performed first, and then multimodal sentiment analysis. The independent multimodal fusion makes the entire model modular. Combined with the bimodal multi-task learning framework, it can not only effectively reduce time overhead and save computing resources, but also make the model well applicable to different video scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0057] Figure 2 It is a schematic diagram of the model structure of the present invention;

[0058] Figure 3 Schematic diagram of the dual-modal multi-task framework in the present invention. DETAILED DESCRIPTION

[0059] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] Example

[0061] like Figure 1 As shown, a hierarchical multimodal sentiment analysis method based on multi-task learning includes the following steps:

[0062] (1) Preprocess the video data, including separating the audio and transcribing the audio into text; perform face detection and alignment after video framing. Both audio separation and video framing are performed using third-party tools.

[0063] (2) Use open source methods to extract text, audio, and raw facial features from the preprocessed data.

[0064] (3) Deep learning methods are used to further extract text, audio and face deep features from the original features.

[0065] (4) Construct a bimodal multi-task learning framework, which uses fine-grained labels of bimodal granularity and takes two unimodal features and their fused bimodal features as input.

[0066] (5) Extracting and preserving bimodal interaction information from the multi-task learning process, where the bimodal interaction information is specifically the value of the hidden layer in the multi-task learning framework.

[0067] (6) According to user needs, set the data source method for the multimodal fusion stage: one is to directly obtain the information obtained in step (5), and the second is to use the locally stored information.

[0068] (7) The obtained bimodal interaction information is integrated, and the bimodal features are concatenated and fused, and then input into the classifier for sentiment prediction. The fusion and classification stages are a whole, but compared with the previous deep feature extraction and bimodal multi-task learning modules, they are independent processes.

[0069] In this embodiment, let U = {u1,u2,u3...,u N} is a series of video clips, for u i In the unimodal feature extraction stage, the audio in the video is first separated and transcribed to obtain the corresponding text, and then the video is framed and face detected and aligned; BERT is then used to obtain the sentence vector of the text, and audio features and face features are extracted using third-party tools; since the text has a contextual relationship and the audio and video have a temporal relationship, the unimodal original features extracted in the previous step are modeled using a neural network to obtain unimodal deep features;

[0070] In the bimodal multi-task learning stage, the obtained unimodal deep features are used to perform pairwise modal fusion, and then a bimodal multi-task learning framework is constructed, in which the unimodal task is used as an auxiliary task and the bimodal task is used as the main task. In addition, bimodal annotation information is used when training the bimodal task. The bimodal annotation information is the emotional label obtained by combining the actual scenario of the two modalities, that is, three groups of emotional scores are obtained by judging sound and text, sound and facial expression, and facial expression and text respectively. Finally, the value of the hidden layer in the bimodal multi-task learning process is saved as the bimodal feature;

[0071] In the multimodal fusion classification prediction stage, the data source of the prediction layer is first set according to user needs: the value of the hidden layer or the local value in the bimodal multi-task learning process; the obtained bimodal information is fused and then input into the classifier for sentiment prediction.

[0072] like Figure 2As shown, the model architecture diagram of the present invention is divided into three parts: unimodal feature extraction layer, multi-task layer, and multimodal fusion and prediction layer. The model takes the speech segment sequence of the video as input, extracts unimodal features through the feature extraction network, and then enters the multi-task layer to construct three multi-task learning frameworks for sound, video, sound-video, sound, text, sound-text, video, text, and video-text, respectively. Unimodal sentiment analysis is used as an auxiliary task, and bimodal sentiment analysis is used as the main task. After joint learning, high-quality bimodal interaction features are obtained, and then multimodal fusion and sentiment prediction are performed.

[0073] The unimodal feature extraction layer needs to extract text, audio and face features separately. i Take the text feature extraction process as an example: the sentence after BERT is represented as s i Since the number of words in sentences in different videos is different, for sentences that are too short, characters are added to the end of the sentence, and for sentences that are too long, the first L word vectors are taken. Finally, the length of all sentences is L, where L is the sum of the mean of the text sequence length corresponding to all speech segments and a certain multiple of the standard deviation. The new sentence representation s is obtained. i After that, it is input into the LSTM network to obtain the text features with extracted contextual relationships, as shown in formula (1), where W i The weight parameters are trainable. Based on the advantages of BERT, the influence of inaccurate Chinese word segmentation tools on the semantic relationship of sentences is avoided, and LSTM is used to capture the contextual dependencies between word sequences.

[0074]

[0075] Audio feature extraction process: Use LibROSA library to extract audio features represented as f i Since audio is a time frame sequence data, each audio contains a different number of frames. For audio with a shorter frame length, the frame vector is padded. For audio with a longer frame length, the first L' frame vectors are taken to make the frame length of all audios L', where L' is the sum of the mean of the frame sequence length corresponding to all audios and a certain multiple of the standard deviation. In order to reduce the computational dimension, we average all frame vectors in the feature dimension to obtain a new audio feature representation Then input into the three-layer deep neural network to extract deep features a i , as shown in formula (2), where W i ' is a trainable weight parameter.

[0076]

[0077] Video feature extraction process: First, use a third-party tool to obtain the image sequence of the face part appearing in each video, and then input it into OpenFace2.0 to extract the initial features, which are represented by g i . Since video is a time frame sequence data, each video contains a different number of frames. For videos with shorter frame lengths, frame vector padding is performed. For videos with longer frame lengths, the first L" frame vectors are taken to make the frame length of all videos L", where L" is the sum of the mean of the frame sequence lengths corresponding to all videos and a certain multiple of the standard deviation. In order to reduce the computational dimension, we average all frame vectors in the feature dimension to obtain a new video feature representation Then input into the three-layer deep neural network to extract deep features v i , as shown in formula (3), where W i ″ is a trainable weight parameter.

[0078]

[0079] In the bimodal multi-task layer, we first need to obtain bimodal fusion information, and then build bimodal multi-task frameworks for audio, video, audio-video (A, V, AV); audio, text, audio-text (A, T, AT); video, text, video-text (V, T, VT), and then save the bimodal features and set the data source of the prediction layer. After extracting unimodal features for all videos, their features are represented as R T ={t1,t2,...,t N}, R A ={a1,a2,...,a N}, R V ={v1,v2,...,v N}, let any two modalities be α and β, γ represents the dual modality after α and β are fused, they represent three different tasks, namely α, β∈{A,V,T}, γ∈{AV,AT,VT}. The dual modality fusion information is obtained as shown in formula (4).

[0080]

[0081] The information obtained by fusion of two modalities is the second-order Cartesian product of the feature representations of two independent modalities. The constructed dual-modal multi-task learning framework is as follows: Figure 3 As shown, C α , C β , C γThey are sentiment analysis classifiers for α, β, and γ respectively. Each task shares a single-modal feature extraction layer, but has an independent classifier, and the structure is a three-layer deep neural network. The classifier for predicting single-modal tasks is shown in formula (5), and the classifier for predicting bimodal tasks is shown in formula (6). They use the bimodal learning task as the main body and the single-modal learning task as the auxiliary for joint learning. The optimization target of training is shown in formula (7), which is the weighted average loss sum of the three tasks.

[0082]

[0083]

[0084]

[0085] In this process, the characteristics H of AV, AT, and VT are saved respectively. AV , H AT , H VT , which is derived from C AV , C AT , C VT The second layer activation value. Before entering the fusion layer, it is necessary to make a judgment. If the multi-task layer needs to be retrained, the data from the multi-task layer is directly used, otherwise the local bimodal features are used.

[0086] In the prediction layer, the bimodal features need to be fused first and then input into the multimodal sentiment classifier C M In, C M A three-layer DNN is used, as shown in formula (8), where F is the fusion function and the concatenation method is used.

[0087]

[0088] In summary, the present invention uses modality-level fine-grained annotation information for multi-task learning to fully obtain modality internal information and inter-modal interaction information, and performs hierarchical processing to achieve modularization of the model. Multi-task learning is mainly used to improve the generalization of the model, making the bimodal sentiment analysis more accurate and thus obtaining rich bimodal features. Specifically, while obtaining the internal features of a single modality, the interactive information between modalities can be fully extracted, and the supervision information of the bimodal granularity is used to improve the prediction accuracy of the model; at the same time, a hierarchical method is used, that is, bimodal sentiment analysis is performed first and then multimodal sentiment analysis, so that the model is modularized and more adaptable to different video scenes, which reduces time overhead and computing resources to a certain extent.

Claims

1. A multimodal sentiment analysis method based on multi-task learning, characterized in that: The following steps are involved: S1. Preprocess the video: separate the audio from the video and transcribe the audio to obtain the corresponding text, then divide the video into frames, perform face detection and alignment on the video frames; S2. Obtain unimodal raw features from preprocessed data: Use the BERT model to obtain sentence vectors from text, and use third-party tools to extract audio and video features; S3. Based on the unimodal original features, further obtaining unimodal deep features, wherein the unimodal deep features include text deep features, audio deep features and video deep features; S4. According to the single-modal deep features, a dual-modal multi-task learning framework based on the neural network model is constructed; S5. Use the value of the hidden layer in the bimodal multi-task learning framework as the bimodal feature, and save the bimodal feature locally; S6. According to user needs, multimodal fusion and classification prediction are performed on the locally saved bimodal features or the values ​​of the hidden layer in the bimodal multi-task learning framework to obtain the corresponding sentiment analysis results; Wherein, step S4 specifically includes the following steps: S41, based on the single-modal deep features, perform two-to-two modal fusions to obtain corresponding dual-modal fusion information; S42, input each bimodal fusion information and the corresponding two unimodal deep features into the corresponding three-layer deep neural network, use the unimodal task as the auxiliary task and the bimodal task as the main task, and perform learning and training in combination with the pre-set bimodal annotation information.

2. According to claim 1, a multi-modal sentiment analysis method based on multi-task learning is characterized in that: The step S3 specifically comprises the following steps: S31. Based on the sentence vectors, the lengths of all sentences are adjusted to be consistent, so as to obtain sentence representations with uniform lengths. Input the sentence representation of uniform length into LSTM to obtain the deep text features that extract the contextual relationship; S32, in the feature dimension, averaging all frame vectors of the audio feature to obtain an averaged audio feature; The averaged audio features are input into a three-layer deep neural network to obtain the audio deep features; S33, in the feature dimension, averaging all frame vectors of the video feature to obtain an averaged video feature; The averaged video features are input into a three-layer deep neural network to obtain the deep features of the video.

3. The multimodal sentiment analysis method based on multi-task learning according to claim 2, characterized in that: The deep features of the text are specifically: Among them, t i is the deep feature of the text, is a sentence representation of uniform length, W i It is the weight parameter used in the process of text deep feature extraction.

4. The multimodal sentiment analysis method based on multi-task learning according to claim 3 is characterized in that: The audio deep features are specifically: Among them, a i is the deep audio feature, is the averaged audio feature, W i ' is the weight parameter used in the process of audio deep feature extraction.

5. The multi-modal sentiment analysis method based on multi-task learning according to claim 4, characterized in that: The video deep features are specifically: Among them, v i is the deep feature of the video, is the averaged video feature, W' i ' is the weight parameter used in the process of video deep feature training and extraction.

6. The multi-modal sentiment analysis method based on multi-task learning according to claim 1, characterized in that: The bimodal fusion information is specifically: R T ={t1,t2,...,t N } <h2 style=";text-align:left;direction:ltr">R<h2 style=";text-align:left;direction:ltr"> A <h2 style=";text-align:left;direction:ltr"> (a1,a2,...,a)<h2 style=";text-align:left;direction:ltr"> N <h2 style=";text-align:left;direction:ltr">} R V ={v1,v2,...,v N } α,β∈{A,V,T} γ∈{AV,AT,VT} Among them, R T is the deep feature set of the text, R A is the audio deep feature set, R V is the deep feature set of the video, R α and R β are different single-modal deep feature information, R γ is the dual-modal fusion information, A is the audio modality, V is the video modality, T is the text modality, AV is the audio and video fusion modality, AT is the audio and text fusion modality, and VT is the video and text fusion modality.

7. The multimodal sentiment analysis method based on multi-task learning according to claim 6, characterized in that: The optimization goal of the learning training in step S42 is specifically: Where N is the number of videos, ω α ,ω β are the hyperparameters of different unimodal task losses, ω γ is the hyperparameter corresponding to the bimodal task loss, are the training loss functions for different unimodal tasks, is the training loss function corresponding to the bimodal task, are the predicted sentiment labels for different unimodal tasks, is the predicted sentiment label corresponding to the bimodal task, y α,i ,y β,i are the true sentiment labels of different unimodal tasks, y γ,i is the true sentiment label corresponding to the bimodal task, C α , C β , C γ Sentiment analysis classifiers are α, β and γ respectively.

8. The multi-modal sentiment analysis method based on multi-task learning according to claim 7, characterized in that: The step S6 specifically comprises the following steps: S61, fusing all the bimodal features to obtain multimodal fusion features; S62: Input the multimodal fusion features into a multimodal sentiment classifier to obtain corresponding sentiment analysis results.

9. The multimodal sentiment analysis method based on multi-task learning according to claim 8, characterized in that: The sentiment analysis results are specifically as follows: in, is the sentiment analysis result, C M is a multimodal sentiment classifier, F is a fusion function, H AV is the audio and video dual-modal feature, H AT is the audio and text bimodal feature, H VT It is a dual-modal feature of video and text.