Image-text question and answer method and device, electronic equipment, storage medium and program product

By fusing the feature vectors of salient targets into the downsampled image feature vectors, the problem of dispersed answer content and poor logic in the graphic question and answer system is solved, the accuracy and detail of the answers are improved, and the accuracy of the salient targets is enhanced. Detailed information processing ability.

CN118734974APending Publication Date: 2024-10-01CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The content of the answers of the graphic question and answer system is scattered and the logic is poor. The existing technology is difficult to highlight the salient targets while retaining the details of the image, resulting in information overload and insufficient context understanding.

Method used

By fusing the feature vector of the salient target of the input image into the downsampled global image feature vector, the detailed information of the salient target is enhanced, the interference of information irrelevant to the problem is reduced, and the accuracy of target recognition and context understanding are improved.

Benefits of technology

It improves the accuracy, detail and logic of the answers of the graphic question and answer system, maintains low computing resource consumption, enhances the detailed information of salient targets in the image, and reduces the interference of irrelevant information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734974A_ABST
    Figure CN118734974A_ABST
Patent Text Reader

Abstract

The invention provides an image-text question answering method and device, electronic equipment, a storage medium and a program product. The method comprises the steps of obtaining an input image and text content, wherein the text content is a problem proposed for the input image; down-sampling the input image to a preset size to obtain a down-sampled global image; a first feature vector and at least one second feature vector are extracted, the first feature vector is a feature vector of the global image, the at least one second feature vector is a feature vector of each local saliency target image, and each local saliency target image is an image corresponding to each saliency target in the input image; fusing each second feature vector with a vector of a corresponding feature position in the first feature vector to obtain a fused visual feature vector; and outputting a question and answer result according to the fused visual feature vector and the text content. According to the method, the question answering accuracy, meticulous performance and logicality of the image-text question answering system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a method, device, electronic device, storage medium and program product for answering questions using a graphic or text. Background Art

[0002] Image and text question answering technology is a technology that combines text and images for information transmission and interaction. With the development of artificial intelligence technology, more and more image and text question answering systems (or applications) have emerged to meet the needs of users in various fields such as information acquisition, education, medical care, e-commerce, and tourism.

[0003] In the related art, the image-text question-answering system crops the received image into a preset size to obtain multiple image blocks, inputs the pixel information of each image block and the text information corresponding to the question of the image into the language model to obtain the answer to the question.

[0004] Although this method retains the image details, it can easily make the answers of the picture-text question-answering system more scattered and less logical. Summary of the invention

[0005] The present application provides a graphic question and answer method, device, electronic device, storage medium and program product, which are used to solve the technical problem that the content of answers given by a graphic question and answer system is relatively scattered and has poor logic.

[0006] In a first aspect, the present application provides a graphic question-and-answer method, the method comprising:

[0007] Obtain an input image and text content, where the text content is a question raised regarding the input image;

[0008] Downsample the input image to a preset size to obtain a downsampled global image;

[0009] Extracting a first eigenvector and at least one second eigenvector, wherein the first eigenvector is a eigenvector of a global image, and the at least one second eigenvector is a eigenvector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first eigenvector includes vectors of a plurality of feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size;

[0010] Fusing each second feature vector with the vector at the corresponding feature position in the first feature vector to obtain a fused visual feature vector;

[0011] Output the question-answering results based on the fused visual feature vector and text content.

[0012] In a possible implementation, the first feature vector carries significant target labeling information, and the significant target labeling information is used to indicate a corresponding relationship between each significant target and a vector of each feature position in the first feature vector;

[0013] Each second feature vector is fused with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector, including:

[0014] For each second feature vector, determine at least one feature position corresponding to the second feature vector in the first feature vector according to the significant object label information, and a set of image blocks corresponding to the at least one feature position respectively includes a significant object corresponding to the second feature vector;

[0015] The second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain a fused visual feature vector.

[0016] In a possible implementation, a method of extracting at least one second feature vector includes:

[0017] Extracting and cropping at least one salient target in the input image according to a preset strategy to obtain at least one local salient target image, and recording the position information of each salient target in the input image; any local salient target image includes one salient target;

[0018] For each local salient target image, the local salient target image is divided into a plurality of image blocks of the same size and non-overlapping;

[0019] The image blocks are spliced ​​into a sequence in a preset order, the sequence is encoded by a preset second encoding strategy to obtain an encoding result, and the second eigenvectors are determined respectively according to the encoding results corresponding to each local salient target image.

[0020] In a possible implementation, the sequence is encoded by presetting a second encoding strategy to obtain an encoding result, and each second feature vector is determined according to the encoding result corresponding to each local salient target image, including:

[0021] For each local salient target image, a feature marker is added at the beginning of the sequence to obtain a second sequence;

[0022] The second sequence is encoded by a preset second encoding strategy to obtain a one-dimensional feature vector corresponding to each image block and a one-dimensional feature vector corresponding to the feature mark, wherein the one-dimensional feature vector corresponding to the feature mark is used to represent the feature aggregation of each image block of the local salient target image;

[0023] The one-dimensional feature vectors corresponding to the feature marks corresponding to the local salient target images are respectively determined as the second feature vectors of the local salient target images.

[0024] In a possible implementation, the preset strategy is a salient target detection algorithm or a target detection algorithm based on deep learning.

[0025] In a possible implementation manner, extracting the first feature vector includes:

[0026] The global image is divided into multiple non-overlapping image blocks of the same size;

[0027] splicing the image blocks into a sequence in a preset order to obtain a first sequence, and generating significant target marking information according to the position information;

[0028] The first sequence is encoded by a preset first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block, and a feature vector group consisting of the one-dimensional feature vectors corresponding to each image block is determined as a first feature vector.

