Image understanding method and device, equipment, storage medium and program product

By using the segmentation model for auxiliary supervision of subject-object mask prediction loss in the training of the general graphic and text model, the illusion problem of the general graphic and text model in image understanding is solved, and the dialogue accuracy and image understanding ability of the model are improved.

CN118690855AInactive Publication Date: 2024-09-24INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411162727.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-09-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

General graphic and text models are prone to hallucinations when understanding images, and the output content is inconsistent with the facts. This is mainly due to its insufficient image understanding ability and its inability to accurately conduct multi-modal conversations.

Method used

By introducing a segmentation model in the training process of the general image and text model to provide auxiliary supervision of the subject-object mask prediction loss, the model is guided to focus on image content that is highly relevant to question and answer, thereby improving the accuracy of the model.

Benefits of technology

It significantly improves the answer accuracy of the general image-text model, alleviates hallucination problems, and enhances the model's conversational capabilities, allowing it to more accurately extract key information in images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690855A
    Figure CN118690855A
Patent Text Reader

Abstract

The invention provides an image understanding method and device, equipment, a storage medium and a program product, and belongs to the technical field of artificial intelligence. The method comprises the following steps: inputting a target image and a corresponding question into a target general image-text model to obtain an answer output by the target general image-text model; wherein the target general image-text model is trained in the following mode: inputting a training sample into the initial general image-text model to obtain a subject feature vector, an object feature vector and an autoregression loss function output by the initial general image-text model; inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; and determining a target loss function of the initial general image-text model based on the subject feature mask and the real mask of the subject, the object feature mask and the real mask of the object, and an autoregression loss function. The image understanding method provided by the invention can alleviate the illusion problem of a general image-text model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an image understanding method, device, equipment, storage medium and program product. Background Art

[0002] Researchers are working hard to enable large language models (LLMs) to understand data from more modalities such as images and videos, so as to build a general graph-text model with the ability to understand multimodal information. Generally speaking, researchers serialize the extracted visual features and send them to the general graph-text model, so that the general graph-text model can understand the input image and perform multimodal dialogue based on it. However, general graph-text models often have hallucination problems, that is, the output content is obviously inconsistent or falsified with the facts or information provided.

[0003] From the perspective of general image-text models, such problems are often attributed to too little text information being provided. However, from the perspective of the input provided, the image itself has extremely rich information that can be used to perform very detailed visual tasks such as detection and segmentation. Therefore, the general image-text model cannot accurately conduct multimodal dialogues only because the general image-text model does not have a strong enough image understanding capability. Summary of the invention

[0004] The present invention provides an image understanding method, device, equipment, storage medium and program product, which are used to solve the defect that the general image-text model in the prior art is prone to hallucinations and realize the accurate dialogue ability of the general image-text model.

[0005] In a first aspect, the present invention provides an image understanding method, comprising the following steps: Inputting a target image and a corresponding question into a target universal graphic model, obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0006] In one embodiment, determining the target loss function of the initial general graphic model based on the subject feature mask and the real mask of the subject, the object feature mask and the real mask of the object, and the autoregressive loss function includes: Determine a first loss function between the subject feature mask and a true mask of the subject, and a second loss function between the object feature mask and a true mask of the object; The target loss function is determined based on the first loss function, the second loss function, and the autoregressive loss function.

[0007] In one embodiment, the method further comprises: Inputting the sample image and the seed annotation into a large language model to obtain a question and an answer corresponding to the sample image output by the large language model; The seed annotation includes the subject and object of the sample image, and the relationship between the subject and object of the sample image; The seed annotation is input into the large language model according to a prompt template; the prompt template includes at least one of various question sentence patterns.

[0008] In one embodiment, the seed annotation further includes at least one of the following: the title of the sample image; Description information of a predetermined area of ​​the sample image; a list of objects in the sample image; The bounding box of the object in the sample image.

[0009] In one embodiment, the method further comprises: According to the value of the target loss function, the parameters of the initial general graphic model and the parameters of the segmentation model are adjusted.

[0010] In one embodiment, determining the target loss function based on the first loss function, the second loss function, and the autoregressive loss function includes any of the following: Determine the target loss function based on the sum of the first loss function, the second loss function and the autoregressive loss function; Determine the target loss function based on the maximum of the first loss function, the second loss function and the autoregressive loss function; The target loss function is determined based on any one of the first loss function, the second loss function, and the autoregressive loss function.

[0011] In a second aspect, the present invention provides an image understanding device, comprising: A processing module, used for inputting a target image and a corresponding question into a target universal graphic model, and obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0012] In a third aspect, the present invention provides an electronic device 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 above-mentioned image understanding methods when executing the computer program.

