Visual question and answer method, device, equipment, medium and product

Multimodal prediction explanations are generated in the reasoning model through the visual question and answer method, which solves the problem of insufficient explanation of the reasoning process in the existing technology, improves the transparency and credibility of the model, and expands its application scenarios in security-sensitive fields.

CN118798372APending Publication Date: 2024-10-18INST OF AUTOMATION CHINESE ACAD OF SCI

Patent Information

Application Number
CN202410881659.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-18

Smart Images

  • Figure CN118798372A_ABST
    Figure CN118798372A_ABST
Patent Text Reader

Abstract

The invention relates to a visual questioning and answering method, device and equipment, a medium and a product. The visual questioning and answering method comprises the steps of obtaining a target image and target questioning data related to the target image; analyzing the target question data to obtain a question analysis program; based on the target image, executing a question analysis program to obtain a prediction answer for the target question data and execution process data of the question analysis program; based on the execution process data, a multi-modal predictive interpretation of the predictive answer is obtained. According to the visual question and answer method, device and equipment, the medium and the product, the problems of low model transparency and low user credibility caused by lack of reasoning process explanation of the reasoning task can be solved, prediction explanation can be synchronously given when the prediction answer of the reasoning task is given, the transparency and credibility of the model can be improved, and the user experience is improved. And the requirement on the professional property of the user can be reduced, so that the user can read and understand the multi-modal interpretation more easily.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of computer technology and artificial intelligence, and in particular to a visual question answering method, device, equipment, medium and product. Background Art

[0002] Reasoning is a fundamental element of human intelligence and a major challenge in artificial intelligence. Visual question answering is a typical and important multimodal reasoning task.

[0003] In related technologies, reasoning models usually only provide answers but not explanations of their reasoning, which greatly limits the applicability of the model, especially in security-sensitive situations, such as in fields such as healthcare, transportation, and finance, where the rationality and accuracy of the model's reasoning need to be verified. If there is a lack of explanation for its reasoning process, the model's transparency will be insufficient, resulting in low user trust, which limits the model's application scenarios. Summary of the invention

[0004] The present application discloses a visual question answering method, device, equipment, medium and product to at least solve the problem in the related art that the lack of explanation of the reasoning process of the reasoning task leads to low model transparency and low user trust. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a visual question answering method is provided, which includes: acquiring a target image and target question data related to the target image; parsing the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image; based on the target image, executing the question analysis program to obtain a predicted answer to the target question data and execution process data of the question analysis program; based on the execution process data, obtaining a multimodal predictive explanation of the predicted answer, wherein the multimodal predictive explanation includes text information formed by natural language and positioning information of the visual target involved in the text information in the target image.

[0006] Optionally, the problem analysis program is obtained in the following manner: based on preset program prompts, the target question data is parsed to obtain a problem analysis program, wherein the problem analysis program has the same format as the preset program prompts, wherein the preset program prompts include multiple program prompt examples, and the program prompt examples show the correspondence between the problem and the program.

[0007] Optionally, the predicted answer and the execution process data are obtained in the following manner: performing target detection on the target image to determine marking information of the visual target required to execute the problem analysis program in the target image; based on the marking information, executing the problem analysis program to obtain the predicted answer and the execution process data.

[0008] Optionally, the execution process data is expressed in text form, and the execution process data does not include the value of the visual frame variable in the problem analysis program.

[0009] Optionally, the multimodal predictive explanation is obtained in the following manner: based on preset explanation prompts, the execution process data is analyzed to obtain textual explanation data, wherein the textual explanation data has the same format as the preset explanation prompts; based on the textual explanation data and visual targets related to the textual explanation data, the multimodal predictive explanation is obtained, wherein the preset explanation prompts include multiple explanation prompt examples, the explanation prompt examples show the correspondence between the program execution process and the standard natural language explanation, and contain labels representing visual box variables in the problem analysis program.

[0010] Optionally, the text interpretation data includes visual frame variable information obtained by performing target detection on the target image, wherein the multimodal predictive interpretation is also obtained by: detecting all visual frame variable information in the text interpretation data; determining positioning information of the visual frame variable information in the target image; and obtaining the multimodal predictive interpretation based on the text interpretation data and the positioning information.