[0029] In a possible implementation, the question-answering result is output based on the fused visual feature vector and text content, including:

[0030] Encode the text content to obtain a text feature vector;

[0031] Mapping the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector;

[0032] The mapped visual feature vector and the text feature vector are concatenated and fused to obtain a fused feature vector;

[0033] The fused feature vector is input into the pre-trained language model and the question-answering result is output.

[0034] In a second aspect, the present application provides a graphic question-and-answer device, which includes an acquisition module, a sampling module, an extraction module, a fusion module, and an output module, wherein:

[0035] An acquisition module is used to acquire an input image and text content, where the text content is a question raised for the input image;

[0036] A sampling module, used to downsample the input image to a preset size to obtain a downsampled global image;

[0037] An extraction module is used to extract a first feature vector and at least one second feature vector, wherein the first feature vector is a feature vector of a global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size;

[0038] A fusion module, used to fuse each second feature vector with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector;

[0039] The output module is used to output the question-answering results based on the fused visual feature vector and text content.

[0040] In a possible implementation, the first feature vector carries significant target labeling information, and the significant target labeling information is used to indicate a corresponding relationship between each significant target and a vector of each feature position in the first feature vector;

[0041] Fusion module, specifically used for:

[0042] For each second feature vector, determine at least one feature position corresponding to the second feature vector in the first feature vector according to the significant object label information, and a set of image blocks corresponding to the at least one feature position respectively includes a significant object corresponding to the second feature vector;

[0043] The second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain a fused visual feature vector.

[0044] In a possible implementation, the extraction module is specifically used to:

[0045] Extracting and cropping at least one salient target in the input image according to a preset strategy to obtain at least one local salient target image, and recording the position information of each salient target in the input image; any local salient target image includes one salient target;

[0046] For each local salient target image, the local salient target image is divided into a plurality of image blocks of the same size and non-overlapping;

[0047] The image blocks are spliced ​​into a sequence in a preset order, the sequence is encoded by a preset second encoding strategy to obtain an encoding result, and the second eigenvectors are determined respectively according to the encoding results corresponding to each local salient target image.

[0048] In a possible implementation, the extraction module is specifically used to:

[0049] For each local salient target image, a feature marker is added at the beginning of the sequence to obtain a second sequence;

[0050] The second sequence is encoded by a preset second encoding strategy to obtain a one-dimensional feature vector corresponding to each image block and a one-dimensional feature vector corresponding to the feature mark, wherein the one-dimensional feature vector corresponding to the feature mark is used to represent the feature aggregation of each image block of the local salient target image;

[0051] The one-dimensional feature vectors corresponding to the feature marks corresponding to the local salient target images are respectively determined as the second feature vectors of the local salient target images.

[0052] In a possible implementation, the preset strategy is a salient target detection algorithm or a target detection algorithm based on deep learning.

[0053] In a possible implementation, the extraction module is specifically used to:

[0054] The global image is divided into multiple non-overlapping image blocks of the same size;

[0055] splicing the image blocks into a sequence in a preset order to obtain a first sequence, and generating significant target marking information according to the position information;

[0056] The first sequence is encoded by a preset first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block, and a feature vector group consisting of the one-dimensional feature vectors corresponding to each image block is determined as a first feature vector.

[0057] In a possible implementation, the output module is specifically configured to:

[0058] Encode the text content to obtain a text feature vector;

[0059] Mapping the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector;

[0060] The mapped visual feature vector and the text feature vector are concatenated and fused to obtain a fused feature vector;

[0061] The fused feature vector is input into the pre-trained language model and the question-answering result is output.

[0062] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the method described in the first aspect.

[0063] In a fourth aspect, the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0064] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect.

[0065] In a sixth aspect, the present application provides a chip having a computer program stored thereon, and when the computer program is executed by the chip, the method described in the first aspect is implemented.

[0066] In a possible implementation manner, the chip is a chip in a chip module.

[0067] The image-text question-and-answer method, device, electronic device, storage medium and program product provided by the present application enhance the vector of the feature position corresponding to the salient target in the feature vector of the downsampled input image by fusing the extracted feature vector of the salient target of the input image to the feature position corresponding to the salient target in the feature vector of the downsampled input image. Since the feature vector of the local salient target is fused to the feature position corresponding to the salient target in the feature vector of the downsampled input image, it is possible to maintain low computing resource consumption and enhance the detail information of the salient target in the image. The salient target is usually related to the core of the problem and provides important contextual information. Therefore, enhancing the detail information of the salient target in the image can reduce the interference of information irrelevant to the problem, improve the target recognition accuracy and context understanding ability of the image-text question-and-answer system, and thus improve the accuracy, meticulousness and logic of the image-text question-and-answer system in answering questions. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0069] Figure 1 A schematic diagram of a network architecture corresponding to an application scenario provided in an embodiment of the present application;

[0070] Figure 2 A schematic diagram of a process of a graphic question-and-answer method provided in an embodiment of the present application Figure 1 ;

[0071] Figure 3 A schematic diagram of a process of a graphic question-and-answer method provided in an embodiment of the present application Figure 2 ;

[0072] Figure 4A schematic diagram of a global image provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of the structure of a graphic question-and-answer device provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0075] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0077] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0078] Image-text question-and-answer technology is a technology that combines text and images for information transmission and interaction. With the development of artificial intelligence technology, more and more image-text question-and-answer systems (or applications) have emerged. Image-text question-and-answer systems effectively combine visual information with language information to answer the content contained in the image, thereby meeting the needs of users in various fields such as information acquisition, education, medical care, e-commerce, and tourism.

[0079] In some implementations, in order to reduce computing resource consumption, the electronic device will downsample the image to a specified size and then answer questions based on the downsampled image. However, this is likely to lose a lot of image details, resulting in inaccurate answers.

