A multi-modal entity relation joint extraction method
By normalizing and weighting the projection components of image features onto text features and fusing them with a cross-modal attention mechanism, the problems of noise interference and modal differences in multimodal entity relation extraction are solved, thereby improving the accuracy and robustness of entity relation extraction.
Patent Information
- Application Number
- CN202410796883.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-06-19
AI Technical Summary
Existing multimodal entity relation extraction methods suffer from noise interference and semantic and structural differences between modalities when dealing with content that is unrelated or weakly related between modalities, leading to performance degradation.
By calculating the projection components of image features onto text features, normalizing the image features, weighting them, and using a cross-modal attention mechanism for feature fusion, combined with a text-oriented cross-modal attention mechanism and a diagonal tag decoding strategy, entity relation triples are extracted.
It effectively suppresses background noise, reduces intermodal cognitive differences, improves the accuracy and robustness of entity relationship extraction, and can accurately locate head and tail entities in complex scenes, alleviating the problem of positive and negative sample imbalance.
Smart Images

Figure CN118797076B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing technology, and more specifically, relates to a method for joint extraction of multimodal entity relations. Background Technology
[0002] Entities refer to things or abstract concepts that exist in the real world, while relationships refer to semantic connections between different entities. A model that completes entity extraction and relationship extraction tasks in an end-to-end manner is called a joint extraction model. Entering a new stage of information dissemination, the presentation of content on various platforms has transcended the single realm of text. Exploring how to effectively utilize and fuse multimodal information from images has become a key issue that urgently needs to be addressed in today's research field.
[0003] Current multimodal methods mainly focus on exploring modal feature extraction, feature alignment, and feature interaction.
[0004] Early research, such as that by Moon et al., involved inputting text into a bidirectional long short-term memory network to extract its inherent semantic representation, while simultaneously using the Inception model based on a convolutional neural network to process image information and obtain vectorized representations rich in fine-grained image features. Subsequently, an attention mechanism was used to fuse these two modalities. However, the vectorized representation of the entire image may contain noise information that is weakly or even irrelevant to the text, because only certain specific regions in the image substantially contribute to supplementing textual information. To address this issue, Lu et al. and Zhang et al. proposed utilizing feature maps from the CNN process to more accurately capture the feature representations of different regions of the image.
[0005] Next, Zhang et al. and Lu et al. used part-of-speech tagging of the text as a guide to direct the selection of image features, thereby specifically assisting in the recognition of text entities. Although this approach improves the effectiveness of image features to some extent, it is susceptible to error propagation due to its reliance on external part-of-speech tagging tools. Furthermore, the model employs a multimodal graph structure to align features from different modalities. This graph structure iteratively updates node features, allowing text and image features to interact and deeply fuse, forming cross-modal contextual embeddings. Meanwhile, many scholars have achieved significant results by utilizing graph structures for multimodal knowledge extraction through various methods.
[0006] To address the challenge of weak or nonexistent correlations between numerous image-text pairs in real-world social media contexts, Sun et al. innovatively designed a gating mechanism. This mechanism adjusts attention-oriented visual cues related to text semantics to accommodate varying degrees of correlation between different image-text pairs. Building upon this, Sun et al. utilized an image-text relationship propagation strategy to dynamically adjust visual attention weights, ensuring that images are only incorporated into the model's decision-making process when they positively impact text entity recognition. This enhances the model's robustness in multimodal environments.
[0007] Furthermore, Wang et al. attempted to transform image features into text features, unifying cross-modal features into the textual representation space using OCR text recognition, region object detection, and image captioning. Wang et al., on the other hand, combined cue learning with multimodal knowledge extraction techniques, extracting image features using entity-related cues, and innovatively proposed a modality-aware attention mechanism to optimize cross-modal fusion, effectively alleviating the semantic gap problem.
[0008] Although current methods for multimodal entity relation extraction have achieved some success, they still have two limitations:
[0009] 1. The content of the modalities is unrelated or weakly correlated.
[0010] In many cases, the correlation between image and text pairing data is limited or even irrelevant. This characteristic may introduce unstructured noise into the multimodal entity relationship joint extraction model, thereby negatively impacting its overall performance.
[0011] 2. Semantic and structural differences between modalities
[0012] Textual modality expresses information through symbolic, linear sequences, typically including vocabulary, syntactic structure, and logical relationships. It possesses a clear grammatical structure and hierarchical relationships, representing a highly abstract and generalized form of language. Image modality, on the other hand, conveys information through color images composed of pixels, visually showcasing the appearance, shape, color, spatial layout, and other concrete visual features of entities. The two differ significantly in their modes of expression; images are more intuitive and concrete, while text focuses more on implicit meaning and logic.
[0013] The above analysis shows that existing entity relationship extraction models cannot achieve ideal results when dealing with modal content that is irrelevant or weakly related, and there is room for improvement in the feature extraction and feature fusion processes. Therefore, it is necessary to conduct in-depth research on multimodal entity relationship extraction tasks. Summary of the Invention
[0014] The purpose of this invention is to overcome the shortcomings of the prior art and provide a multimodal entity relationship joint extraction method. Based on the association strength between the image and text, the image features of different regions are weighted and the image and text features are effectively fused to improve the accuracy of the entity relationship joint extraction task.
[0015] To achieve the above-mentioned objective, the present invention provides a multimodal entity relationship joint extraction method, characterized by comprising the following steps:
[0016] (1) Text and image feature extraction;
[0017] Download the original image from the social media platform, along with the corresponding text description (referred to as "text").
[0018] Image features of the original image are extracted using the VGG-16 model, and text representations of the text are extracted using the BERT model.
[0019] Subsequently, both image features and text representations are nonlinearly mapped to a unified vector space to obtain image features V and text features H;
[0020] (2) Calculate the projection components of image features onto text features;
[0021] Suppose that the image feature V contains a total of M feature vectors, where each feature vector represents a feature corresponding to a certain region in the original image.
[0022] Let v be the feature vector corresponding to the i-th region in the original image. i Let i = 1, 2, ..., M; and let h be the feature vector corresponding to the j-th word in the text. j j = 1, 2, ..., N, where N represents the number of words in the text;
[0023] Calculate the eigenvector v i In the text feature vector h j The projected length;
[0024]
[0025] Among them, L i→j Indicates v i In h j The projected length on;
[0026] Calculate the eigenvector v i Maximum projection length on text features:
[0027]
[0028] (3) Normalize the maximum projection value of each pixel in the image features;
[0029] The maximum projection length of each pixel using the Sigmoid function. i Normalization is performed to map it to the range [0, 1], resulting in the feature vector v. i The correlation coefficient between Moda l Simila and text feature H i r:
[0030] Modal Similarity i =Sigmoid(projectionlength) i )
[0031] (4) Weight the image features V;
[0032] Modal Similarity i With each feature vector v in image feature V i Multiplying by corresponding positions yields a weighted, enhanced image feature V with textual guidance. match ;
[0033]
[0034] in, Represents the eigenvector v i The result after weighted processing;
[0035] (5) Cross-modal feature fusion;
[0036] Suppose that the cross-modal attention mechanism module consists of L layers of cross-modal attention mechanism layers, and each layer of cross-modal attention mechanism layer contains text-to-text sub-attention mechanism and image-to-text cross-modal attention mechanism;
[0037] Each cross-modal attention mechanism layer contains two inputs, one of which is the image feature V. match The other input is the text feature H output from the previous layer. k-1 The input to the first cross-modal attention mechanism layer is the text feature H;
[0038] In each cross-modal attention mechanism layer, the text features H are first converted into three matrices, denoted as:
[0039]
[0040] Where k = 1, 2, ..., L, W Q W K W V The weight matrix represents the transformation of text feature H;
[0041] Then, the image features V match Convert to two sets of matrices, denoted as:
[0042]
[0043] in, Representing image features V match Weight matrix during transformation;
[0044] Will Input-to-text to text sub-attention mechanism, while... The input is a cross-modal attention mechanism from image to text, and then the features are calculated by concatenating the two sub-attention mechanisms through the attention mechanism operation.
[0045]
[0046] Where T2T represents text-to-text sub-attention mechanism, I2T represents image-to-text cross-modal attention mechanism, and Attention represents attention mechanism operation;
[0047] Features After passing through residual connections and a feedforward neural network, the output H of the k-th layer of the cross-modal attention mechanism is obtained. k Finally, the cross-modal fused text features H are obtained at the Lth layer. L ;
[0048] (6) Extract entity relation triples;
[0049] Text features H L Mapped into a feature space of size K×N×N, where K represents the number of predefined relations and N represents the number of words in the text. Each relation in the feature space corresponds to an entity relation triple matrix.
[0050] For the element a in the i-th row and j-th column of the triple matrix ij The corresponding numerical values are used for label mapping, if a ij If ≤λ1, then in element a ij Add the label "HBTB" to indicate the start position of the head entity and the start position of the tail entity; if λ1 < a ij If ≤λ2, then in element a ij Add the label "HETE" to indicate the end position of the head entity and the end position of the tail entity; if λ2 < a ij If ≤λ3, then in element a ij Add the label "IN" to indicate the area enclosed by the beginning and end entities; if a ij If λ > 3, then in element a ijAdding a "-" label at this location indicates that this location does not directly participate in the positioning process of the head and tail entities;
[0051] Subsequently, in each triplet matrix, find the labels “HBTB” and “HETE”, and record the position of label “HBTB” as (x1, y1) and the position of label “HETE” as (x2, y2), where x1, y1, x2, y2 ∈ [1, N].
[0052] Then, the words at positions (x1, x2) are used to form the head entity, and the words at positions (x2, y2) are used to form the tail entity. The relation corresponding to the triple matrix is used as the entity relation, thereby extracting the entity relation triple.
[0053] The objective of this invention is achieved as follows:
[0054] This invention discloses a multimodal entity relation joint extraction method. First, the original image and its corresponding text description are downloaded. Then, the features of the text description and the original image are extracted. Next, the projection components of the image features onto the text features are calculated, and the maximum projection value of each pixel is selected for normalization. Then, the image features are weighted according to the normalization result, and the weighted result is fused with the text features across modalities. Finally, entity relation triples are extracted based on the fusion result.
[0055] Meanwhile, the multimodal entity relation joint extraction method of the present invention also has the following beneficial effects:
[0056] (1) Text-oriented cross-modal feature matching method uses visual information as auxiliary features to quantify the similarity between image and text features, thereby effectively identifying and utilizing key regions that contribute to the task from visual input, while suppressing or ignoring background noise.
[0057] (2) The text-oriented cross-modal attention mechanism effectively integrates text self-attention features and image-text cross-modal attention features within the Transformer encoder architecture, reducing intermodal cognitive differences and enhancing the effectiveness of information extraction and expression.
[0058] (3) The diagonal labeling and decoding strategy transforms the original task into a 3D classification task, enabling the extraction of entity relation triples within a single model. The diagonal and padding labels in this strategy not only effectively locate head and tail entities in complex semantic scenes but also alleviate the limitations caused by the imbalance between positive and negative samples, improving the overall model performance while efficiently handling entity overlap. Attached Figure Description
[0059] Figure 1 This is a flowchart of the multimodal entity relationship extraction method of the present invention;
[0060] Figure 2 This is a schematic diagram of a text-oriented cross-modal attention mechanism module;
[0061] Figure 3 It is a triple matrix carrying four specific labels.
[0062] Specific implementation party
[0063] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here. Example
[0064] Figure 1 This is a flowchart of a multimodal entity relationship joint extraction method according to the present invention.
[0065] In this embodiment, as Figure 1 As shown, the present invention provides a method for joint extraction of multimodal entity relationships, comprising the following steps:
[0066] S1. Text and image feature extraction;
[0067] Download the original image from the social media platform, along with the corresponding text description (referred to as "text").
[0068] Image features of the original image are extracted using the VGG-16 model, and text representations of the text are extracted using the BERT model.
[0069] Subsequently, both image features and text representations are nonlinearly mapped to a unified vector space to obtain image features V and text features H;
[0070] S2. Calculate the projection components of image features onto text features;
[0071] Suppose that the image feature V contains a total of M = 49 feature vectors, where each feature vector represents a feature corresponding to a certain region in the original image.
[0072] Let v be the feature vector corresponding to the i-th region in the original image. i Let i = 1, 2, ..., M; and let h be the feature vector corresponding to the j-th word in the text. j j = 1, 2, ..., N, where N represents the number of words in the text;
[0073] Calculate the eigenvector v i In the text feature vector h j The projected length;
[0074]
[0075] Among them, L i→j Indicates v i In h j The projected length on;
[0076] Calculate the eigenvector v i Maximum projection length on text features:
[0077]
[0078] In this embodiment, the maximum value among each projection component is selected to ensure that the most representative image-text association information is captured, so as to prevent the information from being covered by noise;
[0079] S3. Normalize the maximum projection value of each pixel in the image features;
[0080] The maximum projection length of each pixel using the Sigmoid function. i Normalization is performed to map it to the range [0, 1], resulting in the feature vector v. i The correlation coefficient between Moda l Simila and text feature H i r:
[0081] Modal Similarity i =Sigmoid(projectionlength) i )
[0082] The higher the correlation coefficient, the more key information the image region contains in the extracted relation triples.
[0083] S4. Perform weighted processing on image features V;
[0084] Modal Similarity i With each feature vector v in image feature V i Multiplying by corresponding positions yields a weighted, enhanced image feature V with textual guidance. match ;
[0085]
[0086] in, Represents the eigenvector v i The result after weighted processing;
[0087] S5, cross-modal feature fusion;
[0088] Suppose that the cross-modal attention mechanism module consists of L layers of cross-modal attention mechanism layers, and each layer of cross-modal attention mechanism layer contains text-to-text sub-attention mechanism and image-to-text cross-modal attention mechanism;
[0089] Among them, such as Figure 2 As shown, each cross-modal attention mechanism layer contains two inputs, one of which is the image feature V. match The other input is the text feature H output from the previous layer. k-1 The first layer of the cross-modal attention mechanism takes text features H and image features V as input. match ;
[0090] In each cross-modal attention mechanism layer, the text features H are first converted into three matrices, denoted as:
[0091]
[0092] Where k = 1, 2, ..., L, W Q W K W V The weight matrix represents the transformation of text feature H;
[0093] Then, the image features V match Convert to two sets of matrices, denoted as:
[0094]
[0095] in, Representing image features V match Weight matrix during transformation;
[0096] Will Input-to-text to text sub-attention mechanism, while... The input is a cross-modal attention mechanism from image to text, and then the features are calculated by concatenating the two sub-attention mechanisms through the attention mechanism operation.
[0097]
[0098] Where T2T represents text-to-text sub-attention mechanism, I2T represents image-to-text cross-modal attention mechanism, and Attention represents attention mechanism operation;
[0099] Features After passing through residual connections and a feedforward neural network, the output H of the k-th layer of the cross-modal attention mechanism is obtained. k Finally, the cross-modal fused text features H are obtained at the Lth layer. L ;
[0100] S6. Extract entity relation triples;
[0101] Text features H L The mapping is transformed into a feature space of size K×N×N, where K represents the predefined number of relations and N represents the number of words in the text. Each relation in the feature space corresponds to an entity-relation triple matrix. In this embodiment, each N×N triple matrix is as follows: Figure 3 As shown.
[0102] In this embodiment, the feature classification of each element in the triplet matrix is defined as four specific label categories, namely: "HBTB", "HETE", "IN", and "-"; the corresponding threshold ranges of the four specific label categories are: (-∞,λ1], (λ1,λ2], (λ2,λ3], and (λ3,+∞), where λ1, λ2, and λ3 are thresholds.
[0103] For the element a in the i-th row and j-th column of the triple matrix ij The corresponding numerical values are used for label mapping, if a ij If ≤λ1, then in element a ij Add the label "HBTB" to indicate the start position of the head entity and the start position of the tail entity; if λ1 < a ij If ≤λ2, then in element a ij Add the label "HETE" to indicate the end position of the head entity and the end position of the tail entity; if λ2 < a ij If ≤λ3, then in element a ij Add the label "IN" to indicate the area enclosed by the beginning and end entities; if a ij If λ > 3, then in element a ij Adding a "-" label at this location indicates that this location does not directly participate in the positioning process of the head and tail entities;
[0104] Next, check if the triplet matrix contains the labels "HBTB" and "HETE". Figure 3 As shown, if the labels “HBTB” and “HETE” are found in the triple matrix, the position of the label “HBTB” is recorded as (x1, y1) and the position of the label “HETE” is recorded as (x2, y2), where x1, y1, x2, y2 ∈ [1, N].
[0105] Finally, the words at positions (x1, x2) are used to form the head entity, and the words at positions (x2, y2) are used to form the tail entity. The relation corresponding to the triple matrix is used as the entity relation, thereby extracting the entity relation triple.
[0106] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A method for joint extraction of multimodal entity relationships, characterized in that, Includes the following steps: (1) Text and image feature extraction; Download the original image from the social media platform, along with the corresponding text description (referred to as "text"). Image features of the original image are extracted using the VGG-16 model, and text representations of the text are extracted using the BERT model. Subsequently, both image features and text representations are nonlinearly mapped to a unified vector space to obtain image features V and text features H; (2) Calculate the projection components of image features onto text features; Suppose that the image feature V contains a total of M feature vectors, where each feature vector represents a feature corresponding to a certain region in the original image. Let v be the feature vector corresponding to the i-th region in the original image. i Let i = 1, 2, ..., M; and let h be the feature vector corresponding to the j-th word in the text. j j = 1, 2, ..., N, where N represents the number of words in the text; Calculate the eigenvector v i In the text feature vector h j The projected length; Among them, L i→j Indicates v i In h j The projected length on; Calculate the eigenvector v i Maximum projection length on text features: (3) Normalize the maximum projection value of each pixel in the image features; The maximum projection length of each pixel using the Sigmoid function. i Normalization is performed to map it to the range [0, 1], resulting in the feature vector v. i The correlation coefficient between Modal Simila and text feature H i r: Modal Similarity i =Sigmoid(projectionlength i ) (4) Weight the image features V; Modal Similarity i With each feature vector v in image feature V i Multiplying by corresponding positions yields a weighted, enhanced image feature V with textual guidance. match ; in, Represents the eigenvector v i The result after weighted processing; (5) Cross-modal feature fusion; Suppose that the cross-modal attention mechanism module consists of L layers of cross-modal attention mechanism layers, and each layer of cross-modal attention mechanism layer contains text-to-text sub-attention mechanism and image-to-text cross-modal attention mechanism; Each cross-modal attention mechanism layer contains two inputs, one of which is the image feature V. match The other input is the text feature H output from the previous layer. k-1 The input to the first cross-modal attention mechanism layer is the text feature H; In each cross-modal attention mechanism layer, the text features H are first converted into three matrices, denoted as: Where k = 1, 2, ..., L, W Q W K W V The weight matrix represents the transformation of text feature H; Then, the image features V match Convert to two sets of matrices, denoted as: in, Representing image features V match Weight matrix during transformation; Will Input-to-text to text sub-attention mechanism, while... The input is a cross-modal attention mechanism from image to text, and then the features are calculated by concatenating the two sub-attention mechanisms through the attention mechanism operation. Where T2T represents text-to-text sub-attention mechanism, I2T represents image-to-text cross-modal attention mechanism, and Attention represents attention mechanism operation; Features After passing through residual connections and a feedforward neural network, the output H of the k-th layer of the cross-modal attention mechanism is obtained. k Finally, the cross-modal fused text features H are obtained at the Lth layer. L ; (6) Extract entity relation triples; Text features H L Mapped into a feature space of size K×N×N, where K represents the number of predefined relations and N represents the number of words in the text. Each relation in the feature space corresponds to an entity relation triple matrix. For the element a in the i-th row and j-th column of the triple matrix ij The corresponding numerical values are used for label mapping, if a ij If ≤λ1, then in element a ij Add the label "HBTB" to indicate the start position of the head entity and the start position of the tail entity; if λ1 < a ij If ≤λ2, then in element a ij Add the label "HETE" to indicate the end positions of the head and tail entities; if λ2 < a ij If ≤λ3, then in element a ij Add the label "IN" to indicate the area enclosed by the beginning and end entities; if a ij If λ > 3, then in element a ij Add a "-" label at the location to indicate that the location does not directly participate in the localization process of the head and tail entities; where λ1, λ2, and λ3 are threshold values. Subsequently, in each triplet matrix, find the labels "HBTB" and "HETE", and record the position of the label "HBTB" as (x1, y1) and the position of the label "HETE" as (x2, y2), where x1, y1, x2, y2 ∈ [1, N]. Finally, the words at positions (x1, x2) are used to form the head entity, and the words at positions (x2, y2) are used to form the tail entity. The relation corresponding to the triple matrix is used as the entity relation, thereby extracting the entity relation triple.