[0011] Optionally, the text information is a sentence formed by a natural language, and the positioning information is embedded in the sentence in the form of a tag and is located at the name of the corresponding visual target in the text information.

[0012] Optionally, the question analysis program and the multimodal predictive explanation are both obtained through a large language model, and the predicted answer and the execution process data are obtained based on an open world multimodal tool.

[0013] According to a second aspect of the present disclosure, a visual question-answering device is provided, comprising: an acquisition unit, configured to acquire a target image and target question data related to the target image; an analysis unit, configured to parse the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image; an execution unit, configured to execute the question analysis program based on the target image to obtain a predicted answer to the target question data and execution process data of the question analysis program; a prediction unit, configured to obtain a multimodal prediction explanation of the predicted answer based on the execution process data, wherein the multimodal prediction explanation contains text information formed by natural language and positioning information of the visual target involved in the text information in the target image.

[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor, wherein the processor executable instructions, when executed by the processor, prompt the processor to execute the visual question answering method according to the present disclosure.

[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the visual question answering method according to the present disclosure.

[0016] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer executable instructions, which, when executed by at least one processor, implement the visual question answering method according to the present disclosure.

[0017] The technical solution provided by the present disclosure brings at least the following beneficial effects:

[0018] By adopting the present disclosure, the target question data can be parsed to obtain a question analysis program, and based on the target image, the question analysis program is executed to obtain a predicted answer to the target question data and the execution process data of the question analysis program. Based on the execution process data, a multimodal prediction explanation of the predicted answer can be further obtained. Here, the multimodal prediction explanation can include text information formed by natural language and the positioning information of the visual target involved in the text information in the target image. In this way, the prediction explanation can be given synchronously when the prediction answer of the reasoning task is given, and the prediction explanation can include multimodal explanations such as text and vision, which can not only improve the transparency and credibility of the model, but also reduce the requirements for user professionalism, making it easier for users to read and understand such multimodal explanations.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0021] Figure 1 is a schematic flowchart of a visual question answering method according to an exemplary embodiment of the present disclosure.

[0022] Figure 2 is a schematic flowchart of a visual question answering method according to an exemplary embodiment of the present disclosure.

[0023] Figure 3 is a schematic diagram of a program prompt in a visual question answering method according to an exemplary embodiment of the present disclosure.

[0024] Figure 4 is a schematic flowchart of steps of obtaining predicted answers and executing process data in a visual question answering method according to an exemplary embodiment of the present disclosure.

[0025] Figure 5 is a schematic flowchart of steps for obtaining a multimodal prediction explanation in a visual question answering method according to an exemplary embodiment of the present disclosure.

[0026] Figure 6 is a schematic diagram of explanation prompts in a visual question answering method according to an exemplary embodiment of the present disclosure.

[0027] Figure 7 is another schematic flowchart of the steps of obtaining a multimodal prediction explanation in a visual question answering method according to an exemplary embodiment of the present disclosure.

[0028] Figure 8 A schematic block diagram showing an example of a visual question answering method according to an exemplary embodiment of the present disclosure is shown.

[0029] Fig. 9 is a schematic block diagram of a visual question answering device according to an exemplary embodiment of the present disclosure.

[0030] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the present application will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0033] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0034] As mentioned earlier, in related technologies, reasoning models usually only provide answers but not explanations of their reasoning, which greatly limits the applicability of the models, especially in security-sensitive situations, such as in fields such as healthcare, transportation, and finance, where the rationality and accuracy of the model reasoning need to be verified.

[0035] To address the above issues, a key goal in explainable AI is to create intelligent systems that can reason and interpret real-world data to facilitate reliable decision making.

[0036] Visual question answering is a typical and important multimodal reasoning task. Current research on visual question answering mainly relies on a large amount of training data, which limits the application of models in smaller or specific fields. In addition, although many studies can give good answers, they lack explanations of their reasoning process and the transparency of the models is insufficient, resulting in low user trust.

[0037] In view of the above problems, exemplary embodiments of the present disclosure provide a visual question answering method, a visual question answering device, an electronic device, a computer-readable storage medium, and a computer program product, which can solve or at least alleviate the above problems.

[0038] In a first aspect of an exemplary embodiment of the present disclosure, a visual question answering method is provided.