[0080] In other implementations, the image-text question-answering system crops the received image into a preset size to obtain multiple image blocks, inputs the pixel information of each image block and the text information corresponding to the question about the image into the language model to obtain the answer to the question.

[0081] Although this method retains the image details, it does not highlight the salient targets in the image, which can easily lead to information overload and insufficient context understanding, resulting in scattered and illogical answers from the image-text question-answering system. For example, suppose the question is "What is the person in the image doing?", and there are multiple irrelevant objects in the image (such as trees, buildings, etc.), but the salient target is a person running. If this salient target is not highlighted, the image-text question-answering system may be disturbed by other irrelevant objects and give an inaccurate or irrelevant answer.

[0082] In view of this, an embodiment of the present application provides a picture-text question and answer method, which enhances the vector of the feature position corresponding to the salient target in the feature vector of the downsampled input image by fusing the feature vector of the extracted input image into the feature position corresponding to the salient target in the feature vector of the downsampled input image. Since the feature vector of the local salient target is fused into the feature position corresponding to the salient target in the feature vector of the downsampled input image, it is possible to maintain low computing resource consumption and enhance the detail information of the salient target in the image. The salient target is usually related to the core of the problem, and the salient target provides important contextual information. Therefore, enhancing the detail information of the salient target in the image can reduce the interference of information irrelevant to the problem, improve the target recognition accuracy and context understanding ability of the picture-text question and answer system, and thus improve the accuracy, meticulousness and logic of the picture-text question and answer system in answering questions.

[0083] For example, Figure 1 A schematic diagram of a network architecture corresponding to an application scenario provided by an embodiment of the present application is shown. Figure 1 As shown, a network architecture corresponding to an application scenario provided by an embodiment of the present application includes: a first electronic device 100 and a second electronic device 200. The first electronic device 100 may be equipped with an access entry of a graphic question-and-answer system, and the access entry may be, for example, a client corresponding to the graphic question-and-answer system, and the access entry is used to receive input images and text content input by a user; the second electronic device 200 may be equipped with a server of the graphic question-and-answer system.

[0084] In the embodiment of the present application, the first electronic device 100 and the second electronic device 200 may be electronic devices with certain computing power. Exemplarily, the first electronic device 100 may be a terminal device, and the second electronic device 200 may be a server. The terminal device may also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The terminal device may be a mobile phone, a personal computer (PC), a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The server can be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, but the embodiments of the present application are not limited to this.

[0085] In a possible application scenario, the user 300 sends an input image and text content to the second electronic device 200 through the first electronic device 100, wherein the text content is a question raised for the input image; the second electronic device 200 obtains the input image and text content; downsamples the input image to a preset size to obtain a downsampled global image; extracts a first feature vector and at least one second feature vector, wherein the first feature vector is a feature vector of the global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size; each second feature vector is fused with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector; and outputs a question-and-answer result according to the fused visual feature vector and text content. The second electronic device 200 can return the question-and-answer result to the first electronic device 100 for display. Since the feature vector corresponding to the local salient target image is fused to the feature position corresponding to the salient target in the feature vector of the downsampled input image, it is possible to maintain low computing resource consumption and enhance the detail information of the salient target in the image. The salient target is usually related to the core of the problem and provides important contextual information. Therefore, enhancing the detail information of the salient target in the image can reduce the interference of information irrelevant to the problem, improve the target recognition accuracy and context understanding ability of the picture-text question and answer system, and thus improve the accuracy, meticulousness and logic of the picture-text question and answer system in answering questions.

[0086] Optionally, the graphic question and answer system can be entirely installed in the first electronic device 100 or the second electronic device 200. As long as the first electronic device 100 and the second electronic device 200 have sufficient computing power to support the graphic question and answer system to implement the graphic question and answer method provided in the embodiment of the present application, the embodiment of the present application does not specifically limit the devices on which the graphic question and answer system is installed.

[0087] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0088] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0089] For example, Figure 2 A schematic diagram showing a process of a graphic question-and-answer method provided in an embodiment of the present application is shown. Figure 1 .like Figure 2 As shown, the method may include:

[0090] S201: Obtain an input image and text content, where the text content is a question raised regarding the input image.

[0091] In the embodiment of the present application, the text content can be input in the form of voice or text, and the embodiment of the present application does not limit the input form of the text content.

[0092] In a possible implementation, the second electronic device receives an input image and text content input by a user, and the text content may be a question related to the input image. For example, the content in the input image may be: a cat is sitting on a windowsill basking in the sun, the cat's fur is orange and white, and there are several pots of green plants on the windowsill, and the text content may be: what color is the cat? How many pots of plants are there next to the cat?

[0093] S202: downsample the input image to a preset size to obtain a downsampled global image.

[0094] The global image is an image obtained by downsampling the input image by the electronic device.

[0095] The preset size can be set according to the actual scenario, and the embodiment of the present application does not specifically limit this. For example, the preset size can be 224 pixels*224 pixels or 448 pixels*448 pixels.

[0096] In the embodiment of the present application, in order to reduce the computing resource consumption of the electronic device, the input image is downsampled to a preset size to obtain a global image of the preset size.

[0097] Exemplarily, the electronic device may downsample the input image by pixel averaging, neighbor sampling, bilinear interpolation, etc. The embodiment of the present application does not specifically limit the downsampling method of the input image.

[0098] S203, extracting a first eigenvector and at least one second eigenvector, wherein the first eigenvector is a eigenvector of the global image, and the at least one second eigenvector is a eigenvector of each local salient target image, respectively, and each local salient target image is an image corresponding to each salient target in the input image; the first eigenvector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size.

