Modal characterization decomposition method for multi-modal metaphor detection

Through modal representation decomposition and multi-task learning framework, the consistency and difference features in multi-modal metaphors are captured, which solves the problem of loss of modal unique features in the existing technology and improves the accuracy of multi-modal metaphor detection. and generalization, which enhances the model's ability to understand multi-modal data.

CN118673401APending Publication Date: 2024-09-20XINJIANG UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410694269.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Existing multimodal metaphor detection methods ignore the heterogeneous features of modalities, resulting in the loss of metaphorical features unique to the modality. They also focus on consistency information and ignore differential features, resulting in poor accuracy and generalization of metaphor detection.

Method used

Using the modal representation decomposition method, the general knowledge representation is extracted through the pre-trained RoBERTa and ViT models, using Projector to decompose the modal features into consistency and difference features, and fusion through the fully connected layer and cross-modal attention. The design Contrastive learning and multi-task learning frameworks retain modality-specific information and improve the accuracy and generalization of multi-modal metaphor detection.

Benefits of technology

By capturing the differential features between modalities, the accuracy and generalization of multimodal metaphor detection is improved, the model's ability to understand multimodal data is enhanced, the loss of specific metaphor information is reduced, and the performance is outstanding in metaphor and on the irony detection task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673401A
    Figure CN118673401A
Patent Text Reader

Abstract

The invention discloses a modal representation decomposition method for multi-modal metaphor detection, and belongs to the technical field of natural language processing. According to the method, each modal representation is decomposed into a consistency feature and a difference feature through different Projectors. And then, a more comprehensive view angle is provided for the consistency feature and difference feature learning of the modal by using the designed contrast learning framework. Meanwhile, in order to retain modal specificity information related to metaphor detection tasks, a multi-task learning framework is designed, and the tasks depend on decomposition representation of each modal, so that the model can learn from single-modal prediction, and loss of specific metaphor information is reduced. Through an elaborately designed comparative learning and multi-task learning combined framework, it is ensured that features in all modalities can be fully adjusted and optimized in multiple training paths.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a modal representation decomposition method for multimodal metaphor detection, and belongs to the technical field of natural language processing. Background Art

[0002] Metaphor involves comparing one concept or object with another seemingly unrelated concept or object. It is an inherent part of natural language and plays an important role in communication, cognition, and decision-making. With the popularization of the Internet and smart terminals, users are increasingly using more obscure multimodal metaphors to express their thoughts on the Internet.

[0003] Research on multimodal metaphors is still in its infancy, mainly focusing on extracting common modality encodings from pre-trained models for classification. Although it has been successfully demonstrated that utilizing additional information in visual modalities has a positive impact on metaphor detection, these methods have a significant limitation, namely, they ignore the importance of modal heterogeneity features for metaphors, resulting in the loss of modality-specific metaphorical features. In multimodal metaphors, modality consistency features provide the common motivation of the expresser, determine the overall contextual state, and are crucial for the interpretation of metaphors. Nevertheless, the most inspiring content in multimodal metaphors is often hidden in the unique features that are inconsistent or contradictory between modalities. This is because metaphors often emerge in unique scenarios that break traditions or challenge opposing concepts, and the conceptual differences they induce are the most challenging and innovative aspects of metaphors. Such unique information is of great significance for inferring special expressions such as the expresser's intentional tendency and emotional polarity. However, the special details unique to a modality are usually irrelevant to other modalities and can easily be regarded as noise when performing feature mining.

[0004] Visual information is an important indicator for multimodal metaphor detection, but existing methods have certain limitations, namely, they focus on finding clues from the consistent information between images and texts, ignoring the potential role of differential features in multimodal metaphors, and often have some errors and poor generalization when looking for key metaphor clues. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the present invention provides a modal representation decomposition method for multimodal metaphor detection, which emphasizes the commonalities between different modalities and pays attention to the difference characteristics between modalities to more comprehensively capture the essence of multimodal metaphors. This comprehensive method can make up for the limitations of existing methods and improve the accuracy and generalization of metaphor detection. The technical solution adopted by the present invention is: a modal representation decomposition method for multimodal metaphor detection, comprising the following steps:

[0006] Given a piece of data containing text content T, an accompanying image P, and a binary truth value label y, where y=0 and y=1 represent whether the multimodal data has metaphorical usage, the goal of this study is to predict whether the given image and text content contains metaphorical information (y^=0 or y^=1) by learning a mapping function F:F(T,P)→(y^);

[0007] S1. General Knowledge Representation: In order to start training the model from good text and visual embeddings, the pre-trained RoBERTa and ViT models are used as text and image general knowledge representation extractors, which are defined as follows:

[0008]

[0009] Among them, nt represents the length of the text, Represents the parameters of the RoBERTa model; ni ​​represents the number of image patches, represents the parameters of the ViT model;

[0010] S2. Modal consistency and difference characterization:

[0011] Given a modality m, the feature code S m ,, use different Projectors to decompose it into consistency and difference; each Projector consists of a normalization layer, a Tanh activated linear layer, and a dropout layer;

[0012]

[0013] Among them, m∈{t,v} is the type of modality, d∈{simi,spec} represents consistency and difference respectively, Assign separate parameters to each modality;

[0014] S3. Cross-modal fusion

[0015] Connect the consistent features and differential features of each modality and perform intra-modal fusion through a fully connected layer;

[0016]

[0017] Where m∈{t,v}, MLP represents a fully connected layer, Represents the parameters of this layer;

[0018] Multimodal feature fusion is achieved by connecting two cross-modal attentions in parallel; different feature inputs are given to them to calculate Q, K and V respectively; this fusion layer simulates the dense interaction between input modalities by exchanging information of the input modalities; the calculation is as follows:

[0019]

[0020] Among them, d h represents the feature dimension of the modality, and Atts represents the attention score;

[0021] Update the original unimodal embedding vector by the inter-modal attention weights to obtain explicit relevant features:

[0022]

[0023] Finally, the representations after cross-modal interaction are connected together and input into the fully connected layer to obtain the fused representation:

[0024] S co =MLP(concat(S t←v ,S v←t );θ co )

[0025] Among them, S co It is a joint feature

[0026] S4. Classification layer

[0027] Use an MLP layer with softmax activation to transform the vector S co Map into the target space of metaphorical and non-metaphorical categories and obtain the probability predicted by the model:

[0028]

[0029] Where W multi is the learning weight matrix that maps fusion features to categories, b multi is the bias term. Furthermore, the final loss of this method is expressed as:

[0030]

[0031] Where α and β are the trade-off parameters between different losses;

[0032] is the multimodal task loss, and its formula is:

[0033]

[0034] Where y is the true label, 1 represents metaphor and 0 represents non-metaphor. is the probability predicted by the model, indicating the possibility that the sample belongs to a metaphor;

[0035] It is the unimodal task loss. For unimodal prediction tasks, the prediction distribution is based on the output of different Projectors. Its goal is to retain the modality-specific information represented by the unimodal label. The specific calculation is as follows:

[0036]

[0037] in Represents the true label of the unimodal prediction, and each feature after decomposition is used separately for prediction; As a consistent feature, its true label is the multimodal true label; As a modality difference feature, its corresponding true label is a unimodal label; however, if the unimodal true label is not available, the multimodal true label can be directly selected;

[0038] For contrastive learning loss, the mutual information between intra-modality features and inter-modality is maximized, and the contrastive learning loss is constructed as:

[0039]

[0040] Among them, P is the set of pairs, N is the set of negative pairs, (r a ,r b ) and (r a ,r c ) represents a pair of decomposition features, such as τ is a temperature hyperparameter.

[0041] The beneficial effects of the present invention are:

[0042] This application provides a feature decomposition framework that aims to more comprehensively understand the consistency and difference features in multimodal metaphor data and achieve more effective information fusion between modalities to improve the performance of multimodal metaphor detection. Specifically, each modal representation is decomposed into consistency features and difference features through different Projectors. Then, the designed contrastive learning framework is used to provide a more comprehensive perspective for learning the consistency features and difference features of the modalities. At the same time, in order to retain the modality-specific information related to the metaphor detection task, a multi-task learning framework is designed. This task relies on the decomposed representation of each modality, enabling the model to learn from single-modal predictions and reduce the loss of specific metaphor information. Through the carefully designed contrastive learning and multi-task learning framework, it is ensured that the features in all modalities can be fully adjusted and optimized in multiple training paths.

