Scene graph generation method for local entity relationship coding
By combining RGB and depth features for cross-modal fusion, and using local-level entity relationship encoders, the problem of local information loss in traditional methods is solved, the effect and efficiency of scene graph generation are improved, and more accurate analysis of complex environments is achieved. Deep understanding.
Patent Information
- Application Number
- CN202410602042.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2024-08-30
AI Technical Summary
Traditional scene graph generation methods are prone to losing local entity individual information and entity interaction information in complex visual scenes, resulting in poor scene graph generation effects, and are resource-intensive or limited in the utilization of cross-modal information, resulting in the loss of local key information. of loss.
By combining RGB features and depth features for cross-modal fusion, a local-level entity relationship encoder is used to focus on local entity features in the scene to enhance the scene graph generation effect, and a pre-trained model is used for feature extraction, and through Transformer's multi-head self-attention Force components capture dependencies between entities.
It improves the understanding of complex environments and subtle interactions, reduces the loss of key information during relationship prediction, achieves more efficient scene graph generation, makes the model more lightweight, and reduces computational complexity and parameter volume.
Smart Images

Figure CN118570370A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computer vision and relates to a scene graph generation method for local entity relationship coding. Background Art
[0002] The rapid development of artificial intelligence technology has promoted innovation in the fields of computer vision and natural language processing. Among them, scene graph generation is an important task in the field of computer vision. Its goal is to generate a graph expression with nodes and edges as basic elements by inferring the objects existing in the image and their relationships, so as to obtain a deep understanding of the image scene. Through the visual understanding of different objects in the scene and modeling the relationships between different objects, the generated scene graph can serve advanced visual reasoning tasks such as autonomous driving, visual question answering, and image description generation.
[0003] In recent years, scene graph generation models still have great limitations in practical applications. In complex visual scenes, subtle local features and subtle interactions between entities often contain key information, but this information is easily ignored in traditional entity detection and scene graph generation methods. This is because traditional scene graph generation methods generally use global entity relationship encoding to learn entity representations and predicate representations in the scene. This method loses local entity individual information and local entity interaction information during the relationship encoding process, resulting in the loss of local key information in the scene in the final scene graph generation effect. In addition, although there are many methods such as using additional clues such as depth maps and knowledge graphs to enhance the effect of scene graph generation, this will cause the scene graph generation method to be either resource-intensive and unable to be integrated in practical applications; or it will be limited in utilizing cross-modal information, resulting in the loss of key local information in the scene. Summary of the invention
[0004] In view of this, in order to address the problem of loss of local entity clue information in the entity relationship encoding process in most current mainstream methods, the present invention provides a scene graph generation method for local entity relationship encoding, which utilizes the RGB features and depth features of the scene image to provide additional clue information in the scene, and utilizes the local-level entity relationship encoder to focus on the local entity features in the scene, thereby enhancing the effect of scene graph generation.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for generating a scene graph of local entity relationship coding, the method comprising:
[0007] S1, build scene graph generation task;
[0008] S2, extract features from a given image, including RGB feature extraction and depth feature extraction; and obtain entity relationship suggestions for the given image through an object detector;
[0009] S3, combining entity relationship suggestions to perform cross-modal fusion of RGB features and depth features to obtain fused feature information;
[0010] S4. The fused feature information is used as an additional input tag to the local entity relation encoder for predicate relation prediction.
[0011] Further, in step S1, for a given image I, the task of scene graph generation is to create a summary graph To fully display the entity information and entity interaction information in the scene, including detecting all entity representations in I, that is, Then for each entity pair (e i ,e j ) i→j Make predictions and finally use the triplet (e i ,ω i→j ,e j )Build the scene graph
[0012]
[0013] in, Represents the final scene graph, ω i→j Represents an entity pair (e i ,e j ), Represents a set of predicate relations.
[0014] Furthermore, in step S2, for RGB feature extraction, a pre-trained RGB feature extractor is used to extract RGB features of the scene image I; for depth feature extraction, a depth map prediction model is used to convert the input RGB image I into a depth image D, and a deep feature extraction network is initially trained, and Adam is used to perform training on a completely depth-based relationship detection task, and finally, the depth image D and the trained feature extraction network are used to extract depth features.
[0015] Furthermore, in step S2, the RGB feature extractor is an FPN network based on ResNeXt-101; the depth map prediction model is a fully convolutional neural network based on ResNet-50, and the depth map prediction model uses residual learning to model the fuzzy mapping between the monocular image and the depth map. The depth map prediction model consists of an end-to-end single body architecture; the deep feature extraction network is a neural network based on ResNet-18.
[0016] Further, in step S2, when obtaining entity relationship recommendations, Faster R-CNN is used as the object detector in the scene image. The entity recommendations are obtained directly from the output of the object detection, which includes the class label of the object and the classification score. The recommended bounding box is represented as b i , the detected class is denoted as c i ;
[0017] For the i-th entity proposal, its convolutional features are set to n i , then the entity represents e i The visual, geometric and semantic features of are integrated as follows:
[0018]
[0019] where g i is based on the geometric features of its bounding box bi, w i Based on its class c i The semantic features of word embedding, It is a serial operation.
[0020] Further, in step S3, the following steps are included:
[0021] S31. For a given image I and its depth map D, extract c with size h×w v Channel RGB feature r and has c d Channel and depth features g of the same size;
[0022] S32, by using RGB features and deep features Divided into n×n blocks to preserve local level entity information;
[0023] S33, then average pooling the r features and g features within each block to summarize the average value of feature information that is critical to entity relationship prediction;
[0024] S34. For a given entity pair (e i ,e j ), for two entities e in the image i and e j , merge their RGB features and depth features to form a new feature set, fuse the feature set based on the channel, and obtain a feature set representing the relationship between entities:
[0025] v = pool (r), d = pool (g)
[0026]
[0027] Where F(·) represents the concatenation operation along the channel dimension, pool(·) represents the average pooling operation, and the width and height of the pooling are n;
[0028] S35, v ij and ij Split into continuous blocks of patch size k in space, there are (n / k) 2 Patches, also called tokens:
[0029]
[0030]
[0031] S36, will as well as Features using fully connected network f x Project to a low-dimensional representation:
[0032]
[0033]
[0034] in, and Local projected entity patches representing RGB features and depth features;
[0035] S37, fuse the corresponding patches v and d of the two modalities to capture their dependencies, while reducing the length of the token sequence from 2(n / k) 2 Reduce to (n / k) 2 :
[0036]
[0037] in Represents the first initial input embedding that can express basic features of the input transformer-based relation encoder;
[0038] S38. After fusing feature information for each entity pair, use them as additional input tags for the relation encoder to retain local important feature information:
[0039]
[0040]
[0041] Where f(·) represents a fully connected network, μ(·) represents a nonlinear function operation, l represents position feature information, and w represents semantic feature information.
[0042] Furthermore, in step S4, a Transformer-based multi-head self-attention component is used to capture the entity-to-object inductive bias in scene graph generation, and to provide the embedding tags generated by the feature fusion module in the predicate relation prediction process. The specific steps include:
[0043] The multi-head self-attention component is represented as:
[0044] MSA(Q,K,V)=Concat(A1,A2,…,A n )W O
[0045] Among them, Q, K, and V refer to query, key, and value respectively. is the final fusion matrix, and:
[0046]
[0047] Multi-head self-attention is used to split the input token sequence of the Transformer-based relation encoder into multiple heads for parallel processing, and the input embedding tokens with rich entity local-level information after cross-modal feature fusion are Incorporating learnable class labels A learnable one-dimensional position embedding ζ is added to each input token sequence pos , and the resulting sequence is passed as input to the encoder:
[0048]
[0049] The relation encoder consists of K encoder layers, each of which contains MSA, MLP, and LN blocks and residual connections:
[0050] ζ′ l =MSA(LN(ζ l-1 ))+ζ l-1 ,l=1…K
[0051] ζ l =MLP(LN(ζ′ l ))+ζ′ l ,l=1…K
[0052] Finally, y is linearly projected to the total number of predicate relations to form a relation classification head:
[0053]
[0054] The encoding result is output to the entity relationship decoder, and finally the predicate relationship between entity pairs is output.
[0055] The beneficial effects of the present invention are:
[0056] Compared with the prior art, the present invention pays more attention to local key information, utilizes the RGB features and deep features of the scene image to provide additional clue information in the scene, and adopts a local-level entity relationship encoder to focus on local entity features in the scene, thereby realizing the learning of subtle local features in the scene and reducing the loss of key information during relationship prediction, enhancing the effect of predicting the relationship between entities during the scene graph generation process, and enabling the machine to have a deeper and richer understanding of complex environments and subtle interactions.
[0057] Compared with the prior art, the present invention is more lightweight and has a high model efficiency, which is specifically reflected in the following points: using a pre-trained model as a feature extraction network and keeping the parameters fixed, thereby reducing the number of parameters that need to be trained; projecting and fusion of the extracted features in a low-dimensional manner to capture the dependencies between different modalities, while further reducing the number of parameters and computational complexity of the model; by dividing the features into small blocks and average pooling them to generate local-level entity blocks, the fully connected layer with many parameters and high computing resource requirements in the traditional relational network is replaced by a low-cost local entity projection method.
[0058] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0060] Figure 1 The present invention provides an overall framework for the scene graph generation method for local entity relationship encoding. DETAILED DESCRIPTION
[0061] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0062] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0063] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0064] See also Figure 1 , a scene graph generation method for local entity relationship encoding.
[0065] Figure 1 The overall framework of the scene graph generation method for local entity relationship coding of the present invention is shown, and the method comprises the following steps:
[0066] S1, build scene graph generation task;
[0067] S2, extract features from a given image, including RGB feature extraction and depth feature extraction; and obtain entity relationship suggestions for the given image through an object detector;
[0068] S3, combining entity relationship suggestions to perform cross-modal fusion of RGB features and depth features to obtain fused feature information;
[0069] S4. The fused feature information is used as an additional input tag to the local entity relation encoder for predicate relation prediction.
[0070] Further, in step S1, for a given image I, the task of scene graph generation is to create a summary graph To fully display the entity information and entity interaction information in the scene. First, all entity representations in I need to be detected, that is, Then for each entity pair (e i ,e j ) i→j Make predictions and finally use the triplet (e i ,ω i→j ,e j)Build the scene graph
[0071]
[0072] Predicate relation set represents a set of all predicate relations in the scene, ω i→j Represents a predicate relation in a set.
[0073] Furthermore, in step S2, for RGB feature extraction, the present invention uses a pre-trained RGB feature extractor, that is, an FPN network based on ResNeXt-101 to extract RGB features of the scene image I. The network combines the characteristics of the ResNeXt network and the FPN network, and can take into account both efficient computing performance and powerful feature learning capabilities when processing complex visual tasks that require fine features and multi-scale recognition.
[0074] For the extraction of deep features, we first use the depth map prediction model based on the ResNet-50 fully convolutional neural network to convert the input RGB image I into a depth image D. This model uses residual learning to model the fuzzy mapping between the monocular image and the depth map, and the model consists of an end-to-end single body architecture, which reduces resource consumption while keeping the original data intact. At the same time, we train a deep feature extraction network based on the ResNet-18 network from scratch, and use Adam to train it on a completely depth-based relationship detection task. Finally, we use the depth image D and the trained feature extraction network to extract deep features.
[0075] Further, in step S2, when obtaining entity relationship suggestions, the present invention uses Faster R-CNN as the object detector in the scene image, and the entity suggestions are directly obtained from the output of the object detection, which includes the category label and classification score of the object, where the suggestion bounding box is represented as b i , the detected class is denoted as c i At this time, for the i-th entity proposal, its convolutional feature is set to n i , then the entity represents e i The visual, geometric and semantic features of can be integrated as:
[0076]
[0077] where g i is based on the geometric features of its bounding box bi, w i Based on its class c i The semantic features of word embedding, It is a serial operation.
[0078] Faster R-CNN provides the feature extraction module with initial object detection and location information, and uses the bounding box and category score of the entity to guide the feature extraction module. This information is used to guide the feature extractor to more accurately extract the RGB features of the entity. i And the deep feature g i ,Entity relationship proposals are generated by forming ordered pairs of all entity proposals.
[0079] Further, in step S3, for a given image I and its depth map D, extract c with a size of h×w v Channel RGB feature r and has c d The depth feature g of the same size and channel. By and deep features It is divided into n×n blocks to preserve local level entity information, and then the r features and g features in each block are average pooled to summarize the average value of feature information that is critical for entity relationship prediction. For a given entity pair (e i ,e j ), for two entities e in the image i and e j , merge their RGB features and depth features to form a new feature set, which retains the local information between the two entities. Then these features are fused based on the channel to generate a feature set that represents the relationship between the two entities:
[0080] v = pool (r), d = pool (g)
[0081]
[0082] Where F(·) represents the concatenation operation along the channel dimension, pool(·) represents the average pooling operation, the width and height of the pooling are n, and then v ij and ij Split into continuous blocks of patch size k in space, there are (n / k) 2 Patches, also called tokens:
[0083]
[0084]
[0085] In order to further reduce the model parameters and use RGB features and depth features to enhance the relation encoder, as well as Features using fully connected network f x Project to a low-dimensional representation:
[0086]
[0087]
[0088] The above formula and The local projected entity patches representing RGB features and depth features are fused with the corresponding patches v and d of the two modalities to capture their dependencies. At the same time, the length of the token sequence is increased by 2 Reduce to (n / k) 2 Further reduce parameters and computational complexity. This ensures that the feature information of different modalities is closely integrated so that the subsequent relation encoder can effectively utilize:
[0089]
[0090] in Represents the first initial input embedding that can express basic features of the input transformer-based relation encoder. After fusing feature information for each entity pair, they are used as additional input tokens of the relation encoder to retain local important feature information:
[0091]
[0092]
[0093] Where f(·) represents a fully connected network, μ(·) represents a nonlinear function operation, l represents position feature information, and w represents semantic feature information.
[0094] Further, in step S4, the present invention uses a Transformer-based relation encoder architecture. The Transformer-based multi-head self-attention (MSA) component is used to focus on capturing the entity-to-object inductive bias in scene graph generation by providing the embedding tags generated by the feature fusion module to the predicate relation prediction process. This enriches the subject and object information at the local level.
[0095] Since the multi-head self-attention component omits the calculation of the fully connected layer, it can be formalized as:
[0096] MSA(Q,K,V)=Concat(A1,A2,…,A n )W O
[0097] Among them, Q, K, and V refer to query, key, and value respectively. is the final fusion matrix:
[0098]
[0099] Multi-head self-attention is used to split the Transformer-based relation encoder input token sequence into multiple heads for parallel processing, and the input embedding tokens rich in entity local level information from the cross-modal feature fusion module are embedded in Prepend learnable class label A learnable one-dimensional position embedding ζ is added to each input token sequence pos , to retain the entity subject and object position information, the resulting sequence is passed as input to the encoder:
[0100]
[0101] The relation encoder consists of K encoder layers, each of which contains MSA, MLP and LN blocks and residual connections:
[0102] ζ′ l =MSA(LN(ζ l-1 ))+ζ l-1 ,l=1…K
[0103] ζ l =MLP(LN(ζ′ l ))+ζ′ l ,l=1…K
[0104] Finally, y is linearly projected to the total number of predicate relations to form a relation classification head:
[0105]
[0106] The encoding result is output to the entity relationship decoder, and finally the predicate relationship between entity pairs is output.
[0107] This embodiment uses Recall@k (R@k) and mean Recall@k (mR@k) as evaluation indicators. The definitions are as follows:
[0108] Recall@k (R@k): The evaluation standard recall rate indicates the proportion of correct categories among the top K most likely categories selected by the model.
[0109] Mean Recall@k (mR@k): The average recall rate of the evaluation standard, which indicates the average proportion of relevant or correct categories that are retrieved when viewing the first K results recommended or predicted by the model. The confusion matrix of the classification results shown in Table 1:
[0110] Table 1
[0111]
[0112] The indicator calculation method is as follows:
[0113]
[0114] The data used in this embodiment are from the public dataset ImageNet dataset and Visual Genome dataset. ImageNet is currently the world's largest image recognition database, mainly used for image classification and target detection in the field of machine vision. The dataset is organized according to the WordNet hierarchy, in which each node (also referred to as a category) consists of hundreds or even thousands of images, and each node has an average of more than 500 images. The dataset contains a total of 22,000 image categories and about 15 million pictures. The Visual Genome dataset is an image and image content semantic information related dataset, which has richer semantic information than the ImageNet image annotation dataset, and is used to expand artificial intelligence applications based on images and semantic information. The dataset currently contains 108,249 pictures, 4.2 million regional content descriptions, 1.7 million image content questions and answers, 2.1 million object cases, 1.8 million attributes and 1.8 million relationships.
[0115] In terms of model lightweighting, the number of parameters of the model of the present invention is 20 times less than that of the scene graph generation model of the GB-Net network, and about 10 times less than that of other leading scene graph generation models; in terms of model recall rate, the model of the present invention has achieved a relative improvement of 47% in (mR@100) compared with other scene graph generation models, and an improvement of 23% in the average of all evaluation indicators.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A scene graph generation method for local entity relationship coding, characterized by: The method comprises: S1, build scene graph generation task; S2, extract features from a given image, including RGB feature extraction and depth feature extraction; and obtain entity relationship suggestions for the given image through an object detector; S3, combining entity relationship suggestions to perform cross-modal fusion of RGB features and depth features to obtain fused feature information; S4. The fused feature information is used as an additional input tag to the local entity relation encoder for predicate relation prediction.
2. The method for generating a scene graph of local entity relationship coding according to claim 1, characterized in that: In step S1, for a given image I, the task of scene graph generation is to create a summary graph To fully display the entity information and entity interaction information in the scene, including detecting all entity representations in I, that is, Then for each entity pair (e i ,e j ) i→j Make predictions and finally use the triplet (e i ,ω i→j ,e j )Build the scene graph in, Represents the final scene graph, ω i→j Represents an entity pair (e i ,e j ), Represents a set of predicate relations.
3. The method for generating a scene graph of local entity relationship coding according to claim 2, characterized in that: In step S2, for RGB feature extraction, a pre-trained RGB feature extractor is used to extract the RGB features of the scene image I; for depth feature extraction, a depth map prediction model is used to convert the input RGB image I into a depth image D, and a deep feature extraction network is initially trained, and Adam is used to train on a completely depth-based relationship detection task. Finally, the depth image D and the trained feature extraction network are used to extract depth features.
4. The method for generating a scene graph of local entity relationship coding according to claim 3, characterized in that: In step S2, the RGB feature extractor is a FPN network based on ResNeXt-101; The depth map prediction model is based on the ResNet-50 fully convolutional neural network. The depth map prediction model uses residual learning to model the fuzzy mapping between the monocular image and the depth map. The depth map prediction model consists of an end-to-end single body architecture. The deep feature extraction network is a neural network based on ResNet-18.
5. The method for generating a scene graph of local entity relationship coding according to claim 3, characterized in that: In step S2, when obtaining entity relationship proposals, Faster R-CNN is used as the object detector in the scene image. The entity proposal is obtained directly from the output of the object detection, which includes the class label of the object and the classification score. The proposal bounding box is represented as b i , the detected class is denoted as c i ; For the i-th entity proposal, its convolutional features are set to n i , then the entity represents e i The visual, geometric and semantic features of are integrated as follows: where g i is based on the geometric features of its bounding box bi, w i Based on its class c i The semantic features of word embedding, It is a serial operation.
6. The method for generating a scene graph of local entity relationship coding according to claim 5, characterized in that: In step S3, the following steps are included: S31. For a given image I and its depth map D, extract c with size h×w v Channel RGB feature r and has c d Channel and depth features g of the same size; S32, by using RGB features and deep features Divided into n×n blocks to preserve local level entity information; S33, then average pooling the r features and g features within each block to summarize the average value of feature information that is critical to entity relationship prediction; S34. For a given entity pair (e i ,e j ), for two entities e in the image i and e j , merge their RGB features and depth features to form a new feature set, fuse the feature set based on the channel, and obtain a feature set representing the relationship between entities: v = pool (r), d = pool (g) Where F(·) represents the concatenation operation along the channel dimension, pool(·) represents the average pooling operation, and the width and height of the pooling are n; S35, v ij and ij Split into continuous blocks of patch size k in space, there are (n / k) 2 Patches, also called tokens: S36, will as well as Features using fully connected network f x Project to a low-dimensional representation: in, and Local projected entity patches representing RGB features and depth features; S37, fuse the corresponding patches v and d of the two modalities to capture their dependencies, while reducing the length of the token sequence from 2(n / k) 2 Reduce to (n / k) 2 : in Represents the first initial input embedding that can express basic features of the input transformer-based relation encoder; S38. After fusing feature information for each entity pair, use them as additional input tags for the relation encoder to retain local important feature information: Where f(·) represents a fully connected network, μ(·) represents a nonlinear function operation, l represents position feature information, and w represents semantic feature information.
7. The method for generating a scene graph of local entity relationship coding according to claim 6, characterized in that: In step S4, a Transformer-based multi-head self-attention component is used to capture the entity-to-object inductive bias in scene graph generation, and to provide the embedding tags generated by the feature fusion module in the predicate relation prediction process. The specific steps include: The multi-head self-attention component is represented as: MSA(Q,K,V)=Concat(A1,A2,…,A n )W O Among them, Q, K, and V refer to query, key, and value respectively. is the final fusion matrix, and: Multi-head self-attention is used to split the input token sequence of the Transformer-based relation encoder into multiple heads for parallel processing, and the input embedding tokens with rich entity local-level information after cross-modal feature fusion are Incorporating learnable class labels A learnable one-dimensional position embedding ζ is added to each input token sequence pos , and the resulting sequence is passed as input to the encoder: The relation encoder consists of K encoder layers, each of which contains MSA, MLP, and LN blocks and residual connections: Finally, y is linearly projected to the total number of predicate relations to form a relation classification head: The encoding result is output to the entity relationship decoder, and finally the predicate relationship between entity pairs is output.
Citation Information
Cited By
Visual space description method, system and product based on depth information fusion
CN119322986A