[0039] The visual question answering method according to the exemplary embodiment of the present disclosure can be applied to a scenario where a user interacts with software. For example, a visual question answering software can be loaded on a user terminal, and the user terminal can obtain a target image and target question data related to the target image, for example, the target image and the target question data can be input by the user. The user terminal can also parse the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image. The user terminal can also execute the question analysis program based on the target image to obtain a predicted answer for the target question data and the execution process data of the question analysis program. The user terminal can also obtain a multimodal prediction explanation of the predicted answer based on the execution process data, wherein the multimodal prediction explanation contains text information formed by natural language and the positioning information of the visual target involved in the text information in the target image.

[0040] The above-mentioned user terminal can be, for example, a tablet computer, a laptop computer, a digital assistant, a wearable device, etc. However, the implementation scenario of the above visual question answering method is only an example scenario. The visual question answering method according to the exemplary embodiment of the present disclosure can also be applied to other application scenarios. For example, the user can request the server to process the target image and target question data through the network on the user terminal (for example, a mobile phone, a desktop computer, a tablet computer, etc.). The server can complete the question answering by executing the visual question answering method according to the exemplary embodiment of the present disclosure. Here, the server can be an independent server, a server cluster, a cloud computing platform or a virtualization center.

[0041] According to the visual question answering method of the exemplary embodiment of the present disclosure, a prediction explanation can be given simultaneously with the prediction answer of the reasoning task, and the prediction explanation can include multimodal explanations such as text and vision, which can not only improve the transparency and credibility of the model, but also reduce the requirements for user expertise, making it easier for users to read and understand such multimodal explanations.

[0042] The following will refer to Figure 1 Describe the specific steps of a visual question answering method according to an exemplary embodiment. Figure 1 As shown, the visual question answering method may include the following steps:

[0043] In step S110 , a target image and target question data related to the target image may be acquired.

[0044] Here, the target image and the target question data form multimodal question data, and the target image and the target question data can be arbitrary according to the actual scene.

[0045] For example, Figure 2FIG. 4 is a schematic flow chart of a visual question answering method according to an embodiment of the present disclosure. Figure 2 As shown, the target image may be an image of a dining table with a plate containing cucumbers, tomatoes and other foods, but it is not limited thereto and may also be an image taken from different perspectives, such as but not limited to an image of the dining table, an image of tomatoes, an image of cucumbers, etc. The embodiments of the present disclosure do not impose any particular restrictions on the content of the image, the format of the image, or the way in which the image is formed.

[0046] The sample question data related to the sample image may be any question asked about the sample image, for example, but not limited to, any question asked about any content in the sample image. The sample question data may be text formed by natural language, for example, Figure 2 In the example of , the question data for the image may be “Does the cucumber that is to the left of the tomato look thin and green?”. The sample question data may be automatically generated for the sample image based on an existing model or system, or may be manually input. The embodiments of the present disclosure do not particularly limit the content, data format, and data formation method of the question data.

[0047] In step S120, the target question data may be parsed to obtain a question analysis program.

[0048] Here, the question analysis program can be used to analyze the target question data based on the target image.

[0049] As an example, the target question data may be parsed based on the preset program prompt to obtain the question analysis program. Here, the question analysis program may have the same format as the preset program prompt.

[0050] The preset program prompts may include multiple program prompt examples, and the program prompt examples show the correspondence between the questions and the programs.

[0051] For example, after acquiring the multimodal question data, the program prompts and question data can be input into an existing large language model to obtain a question analysis program output by the large language model. The large language model can be existing, which can analyze the problem and convert the analyzed problem into a logic program. The question analysis program can include one or more program modules, each of which can be used to process a portion of the logic in the corresponding question data. The large language model decomposes the input question data into program steps, which are then executed together with the target image to obtain an answer to the question and the execution process of these steps can represent the reasoning process of obtaining the answer.

[0052] Here, a large language model can be used to programmatically generate the question data for the image. The large language model is a natural language processing technology based on deep learning, which uses a large-scale neural network model to understand, generate and operate natural language text. Exemplarily, the large language model can be a GPT-3.5 model (Generative Pre-training Transformer 3.5, a generative pre-training Transformer model), however, the embodiments of the present disclosure are not limited thereto, and other existing large language models can also be used, and the present disclosure does not specifically limit this.