[0099] Among them, the salient target in the input image can be the most eye-catching area or object in the input image that is most easily noticed by the human visual system. The determination of the salient target in the input image is related to the visual features, spatial features, motion features, semantic features of the input image and the strategy for extracting the salient target.

[0100] The first eigenvector is a numerical representation of the image information of the global image, which can reflect various properties and characteristics of the global image; the second eigenvector is a numerical representation of the image information of the local salient target image, which can reflect various properties and characteristics of the local salient target image. In order to reduce the dimensional conversion calculation and thus reduce the consumption of computing resources, the dimensions of the first eigenvector and the second eigenvector can be the same.

[0101] A local salient target image includes a salient target. For example, suppose the content of an input image is: a person is jumping rope in a room, and there is a TV and a sofa in the room, and suppose the salient targets in the input image are the person jumping rope, the TV and the sofa, then we can get the image corresponding to the person jumping rope, the image corresponding to the TV, and the image corresponding to the sofa, that is, we get three local salient target images.

[0102] In a possible implementation, the global image and each local salient target image are respectively input into a pre-trained visual encoder, the visual encoder segments the global image, and then encodes the non-overlapping image blocks of the same size obtained by segmentation to obtain a first feature vector, and encodes each local salient target image to obtain a second feature vector. The pre-trained visual encoder may be installed in the image-text question-answering system, and the visual encoder may adopt a convolutional neural network architecture, which can capture the spatial context information and local detail features of the image.

[0103] In other possible implementations, other encoding methods may be used to encode the global image and each local salient target image, and the method for encoding the global image to obtain the first eigenvector may be the same as or different from the method for encoding each local salient target image to obtain each second eigenvector. The embodiment of the present application does not specifically limit the encoding method of the global image and the local salient target image.

[0104] S204 , fusing each second feature vector with the vector at the corresponding feature position in the first feature vector to obtain a fused visual feature vector.

[0105] In a possible implementation, each second feature vector is fused with the vector of the corresponding feature position in the first feature vector, so as to enhance the detail information of each salient target in the global image. The fusion method can be any of the following: splicing fusion, weighted average, weighted summation, attention mechanism, etc.

[0106] For example, suppose the content of the input image is: a cat sitting on the windowsill basking in the sun, the cat's fur is orange and white, and there are several pots of green plants on the windowsill. And suppose one of the second eigenvectors is the eigenvector corresponding to the salient target cat, then during fusion, the second eigenvector can be fused to the vector of the feature position corresponding to the image block containing the cat in the first eigenvector to obtain the fused visual feature vector.

[0107] S205: Output the question-answering result based on the fused visual feature vector and text content.

[0108] The question-and-answer result can be understood as the answer to the text content. For example, if the content of the input image is: a cat is sitting on the windowsill basking in the sun, the cat's fur is orange and white, and there are 3 pots of green plants on the windowsill, if the text content is: How many pots of plants are there next to the cat? Then the question-and-answer result can be 3 pots.

[0109] In a possible implementation, the feature vector of the text content is extracted, and the feature vector of the text content is fused with the fused visual feature vector. The picture-text question answering system generates the answer corresponding to the text content based on the result of the fusion of the feature vector of the text content and the fused visual feature vector. The fusion method between the feature vector of the text content and the fused visual feature vector can be splicing fusion, weighted summation, attention mechanism, etc.

[0110] In an embodiment of the present application, an input image and text content are obtained, where the text content is a question posed for the input image; the input image is downsampled to a preset size to obtain a downsampled global image; a first feature vector and at least one second feature vector are extracted, where the first feature vector is a feature vector of the global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to a non-overlapping image block of the global image, and each non-overlapping image block has the same size; each second feature vector is fused with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector; and the question and answer result is output based on the fused visual feature vector and the text content. Since the feature vector corresponding to the local salient target image is fused to the feature position corresponding to the salient target in the feature vector of the downsampled input image, it is possible to maintain low computing resource consumption and enhance the detail information of the salient target in the image. The salient target is usually related to the core of the problem and provides important contextual information. Therefore, enhancing the detail information of the salient target in the image can reduce the interference of information irrelevant to the problem, improve the target recognition accuracy and context understanding ability of the picture-text question and answer system, and thus improve the accuracy, meticulousness and logic of the picture-text question and answer system in answering questions.

[0111] Based on the above embodiments, in order to more clearly describe the technical solution of the present application, for example, please refer to Figure 3 , Figure 3 A schematic diagram showing a process of a graphic question-and-answer method provided in an embodiment of the present application is shown. Figure 2 .like Figure 3 As shown, the method may include:

[0112] S301: Obtain an input image and text content, where the text content is a question raised regarding the input image.

[0113] S302: downsample the input image to a preset size to obtain a downsampled global image.

[0114] Steps S301 to S302 are similar to or identical to the above-mentioned steps S201 to S202.

[0115] The global image can be referenced Figure 4 , exemplary, Figure 4 A schematic diagram of a global image provided by an embodiment of the present application is shown. It is understandable that the global image, image blocks, significant targets and other related contents in this example are only exemplary descriptions and do not constitute specific limitations on the related contents in the present application.

[0116] like Figure 4 As shown, the content of the global image is: there are two window sashes on the window sill 406, namely a first window sash 401 and a second window sash 402, a first potted plant 403 and a second potted plant 405 are placed on the window sill 406, and a toy car 404 is placed between the first potted plant 403 and the second potted plant 405.

[0117] It can be understood that since the global image is obtained by downsampling the input image, except for the different resolutions, the global image is the same as the overall content of the input image, that is, the input image also includes the first window sash 401, the second window sash 402, the first potted plant 403, the toy car 404, the second potted plant 405, and the windowsill 406, and the layout of each element is the same as the global image.

