Multi-modal sentiment analysis method based on unwrapping representation learning
Through the multimodal emotion analysis method based on untangling representation learning, the problems of multiple noise and redundant information in multimodal emotion analysis in the prior art are solved, and the deep fusion of audio, video and text modes and emotional analysis are achieved, and the accuracy and efficiency of emotion analysis are improved.
Patent Information
- Application Number
- CN202510158857.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-13
AI Technical Summary
The existing multimodal sentiment analysis technology has problems such as a lot of noise and redundant information in audio and video features, difficulty in cross-modal learning, underutilization of the role of language modals in emotional expression, and low efficiency in feature extraction, fusion and emotional recognition between data of different modalities.
The method based on untangle representation learning is adopted, and deep fusion and sentiment analysis of audio, video and text modal modalities are achieved through steps such as data collection, multimodal feature extraction, construction of untangle representation learning network, modal untangle and adversarial optimization, time smoothing constraints and feature fusion.
It significantly reduces redundant information in audio and video features, improves consistency of time dimensions, makes full use of the importance of text features, improves cross-modal fusion effect, and shows competitive performance on MOSI and MOSIE datasets.
Smart Images

Figure CN119622280A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language processing, and in particular relates to a multimodal sentiment analysis method based on disentanglement representation learning. Background Art
[0002] With the rapid development of intelligent human-computer interaction, intelligent medical care and robotics, the application scope of multimodal data has been greatly expanded, providing a strong driving force for the research of Multimodal Sentiment Analysis (MSA). Human emotional expression is usually an organic fusion of natural language, facial expressions and vocal behavior. Emotion plays an important role in promoting human interaction, shaping communication methods and assisting decision-making. As an important research direction, multimodal sentiment analysis is committed to understanding human emotional information from multiple dimensions by parsing multimodal data such as text, audio and video, so that machines can more comprehensively grasp human emotional states. By accurately capturing these emotional signals, machines can interact with humans more effectively and produce more natural and deeper emotional resonance.
[0003] In view of the broad application prospects of multimodal sentiment analysis, current researchers have also proposed a large number of multimodal sentiment analysis models to try to solve the core problems in the field. However, existing multimodal sentiment analysis has many shortcomings: (1) Audio and video features often contain a lot of noise and redundant information, which makes it difficult to accurately reflect the core content of emotions. (2) There are significant differences between discrete text features and continuous audio and video features, which leads to huge challenges in cross-modal learning. (3) Existing research has not paid enough attention to the key role of language modality in emotional expression and has failed to fully explore its potential value. (4) The efficiency of feature extraction, fusion and recognition of emotion-related information between different modal data is low, which makes it difficult to accurately analyze the emotional polarity of each entity in multimodal data. Summary of the invention
[0004] Purpose of the invention: The technical problem to be solved by the present invention is to provide a multimodal sentiment analysis method based on disentangled representation learning in view of the shortcomings of the prior art, comprising the following steps: Step 1, data collection: collect data sets for multimodal sentiment analysis. The selected data sets should be representative and diverse, cover multiple modalities such as audio, video and text, and be able to support subsequent training, evaluation and testing processes; the multimodalities include text modality, audio modality and video modality; Step 2: Extract multimodal features: Extract text, audio, and video modal features for the input video data; use the Bert model to extract text model features , using Librosa tool to extract audio model features , use OpenFace to extract facial features and get video model features , for the extracted modal features , transformed to the same feature dimension through linear mapping, and the aligned modal features are obtained ; ; Step 3: Construct a disentangled representation learning network, including: Generate modality-private features: Input to the modality-private encoder to generate the corresponding modality-private features , , ; Generate modal shared features: Modal features Input the shared encoder at the same time to generate modality shared features ; For modal shared features , , Perform full connection processing to obtain global shared features ; Step 4: Modal disentanglement and adversarial optimization: Modal private features , , Shared features with modalities Input modality discriminator, optimize the parameters of modality discriminator, private encoder and shared encoder; Step 5, temporal smoothness constraint: private features of audio modality , audio modality shared features and video modality private features , Video modality shared features Applying temporal smoothness constraints to reduce redundancy and noise in audio and video features over consecutive time periods; Step 6, feature fusion: Deeply fuse audio and video modality features through text-guided mechanism, and finally generate fusion features for sentiment analysis ; Step 7, model optimization and output: Fusion features Input the sentiment analysis module and combine it with sentiment classification or regression tasks to generate sentiment prediction results; at the same time, optimize the sentiment analysis module through the loss function of the training phase.
[0005] Step 2 includes: For the input video data, use the Bert model to extract text model features , using Librosa tool to extract audio model features , use OpenFace to extract facial features and get video model features : , , , Feature set ; For each modal feature Perform linear mapping to unify to the same feature dimension to obtain the aligned feature representation : , Where m represents the mode, , For text, For audio, For video, and Represent the weight matrix and bias matrix of the linear mapping respectively.
[0006] Step 3 includes: Modal characteristics are input into the modality-specific encoder to generate text, audio, and video modality-specific features respectively. , , , modal characteristics They are simultaneously input into the shared encoder to generate shared features for text, audio, and video modalities. , where the private encoder extracts features from each modal data through three independent encoders, and the shared encoder processes all modal data using the same encoder. The mathematical expression is: , , in, , , They are text private encoders Parameters, audio private encoder Parameters of private video encoder Parameters, Is a shared encoder Parameters; Shared Features , , Perform full connection processing to obtain global shared features : , in, is the weight matrix, is the activation function.
[0007] Step 4 includes: Modality Discriminator It is to classify and judge the feature representation of the input data and output the corresponding probability. The formula is: , in, , is the weight matrix of the modality discriminator, T represents the transposed is the bias vector; is the input to the modality discriminator, is the size of the dimension, express dimensional real space, the output of the modal discriminator Represents and corresponds to three modes The probability of correlation; The arccosine-based cross entropy loss function is used, which is defined as: , , , in, is the target modality of the input sample, is the weight vector of mode m, is the target mode The weight vector of is the input feature vector, Represents the input feature vector and mode The angle of Represents the input feature vector and the target mode The angle of represents the cross entropy loss; is the scaling factor, is a marginal parameter; e is a natural constant; Take the weighted sum for each label and calculate the overall adversarial loss: , , in, is the batch size, Represents modal shared features With target mode The cross entropy loss between ; is the adversarial loss of shared features, is the adversarial loss of private features; Represents modal private features With target mode The cross entropy loss between .
[0008] Step 5 includes: The temporal smoothness loss based on KL divergence measures the changing characteristics of audio and video modalities in continuous time. KL divergence is defined as: , in , are two probability distributions, and They are , In the The value at the position; Indicates an event In distribution Probability and distribution under The difference in probability of the following; For audio features, the KL divergence of three consecutive frames of audio features is calculated. The formula is: , , , in, and Respectively represent Frame audio modality private features and Frame audio modality shared features, yes The processed results are averaged. Indicates the audio feature in The private characteristics of a frame are passed The average value after operation; Indicates the audio feature in The shared features of the frames are obtained by The average value after operation; Indicates the frame number. The audio feature is The sliding average of the private features of the frame, The audio feature is The sliding average of the shared features of the frames, , , is the temporal smoothness loss of audio features; For video features, the KL divergence of three consecutive frames of audio features is calculated. The formula is: , , , in, and Respectively represent Frame video modality private features and Frame video modality shared features, Indicates the video feature in The private characteristics of a frame are passed The average value after operation, Indicates the video features in The shared features of the frames are obtained by The average value after operation; The video feature is The sliding average of the private features of the frame, The video feature is The sliding average of the shared features of the frames, is the temporal smoothness loss of video features; Construct a consistency loss function, the formula is: , , , in, and They represent the feature differences between consecutive frames of the video modality and the feature differences between consecutive frames of the audio modality, It is Frame and The average value of + , is the consistency loss; The overall time smoothness loss is calculated by the following formula : .
[0009] Step 6 includes: Initializing a learnable parameter tensor , and then the low-scale text features , audio modality private features , Video modality private features and The text-guided module includes a cross-modal attention mechanism for audio features and text-modal features. is used as the query vector Q, the private features of the audio modality As the key vector K and value vector V respectively, we get and The similarity matrix : , in, and is the learnable parameter matrix, Represents the dimension of each attention head; Calculating text features and video features The similarity matrix : , in is a learnable parameter matrix; Then generate new fusion features : , in , and is the learnable parameter matrix; Will Input into the first Transformer layer, and generate medium-scale text features through deep modeling : , in, represents the first Transformer layer, are the parameters of the first Transformer layer; Then the new fusion feature and mesoscale text features Input into the next text-guided module to obtain fusion features : , in , , , , , and is a learnable parameter matrix; Then the mesoscale text features Input to the second Transformer layer to extract high-scale text features ,then and It is input into the last text-guided module to obtain the final fusion features of audio features and video features. : , , in, represents the second Transformer layer, are the parameters of the second Transformer layer, , , is a learnable parameter matrix; Further modeling through the feedforward network FFN, the final fusion features are obtained: , , , in, , , , is the learnable parameter matrix, is the output after calculation by the cross-modal self-attention mechanism, yes After normalization, the output Represent text features at different scales; hour, , , is a low-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , is the mesoscale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , It is a high-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes The output after normalization.
[0010] represents normalization, represents a feed-forward network; , , They represent the multimodal fusion features generated at low, medium, and high scales respectively; Fusion features at different scales and shared modal features Weighted fusion via gating mechanism: , , , , in, ,Right now , , , , and is a learnable weight matrix, yes Through the weight matrix The result after transformation, Refers to sum pooling, is the size of the pooling window, yes After summing and pooling, express The result after L2 normalization is: express The second norm of hour, yes The learnable weight matrix, yes Through the weight matrix The result after transformation, yes After summing and pooling, express The result after L2 normalization; Enter the Multiply it element by element with the weight matrix, and then sum and pool the matrix after element-by-element multiplication to get , then L2 normalization is used to ensure the same scale, and finally, linear mapping weighted summation is performed to obtain the final fusion feature .
[0011] Step 7 includes: The fusion features As input, it is passed to the multi-layer perceptron , output the sentiment prediction result through nonlinear transformation : , The mean square error (MSE) is used as the loss function for task learning. , the calculation formula is: , in, is the sentiment label of the zth sample, is the prediction result of the sentiment analysis module, is the number of samples in the dataset.
[0012] In step 7, the final total loss function is for: , in, , and is a hyperparameter.
[0013] The present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the described method.
[0014] The present invention also provides a storage medium storing a computer program or instruction. When the computer program or instruction is run on a computer, the steps of the method described are executed.
[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) It adopts temporal smoothness constraints to ensure the consistency of audio and video features in continuous time, significantly reduce redundant information, and improve the consistency of the temporal dimension.
[0016] (2) Introducing a text guidance module, which effectively integrates audio, video, and text modalities through guidance at different language scales, achieving deep collaboration and integration.
[0017] (3) Make full use of the importance of text features and integrate multimodal information of different scales through a deep cross-modal interaction layer, significantly improving the cross-modal fusion effect.
[0018] (4) The proposed method shows competitive performance on the MOSI and MOSIE datasets, verifying its effectiveness and advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Flow chart of the method of the present invention.
[0020] Figure 2 It is a model framework diagram of the system of the present invention.
[0021] Figure 3 Flowchart of the text-guided module.
[0022] Figure 4 Flowchart of the cross-modal interaction layer. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.
[0024] This embodiment provides a multimodal sentiment analysis method based on disentanglement representation learning. The overall architecture of the system model provided in this embodiment is as follows: Figure 2 As shown in the figure, the model consists of three modules: (1) feature extraction module; (2) disentanglement representation learning module; and (3) fusion module.
[0025] like Figure 1 As shown, the method comprises the following steps: Step 1, data collection: Collect training, evaluation and test datasets that can be used for multimodal sentiment analysis. The dataset contains data in three modalities: text, audio and video. Preprocess the dataset to meet the needs of subsequent feature extraction. The "multimodal" refers to text modality, audio modality and video modality.
[0026] Step 2: Extract multimodal features: Extract text, audio, and video modal features for the input video data. Text model features Using Bert model to extract audio model features Use Librosa tool to extract features and video model features Use OpenFace to extract facial features and modal features , transformed to the same feature dimension through linear mapping, and the aligned modal features are obtained .
[0027] Step 3: Construct a disentangled representation learning network: Modality private feature generation: Modality features Input to the modality-private encoder to generate the corresponding modality-private features , , . Modal shared feature generation: Modal features Input the shared encoder at the same time to generate modality shared features . Shared Features , , Perform full connection processing to obtain global shared features .
[0028] Step 4: Modal disentanglement and adversarial optimization: Generate modal private features , , Shared features with modalities Input modality discriminator. By optimizing the parameters of modality discriminator, private encoder and shared encoder, we ensure that modality private features only contain modality-specific information, while modality shared features learn shared information between modalities, thus achieving disentangled representation learning of modality features.
[0029] Step 5, time smoothness constraint: audio modal features , and video modality features , Temporal smoothness constraints are applied to reduce redundancy and noise in audio and video features over consecutive time segments.
[0030] Step 6, feature fusion: The present invention realizes the deep fusion of audio and video modality features through a text-guided mechanism.
[0031] Low-scale fusion: low-scale text features (Right now ) and audio and video modality features and their initialization Input into the text guidance module, generate new fusion features through cross-modal attention mechanism and full connection operation .
[0032] Mesoscale Fusion: Input the first Transformer layer to generate mesoscale text features through deep modeling . Then, and The data are input into the next text guidance module, and the fusion features are generated through similar cross-modal attention mechanism and full connection processing. .
[0033] High-scale fusion: Input to the second Transformer layer to extract high-scale text features . Then, and Input to the final text-guided module to obtain the final fusion features of audio and video features .
[0034] Cross-modal interaction: text features at different scales , , Final fusion features with audio and video Interactive fusion layer by layer to generate intermediate fusion features These features are further combined with the shared features Input to the gating mechanism for processing, thereby filtering redundant information and dynamically fusing multimodal effective features, and finally generating fusion features for sentiment analysis .
[0035] Step 7, model optimization and output: by fusion features The data is input into the subsequent sentiment analysis module and combined with sentiment classification or regression tasks to generate sentiment prediction results. At the same time, the prediction accuracy and generalization ability of the model are ensured through the optimization of the loss function in the training phase.
[0036] Wherein, step 1 comprises: In the study of multimodal sentiment analysis, data collection is a key step in model training, verification and testing. In order to ensure the scientific nature of the research and the applicability of the data, this paper selects two representative and high-quality multimodal datasets: MOSI and MOSEI. The MOSI dataset was proposed by Amir Zadeh et al. in the journal IEEE Intelligent Systems in 2016 and described in detail in their paper “Amir Zadeh, Rowan Zellers, Eli Pincus, Louis-Philippe Morency, Multimodal sentiment intensity analysis in videos: Facialgestures and verbal messages, IEEE Intell. Syst. 31 (6) (2016) 82–88”. The MOSI dataset contains 93 video clips from YouTube, which cover a wide range of emotional expressions, including positive, negative and neutral emotions. The dataset contains a total of 2199 samples, as shown in Table 1. Each sample provides three modal features: text, audio, and video. At the same time, it is annotated in the range of [-3, +3] according to the intensity of emotion. The higher the value, the more positive the emotion, and the lower the value, the more negative the emotion. The MOSEI dataset is an extended version of the MOSI dataset, which was proposed by AmirAli Bagher Zadeh et al. in the 2018 56th Annual Meeting of the Association for Computational Linguistics paper "AmirAli BagherZadeh, Paul Pu Liang, Soujanya Poria, Erik Cambria, Louis-Philippe Morency, Multimodal language analysis in the wild: CMU-MOSEI dataset and interpretabledynamic fusion graph, in: Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, Vol. 1, 2018, pp.2236–2246". MOSEI is currently the largest public multimodal sentiment analysis dataset, containing a total of 22,856 samples, each of which is also labeled in the range of [-3, +3] according to the intensity of the sentiment.
[0037] Table 1
[0038] Step 2 includes: In the process of processing the input video file, the feature extraction model uses Bert, Librosa, and OpenFace to extract modal features of text, audio, and video respectively, denoted as : , , , Then, the features of each modal ( , For text, For audio, For video. ) to unify them to the same feature dimension, thus obtaining the aligned feature representation , , is the length of the sequence, is the length of the mode vector: , in and are the weight matrix and bias matrix of the linear mapping.
[0039] Step 3 includes: Each modal feature is input into the modality-private encoder to generate modality-private features , , , At the same time, they are input into the shared encoder to generate modality shared features , where the private encoder extracts features from each modality data through three independent encoders, while the shared encoder processes all modality data using the same encoder. The specific formula is: , , in, , , They are text private encoders , audio private encoder , Video Private Encoder Parameters, Is a shared encoder Then the present invention will share the characteristics , , Perform full connection processing to obtain global shared features : , in, and is the weight matrix, is the activation function.
[0040] Step 4 includes: During the disentanglement process, the modality discriminator processes the features extracted by the private encoder and the shared encoder to generate the probability of belonging to each modality. For example, the text private feature Input to the discriminator and get the same as text, audio, video (i.e. , , ) features. Modality Discriminator It is to classify and judge the feature representation of the input data and output the corresponding probability. Its definition formula is as follows: , in, , is the weight matrix of the discriminator. yes The transposed matrix of is the bias vector, . is the input of the modality discriminator, and the output of the discriminator Represents and corresponds to three modes ( ) related probability. In order to enhance the discriminator's ability to distinguish similar categories, the cross entropy loss function based on arc cosine is used, which is specifically defined as: , , , in, is the target modality of the input sample, is the weight vector of mode m, is the target mode The weight vector of is the input feature vector, The input eigenvectors and modes are calculated The angle of The input eigenvector and the target mode are calculated The angle of The cross entropy loss is calculated. is the scaling factor, is the marginal parameter. Then the weighted sum is taken for each label to calculate the overall adversarial loss: , , in, is the batch size, For the modal The features of the target modality are calculated The cross entropy loss between . is the adversarial loss of shared features, is the adversarial loss of private features. The goal of shared features is opposite to that of the modality discriminator, that is, to generate consistent features, so the gradient of the shared encoder is reversed during back propagation. It remains fixed during forward propagation.
[0041] Step 5 includes: The temporal smoothness loss based on KL divergence is introduced to measure the changing characteristics of audio and video modalities in continuous time, thereby reducing redundancy and noise. KL divergence is defined as: , , are two probability distributions, and They are respectively The formula calculates the value of the event In distribution Probability and distribution under Taking audio features as an example, the KL divergence of three consecutive frames of audio features is calculated. The specific steps are as follows: , , , in, and Respectively represent Frame audio modality private features and Frame audio modality shared features, yes The processed results are averaged. and Indicates the audio feature in The private and shared features of a frame are defined by The average value after the operation. Indicates the frame number. , The audio feature is The sliding average of the private and shared features of a frame, , , is the temporal smoothness loss of audio features; For video features, the KL divergence of three consecutive frames of audio features is calculated. The formula is: , , , in, and Respectively represent Frame video modality private features and Frame video modality shared features, and Indicates the video feature in The private and shared features of a frame are defined by The average value after the operation. , The video feature is The sliding average of the private and shared features of a frame, is the temporal smoothness loss of the video feature. In order to enhance the coordination of audio and video modalities in continuous time, the present invention first evaluates the feature deviation of the two modalities in continuous time, and constructs a consistency loss function based on this. The specific formula is as follows: , , , in, and Respectively represent the feature differences between consecutive frames of video and audio modalities, It is Frame and The average value of + , is the consistency loss.
[0042] Through the above steps, the temporal smoothness loss of audio and video features is calculated, and finally the following formula is obtained to express the overall temporal smoothness loss: , Through temporal smoothness loss, the present invention can effectively reduce redundant information in audio and video features and ensure their consistency in the temporal dimension, thereby improving the performance of the model in multimodal tasks.
[0043] Step 6 includes:
[0044] The deep fusion of audio and video modalities is achieved through the text-guided mechanism, aiming to fully explore the semantic information contained in the text modality and use it as the core factor to guide the fusion of audio and video features, thereby enhancing the cross-modal synergy and semantic consistency. Figure 4 As shown, in the cross-modal interaction layer, the present invention uses text features of different scales and fusion features of audio and video to fuse layer by layer, and the obtained fusion features Further sent to the gate control mechanism and shared features to be processed.
[0045] Low-scale text information mainly focuses on the emotional features at the word or phrase level, medium-scale text information focuses more on the emotional expression at the sentence level, and high-scale text information focuses on the emotional trend in the global context. The present invention performs multi-level feature extraction on text data through the Transformer layer, generates text representations of different scales, and inputs these text features as guidance information into the text guidance module to further assist the initial fusion of audio and video modalities.
[0046] Step 6.1, low-scale fusion: The present invention first initializes a learnable parameter tensor , and then the low-scale text features ( ), audio features , Video Features and are input into the text guidance module. Figure 3 As shown in Figure 2, the core of the text-guided module lies in the cross-modal attention mechanism. In the cross-modal attention calculation, taking audio features as an example, text modality features is used as the query vector Q, the audio modality features As the key vector K and value vector V respectively, we get and The similarity matrix : , in, and is the learnable parameter matrix, Represents the dimension of each attention head. Text features and video features The similarity matrix The calculation of The calculation is similar: , After cross-modal attention calculation, a fused intermediate feature representation is generated, which is then combined with the fully connected features of audio and video. Further fusion, finally generating new fusion features : , in, and are all learnable parameter matrices.
[0047] Step 6.2, mesoscale fusion: In order to further mine the mesoscale text information of the text modality, Input into the first Transformer layer, and generate mesoscale text features through deep modeling : , in, represents the first Transformer layer, is the parameter of the first Transformer layer. and mesoscale text features is input into the next text-guided module. Similar to the previous text-guided module, through cross-modal attention and full connection, we get : , in, , , , , and are all learnable parameter matrices.
[0048] Step 6.3, high-scale fusion: Then put Input to the second Transformer layer to extract high-scale text features ,then and It is input into the last text-guided module to obtain the final fusion features of audio features and video features. : , , in, represents the second Transformer layer, are the parameters of the second Transformer layer, , , is a learnable parameter matrix;
[0049] Step 6.4, cross-modal interaction: The features extracted from the text modality at low, medium, and high scales are used as query vectors Q, and the fusion features of audio and video are As the key vector K and the value vector V. Based on this, the fusion feature is calculated through the cross-modal attention mechanism, and the layer normalization is performed on the basis of the fusion feature, and then further modeled through the feedforward network (FFN), and the final fusion feature is obtained. The calculation is as follows: , , , in, , , , is the learnable parameter matrix, is the output after calculation by the cross-modal self-attention mechanism, yes After normalization, the output Represent text features at different scales; hour, , , is a low-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , is the mesoscale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , It is a high-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes The output after normalization.
[0050] represents normalization, represents a feed-forward network; , , Represent the multimodal fusion features generated at low, medium and high scales respectively. The present invention introduces a gating mechanism to filter redundant information and dynamically screen the effective information between different modalities. Specifically, the fusion features at different scales are and shared modal features Weighted fusion via gating mechanism: , , , ,
[0051] in, ,Right now , , , , and is a learnable weight matrix, Through the weight matrix The result after transformation, refers to sum pooling, is the size of the pooling window, yes After summing and pooling, express The result after L2 normalization is: express The second norm of . hour, yes The learnable weight matrix, yes Through the weight matrix The result after transformation, yes After summing and pooling, express The result after L2 normalization. The present invention firstly transforms the input Multiply it element by element with the weight matrix, and then sum and pool the matrix after element-by-element multiplication to get , and then L2 normalization is performed to ensure the same scale. Finally, a linear mapping weighted sum is performed to obtain the final fusion feature This feature integrates the information of multimodal features at different scales and significantly improves the effect of cross-modal fusion.
[0052] Step 7 includes:
[0053] The fused multimodal features As input, it is passed to the multi-layer perceptron and outputs the sentiment prediction result through nonlinear transformation. : ,
[0054] In the process of model training, in order to make the prediction results as close as possible to the real emotional label, this paper uses mean square error (MSE) as the main loss function for task learning. Its calculation formula is as follows: ,
[0055] in, is the sentiment label of the nth sample, is the prediction of the model of the present invention, is the number of samples in the dataset. , the model can better fit the sentiment label and improve the accuracy of sentiment prediction. So the final total loss function is: ,
[0056] in, , and is a hyperparameter used to balance the weight between task loss and regularization loss. By optimizing the above-mentioned loss functions, the model can more fully explore the synergistic relationship and temporal consistency between multimodal features, thereby achieving accurate modeling of sentiment prediction tasks and further improving the generalization ability and practical application effect of the model.
[0057] Comparison Baseline: This example uses the following models as baselines to compare model performance. (1) TFN: A high-order tensor is generated by combining the features of text, audio, and video modalities through Cartesian products. Each dimension of this tensor captures the interaction information between unimodal, bimodal, and trimodal modalities. (2) LMF: Efficient multimodal fusion is performed by decomposing high-rank weight tensors into modality-specific low-rank factors. (3) MISA: Disentangled representation learning is used to separate modality-invariant common features and modality-specific unique features. Through this mechanism, MISA can simultaneously maintain the common information between modalities and the uniqueness of each modality. (4) FDMER: A modality discriminator is introduced, and adversarial learning is used to guide the parameter learning of public and private encoders. At the same time, the model designs a customized loss function to achieve modality consistency and parallax constraints. (5) PS-Mixer: A polar vector and an intensity vector are designed to judge the polarity and intensity of emotions respectively. Combined with a multi-layer perceptron (MLP) communication module consisting of multiple fully connected layers and activation functions. (6) TETFN: Obtain a unified and effective multimodal representation by learning text-oriented pairwise cross-modal mapping. (7) TCAN: Adopts a text query cross-attention mechanism to interact information between visual and acoustic modalities. (8) JTUM: Combining a unimodal label generation module with a cross-modal converter, it can generate an effective joint representation in multimodal data. (9) DEVA: Adopts a sentiment description generator to convert raw audio and visual data into textual sentiment descriptions. Subsequently, these sentiment descriptions are fused with the source data to enhance the sentiment information expressed by the features. (10) DLF: Introduces four geometric metrics to refine the disentanglement process, combined with a language-guided cross-attention mechanism, and uses supplementary specific modality information to enhance the effectiveness of language representation.
[0058] Table 2
[0059]
[0060] It can be seen from Table 2 and Table 3 that the method proposed in the present invention is substantially superior to the performance of all the compared baseline models on the two public data sets, thus verifying the effectiveness of the present invention.
[0061] Table 3
[0062]
[0063] The present invention provides a multimodal sentiment analysis method based on disentangled representation learning. There are many methods and ways to implement the technical solution. The above is only a preferred implementation of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention. All components not specified in this embodiment can be implemented by existing technologies.
Claims
1. A multimodal sentiment analysis method based on disentangled representation learning, characterized in that: The following steps are involved: Step 1, data collection: collect data sets for multimodal sentiment analysis. The selected data sets should be representative and diverse, cover multiple modalities such as audio, video and text, and be able to support subsequent training, evaluation and testing processes; the multimodalities include text modality, audio modality and video modality; Step 2: Extract multimodal features: Extract text, audio and video modal features respectively for the input video data; Using the Bert model to extract text model features , using Librosa tool to extract audio model features , use OpenFace to extract facial features and get video model features , for the extracted modal features , transformed to the same feature dimension through linear mapping, and the aligned modal features are obtained ; ; Step 3: Construct a disentangled representation learning network, including: Generate modality-private features: Input to the modality-private encoder to generate the corresponding modality-private features , , ; Generate modal shared features: Modal features Input the shared encoder at the same time to generate modality shared features ; For modal shared features , , Perform full connection processing to obtain global shared features ; Step 4: Modal disentanglement and adversarial optimization: Modal private features , , Shared features with modalities Input modality discriminator, optimize the parameters of modality discriminator, private encoder and shared encoder; Step 5, temporal smoothness constraint: private features of audio modality , audio modality shared features and video modality private features , Video modality shared features Applying temporal smoothness constraints to reduce redundancy and noise in audio and video features over consecutive time periods; Step 6, feature fusion: Deeply fuse audio and video modality features through text-guided mechanism, and finally generate fusion features for sentiment analysis ; Step 7, model optimization and output: Fusion features Input the sentiment analysis module and combine it with sentiment classification or regression tasks to generate sentiment prediction results; at the same time, optimize the sentiment analysis module through the loss function of the training phase.
2. The method according to claim 1, characterized in that Step 2 includes: For the input video data, use the Bert model to extract text model features , using Librosa tool to extract audio model features , use OpenFace to extract facial features and get video model features : , , , Feature set ; For each modal feature Perform linear mapping to unify to the same feature dimension to obtain the aligned feature representation : , Where m represents the mode, , For text, For audio, For video; and Represent the weight matrix and bias matrix of the linear mapping respectively.
3. The method according to claim 2, characterized in that Step 3 includes: Modal characteristics are input into the modality-specific encoder to generate text, audio, and video modality-specific features respectively. , , , modal characteristics They are simultaneously input into the shared encoder to generate shared features for text, audio, and video modalities. , where the private encoder extracts features from each modal data through three independent encoders, and the shared encoder processes all modal data using the same encoder. The mathematical expression is: , , in, , , They are text private encoders Parameters, audio private encoder Parameters of private video encoder Parameters, Is a shared encoder Parameters; Shared Features , , Perform full connection processing to obtain global shared features : , in, is the weight matrix, is the activation function.
4. The method according to claim 3, characterized in that Step 4 includes: Modality Discriminator It is to classify and judge the feature representation of the input data and output the corresponding probability. The formula is: , in, , is the weight matrix of the modality discriminator, T represents the transposed is the bias vector; is the input of the modality discriminator, is the size of the dimension, express dimensional real space, the output of the modal discriminator Represents and corresponds to three modes The probability of correlation; The arccosine-based cross entropy loss function is used, which is defined as: , , , in, is the target modality of the input sample, is the weight vector of mode m, is the target mode The weight vector of is the input feature vector, Represents the input feature vector and mode The angle of Represents the input feature vector and the target mode The angle of represents the cross entropy loss; is the scaling factor, is a marginal parameter; e is a natural constant; Take the weighted sum for each label and calculate the overall adversarial loss: , , in, is the batch size, Represents modal shared features With target mode The cross entropy loss between ; is the adversarial loss of shared features, is the adversarial loss of private features; Represents modal private features With target mode The cross entropy loss between .
5. The method according to claim 4, characterized in that Step 5 includes: The temporal smoothness loss based on KL divergence measures the changing characteristics of audio and video modalities in continuous time. KL divergence is defined as: , in , are two probability distributions, and They are , In the The value at the position; Indicates an event In distribution Probability and distribution under The difference in probability of the following; For audio features, the KL divergence of three consecutive frames of audio features is calculated. The formula is: , , , in, and Respectively represent Frame audio modality private features and Frame audio modality shared features, yes The processed results are averaged. Indicates the audio feature in The private characteristics of a frame are passed The average value after operation; Indicates the audio feature in The shared features of the frames are obtained by The average value after operation; Indicates the frame number. The audio feature is The sliding average of the private features of the frame, The audio feature is The sliding average of the shared features of the frames, , , is the temporal smoothness loss of audio features; For video features, the KL divergence of three consecutive frames of audio features is calculated. The formula is: , , , in, and Respectively represent Frame video modality private features and Frame video modality shared features, Indicates the video features in The private characteristics of a frame are passed The average value after operation, Indicates the video features in The shared features of the frames are obtained by The average value after operation; The video feature is The sliding average of the private features of the frame, The video feature is The sliding average of the shared features of the frames, is the temporal smoothness loss of video features; Construct a consistency loss function, the formula is: , , , in, and They represent the feature differences between consecutive frames of the video modality and the feature differences between consecutive frames of the audio modality, It is Frame and The average value of + , is the consistency loss; The overall time smoothness loss is calculated by the following formula : 。 6. The method according to claim 5, characterized in that Step 6 includes: Initializing a learnable parameter tensor , and then the low-scale text features , audio modality private features , Video modality private features and The text-guided module includes a cross-modal attention mechanism for audio features and text-modal features. is used as the query vector Q, the private features of the audio modality As the key vector K and value vector V respectively, we get and The similarity matrix : , in, and is the learnable parameter matrix, Represents the dimension of each attention head; Calculating text features and video features The similarity matrix : , in is a learnable parameter matrix; Then generate new fusion features : , in , and is the learnable parameter matrix; Will Input into the first Transformer layer, and generate medium-scale text features through deep modeling : , in, represents the first Transformer layer, are the parameters of the first Transformer layer; Then the new fusion feature and mesoscale text features Input into the next text-guided module to obtain fusion features : , in , , , , , and is a learnable parameter matrix; Then the mesoscale text features Input to the second Transformer layer to extract high-scale text features ,then and It is input into the last text-guided module to obtain the final fusion features of audio features and video features. : , , in, represents the second Transformer layer, are the parameters of the second Transformer layer, , , is a learnable parameter matrix; Further modeling through the feedforward network FFN, the final fusion features are obtained: , , , in, , , , is the learnable parameter matrix, is the output after calculation by the cross-modal self-attention mechanism, yes After normalization, the output Represent text features at different scales; hour, , , is a low-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , is the mesoscale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; hour, , , It is a high-scale text feature With fusion features The learnable parameter matrix in the cross-modal attention mechanism, yes and The output after calculation by the cross-modal self-attention mechanism, yes Output after normalization; represents normalization, represents a feed-forward network; , , They represent the multimodal fusion features generated at low, medium, and high scales respectively; Fusion features at different scales and shared modal features Weighted fusion via gating mechanism: , , , , in, ,Right now , , , , and is a learnable weight matrix, yes Through the weight matrix The result after transformation, Refers to sum pooling, is the size of the pooling window, yes After summing and pooling, express The result after L2 normalization is: express The second norm of hour, yes The learnable weight matrix, yes Through the weight matrix The result after transformation, yes After summing and pooling, express The result after L2 normalization; Enter the Multiply it element by element with the weight matrix, and then sum and pool the matrix after element-by-element multiplication to get , then L2 normalization is used to ensure the same scale, and finally, linear mapping weighted summation is performed to obtain the final fusion feature .
7. The method according to claim 6, characterized in that Step 7 includes: The fusion features As input, it is passed to the multi-layer perceptron , output the sentiment prediction results through nonlinear transformation : , The mean square error (MSE) is used as the loss function for task learning. , the calculation formula is: , in, is the sentiment label of the zth sample, is the prediction result of the sentiment analysis module, is the number of samples in the dataset.
8. The method according to claim 7, characterized in that In step 7, the final total loss function is for: , in, , and is a hyperparameter.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: A computer program or instruction is stored, and when the computer program or instruction is run on a computer, the steps of the method according to any one of claims 1 to 8 are executed.
Citation Information
Patent Citations
Multi-task learning sentiment classification method fusing multi-head attention mechanism
CN114238577A
Video emotion content analysis method based on multi-modal fusion and Transform network
CN116453022A
Multi-modal emotion recognition method and system for guiding attention fusion based on text modal, and storage medium
CN117786596A
Multimodal aspect emotion joint extraction method integrated with entity knowledge
CN118504570A
Multi-modal sentiment analysis method based on multi-agent cooperation
CN118673406A
Cited By
Pilot non-contact physiological status assessment method based on signal fusion
CN120021955A
Multi-modal video target identification method based on cross-modal spatio-temporal joint learning
CN120236233A
Cross-modal semantic analysis method
CN120408537A
Dynamic return-to-zero and suppression method and device for electromagnetic background noise, equipment and medium
CN120508922A
Space-time decoupling sentiment analysis method and system based on multi-modal data
CN120930072A