[0053] Program prompts may include contextual examples of any scenario, which demonstrate the correspondence between the question and the program. In the present disclosure, program prompts may be small samples, that is, fewer program prompts may be used to complete the prompts. Specifically, the question data Q may be converted into a program instantiated by a predefined program module, and N contextual examples may be used to form a small number of example program prompts, where N represents the number of program prompts, which may be in the order of ten, such as 16. Here, by using program prompts with a smaller number of samples, the writing format of the output problem analysis program may be standardized, without the need for a large number of samples, thereby avoiding the problems of low calculation speed and work efficiency due to a large sample size.

[0054] As an example, Figure 3 A schematic diagram of program prompts in a visual question-answering method according to an exemplary embodiment of the present disclosure is shown, wherein, in N program prompt examples, the writing formats of the question "Question" and the program "Program" are given, and a question analysis program can be generated according to the writing formats of these examples.

[0055] by Figure 2 For example, according to the few sample program prompts, the problem analysis program can be obtained as follows:

[0056]

[0057]

[0058] By setting preset program prompts, the model used to generate the problem analysis program can quickly learn the format of the program to be generated, which can not only standardize the form of the problem analysis program but also improve the efficiency of generating the program.

[0059] In step S130, a question analysis program may be executed based on the target image to obtain a predicted answer to the target question data and execution process data of the question analysis program.

[0060] In this step, by executing the question analysis program, the content related to the predicted answer can be extracted from the target image to obtain the predicted answer, and the execution process data can be obtained.

[0061] As an example, Figure 4 As shown, the predicted answer and execution process data can be obtained in the following manner: Step S410, target detection can be performed on the target image to determine the marking information of the visual target required to execute the problem analysis program in the target image; Step S420, the problem analysis program can be executed based on the marking information to obtain the predicted answer and execution process data.

[0062] In step S410, an existing image detection model (or referred to as an "object detector") may be used to perform object detection, and the position of the visual object of interest in the detected object in the image is determined and marked. Figure 2 For example, objects such as cucumbers, tomatoes, and plates can be detected in the target image, where "cucumber" and "tomato" are related to the target question data and these visual objects are required when executing the question analysis program. Therefore, the positions of "cucumber" and "tomato" in the target image can be determined and they can be marked, for example, as "{BOX1}" and "{BOX0}" respectively.

[0063] Here, the tag information may be, for example, but not limited to, a visual frame variable, and each tag information may correspond to a tagged value, for example, Figure 2 In the example, the value of the visual box variable "{BOX1}" can be the coordinates of the four corners of the visual target detection box [151,335,249,444] and [230,340,355,430], and the coordinate unit can be pixels.

[0064] In step S420, the question analysis program may be executed, and the execution process data may be output and the answer may be returned.

[0065] Through the above method, important visual targets can be represented in the form of labeled variables and can correspond to corresponding variable values, which can facilitate the subsequent generation of predictive explanations with complete natural language semantics, and visual information can be combined with natural language text by marking variables and giving variable values ​​without affecting the reading and understanding of natural language text information.

[0066] As an example, an open world multimodal tool may be used to implement step S130 . Specifically, the problem analysis program and the target image may be input into the open world multimodal tool for execution.

[0067] The open-world multimodal tool is called in the form of a program module. For example, the open-world object detection model OWL-ViT model is used as the location module LOC. The OWL-ViT model (Vision Transformer for Open-World Localization) is a model based on vision-language interaction, which can fuse visual features and natural language text to solve multimodal tasks, such as image description generation, visual question answering, etc.

[0068] The open-world multimodal tool can be used to execute the problem analysis program, convert the problem into a program instantiated by a predefined program module, and infer the answer through the program's similar execution process. Here, the execution process data can be expressed in text form, and the execution process data does not contain the value of the visual box variable in the problem analysis program.

[0069] Specifically, Figure 2 For example, executing the problem analysis program can obtain the following execution process data:

[0070]

[0071] Here, open-world multimodal tools may include open-world object detectors (Open-World Object Detector), image cropping tools (Image Croppers), and customized Python functions (Customized Python Functions).

[0072] Open-world object detectors can identify and localize objects in images. Specifically, the model is learned from a large number of images and labels to recognize new and unknown objects.

