Visual text question and answer learning method fusing dynamic heterogeneous hypergraph neural network and Transform

By combining dynamic heterogeneous hypergraph neural networks and the Transformer attention mechanism, the problem of capturing the relationship between images and text in visual text question answering tasks is solved, and more accurate multimodal data processing and answer generation are achieved.

CN118964536APending Publication Date: 2024-11-15BEIJING UNIV OF TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410557873.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively capture the complex relationships between images and text in visual text question answering tasks, especially when processing multimodal data, as they neglect the diversity of modalities and the subtle relationships between objects.

Method used

The Dynamic Heterogeneous Hypergraph Neural Network (DHHG-TAC) model is adopted. Through the hypergraph neural network stage, the Transformer-based combined attention stage, the hypergraph dynamic update stage, and the multimodal feature fusion classification stage, it combines scene graph information of image and text modalities and uses hypergraph convolutional layers, self-attention and cross-attention mechanisms to dynamically adjust the modal feature attention and interaction information.

Benefits of technology

It improves the ability to capture complex relationships between images and text, enhances the accuracy of problem understanding and answer generation, and dynamically adjusts the model's ability to identify and process key information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964536A_ABST
    Figure CN118964536A_ABST
Patent Text Reader

Abstract

The invention discloses a visual text question and answer learning method fusing a dynamic heterogeneous hypergraph neural network and a Transform, and belongs to the technical field of deep learning and application in multi-modal data processing. The method comprises the following steps of: preprocessing data of scene graph information and text problems of an image through graph structured processing; the method comprises the following steps: preprocessing original data into hypergraph pairs based on a mode of generating hypergraphs by random walk; giving an initial hyperedge weight according to node features on the hyperedge, and obtaining each modal feature containing a complex structure relation through a hypergraph neural network; on the basis of a self-attention and cross attention mechanism of a Transform, respective characteristics of different modes and important interaction information between the modes are concerned. Related structure information in the answer area is found through the combination of the two kinds of attention; dynamically updating hyperedge weights of the hypergraph pairs through the obtained attention weights; according to the method, the recognition and processing capability of key information is further refined by utilizing a self-attention and cross attention mechanism of a Transform framework.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to deep learning and its application in multimodal data processing, and in particular to a deep learning processing method for visual text question answering tasks, which effectively improves the model's ability to process multimodal data (such as images and text) by combining hypergraph generation and its use with the Transformer attention mechanism. Background Art

[0002] Visual Question Answering (VQA) is an important research direction in the field of computer vision and natural language processing, which aims to enable computer systems to understand the content of images and answer natural language questions about these images. In the prior art, although there are deep learning-based methods for processing VQA tasks, these methods often have limitations in processing complex data relationships with high-order structures, especially in understanding the complex relationship between images and texts and their internal structures.

[0003] Initially, researchers handled multimodal tasks by combining neural network models that handle unimodal tasks, such as a convolutional network for processing image modalities and a recurrent neural network for processing text modalities. However, these methods did not work well due to the intricate interactions between different modalities. To address this problem, two main strategies have emerged to fuse features from various modalities: bilinear pooling and attention mechanisms. The former has achieved certain results in the field of image recognition and can effectively reduce the amount of computation, while the latter has gained more attention due to its success in various fields. However, most questions in VQA tasks are relatively short, so few models incorporate attention into text representation in VQA. In addition, the attention mechanism is difficult to generalize to graph-structured data, and it is difficult to capture the complex and intertwined structural information between objects - this is an important bottleneck in using the attention mechanism to handle multimodal tasks.

[0004] Furthermore, in order to deal with the problem that attention weights cannot be learned directly on graph-structured data, scholars have designed graph neural networks to represent complex graph-structured data as tensors that can use attention mechanisms, and have achieved good results. Unlike the edges of traditional graphs that connect a pair of nodes, the hyperedges of hypergraphs in hypergraph neural networks (HGNNs) can connect multiple nodes, making them good at simulating complex correlations in real-world data rather than simple pairwise associations. For this reason, hypergraph neural networks are more suitable for multimodal tasks. However, most of the current hypergraph-based methods project multiple modalities into a common space when constructing hypergraphs and processing features, thereby ignoring the fact that modalities are diverse, each modality has unique characteristics, and there are also subtle relationships between objects in each modality. Summary of the invention