[0118] S303, extracting and cropping at least one salient target in the input image according to a preset strategy, obtaining at least one local salient target image, and recording the position information of each salient target in the input image; any local salient target image includes a salient target; for each local salient target image, dividing the local salient target image into a plurality of image blocks of the same size and non-overlapping; splicing each image block into a sequence according to a preset order, encoding the sequence by a preset second encoding strategy, obtaining an encoding result, and determining each second eigenvector according to the encoding result corresponding to each local salient target image.

[0119] Among them, the preset strategy can be a salient target detection algorithm or a target detection algorithm based on deep learning, or other methods for extracting and cropping salient targets in an image.

[0120] For example, Figure 4 The local salient target image is described by taking the salient target toy car 404 in FIG. 4 as an example. The local salient target image corresponding to the salient target toy car 404 is an image extracted and cropped from the input image and only includes the toy car 404.

[0121] In the embodiment of the present application, the position information can be used to indicate the position of each significant target in the global image. Exemplarily, the position of the significant target in the global image can be represented by the sequence number of the image block where the significant target is located. The position of the significant target in the global image can also be represented by two-dimensional coordinates. The embodiment of the present application does not specifically limit the form of expression of the position information, as long as it can indicate the position of each significant target in the global image.

[0122] In the embodiment of the present application, the preset order can be set according to the actual scenario, and the embodiment of the present application does not make any specific limitation on this.

[0123] In a possible implementation, for any local salient target image, a feature marker is added at the beginning or end of a sequence of image blocks of the local salient target image spliced ​​in a preset order, the sequence with the added feature marker is encoded using a pre-trained preset second encoding strategy, and a one-dimensional feature vector corresponding to the encoded feature marker is determined as a feature vector of the local salient target image, that is, a second feature vector.

[0124] In another possible implementation, for any local salient target image, a sequence of image blocks of the local salient target image spliced ​​in a preset order is encoded to obtain a one-dimensional feature vector corresponding to each image block, and the one-dimensional feature vectors of all image blocks of the local salient target image are aggregated to obtain an aggregated feature vector, which is determined as the feature vector of the local salient target image, that is, the second feature vector. Aggregation can be, for example, an operation such as averaging, maximum or summing.

[0125] Optionally, the above step encodes the sequence by using a preset second encoding strategy to obtain an encoding result, and determines each second feature vector according to the encoding result corresponding to each local salient target image, which may include:

[0126] For each local salient target image, a feature marker is added at the beginning of the sequence to obtain a second sequence; the second sequence is encoded by a preset second encoding strategy to obtain a one-dimensional feature vector corresponding to each image block and a one-dimensional feature vector corresponding to the feature marker, and the one-dimensional feature vector corresponding to the feature marker is used to characterize the feature aggregation of each image block of the local salient target image; the one-dimensional feature vector corresponding to the feature marker corresponding to each local salient target image is respectively determined as the second feature vector of each local salient target image.

[0127] In the embodiment of the present application, the feature marker may also be referred to as a special marker (classification token, clstoken). The feature marker may be any randomly preset character, number or field. After the feature marker is encoded by a pre-trained encoder, the obtained one-dimensional feature vector may represent the global features of the corresponding locally significant target image.

[0128] In the embodiment of the present application, for any local salient target image, a feature vector group composed of one-dimensional feature vectors corresponding to each image block of the local salient target image can also be used as the feature vector of the local salient target image. However, in order to facilitate the subsequent fusion of the feature vector of the local salient target image to the corresponding feature position of the first feature vector, the embodiment of the present application selects a vector that reflects the global features of the local salient target image, that is, a one-dimensional feature vector corresponding to the feature marker as the feature vector of the local salient target image.

[0129] For example, assuming that the local salient target image is an image extracted and cropped from the input image and only includes the toy car 404, and assuming that the local salient target image is divided into 9 image blocks of the same size and non-overlapping, the second sequence can be {cls token, patch1, patch2, ..., patch9}. After encoding the second sequence, a vector group [cls token_encoded, patch1_encoded, patch2_encoded, ..., patch9_encoded] is obtained, and the one-dimensional feature vector cls token_encoded corresponding to the feature marker is determined as the feature vector of the local salient target image.

[0130] In an embodiment of the present application, a vector representing the global features of a local salient target image is used as a feature vector of the local salient target image. In this way, after the feature vector of the local salient target image is subsequently fused into the first feature vector, the fused feature vector can obtain more detailed information of the salient target.

[0131] S304, dividing the global image into a plurality of image blocks of the same size and non-overlapping; splicing the image blocks into a sequence in a preset order to obtain a first sequence, and generating significant target marking information according to the position information; encoding the first sequence by a preset first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block, and determining a feature vector group consisting of the one-dimensional feature vectors corresponding to each image block as a first feature vector.

[0132] In the embodiment of the present application, the preset first coding strategy and the preset second coding strategy may be the same or different image feature extraction methods. For example, the preset first coding strategy and the preset second coding strategy may be any of the following: scale-invariant feature transform (SIFT), convolutional neural network feature extraction, histogram of oriented gradients (HOG) and other algorithms.

[0133] In a possible implementation, the first feature vector includes a one-dimensional feature vector corresponding to each image block of the global image.

[0134] For example, Figure 4 As an example, assume that the preset order is as follows Figure 4 As shown in 1 to 20, the global image is divided into 20 image blocks of the same size and non-overlapping, and the image blocks are spliced ​​into a sequence in a preset order, so that the first sequence is {patch1, patch2, ..., patch20}.