[0073] Image cropping tools are specifically used to modify or manipulate images, such as cropping a specific area in an image. Image cropping tools are used to focus attention on a specific part of an image and crop the portion of the image that is important for answering the input question.

[0074] Customized Python functions are snippets of Python code written to perform specific tasks. Customized Python functions are designed to work with input questions and images to perform various tasks such as calculations, format conversions, logical judgments, etc. Customized Python functions have flexibility and customization capabilities and are used to handle multimodal data and complex problems.

[0075] In step S140, a multimodal prediction explanation of the prediction answer may be obtained based on the execution process data.

[0076] Here, the multimodal prediction explanation may include text information formed by natural language and the positioning information of the visual targets involved in the text information in the target image.

[0077] As an example, Figure 5 As shown, the multimodal prediction explanation can be obtained in the following way:

[0078] In step S510, the execution process data may be analyzed based on preset explanation prompts to obtain textual explanation data.

[0079] Here, the text explanation data may have the same format as the preset explanation prompt. As an example, the text explanation data may be expressed in a text form, and the text explanation data does not contain the value of the visual frame variable in the problem analysis program.

[0080] In this step, the execution process data can be analyzed using a large language model. For example, the explanation prompt and the execution process data can be input into an existing large language model to obtain textual explanation data output by the large language model. The large language model can be existing, and it can output the execution process data as textual explanation data according to the mode of the explanation prompt. Exemplarily, the large language model can be a GPT-3.5 model, which aims to convert the execution process and returned answers of the question analysis program into predictive explanations. The textual representation of the execution process can be understood by the GPT-3.5 model. Here, the goal of using a large language model is to convert program information that is difficult to interpret into a language expression form to generate an accurate and coherent explanation. The large language model can be a GPT-3.5 model, however, the embodiments of the present disclosure are not limited to this, and other existing large language models can also be used, and the present disclosure does not impose any special restrictions on this.

[0081] However, the embodiments of the present disclosure are not limited thereto, and other existing large language models may also be used, and the present disclosure does not impose any particular limitation on this.

[0082] The preset explanation hints may include a plurality of explanation hint examples, which may demonstrate the correspondence between the program execution process and the standard natural language explanation, and include tags representing visual frame variables in the problem analysis program.

[0083] In the embodiments of the present disclosure, the explanation prompt can be a few samples, that is, a few explanation prompts can be used to complete the prompt, and the few-sample explanation prompt includes multiple context examples to demonstrate the correspondence between the execution process and the standard natural language explanation, and is attached with a tag representing the visual box variable in the program, such as {BOX}. For the input target question data and its execution process, the large language model that receives the explanation prompt can generate an explanation of the reasoning process.

[0084] Specifically, M context examples may be used to form a small number of example explanation prompts, where M represents the number of explanation prompts, which may be in the order of ten, for example, 16. Here, by using explanation prompts with a smaller number of samples, the writing format of the output prediction explanation data can be standardized, without requiring a large number of samples, thereby avoiding the problem of low calculation speed and work efficiency due to a large number of samples.

[0085] As an example, Figure 6 A schematic diagram of explanation prompts in a visual question answering method according to an exemplary embodiment of the present disclosure is shown, wherein in M ​​explanation prompt examples, the writing format of the program execution process is given, and text explanation data can be generated according to the writing format of these examples.

[0086] In step S520, a multimodal prediction explanation may be obtained based on the textual explanation data and the visual target associated with the textual explanation data.

[0087] As an example, the text explanation data may include visual box variable information obtained by performing object detection on the target image, such as Figure 7 As shown, a multimodal predictive explanation is also obtained in the following manner: Step S710, all visual frame variable information in the text interpretation data can be detected; Step S720, the positioning information of the visual frame variable information in the target image can be determined; Step S730, a multimodal predictive explanation can be obtained based on the text interpretation data and the positioning information.

[0088] As described above, the text interpretation data may be expressed in text form and may include visual frame variables in the question analysis program, but not the values ​​of the visual frame variables in the question analysis program. Therefore, in the above steps, the visual frame variables in the text interpretation data may be detected, and the positioning information of the visual frame information in the target image may be determined based on the detection results of the target image by, for example, an open world multimodal tool, so as to generate a multimodal predictive interpretation based on both the text interpretation data and the positioning information.

