Human-object interaction detection method and system based on large model, and electronic equipment
Through the self-attention and cross-attention mechanisms based on large image and text models, the problems of low recognition accuracy and weak generalization ability in human-object interaction recognition are solved, achieving more efficient interaction detection and more natural interaction. describe.
Patent Information
- Application Number
- CN202410728647.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-20
AI Technical Summary
Existing technology is difficult to effectively identify the interaction between people and objects, especially when there are a large number of people and objects and diverse interactions, resulting in low recognition accuracy and weak generalization ability.
Using a method based on a large image and text model, a person query vector is generated through a self-attention mechanism, and similarity calculation is performed through cross-attention and image features, combined with text features to adaptively detect human interaction relationships, and decouple target detection and relationship recognition. , reduce complexity.
It improves the accuracy of human-object interaction detection, solves the problem of inaccurate pairing, and improves the generalization ability of the model, making interaction detection more natural.
Smart Images

Figure CN118675098A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and specifically provides a method, system and electronic equipment for detecting human-object interaction based on a large model. Background Art
[0002] Human-centered perception tasks have always been a hot topic in the field of computer vision and machine learning, and have been widely used in real-world scenarios. Human-object interaction (HOI) detection aims to understand the actions of people in images in a refined manner. The task requires identifying the interaction between people and objects from a video image sequence. It is widely used in security monitoring and human-computer interaction, and has become one of the important research topics in the field of computer vision and pattern recognition technology.
[0003] The difficulty of HOI lies in efficiently extracting the characteristic expressions of people and objects in time and space, integrating their visual features for interactive pairing, and realizing accurate recognition of people's interactive behavior.
[0004] There are a large number of pairing spaces between people and objects in the picture. For example, if there are n people and m objects in the picture, then there may be n*(n+m-1) potential pairing spaces, which will generate a large number of negative example spaces and easily lead to recognition errors.
[0005] The distribution of human-object interaction behaviors is very unbalanced. Some actions and object relationships are very rare in real scenes, and there is a serious long-tail distribution problem, which makes it extremely difficult for us to collect training samples.
[0006] Human actions are very rich and varied, and the objects they interact with are endless. We have no way of enumerating all action-object combinations and training a dedicated model to identify each combination.
[0007] Accordingly, the art needs a large-model-based human-object interaction detection solution to solve the above technical problems. Summary of the invention
[0008] In order to overcome the above-mentioned defects, the present invention is proposed to provide a solution or at least partially solve the technical problems that due to the large number of people and objects and the diverse interaction behaviors, people and objects are not accurately paired, identification errors are easy to occur, and the generalization ability of the trained model is weak.
[0009] In a first aspect, the present invention provides a method for detecting human-object interaction based on a large model, comprising:
[0010] Based on the image features and text features output by the large image and text model, the coordinate frames and scores of people and objects are determined;
[0011] Based on the person and object coordinate frames and scores, obtain person relationship pairs and corresponding feature vectors, and generate a person query vector query through a self-attention mechanism;
[0012] Based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain an action score;
[0013] Based on the character relationship pairs, object scores, and action scores, the interaction relationship between the person and the object is obtained.
[0014] In one embodiment, if the image feature is f i , the text feature is f t , the target detection module is the InstanceDecode module, then the process of obtaining the coordinate frames and scores of the person and object is as follows:
[0015] O instance =InstanceDecode(fi); where O instance The target detection module is used to detect the image feature f i The processing result;
[0016] instance box = linear(O instance ); where linear(O instance ), used for O instance Perform linear transformation; instance box A coordinate frame for a person or object;
[0017] in,
[0018] For O instance , The vector dot product result is normalized; is the transpose of the text feature vector matrix;
[0019] instance prob Score points for a person or object.
[0020] In one embodiment, based on a first preset threshold score, scores less than the first preset threshold score are filtered, and based on the filtered scores, the scores are sorted from high to low, and the detection frames of m objects and n persons with scores greater than a second preset threshold score are selected, and the corresponding feature vectors are obtained;
[0021] After combining the m objects and the n persons, n*(m+n-1) preliminary query vectors are obtained;
[0022] Based on the query vector query, the final character query vector query is generated through the self-attention mechanism.
[0023] In one embodiment, based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain the action score as follows:
[0024] o interaction =crossAtten(query,f i );in,
[0025] crossAtten(query,f i ), used to obtain the target image features o corresponding to each character relationship pair through cross attention. interaction ;
[0026] in, is the transpose of the text feature vector matrix, sigmoid is the activation function, verb prob Score the action.
[0027] In one embodiment, based on the character relationship pair, the object score, and the action score, the process of obtaining the interaction relationship between the person and the object is as follows:
[0028] Based on the character relationship pairs and actions, obtain the <person, object, action> triple;
[0029] The score of each triplet is calculated through the object score and the action score, and after comparing it with the third preset threshold score, the target triplet is output to determine the interaction relationship between people and objects.
[0030] In one embodiment, the process of calculating the score of each triplet by object score and action score is as follows:
[0031] h oi prob =instance prob *verb prob ; Among them, instance prob Score an object, verb prob Score the action; prob Score the triples.
[0032] In one embodiment, based on a large image-text model, image features and text features corresponding to the input image and text are obtained respectively; wherein the text is used to describe the interaction information between people and objects; the image features and text features are input into a target detection module to obtain the coordinate frames and scores of people and objects.
[0033] In one embodiment, based on the visual encoder in the large image-text model, feature extraction is performed on the input image to obtain corresponding image features; based on the text encoder in the large image-text model, feature extraction is performed on the input text to obtain corresponding text features.
[0034] In one embodiment, the visual encoder is a VIT-B structure; the text encoder is a pre-trained Bert model.
[0035] In one embodiment, the training process of the image-text large model is: based on each image-text pair, respectively obtaining image features and text features;
[0036] Based on the image features and text features, through a comparative learning method, the loss is calculated through a loss function and based on the loss, the parameters of the large image and text model are continuously adjusted until a preset loss value is met, or the number of iterations reaches a preset number; wherein the large image and text model is a transformer architecture.
[0037] In a second aspect, the present invention provides a large model-based human-object interaction detection system, including: a determination module, a generation module, a first acquisition module, and a second acquisition module;
[0038] in,
[0039] The determination module is used to determine the coordinate frames and scores of people and objects based on the image features and text features output by the large image and text model;
[0040] The generation module is used to obtain a person relationship pair and a corresponding feature vector based on the person, object coordinate frame and score, and generate a person query vector query through a self-attention mechanism;
[0041] The first acquisition module is used to obtain the target image features corresponding to each character relationship pair based on the character query vector query and the image features corresponding to the input image through cross attention, and perform similarity calculation between the target image features and the text features to obtain an action score;
[0042] The second obtaining module is used to obtain the interactive relationship between the person and the object based on the person relationship pair, the object score, and the action score.
[0043] In a third aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory stores a program, and when the processor executes the program, the method for detecting human-object interaction based on a large model as described in any one of the technical solutions of the above method is implemented.
[0044] In a fourth aspect, a readable storage medium is provided, storing a program, which, when executed, implements the large model-based method for detecting human-object interaction as described in any one of the technical solutions of the above method.
[0045] The above one or more technical solutions of the present invention have at least one or more of the following
[0046] Beneficial effects:
[0047] The technical solution of the present invention is as follows: based on the image features and text features output by the large graphic and text model, the coordinate frames and scores of people and objects are determined; based on the coordinate frames and scores of people and objects, character relationship pairs and corresponding feature vectors are obtained, and a character query vector query is generated through a self-attention mechanism; based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain an action score; based on the character relationship pairs, the object scores and the action scores, the interactive relationship between people and objects is obtained.
[0048] The above scheme can adaptively detect the interaction relationship between people based on the input text content description, which solves the technical problems of inaccurate matching of people and objects, easy recognition errors, and weak generalization ability due to the large number of people and objects and diverse interaction behaviors.
[0049] Furthermore, in the above solution, target detection and relationship recognition are decoupled, and the problem of human-object interaction detection is broken down, which reduces the complexity and improves the detection accuracy.
[0050] Furthermore, in the above solution, the objects and actions to be detected are described in natural language, making the interaction more natural. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:
[0052] Figure 1 This is a schematic flow chart of the main steps of a method for detecting human-object interaction based on a large model according to an embodiment of the present invention;
[0053] Figure 2 is a schematic flow chart of main steps of a method for detecting human-object interaction based on a large model according to an embodiment of the present invention;
[0054] Figure 3 It is a schematic diagram of the main structural block diagram of a large model-based human-object interaction detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0056] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B.
[0057] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a method for detecting human-object interaction based on a large model according to an embodiment of the present invention. Figure 1 As shown, it mainly includes the following steps S20-S50:
[0058] S20, determining the coordinate frames and scores of people and objects based on the image features and text features output by the large image and text model;
[0059] In this embodiment, based on the large image-text model, image features and text features corresponding to the input image and text are obtained respectively; wherein the text is used to describe the interaction information between people and objects; the image features and text features are input into the target detection module to obtain the coordinate frames and scores of people and objects. Target detection module: We use millions of open source detection data sets, including coco, object365, openimages, etc., to train the target detection module Instance Decode. We hope that according to the text prompt, the target detection module can output the detection results of the corresponding targets in the image. For example, if we input the text aphoto of human riding a bike, we hope that the model can locate the positions of human and bike from the image.
[0060] Specifically:
[0061] Based on the visual encoder in the large image-text model, feature extraction is performed on the input image to obtain the corresponding image features; based on the text encoder in the large image-text model, feature extraction is performed on the input text to obtain the corresponding text features. The architecture adopted by the visual encoder includes at least one of the following: Vit-Base, Vit-Large, Vit-Giant; the architecture adopted by the text encoder includes at least one of the following: Bert, XLM-Bert.
[0062] In this embodiment, the training process of the image-text large model is: based on each image-text pair, respectively obtaining image features and text features;
[0063] Based on the image features and text features, through a comparative learning method, the loss is calculated through a loss function and based on the loss, the parameters of the large image and text model are continuously adjusted until a preset loss value is met, or the number of iterations reaches a preset number; wherein the large image and text model is a transformer architecture.
[0064] The specific training process is as follows:
[0065] Through web crawlers and existing data collection, cross-modal data pairs including massive images and texts are obtained and divided into training data sets and test data sets; an overall network model including image feature extraction and text feature extraction is constructed; after obtaining the image feature vector and text feature vector of the data sample pair, the InfoNCE loss function is calculated using different modal features, and then the Lamb optimizer is used to update the parameters of the overall network model to train the final large image and text model.
[0066] The specific steps include:
[0067] S11, establish a large-scale general image and text dataset;
[0068] We obtained sample pairs of pictures and texts from a large number of Chinese and English websites in different fields and businesses; we crawled sample pairs of pictures and texts from social media; and we collected public sample pairs of pictures and texts. Through the above methods, we obtained more than 2 billion pairs of Chinese and English sample pairs.
[0069] S12, Model Architecture
[0070] The large image and text model is based on the transformer architecture (of course, the model architecture of the large image and text model can also be at least one of the following: VIT structure, Resnet structure, Bert structure, XLM-Roberta structure, CNN structure), and at least includes a visual encoder and a text encoder; the visual encoder is used to extract image features; the text encoder is used to extract text features.
[0071] in,
[0072] For the visual encoder, the architecture adopted includes at least one of the following: Vit-Base, Vit-Large, Vit-Giant, the input image is divided into image blocks, and the blocks are encoded into an embedding sequence for image feature extraction; the architecture adopted by the text encoder includes at least one of the following: Bert, XLM-Bert.
[0073] S13, Metric Learning for Computing Loss
[0074] Metric learning is different from representation learning. It aims to learn the similarity between a pair of images and texts through the network. Usually, large image and text models use InfoNCE loss for metric learning.
[0075] The standard InfoNCE is shown in formula (1):
[0076]
[0077] In the above formula, B represents the number of multimodal image-text sample pairs in the nth batch of training data sets. is the feature used for retrieval (i.e. query), is the target matching feature (i.e. gallery), Represents the positive sample feature (in this method and is the feature of the same image-text sample pair), τ is the temperature coefficient, which is used to obtain the smooth output to obtain the soft label.
[0078] In the equation It is used to indicate the similarity between the same image and text sample data pairs. represents the sum of the similarities between a feature and all other sample features in the same batch (such as the similarity between the dog's picture feature and all text description features). Assume Then x / y can represent the proportion of the result of x to the whole. The optimization goal of the loss is to increase the value of x / y, that is, to increase the similarity x between the same image-text sample pairs and reduce the total similarity y between different image-text sample pairs.
[0079] It is to normalize the x / y results, which is more conducive to target optimization. The τ in is the smoothed output result, and the output distribution is more balanced.
[0080] The image-text contrast loss function minimizes the loss by narrowing the feature distance between the image and text pairs of the positive sample. The infoNCE loss of image-text contrast consists of two parts, as shown in Formula 2:
[0081]
[0082] Among them, L I→T is the infoNCE loss for retrieving text from images, L T→I is the infoNCE loss for retrieving images using text. Expand formula (1) and bring in the image text features, and the results are shown in formulas 3 and 4:
[0083]
[0084]
[0085] Among them, Z I and Z T Represent image features and text features respectively.
[0086] Through loss calculation, the large image and text model is pre-trained until the loss meets the requirements.
[0087] In this embodiment, if the image feature is f i , the text feature is f t , the target detection module is the Instance Decode module, then the process of obtaining the coordinate frames and scores of the person and object is as follows:
[0088] O instance =InstanceDecode(fi); where O instance The target detection module is used to detect the image feature f i The processing result;
[0089] instance box = linear(O instance ); where linear(O instance ),
[0090] For Oinstance Perform linear transformation; instance box A coordinate frame for a person or object;
[0091] in,
[0092] For O instance , The vector dot product result is normalized; is the transpose of the text feature vector matrix;
[0093] instance prob Score points for a person or object.
[0094] S30, based on the person, object coordinate frame and score, obtaining a person relationship pair and a corresponding feature vector, and generating a person query vector query through a self-attention mechanism;
[0095] In this embodiment, based on the first preset threshold score, the scores less than the first preset threshold score are filtered, and based on the filtered scores, the scores are sorted from high to low, and the detection frames of m objects and n people with scores greater than the second preset threshold score are selected, and the corresponding feature vectors are obtained;
[0096] After combining the m objects and the n persons, n*(m+n-1) preliminary query vectors are obtained;
[0097] Based on the query vector query, the final character query vector query is generated through the self-attention mechanism.
[0098] The first preset threshold score and the second preset threshold score can be flexibly set as needed.
[0099] S40, based on the character query vector query and the image features corresponding to the input image, obtain the target image features corresponding to each character relationship pair through cross attention, and calculate the similarity between the target image features and the text features to obtain an action score;
[0100] In this embodiment, based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain the action score as follows:
[0101] o interaction =crossAtten(query,f i );in,
[0102] crossAtten(query,fi ), used to obtain the target image features o corresponding to each character relationship pair through cross attention. interaction ;
[0103] in, is the transpose of the text feature vector matrix, sigmoid is the activation function, verb prob Score the action.
[0104] S50, obtaining the interaction relationship between the person and the object based on the person relationship pair, the object score, and the action score.
[0105] In this embodiment, based on the character relationship pair, object score, and action score, the process of obtaining the interaction relationship between the person and the object is as follows:
[0106] Based on the character relationship pairs and actions, obtain the <person, object, action> triple;
[0107] The score of each triplet is calculated through the object score and the action score, and after comparing it with the third preset threshold score, the target triplet is output to determine the interaction relationship between people and objects.
[0108] The process of calculating the score of each triplet through the object score and action score is as follows:
[0109] h oi prob =instance prob *verb prob ; Among them, instance prob Score an object, verb prob Score the action; prob Score the triples.
[0110] The scheme implemented in this embodiment can adaptively detect the interaction relationship between people based on the input text content description, which solves the technical problems of inaccurate matching of people and objects, easy recognition errors, and weak generalization ability due to the large number of people and objects and diverse interaction behaviors.
[0111] Furthermore, in the above solution, target detection and relationship recognition are decoupled, and the problem of human-object interaction detection is broken down, which reduces the complexity and improves the detection accuracy.
[0112] Furthermore, in the above solution, the objects and actions to be detected are described in natural language, making the interaction more natural.
[0113] Figure 2 It is a flowchart of the main steps of a method for detecting human-object interaction based on a large model according to an embodiment of the present invention.
[0114] The technical solution of this embodiment is conceived as follows:
[0115] The human interaction detection is divided into two independent subtasks: Task 1 is the instance detection of people and objects, and Task 2 is the recognition of human-object interaction relationships. The former focuses on detecting people and objects in the image and is highly related to the target detection task. The latter focuses on judging the human-object relationship and classifying the relationship. The two-stage recognition method is equivalent to decomposing a problem with an n*m solution space into two sub-problems with n and m solution spaces, which greatly reduces the difficulty of the problem.
[0116] To address the long-tail problem, we introduce a large model to assist in the identification of human-object interaction relationships. Even though image samples are scarce, we can describe them in natural language. We first use a large number of image-text pairs for pre-training to align images and language in the feature space. Then, for the HOI task, we use (person, object, action) triplet data for fine-tuning to make the pre-trained model more suitable for the task of human interaction detection.
[0117] After being pre-trained on millions of data points, the large model is no longer restricted to the categories of people, objects, and relationships. For the actions between people and objects that need to be detected in actual applications, it is only necessary to give a description of the corresponding actions, avoiding the development of multiple independent customized models.
[0118] Advantages of the present invention:
[0119] This method combines the language model and uses natural language to describe the objects and actions to be detected, making the interaction more natural.
[0120] This method is not targeted at a specific object or action, but can adapt to the target to be detected according to the input text content, which is very suitable for solving the HOI long tail problem.
[0121] This method decouples target detection and relationship recognition, breaks down the problem of human-object interaction detection, reduces the complexity of the model, and improves detection accuracy.
[0122] The present invention designs a fully automated process to construct a pre-training data set of millions of HOIs to ensure the generalization ability of large models.
[0123] Specifically, if Figure 2 As shown, it mainly includes the following steps S201-S205:
[0124] S201, Feature
[0125] After the input image Image passes through the visual encoder Visual Encode, the visual feature ImageFeature is obtained. The visual encoder is usually a standard VIT-B structure. After the text Text corresponding to the image passes through the text encoder Text Encode, the text feature Text Embedding is obtained. The text encoder usually uses a pre-trained Bert model. The corresponding formula is as follows:
[0126] f i =Encode i (image); f t =Encode t (text); where the image feature is f i , the text feature is f t .
[0127] S202, instance detection
[0128] The image features and text features are sent to the target detection module, namely the Instance Decode module. The main function of the Instance Decode module is to detect all people and objects in the image and output the coordinate boxes and category scores of people and objects.<box,prob> It should be noted here that the category score of each instance is calculated based on the features of the input text.
[0129] Specifically:
[0130] If the image feature is f i , the text feature is f t , the target detection module is the Instance Decode module, then the process of obtaining the coordinate frames and scores of the person and object is as follows:
[0131] O instance =InstanceDecode(fi); where O instance The target detection module is used to detect the image feature f i The processing result;
[0132] instance box = linear(O instance ); where linear(O instance ),
[0133] For O instance Perform linear transformation; instance box A coordinate frame for a person or object;
[0134] in,
[0135] For O instance , The vector dot product result is normalized; is the transpose of the text feature vector matrix;
[0136] instance prob Score for person or object category.
[0137] S203, generating person-object relationship pairs
[0138] Based on a first preset threshold score, filtering the scores less than the first preset threshold score, and based on the filtered scores, sorting from high to low, selecting the detection frames of m objects and n persons whose scores are greater than a second preset threshold score, and obtaining corresponding feature vectors;
[0139] After combining the m objects and the n persons, n*(m+n-1) preliminary query vectors are obtained;
[0140] Based on the query vector query, the final character query vector query is generated through the self-attention mechanism.
[0141] Specifically:
[0142] Based on the results of the above Instance Decode detection and decoding, we generate the person-object relationship pair H-Oquery.
[0143] The process is as follows: first, based on the instance score, we use a threshold (e.g. 0.2) to filter the detection score; second, we sort the scores from high to low, select the detection boxes of the top m objects and n people with the highest scores, and obtain the corresponding feature vectors. After combining these m object targets and n person targets, we get n*(m+n-1) queries. After these queries are self-attentioned, we generate the final query we need.
[0144] f select =Select(instance); where f select Represents the initial query after selection, for example: n*(m+n-1) queries.
[0145] query = selfAtten(f select ); where selfAtten(f select ) represents the final query after the initial query is selected and after self-attention.
[0146] S204, Relationship Identification
[0147] After generating the person-object query vector qeury as above, we can perform cross-attention with the original visual features to obtain the decoded features of each person relationship pair, and then calculate the similarity with the text features in turn.
[0148] Specifically:
[0149] Based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain the action score as follows:
[0150] o interaction =crossAtten(query,f i );in,
[0151] crossAtten(query,f i ), used to obtain the target image features o corresponding to each character relationship pair through cross attention. interaction ;
[0152] in, is the transpose of the text feature vector matrix, sigmoid is the activation function, verb prob Score the action.
[0153] S205, combined output.
[0154] For each <person, object, action> triple, we combine the object score and the action score to calculate the final score of each triple. In actual application, we can filter according to the threshold to decide which triple relationship pairs to output.
[0155] Specifically:
[0156] Based on the character relationship pair and action, a <person, object, action> triple is obtained; wherein, the process of calculating the score of each triple is as follows through the object score and the action score:
[0157] h oi prob =instance prob *verb prob ; Among them, instance prob Score an object, verb prob Score the action; prob Score the triples.
[0158] The score of each triplet is calculated by object score and action score, and after comparing it with the third preset threshold score, the target triplet is output.
[0159] result=(instance h ,instance o , verb prob ), determine the interaction between people and objects.
[0160] Among them, result is the target triple; instance h Representative;
[0161] instance o representative; verb prob Represents an action.
[0162] The scheme implemented in this embodiment can adaptively detect the interaction relationship between people based on the input text content description, which solves the technical problems of inaccurate matching of people and objects, easy recognition errors, and weak generalization ability due to the large number of people and objects and diverse interaction behaviors.
[0163] Furthermore, in the above solution, target detection and relationship recognition are decoupled, and the problem of human-object interaction detection is broken down, which reduces the complexity and improves the detection accuracy.
[0164] Furthermore, in the above solution, the objects and actions to be detected are described in natural language, making the interaction more natural.
[0165] Figure 3 is a schematic diagram of the main structural block diagram of a large model-based human-object interaction detection system according to an embodiment of the present invention. Figure 3 As shown, it includes: a determination module 301, a generation module 302, a first acquisition module 303, and a second acquisition module 304;
[0166] in,
[0167] The determination module 301 is used to determine the coordinate frames and scores of people and objects based on the image features and text features output by the large image and text model;
[0168] The generating module 302 is used to obtain a person relationship pair and a corresponding feature vector based on the person and object coordinate frames and scores, and generate a person query vector query through a self-attention mechanism;
[0169] The first obtaining module 303 is used to obtain the target image features corresponding to each character relationship pair based on the character query vector query and the image features corresponding to the input image through cross attention, and perform similarity calculation between the target image features and the text features to obtain an action score;
[0170] The second obtaining module 304 is used to obtain the interaction relationship between the person and the object based on the person relationship pair, the object score, and the action score.
[0171] In some embodiments, one or more of the determination module 301, the generation module 302, the first acquisition module 303, and the second acquisition module 304 can be combined into one module. In one implementation, the description of the specific implementation functions can refer to the steps of the above embodiment.
[0172] The scheme implemented in this embodiment can adaptively detect the interaction relationship between people based on the input text content description, which solves the technical problems of inaccurate matching of people and objects, easy recognition errors, and weak generalization ability due to the large number of people and objects and diverse interaction behaviors.
[0173] Furthermore, in the above solution, target detection and relationship recognition are decoupled, and the problem of human-object interaction detection is broken down, which reduces the complexity and improves the detection accuracy.
[0174] Furthermore, in the above solution, the objects and actions to be detected are described in natural language, making the interaction more natural.
[0175] The above-mentioned large model-based human-object interaction detection system is used to perform Figure 1 The embodiment of the human-object interaction detection method based on a big model shown in the figure has similar technical principles, technical problems solved and technical effects produced. Technicians in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the human-object interaction detection system based on a big model can refer to the contents described in the embodiment of the human-object interaction detection method based on a big model, and will not be repeated here.
[0176] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0177] Furthermore, the present invention also provides an electronic device, the electronic device includes a processor and a memory, the memory can be configured to store a program for executing the large model-based human-object interaction detection method of the above method embodiment, and the processor can be configured to execute the program in the memory, the program including but not limited to the program for executing the large model-based human-object interaction detection method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention.
[0178] Furthermore, the present invention also provides a readable storage medium. In a readable storage medium embodiment according to the present invention, the readable storage medium can be configured to store a program for executing the large model-based human-object interaction detection method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned large model-based human-object interaction detection method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The readable storage medium can be a storage device formed by various electronic devices. Optionally, the readable storage medium in the embodiment of the present invention is a non-temporary readable storage medium.
[0179] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the system of the present invention, the physical devices corresponding to these modules can be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0180] Those skilled in the art will appreciate that the modules in the system may be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0181] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for detecting human-object interaction based on a large model. It is characterized in that include: Based on the image features and text features output by the large image and text model, the coordinate frames and scores of people and objects are determined; Based on the person and object coordinate frames and scores, obtain person relationship pairs and corresponding feature vectors, and generate a person query vector query through a self-attention mechanism; Based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain an action score; Based on the character relationship pairs, object scores, and action scores, the interaction relationship between the person and the object is obtained.
2. The method according to claim 1, It is characterized in that If the image feature is f i , the text feature is f t , the target detection module is the Instance Decode module, then the process of obtaining the coordinate frames and scores of the person and object is as follows: O instance =InstanceDecode(fi); where O instance The target detection module is used to detect the image feature f i The processing result; instance box = linear(O instance ); where linear(O instance ), used for O instance Perform linear transformation; instance box A coordinate frame for a person or object; in, For O instance , The vector dot product result is normalized; is the transpose of the text feature vector matrix; instance prob Score points for a person or object.
3. The method according to claim 2, It is characterized in that Based on a first preset threshold score, filtering the scores less than the first preset threshold score, and based on the filtered scores, sorting from high to low, selecting the detection frames of m objects and n persons whose scores are greater than a second preset threshold score, and obtaining corresponding feature vectors; After combining the m objects and the n persons, n*(m+n-1) preliminary query vectors are obtained; Based on the query vector query, the final character query vector query is generated through the self-attention mechanism.
4. The method according to claim 3, It is characterized in that Based on the character query vector query and the image features corresponding to the input image, the target image features corresponding to each character relationship pair are obtained through cross attention, and the similarity between the target image features and the text features is calculated to obtain the action score as follows: o interaction =crossAtten(query,f i ); where crossAtten(query,f i ), used to obtain the target image features o corresponding to each character relationship pair through cross attention. interaction ; in, is the transpose of the text feature vector matrix, sigmoid is the activation function, verb prob Score the action.
5. The method according to claim 4, It is characterized in that Based on the character relationship pair, object score, and action score, the process of obtaining the interaction relationship between the person and the object is as follows: Based on the character relationship pairs and actions, obtain the <person, object, action> triple; The score of each triplet is calculated through the object score and the action score, and after comparing it with the third preset threshold score, the target triplet is output to determine the interaction relationship between people and objects.
6. The method according to claim 5, It is characterized in that The process of calculating the score of each triplet through the object score and action score is as follows: hoi prob =instance prob *verb prob ; Among them, instance prob Score an object, verb prob Score the action; prob Score the triples.
7. The method according to claim 1, It is characterized in that Based on the image-text model, image features and text features corresponding to the input image and text are obtained respectively; wherein the text is used to describe the interaction information between people and objects; the image features and text features are input into the target detection module to obtain the coordinate frames and scores of people and objects.
8. A human-object interaction detection system based on a large model, It is characterized in that include: Determining module, generating module, first obtaining module, second obtaining module; The determination module is used to determine the coordinate frames and scores of people and objects based on the image features and text features output by the large image and text model; The generation module is used to obtain a person relationship pair and a corresponding feature vector based on the person, object coordinate frame and score, and generate a person query vector query through a self-attention mechanism; The first acquisition module is used to obtain the target image features corresponding to each character relationship pair based on the character query vector query and the image features corresponding to the input image through cross attention, and perform similarity calculation between the target image features and the text features to obtain an action score; The second obtaining module is used to obtain the interactive relationship between the person and the object based on the person relationship pair, the object score, and the action score.
9. An electronic device comprising a processor and a memory, wherein the memory stores a program, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
10. A readable storage medium storing a program, It is characterized in that When the program is executed, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Interaction behavior analysis method and system, electronic equipment and storage medium
CN119377728A