[0043] (1) A multimodal representation learning framework is constructed. The framework emphasizes the consistency and difference characteristics between learning modalities in its design, aiming to more accurately capture and understand the deep connotations of complex and changing multimodal data.

[0044] (2) In order to further enhance the model’s ability to understand data of different modalities, a joint learning strategy of contrastive learning and multi-task learning is designed. This joint learning approach not only improves the performance of the model, but also enables it to perform well in multimodal data processing.

[0045] (3) This method is a model that perceives semantic contrast and meaning transformation, and has achieved good results in both metaphor detection and irony detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is the overall framework diagram of the modal representation decomposition method.

[0047] Figure 2 It is a schematic diagram of the cross-modal fusion module.

[0048] Figure 3 It is the ablation analysis result of the modal representation decomposition method. DETAILED DESCRIPTION

[0049] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments: this example is used to further describe the present application. Obviously, the described examples are only part of the embodiments of the present invention, not all of them.

[0050] Example 1

[0051] Given a piece of data containing text content T, an accompanying image P, and a binary truth value label y, where y=0 and y=1 represent whether the multimodal data has metaphorical usage, the goal of this study is to predict whether the given image and text content contains metaphorical information (y^=0 or y^=1) by learning a mapping function F:F(T,P)→(y^);

[0052] The overall framework of this method is as follows Figure 1 As shown in the figure, the representation decomposition process of learning multimodal representations is introduced in detail below.

[0053] 1. Modality Representation Learning

[0054] General Knowledge Representation: We use the pre-trained contextual model RoBERTa to extract general knowledge representation for text. In order to train our model from a good start with image embedding, we use the pre-trained Vision Transformer (ViT) model as the image general knowledge representation extractor.

[0055] Model RoBERTa reference: A.Conneau, K.Khandelwal, N.Goyal, V.Chaudhary, G.Wenzek, F.Guzmán, E.Grave, M.Ott, L.Zettlemoyer, VJapaStoyanov, Unsupervised cross-lingual representation learning at scale, (2019).

[0056] Vision Transformer (ViT) model reference: A.Dosovitskiy, L.Beyer, A.Kolesnikov, D.Weissenborn, X.Zhai, T.Unterthiner, M.Dehghani, M.Minderer, G.Heigold, SJapaGelly, An image is worth 16x16 words: Transformers for imagerecognition at scale, (2020).

[0057] The definition is as follows:

[0058]

[0059] Among them, nt represents the length of the text, Represents the parameters of the RoBERTa model; ni ​​represents the number of image patches, represents the parameters of the ViT model;

[0060] Modality consistency and difference representation: Each modality encoding is mapped to different representations, namely consistency representation and difference representation. Consistency helps capture the potential commonalities and related features between modalities, while difference captures the unique features and special details of each modality. Given a feature encoding S of a modality m, m ,, we use different Projectors to decompose it into consistency and difference. Each Projector consists of a normalization layer, a Tanh activated linear layer, and a dropout layer.

[0061]

[0062] Among them, m∈{T,V} is the type of mode, d∈{simi,spec} represents consistency and difference respectively, Assign separate parameters to each mode.

[0063] 2. Cross-modal fusion

[0064] Cross-modal fusion modules such as Figure 2 First, the consistency features and difference features of each modality are connected, and the internal fusion of the modality is performed through the fully connected layer.

[0065]

[0066] Among them, m∈{T,V}, MLP represents the fully connected layer, Represents the parameters of this layer.

[0067] Then, multimodal feature fusion is achieved by connecting two cross-modal attentions in parallel. Different feature inputs are given to them to calculate Q, K, and V respectively. This fusion layer simulates the dense interaction between input modalities by exchanging information of the input modalities. The calculation is as follows:

[0068]

[0069] Among them, d h represents the feature dimension of the modality, and Atts represents the attention score. Then, we update the original unimodal embedding vector by the inter-modal attention weight to obtain explicit related features:

[0070]

[0071] Finally, the representations after cross-modal interaction are connected together and input into the fully connected layer to obtain the fused representation.

[0072] S co =MLP(concat(S t←v ,S v←t );θ co )

[0073] Among them, S co is a joint feature.

[0074] 3. Classification layer

[0075] So far, we have obtained a fused multimodal high-level representation S co We project this vector into the target space of metaphorical and non-metaphorical classes using an MLP layer with softmax activation and obtain the probability distribution:

[0076]

[0077] Where W multi is the learning weight matrix that maps fusion features to categories, b multi is the deviation term.

[0078] 4. Loss Function

[0079] The model of this application has three loss terms. The first is the cross entropy loss of the probability distribution of multimodal metaphors. The second is the multi-task prediction loss that preserves the characteristics of modal differences. The third is the inter-modal and intra-modal contrast loss scheme. To this end, we express the final loss of the multimodal metaphor detection method as:

[0080]

[0081] Where α and β are the trade-off parameters between different losses.

[0082] -Multimodal task loss. The task loss is to ensure the basic detection ability. We use the cross entropy loss of multimodal metaphor classification. The formula is:

[0083]

[0084] Where y is the true label, 1 represents metaphor and 0 represents non-metaphor. is the probability predicted by the model, indicating the possibility that the sample belongs to a metaphor.

[0085] – Unimodal task loss. Different from the common aggregation-based multimodal learning methods, our method also uses a multi-task learning framework to use the unimodal detection task as an auxiliary task for the multimodal detection task. For the unimodal prediction task, the prediction distribution is based on the output of different projectors. Its goal is to retain the modality-specific information represented by the unimodal label. The specific calculation is as follows:

[0086]

[0087] in Represents the true label of the unimodal prediction. Each feature after decomposition is used separately for prediction. It should be noted that As a consistent feature, its true label is the multimodal true label. As a modality difference feature, its corresponding true label is a unimodal label. However, if the unimodal true label is not available, the multimodal true label can be directly used.

[0088] – Contrastive loss. In order to simultaneously utilize the intrinsic data properties within each modality and the semantic information from cross-modal correlations to improve the quality of learned different representations, we maximize the mutual information between intra-modal features and inter-modal features and construct a contrastive learning loss to learn better multimodal representations of the main task. The training objective is:

[0089]

[0090] Among them, P is the set of pairs, N is the set of negative pairs, (r a ,r b ) and (r a ,r c ) represents a pair of decomposition features, such as τ is a temperature hyperparameter.

[0091] We consider the following two aspects when constructing positive and negative pairs: (1) modality consistency features capture modality-similar semantics and need to be brought closer to each other. The same applies to modality-unique features, so they are constructed as positive pairs; (2) consistency and difference representations should be separated from each other and aim to complement each other, so they need to be constructed as negative pairs.

[0092] Example 2

[0093] 1. Experimental Dataset

[0094] Experiments were conducted on two public benchmark datasets. Table 1 shows the datasets. Met-meme is a multimodal metaphor dataset containing Chinese and English.

[0095] In addition, Su et al. pointed out that metaphor is a special form of figurative language. Extending the model to other figurative languages, such as metonymy, simile, irony, and pun, can evaluate the model's robustness, generalization, and ability to perceive common semantic contrasts and meaning transformations. It is worth noting that irony and metaphor have similar cognitive mechanisms because they both convey information in a creative and indirect way. Therefore, we further selected the multimodal Sarcasm dataset to comprehensively verify the performance of this model.

[0096] Table 1: Statistics of Met-meme and Sarcasm datasets

[0097] Dataset #Training set # Validation set #Test set total Met-meme 6027 2009 2009 10045 Sarcasm 14997 2410 2409 19816

[0098] 2. Experimental Setup