[0005] VQA tasks require understanding the subtle relationships between multiple objects, combining complex information between modalities, and focusing on specific areas related to the answer. Therefore, in order to better handle multimodal tasks, we invented a dynamic heterogeneous hypergraph neural network model (DHHG-TAC) based on the Transformer combined attention mechanism to improve the processing of visual text question answering tasks.

[0006] The model consists of four main links: hypergraph neural network link (HGNN), Transformer-based combined attention link, hypergraph dynamic update link and multimodal feature fusion classification link.

[0007] The specific steps are as follows:

[0008] Step 1: Preprocess the image scene graph information and text questions through graph structuring

[0009] a) For the image modality, a heterogeneous graph representation of the image is constructed based on the scene graph information. The objects, attributes, and relationships between objects in the scene graph are defined as three types of nodes in the heterogeneous graph, and there is only one type of edge, indicating whether it is connected, namely, attribute->object, object->relationship->object, where A->B means that node A is connected to node B through a directed edge.

[0010] b) For the text modality, the existing dependency tree syntactic analysis (Spacy library) is used to parse the question sentence into structured information, and a graph structure representation is constructed based on the dependency relationship of the sentence.

[0011] Step 2: Based on the random walk method to generate hypergraphs, the original data is preprocessed into hypergraph pairs.

[0012] a) The pre-trained Glove vector will be used as word embedding to represent each node in the graph.

[0013] b) Calculate the similarity between nodes based on the word embedding representation of the nodes, and use it as the initial probability of node transfer during subsequent random walks on the graph after normalization.

[0014] c) Through different random walk paths, multiple hyperedges of the two modes are constructed respectively, and the included nodes and their Glove representations are extracted as the nodes and node features of the hypergraph.

[0015] At this point, the heterogeneous hypergraph is built.

[0016] Step 3: Assign initial hyperedge weights according to the node features on the hyperedge, and obtain the modal features containing complex structural relationships through the hypergraph neural network.

[0017] a) The specific formula for the hypergraph convolutional layer is defined as follows:

[0018] X (l+1) =σ(LX (l) Θ (l) ) (1)

[0019]

[0020] in: is the association matrix between the hypergraph and the nodes v∈N and hyperedges e∈E.

[0021]

[0022] is a diagonal matrix representing the node degree, the i-th th The diagonal elements are is the diagonal matrix representing the hyperedge degree, the jth th The diagonal elements are is the diagonal matrix representing the hyperedge weights, the jth th The diagonal element is the jth th The weight of the hyperedge. is the node feature of the hypergraph, and C is the feature dimension. is the learnable weight matrix for each convolutional layer in the network model.

[0023] b) In the proposed model, there are two hypergraph neural networks, which are responsible for processing the hypergraph of image mode and the hypergraph of text mode respectively. The inputs are the incident matrix H of the hypergraph, the hyperedge weight matrix B and the hypergraph node feature matrix X, and the output is the node feature after hypergraph convolution. They carry complex and intertwined high-order structural features between objects and fully capture the unique characteristics of each modality.

[0024] Step 4: Based on the self-attention and cross-attention mechanisms of Transformer, focus on the respective characteristics of different modalities and the important interaction information between modalities.

[0025] a) Self-attention module

[0026] The hypergraph node features after HGNN convolution will be split into N node feature vectors and copied into three copies, namely query Q, key K and value V. After passing through the multi-head self-attention module and feedforward neural network, the attention weight output with the same dimension as the node feature is obtained.