[0089] As an example, the relationship between the variables present in the problem analysis program and the calculated value of the variable can be constructed, and the location of specific visual targets can be calculated and labeled. Using the location module (LOC), the specific location of the target within the visual box is calculated, and the key visual area in the image is identified by the [BOX] tag. The names of visual targets that are ignored in the program can be extracted from the explanation and their values ​​can be calculated using the location module LOC. Finally, a complete prediction answer and multimodal prediction explanation are generated.

[0090] As an example, the text information may be a sentence formed by a natural language, and the positioning information may be embedded in the sentence in the form of a tag and located at the name of the corresponding visual target in the text information, that is, the visual frame variable may be inserted into the sentence as a tag, such as Figure 2 As shown in the figure, the visual box variables of the visual targets "cucumber" and "tomato" can be embedded in the sentence in the form of tags "{BOX1}" and "{BOX0}", and the text explanation data "The cucumber{BOX1}to the left of the tomato{BOX0}is green but not thin." can be obtained, wherein the positioning information of each visual box variable, that is, the positioning value of the visual box variable, can be given. For example Figure 2 In the text explanation data, the localization information of each visual box variable is obtained as follows:

[0091] “The cucumber[BOX]to the left of the tomato[BOX]is green but notthin.

[0092] Boxes:

[0093] BOX[0]=[37,301,149,375],[3,242,78,318]

[0094] BOX[1]=[151,335,249,444],[230,340,355,430]".

[0095] In the above process of obtaining text explanation data, the large language model is allowed to directly output the required visual targets that may not exist in the program. Here, a rethinking mechanism is introduced to improve the generated explanation. The rethinking mechanism can check all visual box variables in the generated text explanation data and associate those variables that exist in the program with their calculated values. For visual boxes that are ignored in the program, their target names need to be extracted from the explanation and their values ​​are calculated using the location module. By marking boxes such as "[BOX]" to represent key visual targets, the corresponding visual areas in the image are determined to obtain multimodal prediction explanations.

[0096] In the process of obtaining the multimodal predictive explanation described above, the execution process can be converted into a user-friendly multimodal explanation based on the textual explanation data of the question analyzer and combined with the return features of the question analyzer to provide the reasoning process of the answer while providing the answer.

[0097] In addition, in the embodiments of the present disclosure, the question analysis program and the multimodal predictive explanation are both obtained through a large language model, and the predicted answers and execution process data are obtained based on an open world multimodal tool. In this way, the existing model can be utilized without the need for model training, and by introducing program prompts and explanation prompts, the model can output data in the desired form.

[0098] Figure 8 An exemplary block diagram of a visual question answering method according to an exemplary embodiment of the present disclosure is shown.

[0099] Reference Figure 8 In the visual question answering method, in step S1, multimodal question data can be obtained, and the multimodal question data includes a target image and target question data for the target image.

[0100] In step S2, based on the few-sample program prompts, a large language model can be used to generate a program for the target question data to obtain a question analysis program output by the large language model, wherein the large language model can be a GPT-3.5 model.

[0101] In step S3, the question analysis program and the target image can be input into the open world multimodal tool set, and the question analysis program can be executed to obtain the execution process of the question analysis program and the returned answer. Among them, the OWL-ViT model can be used in the open world tool set for open domain target detection, and the open vocabulary target detection task can be completed.

[0102] In step S4, based on the explanation prompt of the few samples, the large language model can be used to parse the execution process of the question analysis program and the returned answer to obtain the predicted explanation output by the large language model. Here, the large language model used can also be a GPT-3.5 model.

[0103] In step S5, based on the predictive explanation of the target problem and in combination with the execution process of the problem analysis program, the corresponding visual area in the target image can be determined to determine the multimodal predictive explanatory result, wherein the predictive explanation includes a description of the visual target detection box, and the execution process of the problem analysis program can include a series of visual target detection box information.

[0104] The visual question answering method according to the embodiment of the present disclosure can reduce the difficulty of answering visual question answering content, improve the accuracy of predicted answers and the quality of explanations, and improve the interpretability and credibility of the reasoning process.