[0099] (1) All neural network models in this paper are implemented using the PyTorch (version 1.7.0) framework. (2) In the experiment, the maximum length of the sentence input is set to 80 and the batchsize is set to 32. (3) The learning rate, dropout rate and weight parameters are respectively grid searched on the combination of [1e-5, 1e-4], [0.1, 0.5] and [0.1, 0.9] to achieve the best performance of the model. (4) The maximum training epoch is 100 and the early stopping is set to 10. (5) The hyperparameters α and β of the total loss are searched on the validation set and are set to 0.01 respectively. (6) For the Met-meme dataset, we use Accuracy and weighted F1-Score; for the Sarcasm dataset, we use Accuracy and macro F1-Score.

[0100] 3. Comparison method

[0101] Unimodal baseline:

[0102] For the text modality, we designed Transformer-based pre-trained language models, including Bert, Bart, ELECTRA, and RoBERTa as baselines. We used a multilingual version of Bert, and a version of RoBERTa fine-tuned on metaphor data using XLM-RoBERTa.

[0103] For the image modality, we use ResNet50 and VGG16, ViT for pre-training and fine-tuning. For the image modality, we use Swin-transformer and ViT for pre-training and fine-tuning on images.

[0104] Multimodal Baselines:

[0105] The following models use image and text data for multimodal metaphor detection: (1) Res+Bert, which fuses the image features extracted by Resnet50 and the text features extracted by Bert in an element-by-element manner for metaphor detection. (2) BiAtt-VGG (cat) uses Bi-LSTM+attention and VGG as text and visual feature extractors, respectively. (3) Bi-Att designs Bi-LSTM and attention mechanism as a fusion network for metaphor detection. (4) MTSA is a multimodal framework that converts visual features into text features. (5) MKGformer is a multi-level fusion hybrid Transformer. (6) EMT is a multimodal Transformer architecture that can fuse unaligned multimodal data.

[0106] 4. Experimental results

[0107] Table 2: Comparison of accuracy and F1-score results between our model and other models on the Met-meme benchmark.

[0108]

[0109]

[0110] The experiments on all datasets were divided into three groups. All datasets were tested in three groups of experiments, and the results are shown in Table 2. On the Met-meme dataset, the image modality method performed poorly compared with the text modality method. This may be because the text in the multimodal metaphor data contains more effective feature information, and relying solely on image data to detect metaphor information may face greater challenges. In addition, the model in this application was compared with some multimodal detection models. The experimental results show that the model in this application achieved the best F1 score (87.39%), exceeding the strongest baseline by 4.85%, fully demonstrating the superior performance of the model in the multimodal metaphor detection task. Compared with the unimodal method, the multimodal method performed better, which once again confirmed the effectiveness of introducing visual features into the metaphor detection task.

[0111] In addition, the model in this application was tested on a public multimodal sarcasm dataset. As shown in Table 3, the model in this application achieved satisfactory accuracy (87.81%) and F1 score (87.51%). Compared with strong baseline models such as CMGCN, the F1 score of the model in this application increased by 0.51%.

[0112] Table 3: Comparison of accuracy and F1-score results between our model and other models on the Sarcasm benchmark

[0113]

[0114] 5. Ablation analysis

[0115] As shown in Table 4, ablation studies are performed using the following variants to evaluate the impact of different components in the proposed model: 1) Without unimodal prediction module 2) No comparative learning module 3) Having task losses only for multimodal prediction 4) The Projector in the model is deleted, and the classification vectors of the text encoder and the image encoder are concatenated and provided to the final classifier - Projector&+Concate. Through these ablation studies, we can more clearly understand the role and importance of each part of the model. For ease of understanding, the results of the ablation experiment are more intuitively displayed in Figure 3 middle.

[0116] Table 4: Ablation analysis studies.

[0117]

[0118] The results show that all variants lead to performance degradation compared to the model in this application. Both contrastive learning and unimodal prediction tasks can standardize the learned representations, thereby producing clearer information and helping the classifier to better understand the samples. The model in this application is also compared with a model without representation decomposition. The experimental results show that in the multimodal metaphor detection task, it is crucial to learn the common consistency and unique difference features of the modalities.