[0027] The self-attention module can be described as mapping a query Q and a set of key-value pairs K, V to an output. The output is calculated as a weighted sum of the values ​​V, where the weight assigned to each value is calculated by the similarity between the query and the corresponding key. The overall calculation formula is as follows:

[0028]

[0029] where d K is the dimension of input K.

[0030] For each attention head:

[0031]

[0032] Among them, W i is the learnable parameter when the input information is linearly transformed. At this time, the output tensor has obtained the attention information required for each modality.

[0033] b) Cross-Attention Module

[0034] Cross-attention is used to weigh and mine the interactive information between modalities, associating specific areas of the two modalities that are relevant to the answer. Its calculation is similar to the self-attention weight, except that the query and key-value pair are not of the same modality. The attention of the image query under the text key-value pair and the attention of the text query under the image key-value pair are obtained respectively, and the cross-attention weight of the two modalities can be obtained.

[0035] Finally, the cross attention of the two modalities is added to the self-attention of the corresponding modality, and we can balance the importance of different features between image and text modalities while retaining the important features unique to each modality.

[0036] Step 5: Find relevant structural information in the answer area by combining the two attentions

[0037] The feature output of a single modality is obtained through a hypergraph neural network, and the feature weights of the interaction between modalities are obtained through a combined attention layer. The combination of the two carries the high-order structural features between objects in a single modality and information unique to a single modality, and has interactive information between multiple modalities, which can focus on important information related to answering questions.

[0038] Since the number of nodes of each sample in the training batch is different, the combined outputs are processed using global average pooling and finally merged through the classification layer to get the answer.

[0039] Step 6: Dynamically update the hyperedge weights of the hypergraph pair using the obtained attention weights

[0040] The combined attention weights are linearly transformed by the feedforward neural network (FFN) to obtain a dimension consistent with the number of hyperedges. The new weight of the hyperedge is calculated based on the nodes contained in the corresponding hyperedge, and finally multiplied with the hyperedge weight matrix before update to obtain the updated hyperedge weight matrix, which is used as the input for the next training.

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

[0042] (1) Through the dynamic heterogeneous hypergraph structure, the model can more accurately capture and utilize the complex relationship between images and text, improving the accuracy of question understanding and answer generation.

[0043] (2) Utilizing the self-attention and cross-attention mechanisms of the Transformer framework, the model dynamically adjusts its attention to features of different modalities and the interaction information between modalities, thereby improving the accuracy of capturing answer-related information.

[0044] (3) The hyperedge weights of the hypergraph are dynamically updated through a feedforward neural network based on the weights obtained by the attention mechanism, further refining the model's ability to recognize and process key information.

[0045] (4) The DHHG-TAC model was tested on two recognized VQA datasets. The experimental results demonstrated the superior performance of the model in processing complex multimodal data. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 This is the overall architecture diagram of the DHHG-TAC model of the present invention.

[0047] Figure 2 An example visualization generated for a hypergraph in the GQA dataset.

[0048] Figure 3 It is a flow chart for implementing the method of the present invention. DETAILED DESCRIPTION

[0049] In order to clarify the purpose, technical solutions and advantages of the present invention, a deep learning method integrating a dynamic heterogeneous hypergraph neural network and a Transformer attention mechanism is further described in detail through the following examples. It should be pointed out that the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0050] In order to illustrate the implementation of the present invention, the following will take the GQA dataset and the CLEVR dataset as examples to describe the specific implementation of the present invention:

[0051] The GQA dataset is a combination of questions in real-world images with public scene graph information, including objects in the image, their attributes and positions, and the relationships between them. This paper will process and use a total of 84,857 images and 1,075,058 questions with scene graph information images and their questions. The entire dataset is roughly divided into 88%, 12% training set and validation set.

[0052] CLEVR (Combined Language and Elemental Visual Question Reasoning) is a collection of synthetic images of 3D shapes (such as spheres and cylinders) of different materials and colors. Similarly, it also has public scene graph information. Unlike GQA, which only presents the relationship between some objects, the positional relationship between all objects is represented by an adjacency list. The training set contains 70,000 images and 699,989 question-answer pairs. The validation set contains 15,000 images and 149,991 question-answer pairs.

