Interaction relationship detection method, interaction relationship detection model training method and device
Through multi-network joint training of data enhancement and interactive relationship detection models in the label space, the long-tail problem in interactive relationship detection is solved and the accuracy and applicability of the detection results are improved.
Patent Information
- Application Number
- CN202110803250.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-07-15
AI Technical Summary
The existing technology has a long-tail problem in interactive relationship detection, which results in better prediction results for interactive relationship categories with more training samples, while poor prediction results for categories with fewer samples. Existing data enhancement methods are not adaptable, and it is difficult to comprehensively solve the long-tail problem. problems, affecting the accuracy of test results.
Through data enhancement in the label space, feature extraction and interaction relationship detection are performed on training samples to generate word vectors. The feature extraction network, interaction relationship detection network and word vector generation network are used to jointly train the model to improve the applicability and accuracy of the model.
It improves the applicability of interactive relationship detection and the accuracy of detection results, weakens the impact of long-tail problems, and enhances the model's prediction ability for categories with few training samples.
Smart Images

Figure CN113643241B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an interaction relationship detection method, an interaction relationship detection model training method, a device, an electronic device and a readable storage medium. Background Art
[0002] In recent years, great progress has been made in the field of object detection and recognition. However, to understand the situation in the scene, it is also necessary to understand how the various objects in the image interact with each other. Interaction relationship detection is a method based on visual images to study the interaction relationship between different targets. The targets can be objects (such as items, animals, plants, etc.) or people. For example, HOI (Human-object interaction, human interaction detection / human relationship detection) is a method based on visual images to study the relationship between people and objects, where the targets are people and objects.
[0003] In practical applications, since different interaction relationship categories are naturally unevenly distributed, interaction relationship detection tasks in real scenarios generally have an obvious long-tail problem - that is, a small number of frequent interaction relationships have easy-to-obtain data, so there are many training samples, while most interaction relationships have low occurrence frequencies, difficult-to-obtain data, and few training samples. If samples are learned directly through the network, it is easy to lead to better prediction results for interaction relationship categories with more training samples, while the prediction results for interaction relationship categories with fewer training samples are very poor.
[0004] In the related art, the long-tail problem is mainly solved by performing data enhancement in the feature space. Taking HOI detection as an example, the typical approach is based on a two-stage method (target detection and interaction relationship classification). First, a target detector is used to detect pedestrians and objects in the image, and then the visual features of pedestrians and objects are extracted. Then, before the relationship classification stage, within the same image or between multiple images, try to combine each person and each object to find a legal combination as a new positive sample to train an interaction relationship detection model. However, since the above method requires data enhancement within the same image in the relationship classification stage or the interaction relationship between multiple images, it can only be applied to the two-stage model training method, and cannot be applied to the one-stage or end-to-end model training. It has low adaptability and it is difficult to comprehensively and effectively solve the long-tail problem of interaction relationship prediction, which will also affect the accuracy of the interaction relationship detection results. Summary of the invention
[0005] The present invention provides an interactive relationship detection method, an interactive relationship detection model training method, device, electronic device and readable storage medium to partially or completely solve the above-mentioned problems related to the relationship detection process in the prior art.
[0006] According to a first aspect of the present invention, there is provided an interaction relationship detection method, comprising:
[0007] Acquire a target image, wherein the target image includes a first type of target and a second type of target;
[0008] Extracting features from the target image through a feature extraction network in an interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target;
[0009] Performing interaction relationship detection on the multiple feature vectors through an interaction relationship detection network in an interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection box where the first type of target is located, a detection box where the second type of target is located, a first identifier representing a specific category of the first type of target, a second identifier representing a specific category of the second type of target, and a third identifier representing a category of the interaction relationship between the first type of target and the second type of target;
[0010] The interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are subjected to data enhancement in the label space.
[0011] According to a second aspect of the present invention, a method for training an interaction relationship detection model is provided, the method comprising:
[0012] Acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least some of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0013] Using the training set to train the interaction relationship detection model to be trained to obtain the interaction relationship detection model;
[0014] The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained;
[0015] The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors;
[0016] The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result;
[0017] The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
[0018] According to a third aspect of the present invention, a method for performing data enhancement in a label space is provided, the method comprising:
[0019] Acquire a first interaction relationship label of a first sample image among the multiple sample images;
[0020] Determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0021] Based on the alternative identification words of each enhanced identification word corresponding to the first sample image, at least one word vector is generated for the first sample image to generate a label; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate words corresponding to the enhanced identification word, and a first sample image with data enhancement in the label space is obtained.
[0022] According to a fourth aspect of the present invention, there is provided an interactive relationship detection device, comprising:
[0023] An image acquisition module, used for acquiring a target image, wherein the target image includes a first type of target and a second type of target;
[0024] A feature extraction module, used to extract features from the target image through a feature extraction network in the interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target;
[0025] An interaction relationship detection module, configured to perform interaction relationship detection on the plurality of feature vectors through an interaction relationship detection network in an interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection frame where the first type of target is located, a detection frame where the second type of target is located, a first identifier representing a specific category of the first type of target, a second identifier representing a specific category of the second type of target, and a third identifier representing a category of an interaction relationship between the first type of target and the second type of target;
[0026] The interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are subjected to data enhancement in the label space.
[0027] According to a fifth aspect of the present invention, there is provided an interactive relationship detection model training device, the device comprising:
[0028] A training set acquisition module, used to acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0029] A model training module, used for training the interaction relationship detection model to be trained using the training set to obtain the interaction relationship detection model;
[0030] The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained;
[0031] The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors;
[0032] The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result;
[0033] The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
[0034] According to a sixth aspect of the present invention, there is provided a device for performing data enhancement in a label space, the device comprising:
[0035] A label acquisition module, used to acquire a first interaction relationship label of a first sample image among the multiple sample images;
[0036] An enhanced identification word determination module, used to determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0037] A label generation module is used to generate at least one word vector for the first sample image based on the alternative identifiers of each enhanced identifier corresponding to the first sample image to generate a label, so as to obtain a first sample image with data enhanced label space; the alternative identifiers of the enhanced identifier include the enhanced identifier itself and / or the approximate words corresponding to the enhanced identifier.
[0038] According to a seventh aspect of the present invention, there is provided an electronic device, comprising:
[0039] A processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the program, it implements any one of the interaction relationship detection methods described in the first aspect, and / or any one of the interaction relationship detection model training methods described in the second aspect, and / or any one of the methods for data enhancement in the label space described in the third aspect.
[0040] According to the eighth aspect of the present invention, a readable storage medium is provided. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute any one of the interaction relationship detection methods described in the first aspect, and / or any one of the interaction relationship detection model training methods described in the second aspect, and / or any one of the methods for performing data enhancement in the label space described in the third aspect.
[0041] According to the interactive relationship detection method of the present invention, a target image is obtained, the target image includes a first type of target and a second type of target; a feature extraction network in an interactive relationship detection model is used to extract features from the target image to obtain multiple feature vectors, each feature vector is used to characterize the interactive relationship between a first type of target and a second type of target; an interactive relationship detection network in the interactive relationship detection model is used to perform interactive relationship detection on the multiple feature vectors to obtain an interactive relationship detection result, the interactive relationship detection result includes at least one of a detection frame where the first type of target is located, a detection frame where the second type of target is located, a first identifier characterizing a specific category of the first type of target, a second identifier characterizing a specific category of the second type of target, and a third identifier characterizing the interactive relationship category between the first type of target and the second type of target; the interactive relationship detection model is obtained by training the interactive relationship detection model to be trained, and at least part of the sample images used to train the interactive relationship detection model to be trained are subjected to data enhancement in the label space. Thereby, the applicability of interactive relationship detection and the accuracy of the detection results are improved, and the long-tail problem is reduced.
[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0044] Figure 1 A flowchart of a method for detecting an interactive relationship according to an embodiment of the present invention is shown;
[0045] Figure 2 A flowchart showing another interactive relationship detection method according to an embodiment of the present invention is shown;
[0046] Figure 3 Two structural schematic diagrams of the interactive relationship detection model in the model training process according to the embodiment of the present invention are shown;
[0047] Figure 4 Two typical structural examples of embedding generation networks according to embodiments of the present invention are shown;
[0048] Figure 5 A schematic diagram of a process of performing data enhancement in a label space according to an embodiment of the present invention is shown;
[0049] Figure 6 A flowchart of a method for detecting an interactive relationship according to an embodiment of the present invention is shown;
[0050] Figure 7 A schematic diagram showing the structure of a relationship detection device according to an embodiment of the present invention is shown; and
[0051] Figure 8 A schematic structural diagram of an interactive relationship detection device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0052] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0053] Reference Figure 1 , showing a step flow chart of an interactive relationship detection method in an embodiment of the present invention.
[0054] Step 110, acquiring a target image, wherein the target image includes a first type of target and a second type of target;
[0055] Step 120, extracting features from the target image through a feature extraction network in the interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target;
[0056] Step 130, performing interaction relationship detection on the multiple feature vectors through the interaction relationship detection network in the interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection box where the first type of target is located, a detection box where the second type of target is located, a first identifier characterizing a specific category of the first type of target, a second identifier characterizing the specific category of the second type of target, and a third identifier characterizing the category of the interaction relationship between the first type of target and the second type of target; the interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained have undergone data enhancement in the label space.
[0057] In an embodiment of the present invention, in order to effectively solve the long-tail problem of prediction results for models of various structures such as one-stage models, two-stage models, and end-to-end models, a data enhancement method that does not affect the model training process is required. Therefore, in an embodiment of the present invention, a scheme for data enhancement for training samples in the label space is proposed. That is, the above-mentioned interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are data enhanced in the label space.
[0058] Wherein, when data enhancement is performed on the sample image in the label space, data enhancement can be performed multiple times or once on at least one label of a sample image, and when data enhancement is performed once on the label space for each sample image, its label can be re-determined. Wherein, during the model training process, the label of the sample image can at least include an interaction relationship label, that is, a label representing the true value of the interaction relationship detection result of the sample image, and can also include other labels according to training requirements, which is not limited in this embodiment of the present invention.
[0059] Moreover, when data enhancement is performed on the labels of the sample images, one of the approximate values of the labels to be enhanced can be selected as the enhanced labels. The selection range and selection method of the enhanced labels can be customized according to requirements, and this embodiment of the present invention does not limit this.
[0060] The target may be an object such as an article, an animal, a plant, or a person. The specific types of the first type of target and the second type of target may be customized as required, and the embodiment of the present invention does not limit this. The specific category of the first type of target may be a category under the first type, or may be the first type itself, and the specific category of the corresponding second type of target may be a category under the second type, or may be the second type itself.
[0061] For example, the first type and the second type may be different. In the HOI application scenario, the target of the first type may be a person (Human), and the target of the second type may be an object (Object) such as an object, an animal, or a plant. The identifiers of the specific categories of the first type of targets may be "person", "human", "man", "woman", or "boy", and the identifiers of the specific categories of the first type of targets may be "horse", "elephant", or "bicycle", etc. In another example, the first type and the second type are the same, for example, both are people or objects.
[0062] In the embodiment of the present invention, the target image may include at least one target of the first type and at least one target of the second type. Of course, if the target image only includes the first type of target or the second type of target, or does not include any target, then the final interaction relationship detection result will not include the third identifier, and information that the interaction relationship between the first type of target and the second type of target cannot be detected may be returned, or no interaction relationship detection result may be returned, etc., which is not limited by the embodiment of the present invention.
[0063] The target image is feature extracted by a feature extraction network in the interactive relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize the interactive relationship between a first type of target and a second type of target. The feature extraction network can be any available network structure, and the structure of the feature extraction network can be customized according to requirements, which is not limited in the embodiment of the present invention. In the embodiment of the present invention, the feature extraction network can come from a two-stage model, a one-stage model, or an end-to-end model, which is not limited in the embodiment of the present invention.
[0064] The features extracted by the feature extraction network may include but are not limited to the visual features of the target image. The extraction and representation of the visual features of the image is the process of converting the visual information of the image into a quantitative form that can be recognized and processed by the computer. The target image can be extracted by the feature extraction network to obtain at least one feature vector, and each feature vector can be used to characterize the interaction between a first type of target and a second type of target. For example, when there are M first type targets and N second type targets in the target image, the feature vectors can be M*N.
[0065] That is, in the embodiment of the present invention, the feature extraction network can extract the global features of the target image and construct a feature vector, or it can extract the local features of different regions in the target image and construct multiple feature vectors, which is not limited by the embodiment of the present invention.
[0066] After feature extraction is performed through the feature extraction network in the interaction relationship detection model, the interaction relationship detection network in the interaction relationship detection model, such as the network used for HOI detection, can be further used to perform interaction relationship detection on each feature vector extracted by the feature extraction network. At this time, interaction relationship detection can be performed on each feature vector separately to obtain the interaction relationship detection result of the target image.
[0067] Among them, the interaction relationship detection result may include but is not limited to at least one of a detection box where the first type of target is located, a detection box where the second type of target is located, a first identifier word representing a specific category of the first type of target, a second identifier word representing a specific category of the second type of target, and a third identifier word representing the category of the interaction relationship between the first type of target and the second type of target.
[0068] The interaction relationship can be a position relationship or an action relationship. The position relationship can be the relative position between the first type of target and the second type of target. The action relationship can be what action the first type of target performs on the second type of target.
[0069] For example, assuming that the interaction relationship detection network at this time is a network for HOI, and the first type mentioned above is a person and the second type is an object, then the interaction relationship detection result at this time may include a detection box of a person in the target image, a detection box of an object in the target image, an identification word representing the specific category of the detected person (for example, "person", "human", "man", "woman", "boy", "girl", etc.), an identification word representing the specific category of the detected object (for example, "horse", "elephant", "bicycle", etc.), and an identification word representing the category of the interaction relationship (verb) between a person and an object (for example, "ride", "kiss", "wear", "carry", "sit at", "left", etc.).
[0070] In addition, if interaction relationship detection is performed on different feature vectors in the same target image respectively, then the interaction relationship detection result corresponding to each feature vector can be obtained respectively, which is not limited in the embodiment of the present invention.
[0071] In addition, in the embodiment of the present invention, the interactive relationship detection network can be any network structure that can be used for interactive relationship detection, and can be customized according to specific application scenarios, which is not limited by the embodiment of the present invention.
[0072] For example, in a HOI detection scenario, the interaction relationship detection network may be any network branch used for HOI detection, which is not limited in the embodiment of the present invention.
[0073] The interactive relationship detection model can also include a word vector generation network to obtain word vector generation results.
[0074] In an embodiment of the present invention, a method for data enhancement of training samples in label space is proposed, which can be applied in the training process of different model structures such as one-stage model, two-stage model, end-to-end model, etc., to effectively solve the long-tail problem in different scenarios.
[0075] Reference Figure 2 In an embodiment of the present invention, the method may further include:
[0076] Step 210, obtaining a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0077] Step 220, using the training set to train the interaction relationship detection model to be trained to obtain the interaction relationship detection model; wherein the interaction relationship detection model to be trained includes a feature extraction network to be trained, an interaction relationship detection network to be trained and a word vector generation network to be trained; the feature extraction network to be trained is used to extract features from the sample image to obtain multiple sample feature vectors; the interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain sample interaction relationship prediction results; the word vector generation network to be trained is used to obtain sample word vector prediction results based on the sample feature vectors.
[0078] In an embodiment of the present invention, in order to improve the accuracy of the prediction results of the interaction relationship detection network to be trained in the interaction relationship detection model to be trained after training, the interaction relationship detection results and NLP embedding, that is, the word vector generation results of the samples can be predicted at the same time during the training process of the interaction relationship detection model to be trained. That is, the interaction relationship detection model to be trained may include a feature extraction network to be trained, an interaction relationship detection network to be trained, and a word vector generation network to be trained. Moreover, during the model training process, the feature extraction network to be trained is used to extract features from sample images to obtain multiple sample feature vectors; the interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain sample interaction relationship prediction results; the word vector generation network to be trained is used to obtain sample word vector prediction results based on the sample feature vectors. Thereby, the parameters of the feature extraction network to be trained, the interaction relationship detection network to be trained, and the word vector generation network to be trained are adjusted by the loss between the prediction results and the corresponding labels.
[0079] Moreover, in the use stage after the model training is completed, the word vector generation network can be removed, and only the trained feature extraction network and interaction relationship detection network can be used to detect the interaction relationship. The word vector generation network can also be retained to obtain the interaction relationship detection results and word vector detection results at the same time.
[0080] like Figure 3 The model training process is shown, and two structural schematic diagrams of the interactive relationship detection model to be trained are shown. The two structures can be equivalent. At this time, the interactive relationship detection network to be trained and the word vector generation network to be trained can be connected to the same feature extraction network to be trained, that is, the same feature vector, which means that they share the knowledge space. At the specific implementation level, this feature vector and the feature extraction network to be trained can come from a two-stage model, a one-stage model, or an end-to-end model, which is not limited by the embodiment of the present invention.
[0081] The feature extraction network to be trained can be a twin network structure, so that during the training process of the interaction relationship detection network to be trained and the word vector generation network to be trained, the feature extraction network to be trained can share parameters. Of course, according to demand, the feature extraction network to be trained can also be other network structure forms, which is not limited in this embodiment of the present invention.
[0082] At this time, during the model training process, on the one hand, the interaction relationship detection network to be trained and the word vector generation network to be trained share the knowledge space. On the other hand, the loss value caused by the difference between the prediction results of the word vector generation network to be trained and its corresponding labels can affect the parameters of the interaction relationship detection network to be trained and the feature extraction network to be trained. Therefore, the knowledge space can be affected during the training process through the word vector generation network to be trained, that is, the parameters of the feature extraction network to be trained are affected, and then the interaction relationship detection network to be trained is affected. In this way, the loss value caused by the difference between the prediction results of the interaction relationship detection network to be trained and its corresponding labels is combined with the influence of the word vector generation network to be trained on the interaction relationship detection network to be trained, so as to improve the training effect of the interaction relationship detection network to be trained and improve the prediction accuracy of the interaction relationship detection network obtained after training.
[0083] Among them, the true value of the sample word vector result, that is, the word vector generation label includes the sentence vector after embedding of at least one of the first identifier, the second identifier, and the third identifier corresponding to any interactive relationship category in the sample, and the embodiment of the present invention is not limited to this. For example, the true value of the sample word vector result can be the sentence vector after embedding of a short sentence after the first identifier, the third identifier, and the second identifier corresponding to an interactive relationship category in a certain sample image, or it can be the sentence vector of a short sentence after embedding of any two words in the first identifier, the third identifier, and the second identifier, or it can be the sentence vector obtained by combining the word vectors of each word after embedding, etc., and the embodiment of the present invention is not limited to this. Each sample image has an interactive relationship label. For example, for a sample image of a person riding a horse, its interactive relationship label can include a first real identifier representing a specific category of a first type of target, a second real identifier representing a specific category of a second type of target, and a third real identifier representing the interactive relationship category between the first type of target and the second type of target: "person ride horse". For sample images, if their interaction relationship labels are known, the word vector generation label of each sample image can be obtained according to the first identifier, second identifier, third identifier and other information contained in the interaction relationship label, which is equivalent to knowing the word vector generation label of each sample image before training. Then the interaction relationship label and word vector generation label of the same sample image can be used as ground truth to train the interaction relationship detection model.
[0084] Optionally, in an embodiment of the present invention, each sample image carries an interaction relationship label and a word vector generation label; the interaction relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing the interaction relationship category between the first type of target and the second type of target;
[0085] The method may further include:
[0086] Step 310, obtaining a first interaction relationship label of a first sample image among the multiple sample images;
[0087] Step 320, determining an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0088] Step 330, based on the alternative identifiers of each of the enhanced identifiers corresponding to the first sample image, generate at least one word vector to generate a label for the first sample image; the alternative identifiers of the enhanced identifiers include the enhanced identifier itself and / or the approximate words corresponding to the enhanced identifier.
[0089] The first sample image can be understood as a sample image for which data enhancement is performed among multiple sample images, and the interaction relationship label of the first sample image is the first interaction relationship label. It can be understood that data enhancement in the label space can be performed on some or all sample images in the training set.
[0090] When performing data enhancement, data enhancement may be performed only on some of the identifiers under the same first interactive relationship label, or on all identifiers under the same first interactive relationship label, that is, the enhanced identifier may include at least one of the first real identifier (that is, the real value of the first identifier), the second real identifier (that is, the real value of the second identifier), and the third real identifier (that is, the real value of the third identifier) in the first interactive relationship label. For example, the first real identifier, the second real identifier, and the third real identifier are person ride horse, respectively. Only ride may be used as an enhanced identifier, or both ride and horse may be used as enhanced identifiers.
[0091] Moreover, for each enhanced identifier, the alternative identifier for each enhanced identifier when performing data enhancement can be set to be an approximate word of the enhanced identifier, or the alternative identifier can include both the enhanced identifier itself and the approximate word of the enhanced identifier. The specific setting can be customized according to the needs, and the embodiment of the present invention is not limited to this. In one example, the approximate word of horse is {elephant, camel, donkey}. When horse is used as an enhanced identifier, its corresponding alternative identifier can be {elephant, camel, donkey}, or {elephant, camel, donkey, horse}.
[0092] Among them, the approximate words are other words whose similarity with the corresponding enhanced identification words is within a specified range, that is, other words outside the enhanced identification words. Approximate words can be understood as words that are close to the enhanced identification words in the semantic space. Among them, the specified range that the distance between the approximate words and the enhanced identification words needs to meet can be customized according to needs, and this embodiment of the present invention is not limited. It can be understood that the specified range can be determined according to the distribution of samples. If the distribution of each sample in the training set is relatively scattered, the specified range can be set larger, otherwise it can be set smaller. For example, there are sample images with interactive relationship labels of "person ride horse" and sample images of "person ride camel" in the training set, indicating that the sample distribution is relatively dense, and the specified range should be set smaller, then camel is no longer considered to be an approximate word of horse. Donkey, which is closer to horse than camel, is considered to be an approximate word of horse.
[0093] Optionally, in the embodiment of the present invention, step 330 may further include:
[0094] Step A331, for each enhanced identification word, selecting at least one word from the candidate identification words corresponding to the enhanced identification word as a generated identification word corresponding to the enhanced identification word;
[0095] Step A332, determining a generated identification word combination corresponding to the first sample image according to the generated identification words corresponding to each enhanced identification word;
[0096] Step A333: Determine the word vector generation label corresponding to the first sample image according to the generated identification word combination corresponding to the first sample image.
[0097] Optionally, in an embodiment of the present invention, step A333 may further include: determining a generated identification word combination corresponding to the first sample image based on the generated identification words and non-enhanced identification words corresponding to the enhanced identification words; wherein the non-enhanced identification words are identification words that are not used as enhanced identification words among the first real identification words, the second real identification words, and the third real identification words in the first interactive relationship label.
[0098] In addition, in practical applications, when data enhancement is performed on sample images in the label space, only some of the real identifiers in the interactive relationship labels of the sample images can be used as enhanced identifiers, that is, at least one of the first real identifier, the second real identifier, and the third real identifier. Then, when determining the candidate identifier corresponding to the enhanced identifier, in order to avoid wasting resources due to invalid operations, only the corresponding approximate words can be determined for the enhanced identifier.
[0099] Then, for each enhanced identifier, in order to perform data enhancement, at least one identifier can be selected from the candidate identifiers corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier. Among them, a word can be randomly selected from the approximate words corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier, or a word can be selected from the approximate words and the enhanced identifier itself as the generated identifier corresponding to the enhanced identifier with a certain probability as a condition. However, for non-enhanced identifiers (real identifiers that do not require data enhancement), they can remain unchanged or their corresponding generated identifiers can be considered as themselves.
[0100] For example, in the HOI detection scenario, the enhanced identifiers targeted by data enhancement may include the second real identifier (i.e., object) and the third real identifier (i.e., interactive relationship verb). Then, the candidate identifiers corresponding to the second real identifier (i.e., object) and the candidate identifiers corresponding to the third real identifier (i.e., interactive relationship verb) can be constructed. For verb and object, their similar words (i.e., neighbors in the semantic space) can be found respectively, which are recorded as Neighborhood Set.
[0101] For sample image a, assume that its interaction relationship label includes "person kiss horse", where "person" is the first real identification word, "horse" is the second real identification word, and "kiss" is the third real identification word, that is, the verb is kiss and the object is horse. The neighborhood set of kiss is {"kisses", "smooch", "kssing", "smacker", "cuddle"}, and the neighborhood set of horse is {"horses", "racehorse", "elephant"}. Then, at this time, at least one word can be selected from the neighborhood set of kiss as the generated identification word corresponding to the enhanced identification word kiss (assuming that "smooch" is selected), and correspondingly, at least one word can be selected from the neighborhood set of horse as the generated new object corresponding to the enhanced identification word horse (assuming that "racehorse", "elephant" are selected). Then, the generated identification word corresponding to each enhanced identification word can be obtained, that is, the new verb and the new object at this time. Moreover, since the first real identification word is not used as the enhanced identification word, the original first real identification word can be used. Therefore, the generated identification word combinations corresponding to the sample image a are (person, smooch, racehorse) and (person, smooch, elephant). Then, embedding processing is performed on the generated identification word combinations person smooch racehorse and person smooch elephant corresponding to the sample image a, and at least one corresponding word vector generated label can be obtained. It can be understood that one generated identification word combination corresponds to one word vector generated label.
[0102] In one example, a generated identifier word combination can be generated for a sample image, and then a word vector generated label corresponding to the sample image can be determined based on the generated identifier word combination. Specifically, continuing with the previous example, the candidate identifier words for the enhanced identifier word "kiss" can be determined as: "kiss" + its similar words {"kisses", "smooch", "kssing", "smacker", "cuddle"}, when determining the generated identifier word for "kiss", kiss itself is selected with a probability of the first probability pv, and selected from its neighboring words with a probability of 1-pv, and finally "smooch" is selected as the generated identifier word corresponding to "kiss". The candidate identifier words for the enhanced identifier word "horse" can be determined as: "horse" + its similar words {"horses", "racehorse", "elephant"}, when determining the generated identifier word for "horse", kiss itself is selected with a probability of the second probability po, and selected from its neighboring words with a probability of 1-po, and finally "racehorse" is selected as the generated identifier word corresponding to "horse". Afterwards, the generated word combination "person kiss racehorse" is determined based on the generated identification word "smooch" corresponding to "kiss", the generated identification word "racehorse" corresponding to "horse" and the non-enhanced identification word "person". The size of po and pv can be set as needed.
[0103] In one example, multiple generated word combinations can be generated for a sample image, and then multiple word vector generation labels corresponding to the sample image can be determined based on the generated word combinations. For example, when determining the generated word for "kiss", all 6 words in its candidate words can be used as its corresponding generated word. When determining the generated word for "kiss", all 4 words in its candidate words can be used as its corresponding generated word. According to the generated word corresponding to "kiss", the generated word corresponding to "horse" and the non-enhanced word person, 24 generated word combinations are determined. For another example, if you want to determine 4 generated word combinations, you can select 4 of the 24 generated word combinations as the final generated word combinations after determining them. Another means of generating multiple generated word combinations for a sample image is to generate a generated word combination for a sample image at a time, perform multiple generation, and ensure that the generated word is selected for the 2-Nth time, and the candidate words that have been selected before are not selected, so that multiple generated word combinations can be obtained.
[0104] In an embodiment of the present invention, data enhancement may be performed multiple times on the same first sample image in the label space in the above manner, thereby obtaining at least one word vector generation label for the same first image label.
[0105] It is understandable that the generated identifier word combination can be embedded through the embedding generation module to obtain the word vector generation label corresponding to the generated identifier word combination. Specifically, when determining the word vector generation label corresponding to the first sample image based on the generated identifier word combination corresponding to the first sample image, all the generated identifier words of the first sample image (since it includes the generated identifier words corresponding to the enhanced identifier words and the non-enhanced identifier words) or part of the generated identifier words (such as the generated identifier words corresponding to the enhanced identifier words mentioned above) can be constructed through the embedding generation (vector generation) module to construct their corresponding NLP embeddings as the ground truth of the sample image after data enhancement in the label space, that is, the word vector generation label, so as to update the model parameters during training.
[0106] The embedding generation model may be any model for generating sentence vectors for a word or a short sentence consisting of multiple words, which is not limited in the embodiment of the present invention.
[0107] like Figure 4 The following are two typical structural examples of embedding generation networks. They mainly include word2vec (word to vector, word conversion into vector), word embedding (word mapping, generating word vector), and phrase embedding (phrase mapping, generating sentence vector). Assuming that the third real identifier is "sit at", which contains two words "sit" and "at", then each word can be processed separately in the word2vec stage, and in the word embedding stage, Figure 4 As shown in (a), the word2vec results of the two words in the third real identification word can be subjected to certain mathematical operations (such as averaging, adding, etc.) to obtain the overall word embedding result of the third real identification word "sitat". Figure 4 As shown in (b), in the word embedding stage, a time-series network such as RNN (Recurrent Neural Network) can also be used for processing to obtain the final word vector generation label; and so on.
[0108] In addition, as described above, in an embodiment of the present invention, data enhancement of the label space can be performed only for some of the real identifiers of the first sample image. Then, when obtaining the generated identifier combination, the generated identifier combination corresponding to the first sample image can be determined according to the generated identifier corresponding to the enhanced identifier and the non-enhanced identifier. The non-enhanced identifier is an identifier that is not used as an enhanced identifier among the first real identifier, the second real identifier, and the third real identifier in the first interactive relationship label.
[0109] Optionally, in an embodiment of the present invention, step A331 may further include: taking the probability of selecting the enhanced identifier as the generated identifier as p, and the probability of selecting any target similar word as the generated identifier as 1-p, selecting a word from the alternative identifiers corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier; wherein the target similar word includes all the similar words corresponding to the enhanced identifier, or the similar words among the similar words corresponding to the enhanced identifier that have not been selected as the generated identifier of the enhanced identifier.
[0110] The specific value of the probability p can be customized according to needs, and in different cases where the enhanced identification word is the first real recognition word, the second real recognition word, the third real recognition word, etc., the value of p can be the same or different, and this embodiment of the present invention is not limited to this.
[0111] For example, taking HOI detection as an example, suppose the original annotation of a sample image is "person kiss horse", where the verb is kiss and the object is horse.
[0112] At this time, the probability p v Choose a word from the neighborhood set of kiss, with 1-p v Continue to use kiss as the condition and select a word from the candidate identifiers of kiss as its corresponding generated identifier, that is, the new verb. At the same time, we can o Choose a word from the neighbor set of horse, with 1-p o Continue to use horse as the condition and select a word from the candidate identifiers of horse as its corresponding generated identifier, that is, the new object. Among them, the probability p v 、p o The value can be set according to requirements.
[0113] In addition, in order to improve the diversity of generated identifiers corresponding to the enhanced identifiers of the training images, improve the diversity of the prediction results of the model after training, reduce the long-tail problem, and improve the efficiency of model training, the generated identifiers corresponding to the same enhanced identifier for the same first sample image can be set to be different when the data is enhanced multiple times, that is, for any enhanced identifier, the probability of selecting the enhanced identifier as the generated identifier is p, and the probability of selecting any target approximate word corresponding to the enhanced identifier as the generated identifier is 1-p, and a word is selected from the candidate identifiers corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier. The target approximate words include all the approximate words corresponding to the enhanced identifier, or the approximate words corresponding to the enhanced identifier that have not been selected as the generated identifier of the enhanced identifier for the current first sample image.
[0114] In addition, it is also possible to ensure that the generated identification word combinations after multiple data enhancements of the same first sample image are different, so that each data enhancement obtains a different word vector generation label. In this case, for the same first sample image, after each data enhancement, the generated identification word combination obtained by this data enhancement can be compared with the previous generated identification word combination. If they are the same, this data enhancement can be ignored and the data enhancement process can be re-executed.
[0115] Moreover, in order to improve the accuracy of the probability p in each scenario, p can be set separately (for example, the above p v 、p o ) takes values between 0.1 and 0.9, and trains the model, and uses the p value with the best training result as the final probability value.
[0116] Optionally, in the embodiment of the present invention, step 330 may further include:
[0117] Step B331, combining candidate identification words of different enhanced identification words according to the candidate identification words of each enhanced identification word corresponding to the first sample image, to obtain a candidate identification word combination corresponding to the first sample image;
[0118] Step B332, selecting at least one candidate identification word combination as a target candidate identification word combination of the first sample image;
[0119] Step B333, for each target candidate identification word combination, determine the generated identification word combination corresponding to the target candidate identification word combination according to the non-enhanced identification word corresponding to the first sample image and the alternative identification words included in the target candidate identification word combination, and obtain at least one generated identification word combination corresponding to the first sample image; the non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship label.
[0120] In the embodiment of the present invention, the candidate identification words of each different enhanced identification word corresponding to the first sample image may be combined in advance to obtain all available candidate identification word combinations. Then, at least one candidate identification word combination may be selected as the target candidate identification word combination of the first sample image. For example, according to the requirements, one candidate identification word combination may be selected as the target candidate identification word combination, or all candidate identification word combinations may be selected as the target candidate identification word combination, or several candidate identification word combinations may be selected as the target candidate identification word combination, and so on.
[0121] Furthermore, for each target candidate identification word combination, the generated identification word combination corresponding to the target candidate identification word combination can be determined according to the non-enhanced identification word corresponding to the corresponding first sample image and the alternative identification words included in the target candidate identification word combination, so as to obtain at least one generated identification word combination corresponding to the first sample image; the non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship label.
[0122] For example, assuming that the first sample image a corresponds to the enhanced identification words kiss and horse, and the unenhanced identification word is person, where the alternative identification words for kiss include smooch and kisses, and the alternative identification words for horse include racehorse and elephant, then at this time, by combining the alternative identification words of different enhanced identification words, the alternative identification word combination corresponding to the first sample image a includes (smooch, racehorse), (smooch, elephant), (kisses, racehorse), and (kisses, elephant).
[0123] Assuming that (kisses, racehorse) is selected as the target candidate identification word combination of the first sample image a, it can be determined that the generated identification word combination corresponding to the target candidate identification word combination is (person, kisses, racehorse).
[0124] Optionally, in the embodiment of the present invention, the above step 220 may further include:
[0125] Step 221, inputting the sample image into the interaction relationship detection model to be trained, obtaining the sample interaction relationship prediction result output by the interaction relationship detection network to be trained, and the sample word vector prediction result output by the word vector generation network to be trained;
[0126] Step 222, calculating a first loss according to the sample interaction relationship prediction result and the interaction relationship label of the sample image;
[0127] Step 223, calculating a second loss based on the sample word vector prediction result and the word vector of the sample image to generate a label;
[0128] Step 224: Update the parameters of the interaction relationship detection model to be trained according to the first loss and the second loss.
[0129] During the model training process, the interaction relationship detection network to be trained and the word vector generation network to be trained in the interaction relationship detection model to be trained can simultaneously output the sample interaction relationship prediction results and the sample word vector prediction results of the sample image, respectively. Then, the first loss of the interaction relationship detection network to be trained can be calculated according to the sample interaction relationship prediction results and the interaction relationship labels of the sample image, and the second loss of the word vector generation network to be trained can be calculated according to the sample word vector prediction results and the word vector generation labels of the sample image, and then the parameters of the interaction relationship detection model to be trained can be updated according to the first loss and the second loss. Thus, in the training process, by simultaneously training the interaction relationship detection network to be trained and the word vector generation network to be trained in the interaction relationship detection model, and the interaction relationship detection network to be trained and the word vector generation network to be trained share the same knowledge space, so as to generate labels based on the word vectors after data enhancement of the sample images, and adjust the knowledge space while training the word vector generation network, that is, the parameters in the feature extraction network, thereby affecting the parameters in the interaction relationship detection network to be trained, improving the diversity of the prediction results of the interaction relationship detection network to be trained, and effectively reducing the problem of long-tail data.
[0130] Among them, the specific calculation form of the first loss and the second loss can be customized according to needs, and the relationship between the overall loss of the interaction relationship detection model to be trained and the first loss and the second loss can also be customized according to needs, which is not limited in this embodiment of the present invention.
[0131] In addition, when training the model, in order to ensure the accuracy of the prediction results of the interaction relationship detection network to be trained in the interaction relationship detection model to be trained, for each sample image, even if its word vector generation label changes, it will not affect its initial interaction relationship label, that is, the interaction relationship label of the sample image after data enhancement is still its initial interaction relationship label, and data enhancement only changes its word vector generation label.
[0132] Then when training the model, the interactive relationship detection model to be trained can be trained according to the word vector generation label of each sample image and its initial interactive relationship label. Thus, the interactive relationship detection result ensures that the accuracy of the interactive relationship detection network to be trained will not deteriorate compared to the single training. At the same time, combined with the word vector generation network to be trained for joint training, the diversity of the prediction results of the interactive relationship detection network to be trained can be improved, and the long tail problem can be effectively reduced, thereby improving the applicability and accuracy of the interactive relationship detection network to be trained after training. Moreover, in the subsequent use of the model, the word vector generation network in the interactive relationship detection model after training can be ignored or deleted, or the word vector generation network can be retained, so that the interactive relationship detection model outputs the interactive relationship detection result and the word vector detection result at the same time, and this embodiment of the present invention is not limited to this.
[0133] Optionally, in an embodiment of the present invention, the model can be trained using only sample images that have undergone data augmentation in the label space. However, if the model is trained using only sample images that have undergone data augmentation in the label space, the accuracy of the training results may be affected to a certain extent because the word vector generated labels of the sample images after data augmentation have a certain deviation from their initial word vector generated labels.
[0134] Therefore, in an embodiment of the present invention, in order to avoid the above problems, when training the model, the sample images can be enhanced in the label space with a certain probability (that is, only part of the sample images are enhanced) to train the interaction relationship detection model.
[0135] Optionally, in the embodiment of the present invention, during the model training process, the loss of the interaction relationship detection model to be trained is L total =L1+α*L2, where L1 is the loss of the interaction relationship detection network to be trained, that is, the first loss, and L2 is the loss of the word vector generation network to be trained, that is, the second loss. The two are balanced by the hyperparameter α, and the preferred empirical value of α can be 0.1;
[0136] In addition, L2 can be expressed as L2 = L distilling +β*L triple , where L distillingTypical distillation losses, such as L1 loss and L2 loss, can be used to make the embedding predicted by the model and its corresponding ground truth distribution the same. triplet is the loss function used for local fine-tuning to push similar but different embeddings in the local range away to prevent confusion. β is a parameter used to balance the two. The optimal empirical value of β can be 10. triplet According to the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding positive sample image, the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding negative sample image is determined to push away the similar but different sample word vector prediction results in the local range, the positive sample image corresponding to the sample image is other sample images that contain at least one same target identification word combination as the sample image, the negative sample image corresponding to the sample image is other sample images except the sample image and its corresponding positive sample image, the target identification word combination includes a third real identification word that represents the category of the interaction relationship between the first type of target and the second type of target, and at least one of the first real identification word that represents the specific category of the first type of target and the second real identification word that represents the specific category of the second type of target corresponding to the third real identification word.
[0137] For example, L triplet It can be expressed as follows:
[0138] L triplet =max((avg(∑d(A,P s ))-avg(∑d(A,N t ))+m),0),
[0139] In this formula, A represents the reference anchor point (that is, the sample word vector prediction result of the current input sample image), P represents the sample word vector prediction result of the positive sample image, N represents the sample word vector prediction result of the negative sample image, d is a distance measurement method, which can have many forms, such as L1 distance, L2 distance, cosine distance, etc., avg represents the average, avg(∑d(A,P s )) represents the average of the sum of the differences between A and the sample word vector prediction results of each positive sample image. m is a hyperparameter, representing margin, and the value of m can preferably be 1.0. In addition, the form of L1 loss can be y(a, b) = |ab|, where a and b are the prediction result and the true value, respectively.
[0140] For example, assuming that the reference anchor point is the embedding prediction result of the current input sample image, that is, the sample word vector prediction result, through the interaction relationship label of each sample image, the real identification word corresponding to each interaction relationship category contained in each sample image can be obtained, then the interaction relationship labels of other sample images and the current input sample image can be compared, and the sample image containing at least one real identification word combination with the current input sample image can be obtained, which is the positive sample image corresponding to the current input sample image, and the others can be used as the negative sample images corresponding to the current input sample image. Then, the L of the current input sample image can be calculated by referring to the above formula. triplet .
[0141] L1 can be expressed as In this formula, Represents the classification loss of different targets and interactions (for example, the classification loss of people (h), objects (o), and interaction (r) during HOI detection). Represents the detection box position loss of the first target and the second target. β1, β2 and μ are all hyperparameters, and their specific values can be customized. Moreover, the classification loss You can use soft cross entropy loss, position loss, etc. A weighted sum of GloU loss and L1 loss may be used, which is not limited in this embodiment of the present invention.
[0142] An embodiment of the present invention provides a loss function for simultaneously optimizing an interaction relationship detection network to be tested and a word vector generation network to be tested, such as a HOI task and an NLP embedding distillation task, which can improve the accuracy of the interaction relationship detection result.
[0143] like Figure 5 The figure shows a schematic diagram of data enhancement in the label space. Model represents the above-mentioned network for generating word vectors to be trained. Taking HOI detection as an example, assume that the interaction relationship label (Original GT) of a sample image is "person kiss horse", where verb is kiss and object is horse. At this time, the second identifier and the third identifier are used as enhanced identifiers.
[0144] The Neighborhood Set of the second identifier horse includes horses, racehorse, stallion, jockey, stables, etc. The Neighborhood Set of the third identifier kiss includes kisses, smooch, kissing, smacker, cuddle, etc. For each enhanced identifier, sampling can be performed from its candidate identifiers to obtain generated identifiers, and the generated identifier combinations are combined, such as "person kisses horse", "person kissingstallion", "person smooch racehorse", etc. For each generated identifier, its word vector generation label can be obtained through EmbeddingGeneration, and then compared with the word vector prediction result phrase embedding output by the word vector generation network to be trained in the interaction relationship detection model to be trained for the corresponding sample, and the loss of the word vector generation network to be tested is obtained. At this time, the data enhancement process occurs in the label space and will not affect the model training progress. Therefore, it can be applied to any type of model such as a one-stage model, a two-stage model, an end-to-end model, that is, it is not limited by the model structure.
[0145] In an embodiment of the present invention, a method for performing data enhancement in a label space is proposed, which includes the following steps:
[0146] Acquire a first interaction relationship label of a first sample image among the multiple sample images;
[0147] Determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0148] Based on the alternative identification words of each enhanced identification word corresponding to the first sample image, at least one word vector is generated for the first sample image to generate a label; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate words corresponding to the enhanced identification word, and a first sample image with data enhancement in the label space is obtained.
[0149] The specific contents of the above steps are as described above and will not be repeated here.
[0150] Data enhancement of samples in the label space can be performed for models of various structural types, effectively reducing the long-tail problem.
[0151] Reference Figure 6 , showing a flow chart of an interactive relationship detection model training method in an embodiment of the present invention.
[0152] The method may include the following steps:
[0153] Step 410, obtaining a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0154] Step 420, using the training set to train the interaction relationship detection model to be trained to obtain the interaction relationship detection model;
[0155] The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained;
[0156] The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors;
[0157] The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result;
[0158] The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
[0159] The specific content of the model training process is similar to that in the above embodiment. Please refer to the above content for details and will not be repeated here.
[0160] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0161] Reference Figure 7 , shows a schematic structural diagram of a relationship detection device in an embodiment of the present invention.
[0162] An image acquisition module 510 is used to acquire a target image, wherein the target image includes a first type of target and a second type of target;
[0163] A feature extraction module 520 is used to extract features from the target image through a feature extraction network in the interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target;
[0164] An interaction relationship detection module 530 is used to perform interaction relationship detection on the multiple feature vectors through an interaction relationship detection network in an interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection box where the first type of target is located, a detection box where the second type of target is located, a first identifier representing a specific category of the first type of target, a second identifier representing a specific category of the second type of target, and a third identifier representing a category of the interaction relationship between the first type of target and the second type of target;
[0165] The interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are subjected to data enhancement in the label space.
[0166] Optionally, in the embodiment of the present invention, the device further includes:
[0167] A training set acquisition module, used to acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0168] A model training module, used for training the interaction relationship detection model to be trained using the training set to obtain the interaction relationship detection model;
[0169] The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained;
[0170] The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors;
[0171] The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result;
[0172] The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
[0173] Optionally, in an embodiment of the present invention, each sample image carries an interaction relationship label and a word vector generation label;
[0174] The interactive relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing a category of the interactive relationship between the first type of target and the second type of target;
[0175] The device also includes:
[0176] A sample interaction relationship label acquisition module, used to acquire a first interaction relationship label of a first sample image among the multiple sample images;
[0177] An enhanced identification word confirmation module, used to determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0178] A label enhancement processing module is used to generate at least one word vector for the first sample image based on the alternative identification words of each enhanced identification word corresponding to the first sample image; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate words corresponding to the enhanced identification word.
[0179] Optionally, in the embodiment of the present invention, the label enhancement processing module includes:
[0180] A generated identification word selection submodule is used to select, for each enhanced identification word, at least one word from the candidate identification words corresponding to the enhanced identification word as a generated identification word corresponding to the enhanced identification word;
[0181] An identification word combination generating submodule, used for determining a generated identification word combination corresponding to the first sample image according to generated identification words corresponding to each enhanced identification word;
[0182] The first word vector label generation submodule is used to determine the word vector generation label corresponding to the first sample image according to the generated identification word combination corresponding to the first sample image.
[0183] Optionally, in the embodiment of the present invention, the identification word combination generating submodule may be specifically used for:
[0184] Determine a generated identification word combination corresponding to the first sample image according to the generated identification word corresponding to the enhanced identification word and the non-enhanced identification word;
[0185] The non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship tag.
[0186] Optionally, in the embodiment of the present invention, the generating identification word selection submodule is specifically used to:
[0187] The probability of selecting the enhanced identifier as the generated identifier is p, and the probability of selecting any target similar word as the generated identifier is 1-p, and a word is selected from the candidate identifiers corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier;
[0188] The target approximate words include all the approximate words corresponding to the enhanced identification word, or the approximate words among the approximate words corresponding to the enhanced identification word that are not selected as the generated identification words of the enhanced identification word.
[0189] Optionally, in the embodiment of the present invention, the label enhancement processing module may include:
[0190] a candidate identification word combination acquisition submodule, configured to combine candidate identification words of different enhanced identification words according to the candidate identification words of each enhanced identification word corresponding to the first sample image, to obtain a candidate identification word combination corresponding to the first sample image;
[0191] a target candidate identification word combination selection submodule, used to select at least one candidate identification word combination as a target candidate identification word combination for the first sample image;
[0192] For each target candidate identification word combination, determining a generated identification word combination corresponding to the target candidate identification word combination according to the non-enhanced identification word corresponding to the first sample image and the candidate identification words included in the target candidate identification word combination, and obtaining at least one generated identification word combination corresponding to the first sample image;
[0193] The second word vector label generation submodule is used to determine at least one word vector generation label corresponding to the first sample image according to each generated identification word combination corresponding to the first sample image.
[0194] The non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship tag.
[0195] Optionally, in an embodiment of the present invention, the model training module includes:
[0196] Inputting the sample image into the interaction relationship detection model to be trained, obtaining the sample interaction relationship prediction result output by the interaction relationship detection network to be trained, and the sample word vector prediction result output by the word vector generation network to be trained;
[0197] Calculating a first loss according to the sample interaction relationship prediction result and the interaction relationship label of the sample image;
[0198] Calculate a second loss based on the sample word vector prediction result and the word vector of the sample image to generate a label;
[0199] Update the parameters of the interaction relationship detection model to be trained according to the first loss and the second loss.
[0200] Optionally, in an embodiment of the present invention, the loss of the interaction relationship detection model to be trained is L total =L1+α*L2, where L1 is the first loss, L2 is the second loss, α is a parameter, and the value of α is 0.1;
[0201] The second loss L2 = L distilling +β*L triplet , L distilling is a distillation loss function, L triplet According to the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding positive sample image, the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding negative sample image is determined to push away the similar but different sample word vector prediction results in the local range. The positive sample image corresponding to the sample image is other sample images that contain at least one target identification word combination that is the same as the sample image. The negative sample image corresponding to the sample image is other sample images other than the sample image and its corresponding positive sample image. The target identification word combination includes a third real identification word that represents the category of the interaction relationship between the first type of target and the second type of target, and at least one of the first real identification word that represents the specific category of the first type of target and the second real identification word that represents the specific category of the second type of target corresponding to the third real identification word. β is a parameter, and the value of β is 10.
[0202] Reference Figure 8 , showing a structural schematic diagram of an interactive relationship detection model training device in an embodiment of the present invention.
[0203] A training set acquisition module 610 is used to acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space;
[0204] A model training module 620 is used to train the interaction relationship detection model to be trained using the training set to obtain the interaction relationship detection model;
[0205] The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained;
[0206] The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors;
[0207] The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result;
[0208] The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
[0209] In an embodiment of the present invention, a device for performing data enhancement in a label space is also provided, the device comprising:
[0210] A label acquisition module, used to acquire a first interaction relationship label of a first sample image among the multiple sample images;
[0211] An enhanced identification word determination module, used to determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label;
[0212] A label generation module is used to generate at least one word vector for the first sample image based on the alternative identifiers of each enhanced identifier corresponding to the first sample image to generate a label, so as to obtain a first sample image with data enhanced label space; the alternative identifiers of the enhanced identifier include the enhanced identifier itself and / or the approximate words corresponding to the enhanced identifier.
[0213] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0214] In an embodiment of the present invention, an electronic device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the aforementioned interaction relationship detection methods and / or steps of any one of the interaction relationship detection model training methods when executing the computer program.
[0215] In an embodiment of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, characterized in that when the program is executed by a processor, it implements the steps of any of the aforementioned interaction relationship detection methods and / or any of the interaction relationship detection model training methods.
[0216] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0217] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0218] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0219] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0220] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0221] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the device for relationship detection according to an embodiment of the present invention. The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0222] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A method for detecting an interactive relationship, characterized in that: include: Acquire a target image, wherein the target image includes a first type of target and a second type of target; Extracting features from the target image through a feature extraction network in an interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target; Performing interaction relationship detection on the multiple feature vectors through an interaction relationship detection network in an interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection box where the first type of target is located, a detection box where the second type of target is located, a first identifier representing a specific category of the first type of target, a second identifier representing a specific category of the second type of target, and a third identifier representing a category of the interaction relationship between the first type of target and the second type of target; The interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are subjected to data enhancement in the label space; Among them, each sample image has an interaction relationship label and a word vector generation label; The interactive relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing a category of the interactive relationship between the first type of target and the second type of target; The method further comprises: Obtaining a first interaction relationship label of a first sample image among multiple sample images; Determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label; Based on the alternative identification words of each enhanced identification word corresponding to the first sample image, at least one word vector generation label is generated for the first sample image; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate word corresponding to the enhanced identification word.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least some of the sample images of the plurality of sample images are subjected to data enhancement in the label space; Using the training set to train the interaction relationship detection model to be trained to obtain the interaction relationship detection model; The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained; The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors; The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result; The word vector generation network to be trained is used to obtain a sample word vector prediction result based on the sample feature vector.
3. The method according to claim 2, characterized in that The step of generating at least one word vector generating label for the first sample image based on the candidate identification words of each enhanced identification word corresponding to the first sample image comprises: For each enhanced identification word, selecting at least one word from the candidate identification words corresponding to the enhanced identification word as the generated identification word corresponding to the enhanced identification word; Determining a generated identification word combination corresponding to the first sample image according to the generated identification words corresponding to each enhanced identification word; Determine a word vector generation label corresponding to the first sample image according to the generated identification word combination corresponding to the first sample image.
4. The method according to claim 3, characterized in that The step of determining the generated identification word combination corresponding to the first sample image according to the generated identification words corresponding to each enhanced identification word includes: Determine a generated identification word combination corresponding to the first sample image according to the generated identification words corresponding to each enhanced identification word and the non-enhanced identification words; The non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship tag.
5. The method according to claim 3, characterized in that: The step of selecting at least one word from the candidate identification words corresponding to the enhanced identification word as the generated identification word corresponding to the enhanced identification word comprises: The probability of selecting the enhanced identifier as the generated identifier is p, and the probability of selecting any target similar word as the generated identifier is 1-p, and a word is selected from the candidate identifiers corresponding to the enhanced identifier as the generated identifier corresponding to the enhanced identifier; The target approximate words include all the approximate words corresponding to the enhanced identification word, or the approximate words among the approximate words corresponding to the enhanced identification word that are not selected as the generated identification words of the enhanced identification word.
6. The method according to claim 2, characterized in that The step of generating at least one word vector generating label for the first sample image based on the candidate identification words of each enhanced identification word corresponding to the first sample image comprises: According to the candidate identification words of each enhanced identification word corresponding to the first sample image, the candidate identification words of different enhanced identification words are combined to obtain a candidate identification word combination corresponding to the first sample image; selecting at least one candidate identification word combination as a target candidate identification word combination for the first sample image; For each target candidate identification word combination, determining a generated identification word combination corresponding to the target candidate identification word combination according to the non-enhanced identification word corresponding to the first sample image and the candidate identification words included in the target candidate identification word combination, and obtaining at least one generated identification word combination corresponding to the first sample image; The non-enhanced identification word is an identification word that is not used as an enhanced identification word among the first real identification word, the second real identification word, and the third real identification word in the first interactive relationship tag.
7. The method according to any one of claims 3 to 6, characterized in that: Using the training set to train the interaction relationship detection model to be trained includes: Inputting the sample image into the interaction relationship detection model to be trained, obtaining the sample interaction relationship prediction result output by the interaction relationship detection network to be trained, and the sample word vector prediction result output by the word vector generation network to be trained; Calculating a first loss according to the sample interaction relationship prediction result and the interaction relationship label of the sample image; Calculate a second loss based on the sample word vector prediction result and the word vector of the sample image to generate a label; Update the parameters of the interaction relationship detection model to be trained according to the first loss and the second loss.
8. The method according to claim 7, characterized in that The loss of the interaction relationship detection model to be trained is L total =L1+α*L2, where L1 is the first loss, L2 is the second loss, α is a parameter, and the value of α is 0.1; The second loss L2 = L distilling +β*L triplet , L distilling is the distillation loss function, L triplet According to the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding positive sample image, the distance between the sample word vector prediction result of the currently input sample image and the sample word vector prediction result of the corresponding negative sample image is determined to push away the similar but different sample word vector prediction results in the local range, the positive sample image corresponding to the sample image is other sample images that contain at least one same target identification word combination as the sample image, the negative sample image corresponding to the sample image is other sample images except the sample image and its corresponding positive sample image, the target identification word combination includes a third real identification word representing the category of the interaction relationship between the first type of target and the second type of target, and at least one of the first real identification word representing the specific category of the first type of target and the second real identification word representing the specific category of the second type of target corresponding to the third real identification word; β is a parameter, and the value of β is 10.
9. A method for training an interactive relationship detection model, characterized in that: The method comprises: Acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least some of the sample images of the plurality of sample images are subjected to data enhancement in the label space; Using the training set to train the interaction relationship detection model to be trained to obtain the interaction relationship detection model; The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained; The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors; The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result; The to-be-trained word vector generation network is used to obtain a sample word vector prediction result based on the sample feature vector; Among them, each sample image has an interaction relationship label and a word vector generation label; The interactive relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing a category of the interactive relationship between the first type of target and the second type of target; The method further comprises: Acquire a first interaction relationship label of a first sample image among the multiple sample images; Determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label; Based on the alternative identification words of each enhanced identification word corresponding to the first sample image, at least one word vector generation label is generated for the first sample image; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate word corresponding to the enhanced identification word.
10. An interactive relationship detection device, characterized in that: include: An image acquisition module, used for acquiring a target image, wherein the target image includes a first type of target and a second type of target; A feature extraction module, used to extract features from the target image through a feature extraction network in the interaction relationship detection model to obtain a plurality of feature vectors, each feature vector being used to characterize an interaction relationship between a first type of target and a second type of target; An interaction relationship detection module, configured to perform interaction relationship detection on the plurality of feature vectors through an interaction relationship detection network in an interaction relationship detection model to obtain an interaction relationship detection result, wherein the interaction relationship detection result includes at least one of a detection frame where the first type of target is located, a detection frame where the second type of target is located, a first identifier representing a specific category of the first type of target, a second identifier representing a specific category of the second type of target, and a third identifier representing a category of an interaction relationship between the first type of target and the second type of target; The interaction relationship detection model is obtained by training the interaction relationship detection model to be trained, and at least part of the sample images used to train the interaction relationship detection model to be trained are subjected to data enhancement in the label space; Among them, each sample image has an interaction relationship label and a word vector generation label; The interactive relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing a category of the interactive relationship between the first type of target and the second type of target; The device also includes: A sample interaction relationship label acquisition module, used to acquire a first interaction relationship label of a first sample image among multiple sample images; An enhanced identification word confirmation module, used to determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label; A label enhancement processing module is used to generate at least one word vector for the first sample image based on the alternative identification words of each enhanced identification word corresponding to the first sample image; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate words corresponding to the enhanced identification word.
11. An interactive relationship detection model training device, characterized in that: The device comprises: A training set acquisition module, used to acquire a training set, wherein the training set includes a plurality of sample images with labels, and at least part of the sample images of the plurality of sample images are subjected to data enhancement in the label space; A model training module, used for training the interaction relationship detection model to be trained using the training set to obtain the interaction relationship detection model; The interactive relationship detection model to be trained includes a feature extraction network to be trained, an interactive relationship detection network to be trained, and a word vector generation network to be trained; The feature extraction network to be trained is used to extract features from the sample image to obtain a plurality of sample feature vectors; The interaction relationship detection network to be trained is used to perform interaction relationship detection on the multiple sample feature vectors to obtain a sample interaction relationship prediction result; The to-be-trained word vector generation network is used to obtain a sample word vector prediction result based on the sample feature vector; Among them, each sample image has an interaction relationship label and a word vector generation label; The interactive relationship label includes at least one of a real detection frame where the first type of target is located, a real detection frame where the second type of target is located, a first real identification word representing a specific category of the first type of target, a second real identification word representing a specific category of the second type of target, and a third real identification word representing a category of the interactive relationship between the first type of target and the second type of target; The device also includes: A sample interaction relationship label acquisition module, used to acquire a first interaction relationship label of a first sample image among the multiple sample images; An enhanced identification word confirmation module, used to determine an enhanced identification word in the first interactive relationship label, wherein the enhanced identification word includes at least one of a first real identification word, a second real identification word, and a third real identification word in the first interactive relationship label; A label enhancement processing module is used to generate at least one word vector for the first sample image based on the alternative identification words of each enhanced identification word corresponding to the first sample image; the alternative identification words of the enhanced identification word include the enhanced identification word itself and / or the approximate words corresponding to the enhanced identification word.
12. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, at least one of the interactive relationship detection method described in any one of claims 1 to 7 and the interactive relationship detection model training method described in claim 9 is implemented.
13. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute at least one of the interaction relationship detection method described in any one of claims 1 to 8 and the interaction relationship detection model training method described in claim 9.
Citation Information
Patent Citations
Model training method and device, interaction relationship recognition method and device and electronic equipment
CN111950591A
Slot filling with contextual information
CN112925516A
Augmenting queries with synonyms selected using language statistics
US20070288449A1
