Large language model assisted retrieval enhanced visual question and answer method and device
Through entity matching and multi-modal feature fusion technology assisted by large language models, the problem of low retrieval accuracy and insufficient robustness of the visual question and answer system in multi-modal data processing is solved, and more efficient and accurate visual question and answer results are achieved. .
Patent Information
- Application Number
- CN202410761024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-01
AI Technical Summary
When existing visual question answering systems process multi-modal data, especially in integrating visual information and text information of complex queries, the retrieval accuracy is not high, it is difficult to handle fine visual details, and the robustness is insufficient for new query types. Information Integration efficiency is low.
A retrieval enhancement method assisted by a large language model is used to retrieve answers from the knowledge base through entity matching, visual positioning and multi-modal feature fusion. Specific steps include matching image description information with question keywords, obtaining target entity information, and performing visual positioning. , extract region-of-interest features and combine them with text features for information retrieval.
It effectively improves the accuracy of visual question and answer results, improves the processing capabilities of complex queries and the robustness of new query types, and enhances the efficiency and accuracy of information integration.
Smart Images

Figure CN118733846A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual question answering, and in particular to a retrieval-enhanced visual question answering method and device assisted by a large language model. Background Art
[0002] In the field of artificial intelligence and computer vision, knowledge-based visual question answering (KB-VQA) systems have been a hot topic of research because they combine the challenges of visual recognition and natural language processing. The core task of these systems is to answer queries about the content of a given image, and the answers often require references to external knowledge sources. Despite significant progress, existing KB-VQA systems still face several major challenges.
[0003] First, existing systems often rely on specific datasets and predefined knowledge bases, which limits their versatility and flexibility in real-world applications. In addition, these systems are often inefficient in processing multimodal data, especially in integrating visual information with textual information for complex queries. Second, current visual question answering techniques often have difficulty in processing subtle visual details that are closely related to the question, especially in images with complex backgrounds or large amounts of information. For example, an effective KB-VQA system needs to be able to distinguish between major elements and minor information in an image and focus only on details that have a decisive impact on answering the user's query. Third, although many systems have adopted deep learning models to improve the quality of question understanding and answer generation, these models usually require a large amount of training data and may not be robust enough on new or unseen query types. Finally, information integration in the multimodal retrieval process remains a problem, especially how to effectively associate textual queries with visual content and accurately retrieve information from a wide range of external knowledge sources. This requires an efficient algorithm that can process and optimize large-scale datasets. Summary of the invention
[0004] The present invention provides a retrieval-enhanced visual question answering method assisted by a large language model, which is used to solve the defect of low retrieval accuracy in the prior art when processing multimodal data, especially in integrating visual information with text information of complex queries, and achieves the effect of effectively improving the accuracy of visual question answering results.
[0005] The present invention provides a retrieval-enhanced visual question answering method assisted by a large language model, comprising the following steps.
[0006] Obtaining an image to be queried and a question to be answered corresponding to the image to be queried; Performing entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried; Performing visual positioning processing on the image to be queried based on the target entity information to obtain an area of interest in the image to be queried that is associated with the question to be answered; Based on the question to be answered, the image to be queried and the region of interest, an answer to the question to be answered is retrieved from a knowledge base.
[0007] According to a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention, the entity matching process is performed on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried, including: Inputting the image to be queried into a visual language model to perform content recognition processing to obtain image description information of the image to be queried; Inputting the question to be answered into a large language model for semantic parsing to obtain keywords in the question to be answered; The keywords and the image description information are input into the large language model for matching processing to obtain the target entity information.
[0008] According to a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention, the answer to the question to be answered is retrieved from a knowledge base based on the question to be answered, the image to be queried and the region of interest, including: Performing feature extraction processing on the question to be answered based on a text feature extraction network to obtain text features of the question to be answered; Performing image feature extraction processing on the query image and the region of interest based on a visual feature extraction network to obtain image visual features; Based on a visual mapping network, the image visual features are mapped to the dimensions of the text features, and based on a feature fusion network, the mapped image visual features and the text features are subjected to feature fusion processing to obtain multimodal fusion features; The answer to the question to be answered is retrieved from a knowledge base according to the question to be answered, the image to be queried and the multimodal fusion feature.
[0009] According to a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention, the answer to the question to be answered is retrieved from a knowledge base according to the question to be answered, the image to be queried and the multimodal fusion feature, including: Based on the text feature extraction network, feature extraction processing is performed on each document in the knowledge base to obtain text features of each document; Performing a similarity comparison process on the text features of each document and the multimodal fusion feature input information retrieval model to obtain a number of documents in the knowledge base with the highest similarity to the multimodal fusion feature; For the plurality of documents, the questions to be answered and the images to be queried, answer generation processing is performed based on a language generation model to obtain answers to the questions to be answered.
[0010] According to a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention, the answer generation process is performed based on a language generation model for the plurality of documents, the questions to be answered and the images to be queried, to obtain the answers to the questions to be answered, including: Performing feature extraction processing on the plurality of documents, the questions to be answered, and the images to be queried, respectively, to obtain document semantic embeddings corresponding to the plurality of documents, question semantic embeddings corresponding to the questions to be answered, and image semantic embeddings corresponding to the images to be queried; The document semantic embedding, the question semantic embedding and the image semantic embedding are input into a language generation model for answer generation processing to obtain a number of answers and their probabilities corresponding to each document, and the answer with the highest probability is used as the answer to the question to be answered.
[0011] According to a retrieval-enhanced visual question answering method assisted by a large language model provided by the present invention, the language generation model is obtained by fine-tuning a retrieval-enhanced answer generator; The target entity information includes target entity text related to the question to be answered in the image to be queried.
[0012] The present invention also provides a retrieval-enhanced visual question-answering device assisted by a large language model, comprising the following modules: An acquisition module, used to acquire an image to be queried and a question to be answered corresponding to the image to be queried; An entity matching module is used to perform entity matching processing on the image to be queried and the question to be answered, so as to obtain target entity information related to the question to be answered in the image to be queried; A visual positioning module, used to perform visual positioning processing on the image to be queried based on the target entity information, so as to obtain an area of interest associated with the question to be answered in the image to be queried; The answer retrieval module is used to retrieve the answer to the question to be answered from the knowledge base based on the question to be answered, the image to be queried and the region of interest.
[0013] The present invention also provides 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 program, a large language model-assisted retrieval-enhanced visual question answering method as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a large language model-assisted retrieval-enhanced visual question answering method as described in any one of the above.
[0015] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned large language model-assisted retrieval-enhanced visual question answering methods.
[0016] The present invention provides a large language model-assisted retrieval-enhanced visual question answering method, which first performs entity matching processing on a query image and a question to be answered to obtain target entity information related to the question to be answered in the query image, then performs visual positioning processing on the query image based on the target entity information to obtain a region of interest associated with the question to be answered in the query image, and then retrieves the answer to the question to be answered from a knowledge base for the region of interest. Since only the region of interest in the image needs to be processed in a targeted manner when retrieving the answer, the accuracy of the answer finally obtained is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] 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 creative work.
[0018] Figure 1 It is a flowchart of a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention.
[0019] Figure 2 It is a schematic diagram of the process of extracting the region of interest provided by the present invention.
[0020] Figure 3 It is a schematic diagram of the process of joint multimodal retrieval provided by the present invention.
[0021] Figure 4 It is a structural schematic diagram of a large language model-assisted retrieval-enhanced visual question-answering device provided by the present invention.
[0022] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] 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.
[0024] Combine the following Figures 1 to 4 A large language model-assisted retrieval-enhanced visual question answering method of the present invention is described.
[0025] Figure 1 is a flow chart of a large language model-assisted retrieval-enhanced visual question answering method provided by the present invention, such as Figure 1 As shown, the method includes the following steps 101 to 104.
[0026] Step 101: Obtain an image to be queried and a question to be answered corresponding to the image to be queried.
[0027] The query image is the image pointed to by the question to be answered, and the query image contains at least one visual element; the question to be answered is the question asked about the query image. For example, when the query image is an image containing a bird, the question to be answered can be "What animal is this?" or "What kind of bird is this?"; for another example, when the query image is an image of a scenic spot, the question to be answered can be "Which scenic spot is this?" or "In which area is this scenic spot located?", etc.
[0028] Step 102: perform entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried.
[0029] In some embodiments, step 102 can be implemented in the following manner: input the image to be queried into a visual language model for content recognition processing to obtain image description information of the image to be queried; input the question to be answered into a large language model for semantic parsing processing to obtain keywords in the question to be answered; input the keywords and the image description information into the large language model for matching processing to obtain the target entity information.
[0030] Specifically, the visual language model (VLM) can understand the query image and generate visual and language data describing the image content. The visual language model used in the present invention can be a CLIP (Contrastive Language-Image Pre-training) model, a PaLM-E model, a Qwen-VL model, etc., which are trained based on preset image-text samples. After the query image is input into the visual language model, the visual language model performs preprocessing, feature extraction, classification, matching, etc. on the image, and then obtains the image description text corresponding to the query image, that is, the image description information.
[0031] For example, if a picture containing food is input into a visual language model to generate text describing the food, the model may output "This is a sushi that includes sashimi, rice, and some seafood." Such a description not only contains the main ingredients of the food, but also provides some additional details, such as "seafood."
[0032] Furthermore, the question to be answered is input into the large language model for semantic analysis to obtain keywords in the question to be answered. The keywords are key concepts or key entities in the question to be answered. For example, if the question to be answered is "What kind of food is this?", the keyword may be "food".
[0033] After obtaining the keywords and image description information in the question to be answered, the keywords and image description information are input into the large language model again for matching processing, that is, matching the keywords with the corresponding objects in the image description information. For example, in the above example, the keyword is "food", then the target entities matched in the image description information are "sushi", "sashimi", "rice", "seafood", or the target entity is "sushi".
[0034] It should be noted that the present invention can input the question to be answered into the large language model for semantic analysis, and after obtaining the keywords in the question to be answered, input the keywords and image description information into the large language model for matching processing to obtain target entity information, so as to improve the accuracy of obtaining the target entity information. Alternatively, the question to be answered and the image description information can be directly input into the large language model at the same time for matching processing to obtain the target entity information, thereby improving processing efficiency.
[0035] In an embodiment of the present invention, a large language model is used to process the image description information of the question to be answered and the image to be queried, and the target entity information in the image to be queried is matched, thereby reducing redundant analysis in subsequent model processing and facilitating subsequent efficient visual analysis of the image to be queried.
[0036] Step 103: Perform visual positioning processing on the image to be queried based on the target entity information to obtain a region of interest in the image to be queried that is associated with the question to be answered.
[0037] Specifically, after obtaining the target entity information in the query image in step 102, the target entity information and the query image are input into the visual localization network to locate the target entity. The visual localization network can segment the entity area according to the specific location of the target entity, and obtain the region of interest (ROI) associated with the question to be answered in the query image. Figure 2 or Figure 3 As shown, Figure 2 is a schematic diagram of the process of extracting the region of interest provided by the present invention, Figure 3 is a schematic diagram of the process of joint multimodal retrieval provided by the present invention, Figure 2 and Figure 3 The question to be answered shown on the left is "Where is the building located?" The query image is an image containing a white church, a statue, trees, and flowers. After processing in step 102, the target entity information can be obtained: the statue and the white church. Then, the target entity information and the query image are input into the visual positioning network for target entity positioning, and multiple regions of interest (ROIs) containing the statue and the white church can be segmented. It should be noted that both steps 102 and 103 are Figure 2 The key visual information extraction operations shown in .
[0038] It should be noted that the target entity information includes the target entity text related to the question to be answered in the image to be queried.
[0039] Exemplarily, the visual localization network may be a commonly used neural network such as U-Net, Mask R-CNN, VGGNet, etc., or may be a referring expression comprehension model (REC).
[0040] In an embodiment of the present invention, visual positioning processing is performed on the query image based on the target entity information to obtain the region of interest, and then answer retrieval and generation are subsequently performed based on the region of interest, thereby reducing redundant analysis in subsequent model processing and facilitating subsequent efficient visual analysis of the query image.
[0041] Step 104: Based on the question to be answered, the image to be queried and the region of interest, retrieve the answer to the question to be answered from a knowledge base.
[0042] In some embodiments, step 104 can be implemented in the following ways: performing feature extraction processing on the question to be answered based on a text feature extraction network to obtain text features of the question to be answered; performing image feature extraction processing on the image to be queried and the region of interest based on a visual feature extraction network to obtain image visual features; mapping the image visual features to the dimensions of the text features based on a visual mapping network, and performing feature fusion processing on the mapped image visual features and the text features based on a feature fusion network to obtain multimodal fusion features; and retrieving the answer to the question to be answered from a knowledge base based on the question to be answered, the image to be queried and the multimodal fusion features.
[0043] See also Figure 3 ,like Figure 3 As shown on the right, a text feature extraction network is first used to extract word-level text features of the question to be answered. The text feature extraction network used here can be any Transformer-based model, such as the BERT model; then based on pre-trained visual features, such as the CLIP (Contrastive Language-Image Pre-Training) model, the extraction network extracts the global image visual features of the image to be queried and the local image visual features of the region of interest. The image visual features here can be color features, texture features, edge features, directional gradient histogram features, etc. It should be noted that the order of extracting text features and image visual features is arbitrary and there is no distinction between first and last.
[0044] Then, based on the visual mapping network, the image visual features are mapped to the dimensions of the text features, and based on the feature fusion network, the mapped image visual features and text features are subjected to feature fusion processing to obtain multimodal fusion features, that is, a single high-dimensional vector, also called query embeddings. The feature fusion process includes feature normalization and weight allocation to ensure the balance of text and visual information. In addition, the present invention can also achieve the fusion of text features and image visual features through methods such as cross-modal attention mechanism and conditional batch normalization.
[0045] After obtaining the multimodal fusion features, the answer to the question to be answered can be retrieved from the knowledge base based on the question to be answered, the query image and the multimodal fusion features.
[0046] In some embodiments, the answer to the question to be answered is retrieved from the knowledge base based on the question to be answered, the image to be queried and the multimodal fusion features, including: performing feature extraction processing on each document in the knowledge base based on the text feature extraction network to obtain the text features of each document; inputting the text features of each document and the multimodal fusion features into the information retrieval model for similarity comparison processing to obtain several documents in the knowledge base with the highest similarity to the multimodal fusion features; for the several documents, the question to be answered and the image to be queried, performing answer generation processing based on the language generation model to obtain the answer to the question to be answered.
[0047] The knowledge base includes at least one document related to the question to be answered. These documents contain basic knowledge and common sense in various fields and are stored in the knowledge base through semantic and logical relationships. The text feature extraction network used to extract documents from the knowledge base can be the same as or different from the network used to extract text features of the question to be answered; the information retrieval model can be a ColBERT model, which measures the similarity between the query embedding and each document in the knowledge base through fine-grained vector interaction, and then uses the late interaction technology to calculate the multi-point similarity between the query embedding and the document to obtain the similarity score of each document, and then ranks all retrieved documents according to the calculated similarity scores, and finally selects the K documents with the highest similarity scores as candidate answers.
[0048] In an embodiment of the present invention, by fusing text and visual information, an advanced retrieval strategy is adopted to retrieve the information most relevant to the question from an external knowledge base, and advanced multimodal deep learning technology is used to ensure the accuracy of the retrieval results.
[0049] In some embodiments, answer generation processing is performed on the several documents, the questions to be answered and the images to be queried based on a language generation model to obtain answers to the questions to be answered, including: feature extraction processing is performed on the several documents, the questions to be answered and the images to be queried respectively to obtain document semantic embeddings corresponding to the several documents, question semantic embeddings corresponding to the questions to be answered, and image semantic embeddings corresponding to the images to be queried; the document semantic embedding, the question semantic embedding and the image semantic embedding are input into a language generation model for answer generation processing to obtain several answers corresponding to each document and their probabilities, and the answer with the highest probability is used as the answer to the question to be answered.
[0050] After obtaining the K documents with the highest similarity scores, the latest language generation model is used, such as the BLIP2-FlanT5-XL model, which combines large-scale pre-trained language models and visual perception capabilities, and can process and interpret multimodal inputs of text and images. The language generation model takes the triple of (knowledge, question, image) as input, and fine-tunes the retrieval-enhanced answer generator under this paradigm. First, the embedding vectors corresponding to the question to be answered, the K documents retrieved related to the question, and the image to be queried are extracted, and the document semantic embedding corresponding to the K documents, the question semantic embedding corresponding to the question to be answered, and the image semantic embedding corresponding to the image to be queried are input into the language generation model. The language generation model combines this information to generate a potential answer for each document and calculate the generation score of the answer. Then, the model calculates the similarity score and generation score of each answer to obtain the joint probability of each answer, and takes the answer with the highest probability as the answer to the question to be answered.
[0051] The present invention provides a large language model-assisted retrieval-enhanced visual question answering method, which first performs entity matching processing on a query image and a question to be answered to obtain target entity information related to the question to be answered in the query image, then performs visual positioning processing on the query image based on the target entity information to obtain a region of interest associated with the question to be answered in the query image, and then retrieves the answer to the question to be answered from a knowledge base for the region of interest. Since only the region of interest in the image needs to be processed in a targeted manner when retrieving the answer, the accuracy of the answer finally obtained is effectively improved.
[0052] The following describes a large language model-assisted retrieval-enhanced visual question-answering device provided by the present invention. The large language model-assisted retrieval-enhanced visual question-answering device described below and the large language model-assisted retrieval-enhanced visual question-answering method described above can refer to each other.
[0053] like Figure 4 As shown, Figure 4 is a structural schematic diagram of a large language model-assisted retrieval-enhanced visual question-answering device provided by the present invention. Figure 4The large language model-assisted retrieval-enhanced visual question-answering device 400 shown includes an acquisition module 401, an entity matching module 402, a visual positioning module 403 and an answer retrieval module 404, wherein the acquisition module 401 is used to acquire an image to be queried and a question to be answered corresponding to the image to be queried; the entity matching module 402 is used to perform entity matching processing on the image to be queried and the question to be answered, and obtain target entity information related to the question to be answered in the image to be queried; the visual positioning module 403 is used to perform visual positioning processing on the image to be queried based on the target entity information, and obtain a region of interest associated with the question to be answered in the image to be queried; the answer retrieval module 404 is used to retrieve the answer to the question to be answered from a knowledge base based on the question to be answered, the image to be queried and the region of interest.
[0054] In some embodiments, the entity matching module 402 is also used to input the image to be queried into a visual language model for content recognition processing to obtain image description information of the image to be queried; input the question to be answered into a large language model for semantic parsing processing to obtain keywords in the question to be answered; input the keywords and the image description information into the large language model for matching processing to obtain the target entity information.
[0055] In some embodiments, the answer retrieval module 404 is also used to perform feature extraction processing on the question to be answered based on a text feature extraction network to obtain text features of the question to be answered; perform image feature extraction processing on the image to be queried and the region of interest based on a visual feature extraction network to obtain image visual features; map the image visual features to the dimensions of the text features based on a visual mapping network, and perform feature fusion processing on the mapped image visual features and the text features based on a feature fusion network to obtain multimodal fusion features; retrieve the answer to the question to be answered from the knowledge base based on the question to be answered, the image to be queried and the multimodal fusion features.
[0056] In some embodiments, the answer retrieval module 404 is also used to perform feature extraction processing on each document in the knowledge base based on the text feature extraction network to obtain the text features of each document; perform similarity comparison processing on the text features of each document and the multimodal fusion feature input information retrieval model to obtain several documents in the knowledge base with the highest similarity to the multimodal fusion feature; perform answer generation processing based on the language generation model for the several documents, the questions to be answered and the images to be queried to obtain the answers to the questions to be answered.
[0057] In some embodiments, the answer retrieval module 404 is also used to perform feature extraction processing on the several documents, the questions to be answered and the images to be queried, respectively, to obtain document semantic embeddings corresponding to the several documents, question semantic embeddings corresponding to the questions to be answered, and image semantic embeddings corresponding to the images to be queried; the document semantic embeddings, the question semantic embeddings and the image semantic embeddings are input into a language generation model for answer generation processing, to obtain several answers corresponding to each document and their probabilities, and the answer with the highest probability is used as the answer to the question to be answered.
[0058] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the retrieval enhanced visual question answering method assisted by a large language model, the method comprising: obtaining an image to be queried and a question to be answered corresponding to the image to be queried; performing entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried; performing visual positioning processing on the image to be queried based on the target entity information to obtain an area of interest associated with the question to be answered in the image to be queried; based on the question to be answered, the image to be queried and the area of interest, retrieving the answer to the question to be answered from the knowledge base.
[0059] In addition, the logic instructions in the above-mentioned memory 530 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.
[0060] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the large language model-assisted retrieval enhanced visual question answering method provided by the above methods, which includes: obtaining an image to be queried and a question to be answered corresponding to the image to be queried; performing entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried; performing visual positioning processing on the image to be queried based on the target entity information to obtain a region of interest associated with the question to be answered in the image to be queried; and retrieving the answer to the question to be answered from a knowledge base based on the question to be answered, the image to be queried and the region of interest.
[0061] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the large language model-assisted retrieval enhanced visual question answering method provided by the above-mentioned methods, the method comprising: obtaining an image to be queried, and a question to be answered corresponding to the image to be queried; performing entity matching processing on the image to be queried and the question to be answered, and obtaining target entity information related to the question to be answered in the image to be queried; performing visual positioning processing on the image to be queried based on the target entity information, and obtaining a region of interest associated with the question to be answered in the image to be queried; and retrieving the answer to the question to be answered from a knowledge base based on the question to be answered, the image to be queried and the region of interest.
[0062] 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.
[0063] 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, it 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.
[0064] 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. A retrieval-enhanced visual question answering method assisted by a large language model, characterized in that: include: Obtaining an image to be queried and a question to be answered corresponding to the image to be queried; Performing entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried; Performing visual positioning processing on the image to be queried based on the target entity information to obtain an area of interest in the image to be queried that is associated with the question to be answered; Based on the question to be answered, the image to be queried and the region of interest, an answer to the question to be answered is retrieved from a knowledge base.
2. The large language model-assisted retrieval-enhanced visual question answering method according to claim 1, characterized in that: The performing entity matching processing on the image to be queried and the question to be answered to obtain target entity information related to the question to be answered in the image to be queried includes: Inputting the image to be queried into a visual language model to perform content recognition processing to obtain image description information of the image to be queried; Inputting the question to be answered into a large language model for semantic parsing to obtain keywords in the question to be answered; The keywords and the image description information are input into the large language model for matching processing to obtain the target entity information.
3. The large language model-assisted retrieval-enhanced visual question answering method according to claim 1, characterized in that: The step of retrieving an answer to the question to be answered from a knowledge base based on the question to be answered, the image to be queried and the region of interest comprises: Performing feature extraction processing on the question to be answered based on a text feature extraction network to obtain text features of the question to be answered; Performing image feature extraction processing on the query image and the region of interest based on a visual feature extraction network to obtain image visual features; Based on a visual mapping network, the image visual features are mapped to the dimensions of the text features, and based on a feature fusion network, the mapped image visual features and the text features are subjected to feature fusion processing to obtain multimodal fusion features; The answer to the question to be answered is retrieved from a knowledge base according to the question to be answered, the image to be queried and the multimodal fusion feature.
4. A large language model-assisted retrieval-enhanced visual question answering method according to claim 3, characterized in that: The knowledge base includes at least one document related to the question to be answered; The step of retrieving an answer to the question to be answered from a knowledge base according to the question to be answered, the image to be queried and the multimodal fusion feature comprises: Based on the text feature extraction network, feature extraction processing is performed on each document in the knowledge base to obtain text features of each document; Performing a similarity comparison process on the text features of each document and the multimodal fusion feature input information retrieval model to obtain a number of documents in the knowledge base with the highest similarity to the multimodal fusion feature; For the plurality of documents, the questions to be answered and the images to be queried, answer generation processing is performed based on a language generation model to obtain answers to the questions to be answered.
5. The large language model-assisted retrieval-enhanced visual question answering method according to claim 4, characterized in that: The step of performing answer generation processing based on a language generation model for the plurality of documents, the questions to be answered, and the images to be queried to obtain answers to the questions to be answered includes: Performing feature extraction processing on the plurality of documents, the questions to be answered, and the images to be queried, respectively, to obtain document semantic embeddings corresponding to the plurality of documents, question semantic embeddings corresponding to the questions to be answered, and image semantic embeddings corresponding to the images to be queried; The document semantic embedding, the question semantic embedding and the image semantic embedding are input into a language generation model for answer generation processing to obtain a number of answers and their probabilities corresponding to each document, and the answer with the highest probability is used as the answer to the question to be answered.
6. The large language model-assisted retrieval-enhanced visual question answering method according to claim 5, characterized in that: The language generation model is obtained by fine-tuning the retrieval-enhanced answer generator; The target entity information includes target entity text related to the question to be answered in the image to be queried.
7. A retrieval-enhanced visual question answering device assisted by a large language model, characterized in that: include: An acquisition module, used to acquire an image to be queried and a question to be answered corresponding to the image to be queried; An entity matching module is used to perform entity matching processing on the image to be queried and the question to be answered, so as to obtain target entity information related to the question to be answered in the image to be queried; A visual positioning module, configured to perform visual positioning processing on the image to be queried based on the target entity information, so as to obtain an area of interest in the image to be queried that is associated with the question to be answered; The answer retrieval module is used to retrieve the answer to the question to be answered from the knowledge base based on the question to be answered, the image to be queried and the region of interest.
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 program, the retrieval-enhanced visual question answering method assisted by a large language model is implemented as described in any one of claims 1 to 6.
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, it implements a large language model-assisted retrieval-enhanced visual question answering method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements a large language model-assisted retrieval-enhanced visual question answering method as described in any one of claims 1 to 6.
Citation Information
Cited By
Visual question and answer processing method
CN118898240A
Intelligent question and answer method and system, electronic equipment and readable storage medium
CN119046440A
Visual question and answer data enhancement method and device, equipment and storage medium
CN119128118A
Hybrid retrieval method, device and equipment based on industrial large model and medium
CN119293269A
Dense image description generation method, system, device, medium and program product
CN119418098A