[0053] like Figure 1 As shown in the figure, a deep learning method that integrates dynamic heterogeneous hypergraph neural network and Transformer attention mechanism includes the following steps:

[0054] Hypergraph neural network link (HGNN), Transformer-based combined attention link, hypergraph dynamic update link and multimodal feature fusion classification link;

[0055] The specific steps are as follows:

[0056] like Figure 2 As shown, step 1: preprocess the scene graph information and text questions of the image through the graph structured processing method

[0057] a) For image modality, a heterogeneous graph representation of the image is constructed based on the scene graph information, and the objects, attributes, and relationships between objects in the scene graph are defined as three types of nodes in the heterogeneous graph, while there is only one type of edge, indicating whether it is connected, that is, attribute->object, object->relationship->object.

[0058] b) For the text modality, we use the existing dependency tree syntactic analysis (Spacy library) to parse the question sentence into structured information and build a graph structure representation based on the dependency relationships of the sentences.

[0059] Step 2: Based on the random walk method to generate hypergraphs, the original data is preprocessed into hypergraph pairs.

[0060] a) The pre-trained Glove vector will be used as word embedding to represent each node in the graph.

[0061] b) Calculate the similarity between nodes based on the word embedding representation of the nodes, and use it as the initial probability of node transfer during subsequent random walks on the graph after normalization.

[0062] c) Through different random walk paths, multiple hyperedges of the two modes are constructed respectively, and the included nodes and their Glove representations are extracted as the nodes and node features of the hypergraph.

[0063] At this point, the heterogeneous hypergraph is built.

[0064] Step 3: Assign initial hyperedge weights according to the node features on the hyperedge, and obtain the modal features containing complex structural relationships through the hypergraph neural network.

[0065] a) The specific formula for the hypergraph convolutional layer is defined as follows:

[0066] X (l+1) =σ(LX (l) Θ (l) ) (1)

[0067]

[0068] b) In the proposed model, there are two hypergraph neural networks, which are responsible for processing the hypergraph of image mode and the hypergraph of text mode respectively. The inputs are the incident matrix H of the hypergraph, the hyperedge weight matrix B and the hypergraph node feature matrix X, and the output is the node feature after hypergraph convolution. They carry complex and intertwined high-order structural features between objects and fully capture the unique characteristics of each modality.

[0069] For both modalities, all graph node features use 300-dimensional GloVe vectors, and a hypergraph with 100 hyperedges is generated using random walks. The hypergraph passes through nine layers of residual hypergraph convolutional layers with a dropout probability of 0.4 and the default value of Leaky-Relu, outputting the intra-modal structural features with the number of nodes multiplied by the number of hyperedges.

[0070] Step 4: Based on the self-attention and cross-attention mechanisms of Transformer, focus on the respective characteristics of different modalities and the important interaction information between modalities.

[0071] a) Self-attention module

[0072] The hypergraph node features after HGNN convolution will be split into N node feature vectors and copied into three copies, namely query Q, key K and value V. After passing through the multi-head self-attention module and feedforward neural network, the attention weight output with the same dimension as the node feature is obtained.

[0073] The self-attention module can be described as mapping a query Q and a set of key-value pairs K, V to an output. The output is calculated as a weighted sum of the values ​​V, where the weight assigned to each value is calculated by the similarity between the query and the corresponding key. The overall calculation formula is as follows:

[0074]

[0075] For each attention head:

[0076]

[0077] At this time, the output tensor has obtained the attention information required for each modality.

[0078] b) Cross-Attention Module

[0079] Cross-attention is used to weigh and mine the interactive information between modalities, associating specific areas of the two modalities that are relevant to the answer. Its calculation is similar to the self-attention weight, except that the query and key-value pair are not of the same modality. The attention of the image query under the text key-value pair and the attention of the text query under the image key-value pair are obtained respectively, and the cross-attention weight of the two modalities can be obtained.