[0013] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements any of the above-mentioned image understanding methods when executed by a processor.

[0014] In a fifth aspect, the present invention provides a computer program product, comprising a computer program, which implements any one of the above-mentioned image understanding methods when executed by a processor.

[0015] The image understanding method, apparatus, device, storage medium and program product provided by the present invention use a segmentation model to perform auxiliary supervision of subject-object mask prediction loss during the training process of the general image-text model, thereby guiding the general image-text model to focus on image content that is highly relevant to questions and answers, so that the general image-text model can explicitly extract the features of key information in the image, and ensure that the model pays attention to image details closely related to the question before responding to and answering the question, thereby improving the accuracy of the model's response, alleviating the hallucination problem of the general image-text model, and enhancing the general image-text model's accurate conversation ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flowchart of the image understanding method provided by the present invention.

[0018] Figure 2 It is a schematic diagram of the structure of the image understanding device provided by the present invention.

[0019] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] Figure 1 FIG. 4 is a flow chart of the image understanding method provided by the present invention. Figure 1 As shown, the method includes: Step 110: input the target image and the corresponding question into the target general graphic model to obtain the answer output by the target general graphic model, the answer including the subject and object of the target image and the relationship between the subject and the object; Among them, the target general image and text model is trained in the following way: Input the training sample into the initial general graph-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general graph-text model; Inputting the subject feature vector and the object feature vector into the segmentation model to obtain the subject feature mask and the object feature mask output by the segmentation model; Determine the target loss function of the initial general image-text model based on the subject feature mask and the subject's true mask, the object feature mask and the object's true mask, and the autoregressive loss function; When the target loss function converges, the initial general graph-text model is used as the target general graph-text model; The training samples include: sample images, subjects and objects of sample images, the relationship between the subjects and objects of sample images, true masks of the subjects of sample images, true masks of the objects of sample images, and questions and answers corresponding to the sample images.

[0022] It should be noted that the execution subject of the image understanding method provided by the present invention can be a computer device, such as a mobile phone, a tablet computer, a laptop computer, a PDA, etc.

[0023] In step 110, the target image and the corresponding question may be input into the target general graphic model, and the target general graphic model outputs an answer including the subject, object and the relationship between the subject and object of the target image.

[0024] The target image may be an image including a subject and an object. The subject and the object may be any object. The target universal graphic model may be a large language model with the ability to understand multimodal information (such as text, image, sound, video, etc.).

[0025] Assume that the target image includes a cat lying on a laptop. If the question corresponding to the target image is "Is the cat lying on the table?", the target general graphic model can output the answer "No, the cat is lying on a laptop" after analyzing and recognizing the target image. Among them, the cat is the subject, the laptop is the object, and the cat lying on the laptop is the relationship between the subject and the object.

[0026] It should be noted that the training samples of the present invention include not only sample images ( ), the subject and object of the sample image, the relationship between the subject and object of the sample image, and the corresponding problems of the sample image ( ) and the answer, it also includes the true mask of the subject of the sample image and the true mask of the object of the sample image. The true mask of the subject and the true mask of the object can be used to explicitly guide the target general image-text model to focus on specific details in the image.

[0027] Correspondingly, the present invention adopts an additional segmentation model to assist in supervising the target general image-text model during the training phase of the target general image-text model, thereby guiding the target general image-text model to focus on image content that is highly relevant to question and answer.

[0028] The segmentation model specifically refers to a model with image segmentation function, such as the SAM (Segment Anything Model) model.

[0029] During the training process, the initial general graph-text model analyzes and processes the training samples to output the main feature vector ( ), object feature vector ( ) and the autoregressive loss function. Among them, the subject feature vector ( ) and the object feature vector ( ) can refer to two instances respectively.

[0030] Specifically, the subject feature vector ( ) and the object feature vector ( ) depends on the input sample image ( ) and the corresponding problem of the sample image ( ): Sample image ( ) and the corresponding question ( ) after the linear layer of the initial general graph model ( ) after processing, we can get the main feature vector ( ) and the object feature vector ( ). The process can be expressed by the formula: Formula (1)

[0031] in, Represents the processing of a general graphic model.

[0032] It should be noted that two markers [SUB] and [OBJ] can be added to the input sequence of the initial general graph-text model, and the initial general graph-text model will output the corresponding feature subject feature vector ( ) and the object feature vector ( ). These tokens are processed before the initial general graph model generates answers to encourage the initial general graph model to predict subject feature masks and object feature masks based only on the input question during training.