[0135] Further, the first sequence {patch1, patch2, ..., patch20} is encoded by presetting a first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block patch, and a feature vector group [vector1, vector2, ..., vector20] composed of the one-dimensional feature vectors corresponding to each image block patch is determined as the first feature vector. Among them, vector1 is the one-dimensional feature vector of the first image block patch1 in the global image, vector2 is the one-dimensional feature vector of the second image block patch2 in the global image... vector20 is the one-dimensional feature vector of the 20th image block patch20 in the global image.

[0136] In the embodiment of the present application, feature extraction is performed on the global image obtained by downsampling, which can reduce the consumption of computing resources compared to directly extracting features from the input image.

[0137] It can be understood that steps S303 to S304 may be specific implementations of the above step S203.

[0138] S305. The first feature vector carries significant target marking information, and the significant target marking information is used to indicate the correspondence between each significant target and the vector of each feature position in the first feature vector. For each second feature vector, at least one feature position corresponding to the second feature vector in the first feature vector is determined according to the significant target marking information, and the set of image blocks corresponding to at least one feature position includes the significant target corresponding to the second feature vector; the second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain a fused visual feature vector.

[0139] In an embodiment of the present application, the significant target marking information can be understood as being used to indicate which image blocks of the global image contain which significant targets. Different image blocks of the global image correspond to vectors of different feature positions in the first feature vector. Therefore, the significant target marking information can also be understood as which significant targets the vectors of each feature position in the first feature vector correspond to.

[0140] For example, Figure 4 As shown, assuming that the global image is divided into 20 image blocks, the first feature vector includes vectors of 20 feature positions, and the vectors of each feature position correspond to the 20 image blocks in sequence. For example, assuming that the first potted plant 403, the toy car 404, and the second potted plant 405 are salient targets in the input image, the salient target marking information may indicate that the 11th, 12th, 16th, and 17th image blocks of the global image contain the salient target first potted plant 403, the 12th, 13th, 14th, 17th, 18th, and 19th image blocks contain the salient target toy car 404, and the 15th and 20th image blocks contain the salient target second potted plant 405, that is, the salient target first potted plant 403 corresponds to the vectors of the 11th, 12th, 16th, and 17th feature positions in the first feature vector, the salient target toy car 404 corresponds to the vectors of the 12th, 13th, 14th, 17th, 18th, and 19th feature positions in the first feature vector, and the salient target second potted plant 405 corresponds to the vectors of the 15th and 20th feature positions in the first feature vector.

[0141] The second feature vector is the feature vector corresponding to the significant target. For example, the second feature vector is the feature vector corresponding to the significant target toy car 404. Therefore, it can be determined based on the significant target marking information that the feature position corresponding to the feature vector corresponding to the significant target toy car 404 in the first feature vector is the 12th, 13th, 14th, 17th, 18th, and 19th feature position.

[0142] Furthermore, the second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain a fused visual feature vector. Figure 4 For example, assuming that the first feature vector is [vector 1, vector 2, ..., vector 20], the feature vector corresponding to the significant target toy car 404 is vector x, the feature vector corresponding to the first potted plant 403 is vector y, and the feature vector corresponding to the second potted plant 405 is vector z, then the feature vector x corresponding to the significant target toy car 404 is added to the vectors of the 12th, 13th, 14th, 17th, 18th, and 19th feature positions in the first feature vector, and the feature vector y corresponding to the significant target first potted plant 403 is added to the vectors of the 11th, 12th, and 13th feature positions in the first feature vector, respectively. The vectors of the 2nd, 16th, and 17th feature positions are added, and the feature vector z corresponding to the second potted plant 405 of the significant target is added to the vectors of the 15th and 20th feature positions in the first feature vector respectively, and the fused feature vector is [vector 1, vector 2, ..., vector 11+vector y, vector 12+vector x+vector y, vector 13+vector x, vector 14+vector x, vector 15+vector z, vector 16+vector y, vector 17+vector x+vector y, vector 18+vector x, vector 19+vector x, vector 20+vector z].

[0143] In an embodiment of the present application, the feature vector corresponding to the significant target in the input image with higher resolution is fused to the corresponding feature position of the special diagnostic vector of the global image with lower resolution, so as to highlight the significant target and enhance the detail information of the significant target, thereby providing support for the accurate, detailed and logical answers of the subsequent graphic question and answer system.

[0144] The step S305 may be a specific implementation of the above step S204.

[0145] S306. Encode the text content to obtain a text feature vector; map the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector; concatenate and fuse the mapped visual feature vector and the text feature vector to obtain a fused feature vector; input the fused feature vector into a pre-trained language model and output the question and answer result.

[0146] In the embodiment of the present application, the pre-trained language model may refer to a model for understanding and processing natural language. Through the language model, it can be determined which word is more likely to appear, or the next most likely word to appear can be predicted through several context words in the previous text. The language model can have the ability to ask and answer questions by learning from a large amount of corpus. The language model may include a statistical language model and a neural network language model, wherein the neural network language model has a more powerful generalization ability and prediction ability compared to the statistical language model. In a possible implementation, in order to better realize the determination of the question and answer function, the language model used in the embodiment of the present application may be a neural network language model. Further, since the question and answer ability of the neural network language model can be improved with the increase of the amount of data used for training and the amount of model parameters, in a possible implementation, in order to determine a more accurate answer, the electronic device uses a neural network language model with large-scale parameters, data volume and calculation amount to meet the quality requirements of question and answer in a specific application. When the scale of the language model reaches a certain level, it will have cognitive, common sense and logical reasoning abilities that meet the application expectations. In a possible implementation, in order to ensure the effect of the model, the parameter weights of the model can be determined by pre-training.

[0147] The language model in the embodiment of the present application can be, for example, a transformer model, and the structure can use any transformer framework such as Llama, Llama2, gpt, gpt2, gpt3, etc., which is not limited in the present application. The language model can be deployed in the second electronic device and carried in the graphic question and answer system, or it can be called by the graphic question and answer system during the question and answer process.