[0080] The output features of the two modalities are sent to two Transformer-based self-attention layers respectively. At the same time, the key-value pairs of different modalities are combined to obtain cross-attention under different modalities. The number of heads of all multi-head attention is 10, the number of self-attention layers is 6, and the number of cross-attention layers is 8. Finally, the cross-attention of the two modalities is added to the self-attention of the corresponding modality, and the importance of different features between the image and text modalities is weighed and the important features unique to each modality are retained. It is used to make a Hadamard product with the output features of the hypergraph neural network, and the final prediction answer is obtained through the linear layer.

[0081] Step 5: The classifier obtains the final answer by combining the features of the two types of attention and hypergraph learning.

[0082] The feature output of a single modality is obtained through the hypergraph neural network, and the feature weight of the interaction between modalities is obtained through the combined attention layer. The combination of the two carries the high-order structural features between objects in a single modality and information unique to a single modality, and has interactive information between multiple modalities, which can pay good attention to important information related to answering questions.

[0083] Since the number of nodes of each sample in the training batch is different, the combined outputs are processed using global average pooling and finally merged through the classification layer to get the answer.

[0084] Step 6: Dynamically update the hyperedge weights of the hypergraph pair using the obtained attention weights

[0085] The combined attention weights are linearly transformed by the feedforward neural network (FFN) to obtain a dimension consistent with the number of hyperedges. The new weight of the hyperedge is calculated based on the nodes contained in the corresponding hyperedge, and finally multiplied with the hyperedge weight matrix before update to obtain the updated hyperedge weight matrix, which is used as the input for the next training.

[0086] The Adam optimizer is used for training with an initial learning rate of 1e-3. After the first 10 epochs, the combined attention weights are passed through two feed-forward neural networks (FFNs) to generate an update matrix for updating the original hyperedge weight matrix to achieve the dynamic update of the hypergraph.

[0087] Using the above process and settings, after 30 rounds of training on both datasets, the average results (5 random number seeds) were obtained together with other baseline models as shown in Tables 1 and 2 below.

[0088] Table 1 Average results of baseline models on the GQA dataset

[0089]

[0090] Table 2 Average results of baseline models on the CLEVR dataset

[0091]

[0092]

[0093] The remaining baseline models are introduced as follows:

[0094] CNN-LSTM: Use a convolutional neural network (CNN) to encode the image and the last hidden state of a long short-term memory network (LSTM) to encode the question and concatenate them. The final representation is then fed into a multi-layer perceptron (MLP) classifier to infer the answer.

[0095] SAN: The image and question are encoded based on a CNN-LSTM model, then fused using two soft spatial attention blocks, and finally the answer is inferred by a classifier.

[0096] HAN: Use the symbolic graphs of each modality to build a common semantic space, match the semantics between the symbolic graph substructures to generate a hypergraph, combine the two hypergraphs to obtain a common attention graph, and use the common attention graph to integrate multimodal inputs to obtain the final joint representation.

[0097] RAN: Use residual blocks to encode the image, use LSTM to encode the question, and use residual attention network to fuse the two representations. Finally, use MLP classifier to infer the answer.

Claims