[0033] The segmentation model then uses the subject feature vector ( ) and the object feature vector ( ), to predict the subject feature mask respectively ( ) and the object feature mask ( ), the process can be expressed by the formula: Formula (2)

[0034] Formula (3)

[0035] in, represents the processing of the segmentation model, Represents the processing of the linear layer in the general graph model.

[0036] Furthermore, the subject feature mask and the object feature mask predicted by the segmentation model can be supervised respectively based on the true mask of the subject and the true mask of the object predetermined in the training sample.

[0037] Specifically, the present invention can determine the target loss function of the initial general graph-text model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function of the initial general graph-text model.

[0038] Among them, during the training process, the autoregressive loss function of the initial general image-text model is determined by comparing the answers predicted by the initial general image-text model (the predicted subject, object and relationship between the subject and object of the sample image) with the actual answers of the sample image.

[0039] It should be noted that, in the present invention, the training objective is to minimize the target loss function, that is, when the target loss function converges, its value reaches the minimum.

[0040] It can be understood that the present invention determines the target loss function of the initial general graph-text model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function of the initial general graph-text model. It can introduce additional subject-object mask prediction loss to assist in supervising the general graph-text model, thereby guiding the model to focus on image content that is highly relevant to question and answer.

[0041] In summary, the image understanding method provided by the present invention uses a segmentation model to perform auxiliary supervision of the subject-object mask prediction loss during the training process of the general image-text model, thereby guiding the general image-text model to focus on image content that is highly relevant to questions and answers, so that the general image-text model can explicitly extract the features of key information in the image, and ensure that the model pays attention to image details closely related to the question before responding and answering the question, thereby improving the accuracy of the model's response, alleviating the hallucination problem of the general image-text model, and enhancing the general image-text model's accurate conversation ability.

[0042] In one embodiment, determining the target loss function of the initial general image-text model based on the subject feature mask and the real mask of the subject, the object feature mask and the real mask of the object, and the autoregressive loss function may include: Determine a first loss function between a subject feature mask and a true mask of the subject, and a second loss function between an object feature mask and a true mask of the object; A target loss function is determined based on the first loss function, the second loss function, and the autoregressive loss function.

[0043] It can be understood that by respectively calculating the first loss function of the subject feature mask predicted by the segmentation model and the true mask of the subject, and the second loss function of the object feature mask predicted by the segmentation model and the true mask of the object, and determining the target loss function based on the first loss function, the second loss function and the autoregressive loss function of the general graph and text model itself, the combination of mask prediction loss and autoregressive loss can be achieved, thereby organically integrating the auxiliary supervision of mask prediction and the self-supervision of the general graph and text model, and improving the feasibility of reducing the hallucinations of the general graph and text model.

[0044] Further, in one embodiment, determining the target loss function based on the first loss function, the second loss function, and the autoregressive loss function may include any of the following methods: Method 1: Determine the target loss function based on the sum of the first loss function, the second loss function and the autoregressive loss function; Method 2: Determine the target loss function based on the maximum of the first loss function, the second loss function and the autoregressive loss function; Method 3: Determine the target loss function based on any one of the first loss function, the second loss function and the autoregressive loss function.

[0045] It can be understood that method 1, by taking the sum of the first loss function, the second loss function and the autoregressive loss function as the target loss function, can fully consider the combination of mask prediction loss and autoregressive loss, thereby significantly alleviating the hallucination problem of the general graph-text model and enhancing the accurate conversation ability of the general graph-text model.

[0046] Method 2 uses the largest of the first loss function, the second loss function and the autoregressive loss function as the target loss function. Compared with method 1, it can speed up the training amount corresponding to the convergence (minimization) of the target loss function, thereby alleviating the hallucination problem of the general graph and text model to a certain extent, effectively reducing the training amount of the general graph and text model, and thus improving the utilization efficiency of the general graph and text model.

[0047] Method 3 uses any one of the first loss function, the second loss function and the autoregressive loss function as the target loss function, which can alleviate the hallucination problem of the general graph-text model to a certain extent while ensuring that the general graph-text model can predict the answer in various situations, thereby improving the practicality of the general graph-text model.

[0048] In one embodiment, the image understanding method provided by the present invention may further include: Input the sample image and seed annotation into the large language model to obtain the question and answer corresponding to the sample image output by the large language model; Among them, the seed annotation includes the subject and object of the sample image, and the relationship between the subject and object of the sample image; The seed annotation is input into the large language model according to a prompt template; the prompt template includes at least one of various question sentence patterns.