[0148] In a possible implementation, the text content can be encoded by a pre-trained bag-of-words model, a word embedding model, or a sentence embedding model to obtain a text feature vector. Among them, the word embedding model can include Word2Vec, word embedding with global vectors (gloVe) and FastText, etc., and the sentence embedding model can include Doc2Vec, Sentence-BERT, etc.

[0149] Since the text feature vector is the feature vector of the text, and the fused visual feature vector is the feature vector of the image, and the feature vector of the text and the feature vector of the image are generally located in different feature spaces, the text feature vector and the fused visual feature vector are located in different feature spaces. Therefore, it is necessary to map the fused visual feature vector to a feature space similar to the text feature vector to facilitate language model recognition. In a possible implementation, the image-text question-and-answer system includes a feature adaptation layer, which is used to map the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector. Among them, the feature adaptation layer can be, for example, a fully connected layer, a self-attention mechanism, or a specially designed conversion network structure.

[0150] Furthermore, the feature space of the mapped visual feature vector is similar to that of the text feature vector, so the mapped visual feature vector and the text feature vector can be concatenated and fused to obtain a fused feature vector. In other possible implementations, the fusion method between the mapped visual feature vector and the text feature vector can also be a weighted summation, an attention mechanism, or other fusion methods.

[0151] For example, assume that the input image is Figure 4 , and assuming the text content is: What is the positional relationship between the toy car and the potted plants? After the fused feature vector is input into the pre-trained language model, the output question and answer result can be: The toy car is placed between the two potted plants.

[0152] In the embodiment of the present application, the corresponding feature position of the salient target is found in the feature vector of the global image, the feature vector of the local salient target image is fused to the corresponding feature position, and the fused visual feature vector is obtained. After the fused visual feature vector is fused with the text feature vector, the obtained fused feature vector is input into the trained language model to output the question-answering result. This method not only contains the information of the global image, but also highlights the characteristics of the salient target, and enhances the ability of the image-text question-answering system to perceive and understand the details of the salient target, so that the image-text question-answering system can make accurate, detailed and logical answers to the content contained in the image.

[0153] It should be noted that, for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, some steps can be performed in other sequences or simultaneously. Moreover, at least a portion of the steps in the flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0154] Figure 5 This is a schematic diagram of the structure of a graphic question-and-answer device provided in an embodiment of the present application. Figure 5 The device 50 includes an acquisition module 501, a sampling module 502, an extraction module 503, a fusion module 504 and an output module 505, wherein:

[0155] An acquisition module 501 is used to acquire an input image and text content, where the text content is a question raised for the input image;

[0156] The sampling module 502 is used to downsample the input image to a preset size to obtain a downsampled global image;

[0157] The extraction module 503 is used to extract a first feature vector and at least one second feature vector, wherein the first feature vector is a feature vector of the global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size;

[0158] A fusion module 504 is used to fuse each second feature vector with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector;

[0159] The output module 505 is used to output the question-answering result according to the fused visual feature vector and text content.

[0160] In a possible implementation, the first feature vector carries significant target labeling information, and the significant target labeling information is used to indicate a corresponding relationship between each significant target and a vector of each feature position in the first feature vector;

[0161] The fusion module 504 is specifically used for:

[0162] For each second feature vector, determine at least one feature position corresponding to the second feature vector in the first feature vector according to the significant object label information, and a set of image blocks corresponding to the at least one feature position respectively includes a significant object corresponding to the second feature vector;

[0163] The second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain a fused visual feature vector.

[0164] In a possible implementation, the extraction module 503 is specifically configured to:

[0165] Extracting and cropping at least one salient target in the input image according to a preset strategy to obtain at least one local salient target image, and recording the position information of each salient target in the input image; any local salient target image includes one salient target;

[0166] For each local salient target image, the local salient target image is divided into a plurality of image blocks of the same size and non-overlapping;

[0167] The image blocks are spliced ​​into a sequence in a preset order, the sequence is encoded by a preset second encoding strategy to obtain an encoding result, and the second eigenvectors are determined respectively according to the encoding results corresponding to each local salient target image.

[0168] In a possible implementation, the extraction module 503 is specifically configured to:

[0169] For each local salient target image, a feature marker is added at the beginning of the sequence to obtain a second sequence;

[0170] The second sequence is encoded by a preset second encoding strategy to obtain a one-dimensional feature vector corresponding to each image block and a one-dimensional feature vector corresponding to the feature mark, wherein the one-dimensional feature vector corresponding to the feature mark is used to represent the feature aggregation of each image block of the local salient target image;

[0171] The one-dimensional feature vectors corresponding to the feature marks corresponding to the local salient target images are respectively determined as the second feature vectors of the local salient target images.

[0172] In a possible implementation, the preset strategy is a salient target detection algorithm or a target detection algorithm based on deep learning.

[0173] In a possible implementation, the extraction module 503 is specifically configured to:

[0174] The global image is divided into multiple non-overlapping image blocks of the same size;

[0175] splicing the image blocks into a sequence in a preset order to obtain a first sequence, and generating significant target marking information according to the position information;

[0176] The first sequence is encoded by a preset first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block, and a feature vector group consisting of the one-dimensional feature vectors corresponding to each image block is determined as a first feature vector.

[0177] In a possible implementation, the output module 505 is specifically configured to:

[0178] Encode the text content to obtain a text feature vector;

[0179] Mapping the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector;

[0180] The mapped visual feature vector and the text feature vector are concatenated and fused to obtain a fused feature vector;

[0181] The fused feature vector is input into the pre-trained language model and the question-answering result is output.