[0105] In addition, the visual question answering method according to the embodiment of the present disclosure can avoid dependence on a large amount of training data, improve the accuracy of predicted answers and the quality of explanation, and improve the interpretability and credibility of the reasoning process.

[0106] Fig. 9 is a schematic block diagram of a visual question answering device according to an exemplary embodiment of the present disclosure. Fig. 9 As shown, the visual question answering device may include an acquisition unit 910 , an analysis unit 920 , an execution unit 930 and a prediction unit 940 .

[0107] The acquisition unit 910 may be configured to acquire a target image and target question data related to the target image.

[0108] The analyzing unit 920 may be configured to parse the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image.

[0109] The execution unit 930 may be configured to execute a question analysis program based on the target image to obtain a predicted answer to the target question data and execution process data of the question analysis program.

[0110] The prediction unit 940 can be configured to obtain a multimodal prediction explanation of the prediction answer based on the execution process data, wherein the multimodal prediction explanation includes text information formed by natural language and positioning information of the visual target involved in the text information in the target image.

[0111] As an example, the analysis unit 920 can also be configured to obtain a problem analysis program in the following manner: based on preset program prompts, the target question data is parsed to obtain a problem analysis program, wherein the problem analysis program has the same format as the preset program prompts, wherein the preset program prompts include multiple program prompt examples, and the program prompt examples show the correspondence between the problem and the program.

[0112] As an example, the execution unit 930 can also be configured to obtain the predicted answer and execution process data in the following manner: perform target detection on the target image to determine the marking information of the visual target required to execute the problem analysis program in the target image; based on the marking information, execute the problem analysis program to obtain the predicted answer and execution process data.

[0113] As an example, the execution process data is expressed in text form, and the execution process data does not include the value of the visual box variable in the problem analysis program.

[0114] As an example, the prediction unit 940 can also be configured to obtain a multimodal predictive explanation in the following manner: based on a preset explanation prompt, analyzing the execution process data to obtain textual explanation data, wherein the textual explanation data has the same format as the preset explanation prompt; based on the textual explanation data and visual targets related to the textual explanation data, obtaining a multimodal predictive explanation, wherein the preset explanation prompt includes multiple explanation prompt examples, the explanation prompt examples show the correspondence between the program execution process and the standard natural language explanation, and include tags representing visual box variables in the problem analysis program.

[0115] As an example, the text interpretation data may include visual frame variable information obtained by performing target detection on the target image, wherein the prediction unit 940 may also be configured to obtain a multimodal predictive interpretation in the following manner: detecting all visual frame variable information in the text interpretation data; determining the positioning information of the visual frame information in the target image; and obtaining a multimodal predictive interpretation by marking the positioning information on the text interpretation data.

[0116] As an example, the text information may be a sentence formed by a natural language, and the positioning information may be embedded in the sentence in the form of a tag and located at the name of the corresponding visual target in the text information.

[0117] As an example, question analysis procedures and multimodal predictive explanations can both be obtained through large language models, and predicted answers and execution process data can be obtained based on open-world multimodal tools.

[0118] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0119] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Fig.10 As shown, the electronic device 10 includes a processor 101 and a memory 102 for storing processor executable instructions. Here, when the processor executable instructions are executed by the processor, the processor is prompted to execute the visual question answering method as described in the above exemplary embodiment.

[0120] As an example, the electronic device 10 is not necessarily a single device, but may be any collection of devices or circuits that can execute the above instructions (or instruction sets) individually or in combination. The electronic device 10 may also be part of an integrated control system or system manager, or may be configured as a server that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0121] In the electronic device 10, the processor 101 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not a limitation, the processor 101 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0122] The processor 101 may execute instructions or codes stored in the memory 102, wherein the memory 102 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0123] The memory 102 may be integrated with the processor 101, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 102 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 102 and the processor 101 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 101 can read files stored in the memory 102.

[0124] In addition, the electronic device 10 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 10 may be connected to each other via a bus and / or a network.

[0125] In an exemplary embodiment, a computer-readable storage medium may also be provided, and when the instructions in the computer-readable storage medium are executed by the processor of the server, the server is able to execute the visual question answering method as described in the above exemplary embodiment. The computer-readable storage medium may be, for example, a memory including instructions. Optionally, the computer-readable storage medium may be: read-only memory (ROM), random access memory (RAM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, B D-R, BD-RLTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0126] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. The computer program product includes computer executable instructions. When the computer executable instructions are executed by at least one processor, the visual question answering method according to the exemplary embodiment of the present disclosure is implemented.