[0049] It should be noted that the existing methods for constructing sample sets usually involve directly inputting all available titles and object annotations into a large language model. This method usually produces image-text pairs that are highly consistent overall, but lacks description and attention to specific details in the image. However, actual application scenarios usually revolve around specific elements, facts or events in the image. Therefore, the existing technology cannot meet daily needs.

[0050] In view of the above defects, the present invention creatively proposes the concept of seed annotation. The seed annotation specifically includes the subject and object of the sample image, and the relationship between the subject and object of the sample image.

[0051] By inputting sample images and seed annotations into the large language model, detailed information can be provided for the large language model to construct a single-turn dialogue focusing on the relationship between the subject and the object in the sample image.

[0052] The training samples can come from various databases such as the Scene Image Dataset (PSG), or can be customized. The seed annotations can be manually determined for each training sample.

[0053] Furthermore, the present invention also provides prompt templates to generate different questions. The prompt templates include various interrogative sentence patterns starting with yes / no, what, how, where, etc. For each training sample, a prompt template can be randomly selected and a seed annotation can be filled in accordingly, and the large language model can generate a question-answer pair based on the prompt template.

[0054] For example, in one instance, the sample image includes a cat lying on a toaster, and the input question (with the corresponding seed annotation filled in) is "Is the cat playing on the toaster?".

[0055] The answer output by the large language model is “No, the cat is not playing on the toaster. It is just lying on the toaster.”

[0056] Next, the question was entered as “What safety issues should be considered when a cat sleeps on a toaster?”.

[0057] The answer output by the large language model is "When a cat sleeps on a toaster, there are several safety issues to consider. First, the cat may accidentally turn on the appliance, causing the toaster to heat up and cause burns or injury to the cat. In addition, there is a risk of fire when the cat's fur comes into contact with the heating element inside the toaster. In addition, the possibility of electric shock and short circuits is increased because a careless movement may cause the cat to accidentally damage the toaster's power cord. For the safety of the cat and the family, it is best to keep cats away from kitchen appliances. Providing designated sleeping areas or furniture for cats can help reduce such risks."

[0058] This approach ensures a rich variety of conversational scenarios, reflecting the complexity and variability of real-world interactions with images.

[0059] Furthermore, in one embodiment, the seed annotation may also include at least one of the following: The title of the sample image; Description information of a predetermined area of ​​the sample image; A list of objects in the sample image; Bounding boxes of objects within sample images.

[0060] In order to further enrich the details of the conversation and ensure that these details correspond to the input sample image, the present invention also adds the above detailed information for the same image from various visual datasets (such as COCO, Visual GENOME, etc.) to the seed annotation.

[0061] After determining each sample image and its seed annotation, the true mask of the subject of the sample image, the true mask of the object of the sample image, and the question and answer corresponding to the sample image in the above manner, training samples in various forms such as RAI-30k format can be established.

[0062] Furthermore, in order to enrich the training sample data, in one embodiment, multiple rounds of dialogues from the LLAVA-80k dataset for the same sample image are also appended to each sample data.

[0063] The image understanding method provided by the present invention enriches the data of training samples in various ways, and can train the general image-text model to further achieve accurate and context-related responses, thereby further alleviating the hallucination phenomenon of the general image-text model.

[0064] In one embodiment, the image understanding method provided by the present invention may further include: According to the value of the target loss function, the parameters of the initial general image-text model and the parameters of the segmentation model are adjusted.

[0065] During the training process of the general graph-text model, it can be first initialized according to the pre-trained weights of the initial general graph-text model and the segmentation model, and then the segmentation model can be used to promote the instruction adjustment of the initial general graph-text model.

[0066] Specifically, once the value of the target loss function is determined, the LoRA technology can be used to fine-tune the initial general image and text model with low parameters (including parameters of the attention layer and the linear fully connected layer) based on the value of the target loss function, and simultaneously update the decoder parameters in the segmentation model.

[0067] By adjusting the parameters of the initial general graph-text model and the parameters of the segmentation model simultaneously, efficient training of the general graph-text model can be achieved.

[0068] The image understanding device provided by the present invention is described below. The image understanding device described below and the image understanding method described above can refer to each other and can achieve the same technical effects, which will not be repeated here.

[0069] Figure 2 Schematic diagram of the structure of the image understanding device provided by the present invention. Figure 2 As shown, the image understanding device provided by the present invention may include: The processing module 210 is used to input the target image and the corresponding question into the target general graphic model to obtain the answer output by the target general graphic model, wherein the answer includes the subject, object and the relationship between the subject and object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0070] In one embodiment, determining the target loss function of the initial general graphic model based on the subject feature mask and the real mask of the subject, the object feature mask and the real mask of the object, and the autoregressive loss function includes: Determine a first loss function between the subject feature mask and a true mask of the subject, and a second loss function between the object feature mask and a true mask of the object; The target loss function is determined based on the first loss function, the second loss function, and the autoregressive loss function.