[0182] The graphic question-and-answer device provided in the embodiment of the present application can be used to execute the above-mentioned method embodiment. Its implementation principle and technical effect are similar, and the embodiment of the present application will not be repeated here.

[0183] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0184] An embodiment of the present application provides an electronic device, Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.

[0185] like Figure 6 As shown, the electronic device 60 includes: a processor 601 and a memory 602; the memory 602 stores computer-executable instructions; the processor 601 executes the computer-executable instructions stored in the memory 602, so that the electronic device 60 executes the above method.

[0186] When the memory 602 is independently provided, the electronic device 60 further includes a bus 603 for connecting the memory 602 and the processor 601 .

[0187] Figure 6 The electronic device 60 shown in the embodiment can execute the steps in the above method embodiment, and its implementation principles and beneficial effects are similar, which will not be described in detail here.

[0188] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.

[0189] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. The above method is implemented when the computer-executable instructions are executed by the processor. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.

[0190] In one possible implementation, a computer readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disk and optical disk as used herein include optical disk, laser disk, optical disk, digital versatile disk (DVD), floppy disk and Blu-ray disk, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer readable media.

[0191] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.

[0192] The embodiments of the present application are described by flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0193] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0194] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0195] It should be understood that the present application is not limited to the precise 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 application is limited only by the appended claims.

Claims

1. A graphic question-and-answer method, characterized in that: The method comprises: Acquire an input image and text content, wherein the text content is a question raised with respect to the input image; Downsampling the input image to a preset size to obtain a downsampled global image; Extracting a first feature vector and at least one second feature vector, wherein the first feature vector is a feature vector of the global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size; Fusing each second feature vector with the vector at the corresponding feature position in the first feature vector to obtain a fused visual feature vector; Outputting a question-answering result according to the fused visual feature vector and the text content.

2. The method according to claim 1, characterized in that The first feature vector carries significant target label information, and the significant target label information is used to indicate the corresponding relationship between each significant target and the vector of each feature position in the first feature vector; The step of fusing each second feature vector with the vector at the corresponding feature position in the first feature vector to obtain a fused visual feature vector includes: For each second feature vector, determining at least one feature position corresponding to the second feature vector in the first feature vector according to the significant object label information, wherein a set of image blocks corresponding to the at least one feature position respectively includes a significant object corresponding to the second feature vector; The second feature vector is added to the vector of at least one feature position corresponding to the first feature vector to obtain the fused visual feature vector.

3. The method according to claim 2, characterized in that The method of extracting the at least one second feature vector includes: Extracting and cropping at least one salient target in the input image according to a preset strategy to obtain at least one local salient target image, and recording position information of each salient target in the input image; any local salient target image includes one salient target; For each local salient target image, dividing the local salient target image into a plurality of image blocks of the same size and non-overlapping; The image blocks are spliced ​​into a sequence in a preset order, the sequence is encoded by a preset second encoding strategy to obtain an encoding result, and the second eigenvectors are determined respectively according to the encoding results corresponding to the local salient target images.

4. The method according to claim 3, characterized in that The encoding of the sequence by a preset second encoding strategy to obtain an encoding result, and determining each second feature vector according to the encoding result corresponding to each local salient target image, respectively, comprises: For each local salient target image, a feature marker is added at the beginning of the sequence to obtain a second sequence; The second sequence is encoded by the preset second encoding strategy to obtain a one-dimensional feature vector corresponding to each image block and a one-dimensional feature vector corresponding to the feature mark, wherein the one-dimensional feature vector corresponding to the feature mark is used to represent the feature aggregation of each image block of the local salient target image; The one-dimensional feature vectors corresponding to the feature marks corresponding to the local salient target images are respectively determined as the second feature vectors of the local salient target images.

5. The method according to claim 4, characterized in that The preset strategy is a significant target detection algorithm or a target detection algorithm based on deep learning.

6. The method according to claim 3, characterized in that The extracting of the first feature vector comprises: Dividing the global image into a plurality of image blocks of the same size and without overlapping; splicing the image blocks into a sequence in a preset order to obtain a first sequence, and generating the significant object marking information according to the position information; The first sequence is encoded by using a preset first encoding strategy to obtain a one-dimensional feature vector corresponding to each image block, and a feature vector group consisting of the one-dimensional feature vectors corresponding to each image block is determined as the first feature vector.

7. The method according to any one of claims 1 to 6, characterized in that Outputting the question-answer result according to the fused visual feature vector and the text content includes: Encoding the text content to obtain a text feature vector; Mapping the fused visual feature vector to a feature space similar to the text feature vector to obtain a mapped visual feature vector; Concatenating and fusing the mapped visual feature vector and the text feature vector to obtain a fused feature vector; The fused feature vector is input into a pre-trained language model, and the question-answering result is output.

8. A graphic question-and-answer device, characterized in that: The device includes an acquisition module, a sampling module, an extraction module, a fusion module and an output module, wherein: The acquisition module is used to acquire an input image and text content, wherein the text content is a question raised for the input image; The sampling module is used to downsample the input image to a preset size to obtain a downsampled global image; The extraction module is used to extract a first feature vector and at least one second feature vector, wherein the first feature vector is a feature vector of the global image, and the at least one second feature vector is a feature vector of each local salient target image, and each local salient target image is an image corresponding to each salient target in the input image; the first feature vector includes vectors of multiple feature positions, each feature position corresponds to each non-overlapping image block of the global image, and each non-overlapping image block has the same size; The fusion module is used to fuse each second feature vector with the vector of the corresponding feature position in the first feature vector to obtain a fused visual feature vector; The output module is used to output the question-answering result according to the fused visual feature vector and the text content.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image-based question and answer method and device, computer equipment and storage medium

    CN113220859A

  • System for collecting interest graph by relevance search incorporating image recognition system

    US20140149376A1