1. A visual text question answering learning method that integrates dynamic heterogeneous hypergraph neural network and Transformer, characterized by: The steps include: Step 1: Preprocess the scene graph information and text questions of the image through graph structuring; a) For image modality, a heterogeneous graph representation of the image is constructed based on scene graph information. Objects, attributes, and relationships between objects in the scene graph are defined as three types of nodes in the heterogeneous graph. There is only one type of edge, indicating whether it is connected, namely, attribute->object, object->relationship->object, where A->B means that node A is connected to node B through a directed edge; b) For text modality, use the existing dependency tree syntactic analysis to parse the question sentence into structured information, and construct a graph structure representation based on the dependency relationship of the sentence; Step 2: Based on the random walk method to generate hypergraphs, the original data is preprocessed into hypergraph pairs; a) Use the pre-trained Glove vector as word embedding to represent each node in the graph; b) Calculate the similarity between nodes based on the word embedding representation of the nodes, and use it as the initial probability of node transfer during subsequent random walks on the graph after normalization; c) Through the different paths of random walks, multiple hyperedges of the two modes are constructed respectively, and the included nodes and their Glove representations are extracted as the nodes and node features of the hypergraph; At this point, the heterogeneous hypergraph is built; Step 3: Assign initial hyperedge weights based on node features on the hyperedge, and obtain the modal features containing complex structural relationships through the hypergraph neural network; a) The specific formula for the hypergraph convolutional layer is defined as follows: X (l+1) =σ(LX (l) I (l) ) (1) in: is the association matrix between the hypergraph and the nodes v∈N and hyperedges e∈E; is a diagonal matrix representing the node degree, the i-th th The diagonal elements are is the diagonal matrix representing the hyperedge degree, the jth th The diagonal elements are is the diagonal matrix representing the hyperedge weights, the jth th The diagonal element is the jth th The weight of the hyperedge; is the node feature of the hypergraph, and C is the feature dimension; is the learnable weight matrix for each convolutional layer in the network model; b) There are two hypergraph neural networks in the network model, which are responsible for processing the hypergraph of image mode and the hypergraph of text mode respectively; the inputs are the incident matrix H of the hypergraph, the hyperedge weight matrix B and the hypergraph node feature matrix X, and the output is the node feature after hypergraph convolution. Step 4: Based on the self-attention and cross-attention mechanisms of Transformer, focus on the respective characteristics of different modalities and the important interaction information between modalities; a) Self-attention module; The hypergraph node features after HGNN convolution will be split into N node feature vectors and copied into three copies, namely query Q, key K and value V. After passing through the multi-head self-attention module and feedforward neural network, the attention weight output with the same dimension as the node feature is obtained; The self-attention module is described as mapping a query Q and a set of key-value pairs K, V to an output. The output is calculated as a weighted sum of the values ​​V, where the weight assigned to each value is calculated by the similarity between the query and the corresponding key. The overall calculation formula is as follows: where d K is the dimension of input K; For each attention head: head i =Attention(QW i Q ,KW i K ,VW i V ) (5) Among them, W i is the learnable parameter when the input information is linearly transformed; at this time, the output tensor has obtained the attention information required for each modality; b) Cross-attention module; Use cross-attention to weigh and mine the interactive information between modalities, associating specific regions of the two modalities that are relevant to the answer; Finally, the cross attention of the two modalities is added to the self-attention of the corresponding modality to weigh the importance of different features between the image and text modalities and retain the important features unique to each modality; Step 5: Find the relevant structural information in the answer area by combining the two attentions; The feature output of a single modality is obtained through a hypergraph neural network, and the feature weight of the interaction between modalities is obtained through a combined attention layer. The combination of the two carries the high-order structural features between objects in a single modality and information unique to a single modality, and has interactive information between multiple modalities, which can pay good attention to important information related to answering questions; the combined output is processed using global average pooling, and finally merged to obtain the answer through the classification layer; Step 6: Dynamically update the hyperedge weights of the hypergraph pair using the obtained attention weights; The combined attention weights are linearly transformed through the feedforward neural network FFN to obtain a dimension consistent with the number of hyperedges; the new weights of the hyperedges are calculated based on the nodes contained in the corresponding hyperedges, and finally multiplied with the hyperedge weight matrix before update to obtain the updated hyperedge weight matrix, which is used as the input for the next training.

Citation Information

Cited By

  • Power Internet of Things anomaly detection method and system based on hypergraph fusion

    CN119337326A

  • Driving state identification method and system based on multi-modal fusion

    CN119416003A

  • Digital human interaction control method and device based on multiple modes

    CN122389919A

  • Digital human interaction control method and device based on multi-modal

    CN122389919B