[0071] In one embodiment, the device further comprises a sample module (not shown in the figure) for: Inputting the sample image and the seed annotation into a large language model to obtain a question and an answer corresponding to the sample image output by the large language model; The seed annotation includes the subject and object of the sample image, and the relationship between the subject and object of the sample image; The seed annotation is input into the large language model according to a prompt template; the prompt template includes at least one of various question sentence patterns.

[0072] In one embodiment, the seed annotation further includes at least one of the following: the title of the sample image; Description information of a predetermined area of ​​the sample image; a list of objects in the sample image; The bounding box of the object in the sample image.

[0073] In one embodiment, the processing module is further configured to: According to the value of the target loss function, the parameters of the initial general graphic model and the parameters of the segmentation model are adjusted.

[0074] In one embodiment, determining the target loss function based on the first loss function, the second loss function, and the autoregressive loss function includes any of the following: Determine the target loss function based on the sum of the first loss function, the second loss function and the autoregressive loss function; Determine the target loss function based on the maximum of the first loss function, the second loss function and the autoregressive loss function; The target loss function is determined based on any one of the first loss function, the second loss function, and the autoregressive loss function.

[0075] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the image understanding methods provided by the above embodiments, for example, including: Inputting a target image and a corresponding question into a target universal graphic model, obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0076] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0077] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the image understanding method provided by the above embodiments, for example, including: Inputting a target image and a corresponding question into a target universal graphic model, obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0078] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image understanding method provided in the above embodiments, for example, including: Inputting a target image and a corresponding question into a target universal graphic model, obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image understanding method, characterized in that: include: Inputting a target image and a corresponding question into a target universal graphic model, obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

2. The image understanding method according to claim 1, characterized in that: The determining of the target loss function of the initial general graphic model based on the subject feature mask and the real mask of the subject, the object feature mask and the real mask of the object, and the autoregressive loss function includes: Determine a first loss function between the subject feature mask and a true mask of the subject, and a second loss function between the object feature mask and a true mask of the object; The target loss function is determined based on the first loss function, the second loss function, and the autoregressive loss function.

3. The image understanding method according to claim 1, characterized in that: The method further comprises: Inputting the sample image and the seed annotation into a large language model to obtain a question and an answer corresponding to the sample image output by the large language model; The seed annotation includes the subject and object of the sample image, and the relationship between the subject and object of the sample image; The seed annotation is input into the large language model according to a prompt template; the prompt template includes at least one of various question sentence patterns.

4. The image understanding method according to claim 3, characterized in that: The seed annotation also includes at least one of the following: the title of the sample image; Description information of a predetermined area of ​​the sample image; a list of objects in the sample image; The bounding box of the object in the sample image.

5. The image understanding method according to claim 2, characterized in that: The method further comprises: According to the value of the target loss function, the parameters of the initial general graphic model and the parameters of the segmentation model are adjusted.

6. The image understanding method according to claim 2, characterized in that: The determining the target loss function based on the first loss function, the second loss function, and the autoregressive loss function includes any one of the following: Determine the target loss function based on the sum of the first loss function, the second loss function and the autoregressive loss function; Determine the target loss function based on the maximum of the first loss function, the second loss function and the autoregressive loss function; The target loss function is determined based on any one of the first loss function, the second loss function, and the autoregressive loss function.

7. An image understanding device, characterized in that: include: A processing module, used for inputting a target image and a corresponding question into a target universal graphic model, and obtaining an answer output by the target universal graphic model, wherein the answer includes a subject, an object, and a relationship between the subject and the object of the target image; The target general image-text model is trained in the following way: Inputting the training sample into the initial general image-text model to obtain the subject feature vector, object feature vector and autoregressive loss function output by the initial general image-text model; Inputting the subject feature vector and the object feature vector into a segmentation model to obtain a subject feature mask and an object feature mask output by the segmentation model; Determining a target loss function of the initial general graphic model based on the subject feature mask and the true mask of the subject, the object feature mask and the true mask of the object, and the autoregressive loss function; When the target loss function converges, using the initial universal graph-text model as the target universal graph-text model; The training samples include: sample images, subjects and objects of sample images, relationships between subjects and objects of sample images, true masks of subjects of sample images, true masks of objects of sample images, and questions and answers corresponding to sample images.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the image understanding method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image understanding method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image understanding method according to any one of claims 1 to 6 is implemented.