A visual scene graph generation method based on a multi-branch hybrid attention model
By using a multi-branch hybrid attention model to process semantic, positional, and visual features, the problems of noise and feature imbalance in scene graph generation are solved, improving the model's adaptive adjustment capability and accuracy.
Patent Information
- Application Number
- CN202411066922.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-08-06
AI Technical Summary
Existing scene graph generation methods are prone to introducing noise into the relationship prediction module, and the contributions of different features are uneven, affecting the model's adaptive adjustment capability.
A multi-branch hybrid attention model is adopted to process semantic, positional, and visual features separately. The contribution ratio of each modality is calculated through self-attention and cross-attention modules. A new visual feature preprocessing module for main and secondary targets is designed to reduce interference from irrelevant targets and improve the model's adaptability.
It improves the accuracy of scene graph generation, enhances the focus on key features, reduces interference from redundant information, and improves the performance of the model in different scenarios.
Smart Images

Figure CN119007207B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of deep learning technology in machine learning, specifically relating to a method for generating visual scene graphs based on a multi-branch hybrid attention model. Background Technology
[0002] Scene graph generation requires models to identify all targets in an image based on object detection, as well as detect the interactions between targets, extract multiple subject-verb-object triples, and finally organize them into a graph structure containing semantic information of the image. Since the introduction of scene graph generation, many researchers have explored and studied it, among which the message passing and attention mechanism method has become the mainstream approach due to its reasonable and effective structure. Xu et al. applied GRU (Gate Recurrent Unit) to replace the fully connected structure, passing the information of each target to other targets through a recurrent structure to extract contextual information; Rowan et al. analyzed the distribution characteristics of scene graph generation datasets and designed the MotifsNet model to make predictions using the long-tail distribution of the data; Tang et al. proposed the VCTree model, which encodes target features in a tree structure; Woo et al. proposed the LinkNet structure based on convolutional neural networks, combining convolutional self-attention mechanism to extract features between targets; in addition, some researchers have proposed effective scene graph generation methods based on reinforcement learning, bridging networks, etc.
[0003] Most current scene graph generation methods have similar design architectures, which predict the relationship predicates between targets through a processing flow of basic feature extraction, target context information transmission, edge context information transmission, and relationship prediction module. However, this architecture has two problems: First, using the minimum bounding region of the subject and object targets as the visual feature of the relationship predicate in the relationship prediction module will introduce noise from other targets; second, directly and simply concatenating the visual, semantic, and positional features of the target pair as the prediction input, but the contribution of these three features to the final prediction result is not the same in different scenarios, which affects the adaptive adjustment capability of the model. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a visual scene graph generation method based on a multi-branch hybrid attention model. After target features are passed through context and edge context passing modules, the features of different modalities (semantic, positional, and visual) are combined according to target pairs and input into the designed multi-branch hybrid attention module to predict the contribution ratio of each modality in the current scene. In addition, a new preprocessing module for the visual features of main and secondary targets is designed, which can effectively increase the proportion of main and secondary targets while reducing the interference of other irrelevant targets, thereby improving the model's adaptability and performance.
[0005] To achieve the above objectives, the present invention provides a visual scene graph generation method based on a multi-branch hybrid attention model, which includes the following steps:
[0006] Step 1: The model input is the original RGB image. First, the image is input to the feature extraction, i.e., object detection module to detect all objects in the image and output their corresponding features, which include visual features, positional features and semantic features.
[0007] Step 2: Target context information transmission and edge context information transmission. This step follows the model structure based on the message passing mechanism. After concatenating the visual, semantic, and positional features of each target output in Step 1, an LSTM structure is used as the information extraction model to perform information transmission calculations on the features to obtain the comprehensive features of the target. Then, the comprehensive features and the target category are input into the edge context transmission module, and finally, the edge feature vector of each target is output.
[0008] Step 3: Select any two targets from all the targets in Step 1. The features are combined pairwise within the modality according to the target relation pair to obtain the visual, semantic, and positional features of the relation pair: Simultaneously, the comprehensive feature vectors output from step 2 are combined according to the target relation pairs to obtain the comprehensive features of the relation pairs. The inputs are combined and fed into the multi-branch hybrid attention module.
[0009] Step 4: In the multi-branch hybrid attention module, the input features are first extracted individually using self-attention features. Then, the correlation between visual features, semantic features, positional features, and the comprehensive features is calculated using three cross-attention modules. Finally, the features from each modality are weighted and fused to output the final feature vector. The process can be expressed by the following formula:
[0010] The preprocessing stage consists of three branches:
[0011]
[0012] Mixed attention calculation for each branch:
[0013]
[0014] Branch feature merging phase:
[0015]
[0016] In the above formula, This represents a hybrid attention module, consisting of self-attention units. and cross-attention units composition; This indicates a fully connected mapping layer. Indicates feature concatenation operation; Indicate target The modal features are visual, semantic, and positional features.
[0017] Step 5: Visual region preprocessing for relationship pairs. When introducing the visual regions of relationship pairs, a hybrid attention block is used to extract key features. The self-attention units and cross-attention units in the hybrid attention block are used to enhance the feature ratio of the main and secondary targets. The input of the cross-attention unit is divided into two parts: the first part is the category features and location features of the main and secondary targets, and the second part is the visual region features of the relationship pair. The output features are superimposed with the output of the multi-branch hybrid attention module to obtain the final feature vector.
[0018] Step 6: Use the classification layer to predict and classify the feature vectors obtained in Step 5, and output the prediction results of the relation predicates for each relation pair.
[0019] Compared with the prior art, the present invention has the following beneficial technical effects:
[0020] This invention designs a multi-branch hybrid attention module, which can effectively improve the tendency of the scene graph generation model to output different modal features in different scenarios, increase attention to key features and reduce the interference of redundant information, thereby improving the accuracy of visual scene graph generation. Attached Figure Description
[0021] Figure 1 This is a flowchart of a visual scene graph generation method based on a multi-branch hybrid attention model according to the present invention;
[0022] Figure 2 This is a framework diagram of the multi-branch hybrid attention model of the present invention;
[0023] Figure 3 This is a detailed structural diagram of the multi-branch hybrid attention module of the present invention. Detailed Implementation
[0024] The present invention will now be described in further detail with reference to the accompanying drawings. The present invention will include, but is not limited to, the following embodiments.
[0025] like Figures 1 to 3 As shown, the present invention provides a visual scene graph generation method based on a multi-branch hybrid attention model, which includes the following steps:
[0026] Step 1: The model input is the original RGB image. First, the image is input to the feature extraction, i.e., object detection module to detect all objects in the image and output their corresponding features, which include visual features, positional features and semantic features.
[0027] Step 2: Target context information transmission and edge context information transmission. Using a model structure based on message passing mechanism, the visual, semantic, and positional features of each target output in Step 1 are concatenated and information transmission calculations are performed on the features to obtain the comprehensive features of the target. Then, the comprehensive features and the target category are input into the edge context transmission module, and finally, the edge feature vector of each target is output.
[0028] Step 3: Combine the features of any two targets from all targets in Step 1 according to the target relationship pair in the modality to obtain the visual, semantic, and positional features of the relationship pair. At the same time, combine the comprehensive feature vector output from Step 2 according to the target relationship pair to obtain the edge context features of the relationship pair. Input them together into the multi-branch hybrid attention module.
[0029] Step 4: In the multi-branch hybrid attention module, the input features are first extracted individually using self-attention features. Then, the correlation between visual features, semantic features, positional features, and the comprehensive features is calculated using three cross-attention modules. Finally, the features from each modality are weighted and fused to output the final feature vector. The process can be expressed by the following formula:
[0030] The preprocessing stage consists of three branches:
[0031]
[0032] Mixed attention calculation for each branch:
[0033]
[0034] Branch feature merging phase:
[0035]
[0036] In the above formula, This represents a hybrid attention module, consisting of self-attention units. and cross-attention units composition; This indicates a fully connected mapping layer. This indicates a feature concatenation operation. Indicate target The modal features are visual, semantic, and positional features.
[0037] Step 5: Visual region preprocessing for relationship pairs. When introducing the visual regions of relationship pairs, a hybrid attention block is used to extract key features. The self-attention units and cross-attention units in the hybrid attention block are used to enhance the feature ratio of the main and secondary targets. The input of the cross-attention unit is divided into two parts: the first part is the category features and location features of the main and secondary targets, and the second part is the visual region features of the relationship pair. The output features are superimposed with the output of the multi-branch hybrid attention module to obtain the final feature vector.
[0038] Step 6: Use the classification layer to predict and classify the feature vectors obtained in Step 5, and output the prediction results of the relation predicates for each relation pair.
Claims
1. A method for generating visual scene graphs based on a multi-branch hybrid attention model, characterized in that, It includes the following steps: Step 1: The model input is the original RGB image. First, the image is input to the feature extraction, i.e., object detection module to detect all objects in the image and output their corresponding features, which include visual features, positional features and semantic features. Step 2: Target context information transmission and edge context information transmission. The model structure based on message passing mechanism is adopted. After concatenating the visual, semantic and positional features of each target output in Step 1, the LSTM structure is used as the information extraction model to perform information transmission calculation on the features to obtain the comprehensive features of the target. Then, the comprehensive features and target category are input to the edge context transmission module, and finally the edge feature vector of each target is output. Step 3: Select any two targets from all the targets in Step 1. The features are combined pairwise within the modality according to the target relation pair to obtain the visual, semantic, and positional features of the relation pair. At the same time, the comprehensive feature vector output from step 2 is combined according to the target relation pair to obtain the comprehensive features of the relation pair. Both are input into the multi-branch hybrid attention module. Step 4: In the multi-branch hybrid attention module, the input features are first extracted individually using self-attention features. Then, the correlation between visual features, semantic features, positional features, and comprehensive features is calculated using three cross-attention modules. Finally, the features of each modality are weighted and fused to output the final feature vector. The process can be described by the following formula: The preprocessing stage consists of three branches: Mixed attention calculation for each branch: Branch feature merging phase: In the above formula, This represents a hybrid attention module, consisting of self-attention units. and cross-attention units composition; This indicates a fully connected mapping layer. This indicates a feature concatenation operation. Representing the visual, semantic, and positional features of each modality; Step 5: Visual region preprocessing for relationship pairs. When introducing the visual regions of relationship pairs, a hybrid attention block is used to extract key features. The self-attention unit and cross-attention unit in the hybrid attention block are used to enhance the feature ratio of the main and secondary targets. The input of the cross-attention unit is divided into two parts: the first part is the category features and position features of the main and secondary targets, and the second part is the visual region features of the relationship pair. The output features are superimposed with the output of the multi-branch hybrid attention module to obtain the final feature vector. Step 6: Use the classification layer to predict and classify the feature vectors obtained in Step 5, and output the prediction results of the relation predicates for each relation pair.
2. The visual scene graph generation method based on a multi-branch hybrid attention model according to claim 1, characterized in that, The target detection module allows you to choose any target detection algorithm based on your needs.
Citation Information
Patent Citations
Image processing method, training method of scene graph generation model and electronic equipment
CN114821188A
Traffic scene graph generation method fusing prior knowledge
CN115830549A