[0127] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0128] In addition, it should be noted that although several examples of each step are described above with reference to specific drawings, it should be understood that the embodiments of the present disclosure are not limited to the combinations given in the examples, and the steps appearing in different drawings may be combined, which are not exhaustively listed here.

[0129] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A visual question answering method, It is characterized in that The visual question answering method comprises: Acquire a target image and target question data related to the target image; Parsing the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image; Based on the target image, executing the question analysis program to obtain a predicted answer to the target question data and execution process data of the question analysis program; Based on the execution process data, a multimodal prediction explanation of the predicted answer is obtained, wherein the multimodal prediction explanation includes text information formed by natural language and positioning information of the visual target involved in the text information in the target image.

2. The visual question answering method according to claim 1, It is characterized in that The problem analysis program is obtained by: Based on a preset program prompt, the target question data is parsed to obtain a question analysis program, wherein the question analysis program has the same format as the preset program prompt, The preset program prompt includes a plurality of program prompt examples, and the program prompt examples show the corresponding relationship between the question and the program.

3. The visual question answering method according to claim 2, It is characterized in that The prediction answer and the execution process data are obtained in the following manner: Performing target detection on the target image to determine marking information of the visual target in the target image required for executing the problem analysis program; Based on the tag information, the question analysis program is executed to obtain the predicted answer and the execution process data.

4. The visual question answering method according to claim 3, It is characterized in that The execution process data is expressed in text form, and the execution process data does not include the value of the visual frame variable in the problem analysis program.

5. The visual question answering method according to claim 1, It is characterized in that The multimodal prediction explanation is obtained in the following way: Based on the preset explanation prompt, the execution process data is analyzed to obtain text explanation data, wherein the text explanation data has the same format as the preset explanation prompt; Based on the textual interpretation data and a visual target associated with the textual interpretation data, obtaining the multimodal prediction interpretation, The preset explanation prompts include a plurality of explanation prompt examples, which show the correspondence between the program execution process and the standard natural language explanation, and contain tags representing visual frame variables in the problem analysis program.

6. The visual question answering method according to claim 5, It is characterized in that The text interpretation data includes visual frame variable information obtained by performing target detection on the target image, wherein the multimodal prediction interpretation is also obtained by: Detect all visual frame variable information in the text interpretation data; Determining positioning information of the visual frame variable information in the target image; Based on the text interpretation data and the positioning information, the multimodal prediction interpretation is obtained.

7. A visual question-answering device, It is characterized in that The visual question answering device comprises: An acquisition unit, configured to acquire a target image and target question data related to the target image; an analysis unit, configured to parse the target question data to obtain a question analysis program, wherein the question analysis program is used to analyze the target question data based on the target image; An execution unit, configured to execute the question analysis program based on the target image, and obtain a predicted answer to the target question data and execution process data of the question analysis program; A prediction unit is configured to obtain a multimodal prediction explanation of the prediction answer based on the execution process data, wherein the multimodal prediction explanation includes text information formed by natural language and positioning information of the visual target involved in the text information in the target image.

8. An electronic device, It is characterized in that The electronic device comprises: processor; a memory for storing instructions executable by the processor, Wherein, when the processor executable instructions are executed by the processor, the processor is prompted to execute the visual question answering method according to any one of claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the visual question answering method according to any one of claims 1 to 6.

10. A computer program product comprising computer executable instructions, It is characterized in that When the computer executable instructions are executed by at least one processor, the visual question answering method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Visual common sense reasoning method and device, electronic equipment and storage medium

    CN118052285A

  • Logic integration explanatory visual question and answer method and device, electronic equipment and storage medium

    CN118132746A

  • Processing method and apparatus for visual question answering task, and device and non-volatile readable storage medium

    WO2024045444A1

Cited By

  • Visual question and answer method and device, electronic equipment, storage medium and computer program product

    CN120146205A

  • Visual question answering method, device, electronic device, storage medium and computer program product

    CN120146205B