[0119] This method decomposes features into modality consistency and difference features through different projectors. Then, a multi-task learning framework is introduced to take unimodal metaphor detection as an auxiliary task to fully capture the unimodal representation related to the metaphor detection task and reduce the multimodal metaphor detection bias caused by the loss of specific metaphor information. A contrastive learning strategy is designed to simultaneously utilize the intrinsic data properties within each modality and the semantic information from cross-modal correlations to improve the quality of representation decomposition. Finally, a large number of experiments on multimodal metaphor and irony datasets demonstrate the effectiveness of the proposed model.

Claims

1. A modal representation decomposition method for multimodal metaphor detection, characterized in that: The following steps are involved: Given a piece of data containing text content T, an accompanying image P, and a binary truth value label y, where y=0 and y=1 represent whether the multimodal data has metaphorical usage, a mapping function F:F(T,P)→(y^) is learned to predict whether the given image and text content contains metaphorical information; S1. General knowledge representation: Use the pre-trained RoBERTa and ViT models as text and image general knowledge representation extractors, defined as follows: Among them, nt represents the length of the text, Represents the parameters of the RoBERTa model; ni ​​represents the number of image patches, Represents the parameters of the ViT model; S2. Modal consistency and difference characterization: Given a modality m, the feature code S m ,, use different Projectors to decompose it into consistency and difference; each Projector consists of a normalization layer, a Tanh activated linear layer, and a dropout layer; Among them, m∈{t,v} is the type of modality, d∈{simi,spec} represents consistency and difference respectively, Assign separate parameters to each modality; S3. Cross-modal fusion Connect the consistent features and differential features of each modality and perform intra-modal fusion through a fully connected layer; Where m∈{t,v}, MLP represents a fully connected layer, Represents the parameters of this layer; Multimodal feature fusion is achieved by connecting two cross-modal attentions in parallel; different feature inputs are given to them to calculate Q, K and V respectively; this fusion layer simulates the dense interaction between input modalities by exchanging information of the input modalities; the calculation is as follows: Among them, d h represents the feature dimension of the modality, and Atts represents the attention score; Update the original unimodal embedding vector by the inter-modal attention weights to obtain explicit relevant features: Finally, the representations after cross-modal interaction are connected together and input into the fully connected layer to obtain the fused representation: S co =MLP(concat(S t←v ,S v←t );θ co ) Among them, S co It is a joint feature S4. Classification layer Use an MLP layer with softmax activation to transform the vector S co Map into the target space of metaphorical and non-metaphorical categories and obtain the probability predicted by the model: Where W multi is the learning weight matrix that maps fusion features to categories, b multi is the deviation term.

2. A modal representation decomposition method for multimodal metaphor detection, characterized by: The final loss of this method is expressed as: Where α and β are the trade-off parameters between different losses; is the multimodal task loss, and its formula is: Where y is the true label, 1 represents metaphor and 0 represents non-metaphor. is the probability predicted by the model, indicating the possibility that the sample belongs to a metaphor; It is the unimodal task loss. For unimodal prediction tasks, the prediction distribution is based on the output of different Projectors. Its goal is to retain the modality-specific information represented by the unimodal label. The specific calculation is as follows: in Represents the true label of the unimodal prediction, and each feature after decomposition is used separately for prediction; As a consistent feature, its true label is the multimodal true label; As a modality difference feature, its corresponding true label is a unimodal label; however, if the unimodal true label is not available, the multimodal true label can be directly selected; For contrastive learning loss, the mutual information between intra-modality features and inter-modality is maximized, and the contrastive learning loss is constructed as: Among them, P is the set of pairs, N is the set of negative pairs, (r a ,r b ) and (r a ,r c ) represents a pair of decomposed features, and τ is the temperature hyperparameter.

Citation Information

Cited By

  • Multi-modal large language model metaphor characterization method based on edge detection

    CN120448919A

  • A Metaphorical Representation Method for Multimodal Large Language Models Based on Edge Detection

    CN120448919B

  • Multi-mode private harmful content detection method and device, electronic equipment and storage medium

    CN120744566A