Image-text search method, image-text search device, and computer storage medium
By combining feature vector filtering and a multimodal large language model, the contradiction between semantic understanding and computational efficiency in existing image and text retrieval schemes is resolved, achieving efficient and accurate image and text retrieval with limited resources and improving the performance of cross-modal information retrieval.
Patent Information
- Application Number
- CN202611339624.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-27
AI Technical Summary
Existing image and text retrieval solutions based on visual language contrastive learning models struggle to accurately capture deep semantic relationships and subtle semantic differences when faced with retrieval corpora that are semantically diverse and rich in implicit information. This results in a large number of candidate images with insufficient semantic matching in the retrieval results. Furthermore, directly using large-scale multimodal models for fine-grained judgment leads to increased computational resource consumption and time delays, limiting the availability of retrieval systems in large-scale data scenarios.
By acquiring the retrieval corpus and the image set to be retrieved, a multimodal large language model is used to match and predict the initially selected target candidate images and their corresponding target retrieval corpus. Combined with feature vector screening and multiple rounds of iteration, candidate images with insufficient semantic matching are eliminated to achieve accurate judgment and finally obtain the target retrieval image set that matches the original retrieval corpus.
With limited computing resources, a balance between retrieval accuracy and computational efficiency was achieved by combining preliminary screening and secondary screening, which improved retrieval performance, reduced computational overhead on the full image database, and increased the accuracy of retrieval results.
Smart Images

Figure CN123178666A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cross-modal information retrieval, and in particular to a text-image retrieval method, a text-image retrieval device, and a computer storage medium. Background Technology
[0002] In the field of cross-modal information retrieval of images and text, image-text retrieval technology is widely used in scenarios such as intelligent security, e-commerce recommendations, and medical image report generation. Its core objective is to accurately identify target images semantically related to a given retrieval corpus from massive amounts of data. With the development of deep learning technology, image-text retrieval methods based on visual-language contrastive learning models have become the mainstream technical approach in this field due to their excellent cross-modal feature alignment capabilities.
[0003] However, existing retrieval schemes based on visual-language contrastive learning models still have limitations in semantic understanding and reasoning capabilities when faced with retrieval corpora that are semantically diverse and rich in implicit information. They struggle to accurately capture deep semantic connections and subtle semantic differences within the retrieval corpus, resulting in a large number of candidate images with insufficient semantic matching in the search results, making it difficult to meet the retrieval accuracy requirements of practical applications. Furthermore, directly using large-scale multimodal models with stronger semantic understanding capabilities to perform fine-grained judgments on the entire image database would generate unbearable computational resource consumption and time delays, limiting the usability of the retrieval system in large-scale data scenarios.
[0004] Therefore, there is an urgent need for an image and text retrieval technology that can balance retrieval accuracy and computational efficiency, so as to achieve a significant improvement in retrieval performance with limited computing resources. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a text and image retrieval method, a text and image retrieval device, and a computer storage medium.
[0006] To address the aforementioned technical problems, this application provides an image-text retrieval method, comprising: acquiring a retrieval corpus and a set of images to be retrieved, wherein the retrieval corpus includes several retrieval data, which are either original retrieval data or data rewritten based on the original retrieval data; filtering the set of images to be retrieved based on the text feature vector of the retrieval corpus and the image feature vector of each image to be retrieved in the set of images to be retrieved, to obtain a set of target candidate images and target retrieval data corresponding to each target candidate image in the set of target candidate images; inputting each target candidate image in the set of target candidate images and the corresponding target retrieval data into a multimodal large language model to obtain a matching prediction result for each target candidate image against the target retrieval data; and filtering the set of target candidate images based on the matching prediction results of each target candidate image to obtain a set of target retrieval images that matches the original retrieval data.
[0007] The matching prediction result is determined based on the matching prediction probability and the non-matching prediction probability between the target candidate image and the corresponding target retrieval corpus. The step of filtering the target candidate image set based on the matching prediction results of each target candidate image to obtain a target retrieval image set matching the original retrieval corpus includes: characterizing the matching prediction result as a target candidate image matching the target retrieval corpus, and determining it as an initial matching image; filtering each initial matching image based on the matching prediction probability and the non-matching prediction probability corresponding to each initial matching image to obtain a target retrieval image set matching the original retrieval corpus.
[0008] The step of filtering each initial matching image based on the matching prediction probability and the non-matching prediction probability corresponding to each initial matching image to obtain a target retrieval image set that matches the original retrieval corpus includes: taking the ratio between the matching prediction probability and the sum of prediction probabilities corresponding to each initial matching image as the first matching score of the initial matching image, wherein the sum of prediction probabilities represents the sum of the matching prediction probability and the non-matching prediction probability corresponding to the initial matching image, and the higher the first matching score, the more the initial matching image matches the target retrieval corpus corresponding to the target candidate image; sorting the first matching scores of each initial matching image in descending order, and adding at least one of the first initial matching images to the target retrieval image set.
[0009] The retrieval corpus is either a positive corpus or a mixed positive-negative corpus. Obtaining the positive corpus includes: rewriting the original retrieval corpus in a positive direction to generate at least one positively rewritten retrieval corpus, wherein the retrieval intent of the positively rewritten retrieval corpus is the same as that of the original retrieval corpus; using the original retrieval corpus and the positively rewritten retrieval corpus to obtain a positive corpus. Obtaining the mixed positive-negative corpus includes: after obtaining at least one positively rewritten retrieval corpus from the original retrieval corpus, performing negative rewriting on at least one corpus to be rewritten to obtain at least one negatively rewritten retrieval corpus, wherein the corpus to be rewritten is either the original retrieval corpus or the positively rewritten retrieval corpus, and the retrieval intent of the negatively rewritten retrieval corpus is different from that of the original retrieval corpus; using the original retrieval corpus, the positively rewritten retrieval corpus, and the at least one negatively rewritten retrieval corpus to form the mixed positive-negative corpus.
[0010] The positive rewriting includes at least one of the following: syntactic structure transformation, reference resolution and reconstruction, synonym replacement of at least some words in the original retrieval corpus, and standardized rewriting of colloquial expressions in the original retrieval corpus; the negative rewriting includes at least one of the following: replacing attribute words in the retrieval corpus with other attribute words in the same attribute domain, replacing action verbs, spatial relation words or logical relation words in the retrieval corpus with action verbs, spatial relation words or logical relation words with different semantics or reversed relations, and swapping attribute words or action verbs corresponding to different subjects in the retrieval corpus.
[0011] The retrieval corpus has at least one component. The step of filtering the image set to be retrieved based on the text feature vector of the retrieval corpus and the image feature vectors of each image to be retrieved in the image set to be retrieved, to obtain a target candidate image set and target retrieval corpus corresponding to each target candidate image in the target candidate image set, includes: selecting one of the retrieval corpus sets as the current corpus set, and filtering the image set to be retrieved based on the feature similarity between the text feature vector of the current corpus set and the image feature vectors of each image to be retrieved in the image set to be retrieved, to obtain a new image set to be retrieved; repeating the above steps until each of the retrieval corpus sets is used as the current corpus set, and the final image set to be retrieved is used as the target candidate image set, and the target retrieval corpus for each target candidate image is determined, wherein the target retrieval corpus for each target candidate image is: the positive retrieval corpus with the highest matching degree between the target candidate image and the last current corpus set, determined based on the feature similarity, and the retrieval intent of the positive retrieval corpus is the same as the retrieval intent of the original retrieval corpus.
[0012] The retrieval corpus consists of two sets: a positive corpus and a mixed positive-negative corpus. The positive corpus and the mixed positive-negative corpus are used as the current corpus in sequence. The positive corpus includes the positive rewritten corpus of the original retrieval corpus, and the mixed positive-negative corpus includes the positive rewritten corpus and the negative rewritten corpus of the original retrieval corpus.
[0013] The step of filtering the image set to obtain a new image set to be retrieved based on the feature similarity between the text feature vector of the current corpus and the image feature vector of each image to be retrieved in the image set to be retrieved includes: calculating the feature similarity between the image feature vector of each image to be retrieved in the image set to be retrieved and the text feature vector of each retrieval corpus in the current corpus; for each image to be retrieved, selecting the matching retrieval corpus with the highest matching degree from the current corpus based on the feature similarity between the image to be retrieved and each retrieval corpus; and selecting several images to be retrieved as a new image set to be retrieved based on the feature similarity between the image to be retrieved and the matching retrieval corpus and / or the positive or negative attributes of the matching retrieval corpus.
[0014] The step of selecting the matching retrieval corpus with the highest matching degree between the image to be retrieved and each retrieval corpus based on the feature similarity between the image to be retrieved and each retrieval corpus includes: when the current corpus is a positive corpus of the original retrieval corpus, selecting the retrieval corpus with the highest feature similarity between the image to be retrieved as the matching retrieval corpus; when the current corpus is a positive-negative mixed corpus of the original retrieval corpus, normalizing the feature similarity between the image to be retrieved and each retrieval corpus based on a preset temperature coefficient to obtain the matching confidence between the image to be retrieved and each retrieval corpus, and selecting the retrieval corpus with the highest matching confidence between the image to be retrieved as the matching retrieval corpus; and / or, the step of selecting the matching retrieval corpus based on the feature similarity between the image to be retrieved and the matching retrieval corpus... The method involves selecting several images to be retrieved as a new set of images to be retrieved based on the feature similarity and / or the positive and negative attributes of the matching retrieval corpus. This includes: when the current corpus is a positive corpus of the original retrieval corpus, using the feature similarity between the image to be retrieved and the matching retrieval corpus as the second matching score of the image to be retrieved, wherein a higher second matching score indicates a better match between the image to be retrieved and the corresponding retrieval corpus; sorting the second matching scores of each image to be retrieved in descending order, and adding a predetermined number of images to be retrieved that are ranked first to the new set of images to be retrieved; when the current corpus is a mixed positive and negative corpus of the original retrieval corpus, in response to the matching retrieval corpus of the image to be retrieved being a positive retrieval corpus of the original retrieval corpus, adding the image to be retrieved to the new set of images to be retrieved.
[0015] To address the aforementioned technical problems, this application also provides an image and text retrieval device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the image and text retrieval method as described above.
[0016] To address the aforementioned technical problems, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the image and text retrieval method described above.
[0017] Compared with existing technologies, the advantages of this application are as follows: By reducing the size of the image set to be retrieved through preliminary screening based on feature vectors, subsequent processing only requires a smaller number of target candidate images, which helps reduce the computational overhead of directly calling the multimodal large language model from the entire image database. Furthermore, the multimodal large language model is used to match and predict the target candidate images obtained from the preliminary screening with their corresponding target retrieval corpus. Leveraging its superior deep semantic understanding and complex reasoning capabilities compared to conventional visual-language contrastive learning models, it accurately judges the preliminary screening results, eliminating candidate images with insufficient semantic matching, and performing a secondary screening to obtain the final target retrieval image set that matches the original retrieval corpus. The two stages of preliminary and secondary screening work together to achieve a good balance between retrieval accuracy and computational efficiency, which is beneficial for improving retrieval performance with limited computing resources. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart illustrating an embodiment of the image and text retrieval method provided in this application; Figure 2 This is a schematic diagram of the structure of an embodiment of the image and text retrieval device provided in this application; Figure 3 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation
[0019] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0020] The terms “first,” “second,” etc. (if applicable) in this application are used to distinguish different objects, not to describe a particular order. Furthermore, the terms “comprising” and “featured,” and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0021] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0022] The image and text retrieval method of this application is applied to an image and text retrieval device, which can be a server, a terminal device, or a system in which the server and the terminal device cooperate with each other. Accordingly, the various parts of the image and text retrieval device, such as each unit, subunit, module, and submodule, can all be set in the server, all in the terminal device, or separately in the server and the terminal device.
[0023] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed server functionality, or as a single software program or software module; no specific limitations are made here.
[0024] Please refer to details. Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the image and text retrieval method provided in this application.
[0025] like Figure 1 As shown, the specific steps are as follows: Step S11: Obtain the retrieval corpus set and the image set to be retrieved, wherein the retrieval corpus set includes several retrieval corpora, and the retrieval corpora are original retrieval corpora or corpora rewritten based on the original retrieval corpora.
[0026] In this embodiment of the application, the retrieval corpus serves as the query basis for image-text retrieval, and includes the original retrieval corpus and / or the retrieval corpus obtained by rewriting the original retrieval corpus; the image set to be retrieved is the image data set to be used for image-text matching retrieval, that is, it is necessary to select target images that are semantically related to the retrieval corpus from the image set to be retrieved.
[0027] The original retrieval corpus can be the text query statement entered by the user, or the search keywords or descriptive text preset by the system.
[0028] Furthermore, by rewriting the original retrieval corpus, such as by synonym replacement, sentence transformation, and semantic expansion, multiple retrieval corpora with similar semantics but different linguistic expressions can be generated, thereby enriching the semantic coverage of the retrieval and helping to improve the retrieval recall rate.
[0029] The image set to be retrieved can originate from a local image database, a cloud image storage system, or be obtained through real-time acquisition or web crawling. The image types included in the image set include, but are not limited to, natural scene images, medical images, remote sensing images, product images, or surveillance video frames. Furthermore, the image set to be retrieved can be a pre-built and continuously updated fixed image library, or it can be a set of images temporarily combined according to actual retrieval needs; this application does not impose any limitations on this.
[0030] In some embodiments, the retrieval corpus is a positive corpus or a mixed positive and negative corpus.
[0031] The positive corpus refers to the retrieval corpus, in which all the retrieval corpus texts are semantically positively related to the original retrieval corpus. That is, each retrieval corpus describes or expresses the retrieval intent pointed to by the original retrieval corpus from a positive perspective, and is used to select target images from the image set to be retrieved that are semantically matched with the original retrieval corpus.
[0032] The mixed positive and negative corpus refers to a retrieval corpus that includes both positive corpora that are semantically positively correlated with the original retrieval corpus and negative corpora that are semantically negatively correlated or unrelated to the original retrieval corpus. By introducing negative corpora, the model's ability to distinguish semantic differences can be enhanced during model training or retrieval, enabling the model to more accurately understand the semantic boundaries of the original retrieval corpus. This helps reduce interference from mismatched images and further improves the accuracy of retrieval results.
[0033] In this embodiment, the specific retrieval corpus used, whether it is a positive corpus or a mixed positive and negative corpus, can be flexibly configured according to the different requirements for recall and precision in the actual application scenario. This application does not limit this.
[0034] In one embodiment, obtaining the positive corpus set includes: rewriting the original retrieval corpus in a positive direction to generate at least one positively rewritten retrieval corpus, wherein the retrieval intent of the positively rewritten retrieval corpus is the same as the retrieval intent of the original retrieval corpus; and obtaining a positive corpus set using the original retrieval corpus and the positively rewritten retrieval corpus.
[0035] In this embodiment, the original retrieval corpus serves as the baseline query text, and its retrieval intent reflects the semantic features that the user expects the target image to possess.
[0036] By rewriting the original retrieval corpus in a forward manner, multiple retrieval corpora with consistent semantics but different forms of expression can be obtained without changing the retrieval intent, thereby enriching the semantic expression dimension of the query.
[0037] Specifically, a pre-trained large language model can be used to expand and enhance the original retrieval corpus. By designing a structured cue word constraint model, an expanded corpus that is semantically equivalent to the original retrieval corpus but has a different expression can be generated.
[0038] The number of forward-rewritten retrieval corpora generated can be flexibly set according to actual retrieval needs. For example, K extended corpora can be generated in advance, where K is a positive integer. The larger the value of K, the wider the semantic coverage of the retrieval corpus, but it may also increase the computational load of subsequent cross-modal matching. Therefore, the specific value of K needs to be balanced between retrieval recall and computational efficiency, and this application does not impose a specific limitation on this.
[0039] In this embodiment, the generated forward rewritten retrieval corpora together with the original retrieval corpora constitute a forward corpus set. Each retrieval corpus in this corpus set points to the same retrieval intent, that is, it is used to describe the semantic content of the target image that the user expects to retrieve.
[0040] In some embodiments, the forward rewriting includes at least one of the following: syntactic structure transformation, reference resolution and reconstruction, synonym replacement of at least some words in the original retrieval corpus, and standardized rewriting of colloquial expressions in the original retrieval corpus.
[0041] In this embodiment, the core objective of forward rewriting is to maintain the retrieval intent of the original retrieval corpus unchanged, and only to diversify its linguistic expression to generate retrieval corpora that are semantically equivalent but have different linguistic expressions.
[0042] Specifically, syntactic structure transformation refers to adjusting the sentence structure or word order of the original retrieval corpus without changing its semantics. This includes, but is not limited to, changing the active voice to the passive voice, changing the pre-modifier to the post-modifier, and changing the declarative sentence to an inverted sentence. For example, "A woman wearing red clothes is holding a bag" can be changed to "A woman holding a bag is wearing red clothes" to simulate the expression habits of different users.
[0043] Referential deconstruction and reconstruction refers to making the implicit referential relationships in the original retrieval corpus explicit or reorganizing them. For example, "a woman wearing red clothes is carrying a bag" can be adjusted to "a woman wearing red clothes is carrying a bag". By adding the explicit referent "she", the implicit subject referential relationship in the original sentence is made explicit, making the semantic relationship between the subject and object of the action clearer.
[0044] Synonym replacement of at least some words in the original retrieval corpus refers to replacing certain words in the retrieval corpus with other words that have the same or similar meanings without changing the original word meaning and grammatical function. For example, replacing "backpack" with "double shoulder bag" and "backpacker" with "traveler carrying a backpack" to expand the semantic expression dimension.
[0045] Standardizing the colloquial expressions in the original retrieval corpus refers to converting informal language expressions in the retrieval corpus into more formal and standardized expressions, thereby improving the semantic clarity and standardization of the retrieval corpus.
[0046] The aforementioned positive rewriting strategies can be used individually or in any combination, and this application does not impose any specific limitations on them.
[0047] By performing the above-mentioned positive rewriting on the original retrieval corpus, it is possible to maintain the retrieval meaning. Figure 1 Under the premise of consistency, generating positive rewritten retrieval corpora with diverse language expressions is beneficial for capturing different language expressions of the same retrieval intent from multiple perspectives, providing richer retrieval basis for subsequent cross-modal semantic matching, thereby improving the retrieval recall rate to a certain extent.
[0048] In one embodiment, obtaining the positive-negative mixed corpus includes: after obtaining at least one positively rewritten retrieval corpus of the original retrieval corpus, negatively rewriting at least one corpus to be rewritten to obtain at least one negatively rewritten retrieval corpus, wherein the corpus to be rewritten is either the original retrieval corpus or the positively rewritten retrieval corpus, and the retrieval intent of the negatively rewritten retrieval corpus is different from that of the original retrieval corpus; the positive-negative mixed corpus corpus is formed using the original retrieval corpus, the positively rewritten retrieval corpus, and the at least one negatively rewritten retrieval corpus.
[0049] In this embodiment, the positive-negative mixed corpus is constructed by further introducing negative corpus on the basis of the positive corpus. The aim is to enhance the model's ability to distinguish semantic boundaries in the subsequent retrieval process through the combined effect of positive and negative corpus.
[0050] Specifically, after obtaining at least one positively rewritten retrieval corpus of the original retrieval corpus, at least one corpus to be rewritten is negatively rewritten to obtain at least one negatively rewritten retrieval corpus.
[0051] The corpus to be rewritten can be the original retrieval corpus itself or the already generated forward rewritten retrieval corpus. The specific choice can be made flexibly according to actual needs, and this application does not limit it.
[0052] The core objective of the negative rewriting is to generate retrieval corpora with search intents different from the original search corpora. That is, through semantic-level directional shifts, the generated negative rewritten retrieval corpora differ from the original search intents, thereby providing semantic comparison samples for the model in subsequent processing.
[0053] After obtaining the original search corpus, at least one positively rewritten search corpus, and at least one negatively rewritten search corpus, these search corpora are combined to form a mixed positive-negative corpus. This mixed positive-negative corpus simultaneously contains information related to the original search intent. Figure 1 By comparing positive corpora that are consistent with the original retrieval intent and negative corpora that are inconsistent with the original retrieval intent, the model can enhance its understanding of the semantic boundaries of the retrieval intent in the subsequent cross-modal semantic matching process. This helps to reduce semantic confusion and mismatches, thereby improving the accuracy of retrieval to a certain extent.
[0054] In some embodiments, the negative rewriting includes at least one of the following: replacing attribute words in the retrieval corpus with other attribute words in the same attribute domain; replacing action verbs, spatial relation words or logical relation words in the retrieval corpus with action verbs, spatial relation words or logical relation words that are semantically different or have reversed relations; or swapping attribute words or action verbs corresponding to different subjects in the retrieval corpus.
[0055] In this embodiment, replacing attribute words in the retrieval corpus with other attribute words within the same attribute domain means identifying key attribute words in the retrieval corpus, such as color, brand, shape, size, and material, and replacing them with other values within the same attribute domain, thereby changing the target attribute described by the corpus. For example, if the original retrieval corpus is "a person wearing a white shirt and black pants," replacing "white" with "black" or "red," and replacing "black" with "white" or "gray," can generate negatively rewritten retrieval corpora such as "a person wearing a black shirt and white pants" and "a person wearing a red shirt and gray pants."
[0056] Replacing action verbs, spatial relation words, or logical relation words in the search corpus with semantically different or reversed action verbs, spatial relation words, or logical relation words means changing the action type, action direction, spatial location, or logical connection relationship so that the behavior or relationship expressed in the rewritten corpus is different from that in the original corpus. For example, if the original search corpus is "a man who hands a black backpack to a woman", replacing "hands" with "takes", "carries", or "puts down" can generate negative rewritten search corpora such as "a man takes a black backpack from a woman" or "a man stands next to a woman carrying a black backpack".
[0057] Interchanging attribute words or action verbs corresponding to different subjects within the retrieval corpus refers to cross-exchanging attribute words or action verbs corresponding to different subjects in a multi-subject descriptive scenario, thereby changing the correspondence between the attribute words or action verbs and the original subjects. For example, if the original retrieval corpus is "a man wearing a white shirt and a woman wearing a red skirt and carrying a black shoulder bag," swapping the attributes corresponding to men and women can generate negatively rewritten retrieval corpus such as "a woman wearing a white shirt and a man wearing a red skirt and carrying a black shoulder bag."
[0058] The aforementioned negative rewriting strategies can be used individually or in any combination, and this application does not impose any specific limitations on them.
[0059] By performing the aforementioned negative rewriting on the original retrieval corpus, we can generate negatively rewritten retrieval corpus with identifiable semantic differences between the retrieval intent and the original retrieval intent. This allows us to construct an effective positive and negative sample comparison relationship in the subsequent cross-modal semantic matching process, which helps enhance the model's ability to recognize the semantic boundaries of the retrieval intent, reduce semantic confusion and mismatches, and thus improve the accuracy of retrieval to a certain extent.
[0060] Step S12: Based on the text feature vector of the retrieval corpus and the image feature vector of each image to be retrieved in the image set to be retrieved, the image set to be retrieved is filtered to obtain the target candidate image set and the target retrieval corpus corresponding to each target candidate image in the target candidate image set.
[0061] In this embodiment of the application, after obtaining the retrieval corpus and the image set to be retrieved, feature extraction is first performed on each retrieval corpus in the retrieval corpus and each image to be retrieved in the image set to be retrieved, so as to obtain the text feature vector of each retrieval corpus and the image feature vector of each image to be retrieved.
[0062] Among them, the text feature vector is used to represent the textual semantic information of the retrieval corpus, and the image feature vector is used to represent the visual feature information of the image to be retrieved.
[0063] In this process, a pre-trained visual-language contrastive learning model can be used to extract features from each retrieval corpus in the retrieval corpus and each image to be retrieved in the image to be retrieved corpus. By mapping the retrieval corpus and the images to be retrieved to the same common feature space, the text feature vector and the image feature vector are comparable in this space, providing a foundation for subsequent cross-modal similarity calculation.
[0064] Next, cross-modal similarity calculation is performed between the text feature vectors of each retrieval corpus and the image feature vectors of each image to be retrieved, to measure the degree of semantic matching between each retrieval corpus and each image to be retrieved.
[0065] The similarity can be any one of cosine similarity, Euclidean distance similarity, or dot product similarity.
[0066] Based on the calculated similarity, the image set to be retrieved is filtered according to a preset filtering strategy. Images that meet the preset conditions are identified as target candidate images, and the retrieval corpus with the highest similarity to the target candidate image is selected as the target retrieval corpus for the target candidate image, thereby obtaining the target candidate image set and the target retrieval corpus corresponding to each target candidate image.
[0067] The preset condition can be that for each image to be retrieved, if the similarity between the image to be retrieved and any retrieval corpus in the retrieval corpus exceeds a preset threshold, then the image to be retrieved is determined as a target candidate image; or it can be that the similarity between each image to be retrieved and each retrieval corpus is sorted from high to low, and the top N images to be retrieved are determined as target candidate images, where N is a preset positive integer.
[0068] This embodiment can quickly eliminate images that are semantically irrelevant to the retrieval corpus with low computational cost by comparing the similarity between feature vectors, which greatly reduces the size of the image set to be retrieved and provides a candidate image set of controllable size for subsequent refined screening.
[0069] In some embodiments, the retrieval corpus has at least one component; the step of filtering the image set to be retrieved based on the text feature vector of the retrieval corpus and the image feature vector of each image to be retrieved in the image set to be retrieved, to obtain a target candidate image set and the target retrieval corpus corresponding to each target candidate image in the target candidate image set, includes: selecting one of the retrieval corpus sets as the current corpus set, and filtering the image set to be retrieved based on the feature similarity between the text feature vector of the current corpus set and the image feature vector of each image to be retrieved in the image set to be retrieved, to obtain a new image set to be retrieved; repeating the above steps until each of the retrieval corpus sets is used as the current corpus set, and the final image set to be retrieved is used as the target candidate image set, and the target retrieval corpus of each target candidate image is determined, wherein the target retrieval corpus of the target candidate image is: the positive retrieval corpus with the highest matching degree between the target candidate image and the last current corpus set, based on the feature similarity, and the retrieval intent of the positive retrieval corpus is the same as the retrieval intent of the original retrieval corpus.
[0070] In this embodiment, the size of the retrieval corpus can be flexibly configured according to actual retrieval needs.
[0071] When there is only one retrieval corpus, the retrieval corpus is used as the current corpus to perform a filtering operation, which will obtain the target candidate image set and the target retrieval corpus corresponding to each target candidate image.
[0072] When there are multiple retrieval corpora, the image set to be retrieved is filtered sequentially using each retrieval corpus through multiple rounds of iterative filtering.
[0073] Specifically, each retrieval corpus is traversed, and each round of filtering uses the currently traversed retrieval corpus as the query basis. Based on the feature similarity between the text feature vectors of each retrieval corpus in the retrieval corpus and the image feature vectors of each image to be retrieved in the current image to be retrieved corpus, the current image to be retrieved corpus is filtered, and images that meet the preset conditions are retained to form the next round of image to be retrieved corpus.
[0074] The feature similarity can be any one of cosine similarity, Euclidean distance similarity, or dot product similarity.
[0075] After each round of filtering is completed, the system switches to the next retrieval corpus as the current corpus, and repeats the above filtering process until all retrieval corpora have been used.
[0076] Through multiple rounds of iterative filtering, each retrieval corpus is gradually filtered from different semantic dimensions or different expression perspectives to improve the comprehensiveness and accuracy of the filtering results.
[0077] After completing all rounds of filtering, the final set of images to be retrieved is determined as the target candidate image set.
[0078] For each target candidate image in the target candidate image set, its target retrieval corpus is determined as: the positive retrieval corpus with the highest matching degree based on feature similarity in the last retrieval corpus that serves as the current corpus set.
[0079] Specifically, in the final round of screening, the feature similarity between the image feature vector of each image in the current image set and the text feature vector of each forward retrieval corpus in the last current corpus was calculated. Therefore, for each target candidate image retained after the final round of screening, the feature similarity calculation results between it and each forward retrieval corpus in all corpora have been obtained.
[0080] Based on these calculated feature similarity values, the positive retrieval corpus with the highest feature similarity to the target candidate image is selected as the target retrieval corpus for the target candidate image. If multiple positive retrieval corpora have the same and the highest feature similarity to the target candidate image, any one of them can be selected as the target retrieval corpus for the target candidate image; this application does not impose specific limitations on this.
[0081] The selected positive retrieval corpus has the same retrieval intent as the original retrieval corpus, thus ensuring that the final target retrieval corpus is semantically consistent with the original retrieval intent.
[0082] Through the above methods, with the synergistic effect of multiple retrieval corpora, target candidate images with a high semantic matching degree with the original retrieval intent can be selected from the image set to be retrieved. At the same time, the corresponding target retrieval corpora can be accurately associated with each target candidate image, providing a reliable data foundation for the subsequent refined judgment of the multimodal large language model.
[0083] In one embodiment, there are two retrieval corpora, namely a positive corpus and a positive-negative mixed corpus. The positive corpus and the positive-negative mixed corpus are used as the current corpus in sequence. The positive corpus includes the positive rewritten corpus of the original retrieval corpus, and the positive-negative mixed corpus includes the positive rewritten corpus and the negative rewritten corpus of the original retrieval corpus.
[0084] In this embodiment, two corpora are set: a positive corpus and a mixed positive-negative corpus. The two are used as the current corpus in two rounds of iterative filtering.
[0085] The positive corpus includes the original retrieval corpus and the positive rewritten retrieval corpus generated based on the original retrieval corpus. Its purpose is to capture multiple expressions that are consistent with the semantics of the original retrieval intent from a positive dimension, so as to expand the semantic coverage of the retrieval. The positive-negative mixed corpus includes both positive rewritten retrieval corpus and negative rewritten retrieval corpus. Its purpose is to introduce a semantic comparison mechanism in the screening process through the joint participation of positive and negative corpus, so as to enhance the ability to distinguish the semantic boundaries of the retrieval intent.
[0086] Specifically, in the first round of screening, the positive corpus is used as the current corpus. Based on the similarity between the text feature vectors of each positive retrieval corpus in the corpus and the image feature vectors of each image to be retrieved in the image to be retrieved set, the image to be retrieved is screened, and images that are semantically related to the positive retrieval corpus are retained to form the image to be retrieved set after the first round of screening.
[0087] This round of filtering can quickly exclude images that are irrelevant to the original search intent from the image set to be searched, reducing the size of candidate images to a range that are relevant to positive semantics.
[0088] In the second round of screening, the mixed positive and negative corpus is used as the current corpus. Based on the feature similarity between the text feature vectors of each positive and negative retrieval corpus in the corpus and the image feature vectors of each image to be retrieved retained after the first round of screening, the image set to be retrieved after the first round of screening is screened again, and images that meet the preset conditions are retained to form the final image set to be retrieved.
[0089] Since the mixed positive and negative corpus contains both positive and negative data, this round of screening can further utilize the semantic comparison function of the negative data to eliminate images that are semantically confused with the original search intent, based on the irrelevant images filtered out in the previous round, thereby obtaining a candidate image set with higher semantic matching degree.
[0090] Through the two rounds of screening described above, the positive corpus and the mixed positive-negative corpus are progressively refined from different perspectives. The first round focuses on broad recall based on positive semantics, while the second round focuses on precise filtering based on the comparison of positive and negative semantics. The synergistic effect of these two rounds effectively improves the accuracy of the screening results while maintaining recall, providing a higher-quality set of candidate images for the subsequent refined judgment of the multimodal large language model.
[0091] In one embodiment, the step of filtering the image set to be retrieved based on the feature similarity between the text feature vector of the current corpus and the image feature vector of each image to be retrieved in the image set to be retrieved, to obtain a new image set to be retrieved, includes: calculating the feature similarity between the image feature vector of each image to be retrieved in the image set to be retrieved and the text feature vector of each retrieval corpus in the current corpus; for each image to be retrieved, selecting the matching retrieval corpus with the highest matching degree from the current corpus based on the feature similarity between the image to be retrieved and each retrieval corpus; and selecting a number of images to be retrieved as a new image set to be retrieved based on the feature similarity between the image to be retrieved and the matching retrieval corpus and / or the positive or negative attributes of the matching retrieval corpus.
[0092] In this embodiment, the process of filtering the image set to be retrieved specifically includes similarity calculation, selection of matching corpus, and candidate image filtering.
[0093] First, in the similarity calculation stage, for each image in the current image set to be retrieved, the feature similarity between its image feature vector and the text feature vector of each retrieval corpus in the current corpus is calculated. This feature similarity is used to measure the degree of semantic matching between each retrieval corpus and each image to be retrieved in the common feature space. The higher the similarity value, the stronger the semantic association between the retrieval corpus and the image to be retrieved.
[0094] The feature similarity can be any one of cosine similarity, Euclidean distance similarity, or dot product similarity.
[0095] Secondly, in the matching corpus selection stage, for each image to be retrieved in the current image set, based on the calculated feature similarity between the image to be retrieved and each retrieval corpus in the current corpus, the retrieval corpus with the highest feature similarity is selected from the current corpus as the matching retrieval corpus for that image to be retrieved. This matching retrieval corpus reflects the retrieval corpus expression form that is most closely related to the semantics of the image to be retrieved under the query guidance of the current corpus set.
[0096] Finally, in the candidate image selection stage, based on the feature similarity between each image to be retrieved and its matching retrieval corpus and / or the positive or negative attributes of the matching retrieval corpus, several images to be retrieved are selected from the current image set to be retrieved as a new image set to be retrieved.
[0097] Specifically, filtering can be based on feature similarity, retaining images whose feature similarity meets preset conditions. For example, images with feature similarity exceeding a preset threshold can be selected for retention, or images can be sorted from highest to lowest feature similarity and a preset number of images at the top of the sorted list can be retained. Filtering can also be based on the positive or negative attributes of the matching corpus, prioritizing images whose matching corpus is positive and excluding those whose matching corpus is negative. Alternatively, both methods can be combined, further considering the positive or negative attributes of the matching corpus for a comprehensive judgment in addition to feature similarity-based filtering.
[0098] In one embodiment, selecting the matching retrieval corpus with the highest degree of matching with the image to be retrieved from the current corpus set based on the feature similarity between the image to be retrieved and each retrieval corpus includes: when the current corpus set is a positive corpus set of the original retrieval corpus, selecting the retrieval corpus with the highest feature similarity with the image to be retrieved as the matching retrieval corpus; when the current corpus set is a positive and negative mixed corpus set of the original retrieval corpus, normalizing the feature similarity between the image to be retrieved and each retrieval corpus based on a preset temperature coefficient to obtain the matching confidence level between the image to be retrieved and each retrieval corpus, and selecting the retrieval corpus with the highest matching confidence level with the image to be retrieved as the matching retrieval corpus; and / or, the step of selecting the matching retrieval corpus based on the image to be retrieved and the matching retrieval corpus... Based on the feature similarity between the corpora and / or the positive and negative attributes of the matching retrieval corpus, a number of images to be retrieved are selected as a new set of images to be retrieved. This includes: when the current corpus is a positive corpus of the original retrieval corpus, the feature similarity between the image to be retrieved and the matching retrieval corpus is used as the second matching score of the image to be retrieved, wherein the higher the second matching score, the more closely the image to be retrieved matches the corresponding retrieval corpus; the second matching scores of each image to be retrieved are sorted in descending order, and a predetermined number of images to be retrieved at the top of the sorted list are added to the new set of images to be retrieved; when the current corpus is a mixed positive and negative corpus of the original retrieval corpus, in response to the matching retrieval corpus of the image to be retrieved being a positive retrieval corpus of the original retrieval corpus, the image to be retrieved is added to the new set of images to be retrieved.
[0099] In this embodiment, the type of the current corpus determines the selection method of the matching retrieval corpus and the filtering strategy of the candidate images.
[0100] When the current corpus is a positive corpus, it contains only positive search corpora whose search intent aligns with the original search corpus. In this case, for each image in the current image set to be searched, the feature similarity between its image feature vector and the text feature vectors of each positive search corpus in the positive corpus is calculated. The search corpus with the highest feature similarity is then determined as the matching search corpus for that image. Since all search corpora in the positive corpus are positive and there is no interference from negative corpora, the positive or negative attributes of the matching search corpus do not need to be considered separately; selection can be made directly based on feature similarity.
[0101] After selecting the matching retrieval corpus, the feature similarity between each image to be retrieved and its matching retrieval corpus is used as the second matching score for that image. The higher the second matching score, the higher the degree of semantic matching between the image to be retrieved and the overall positive corpus set. Subsequently, the images to be retrieved are sorted in descending order of their second matching scores, and a predetermined number of the top-ranked images are added to a new set of images to be retrieved. This ensures that the candidate image size is kept within a reasonable range while maintaining semantic relevance to the original retrieval intent.
[0102] When the current corpus is a mixed positive and negative corpus, containing both positive retrieval corpora and negative rewrite retrieval corpora, the following steps are taken: For each image in the current retrieval image set, the feature similarity between its image feature vector and the text feature vectors of each retrieval corpus in the mixed positive and negative corpus is first calculated. Then, based on a preset temperature coefficient and a normalization exponential function, the feature similarity values are normalized, transforming the original feature similarity values into a probability distribution form of matching confidence. This matching confidence reflects the probability that the image to be retrieved matches each retrieval corpus semantically. After normalization, the matching confidence between different retrieval corpora is comparable. Based on this, the retrieval corpus with the highest matching confidence with the image to be retrieved is selected as the matching retrieval corpus for that image.
[0103] After selecting the matching retrieval corpus, the positive or negative attributes of the corpus are further determined. If the matching retrieval corpus is positive, meaning its search intent matches the search intent of the original retrieval corpus... Figure 1 If the image matches the original search intent, it indicates that the image to be retrieved has a high semantic matching probability, and the image to be retrieved is added to a new set of images to be retrieved. If the matching retrieval corpus is a negative rewritten retrieval corpus, that is, its search intent is different from the search intent of the original retrieval corpus, it indicates that the image to be retrieved has a low semantic matching probability with the original search intent, and it is removed from the candidate set.
[0104] By using the mechanism described above, which determines the positive or negative attributes of the corpus based on the maximum matching confidence value, negative corpus in the mixed positive and negative corpus can be used as a semantic comparison reference to effectively identify and filter out images that do not match the original retrieval intent, thereby improving the accuracy of the screening results while ensuring recall.
[0105] By combining the two approaches described above—using a positive corpus and a mixed positive-negative corpus to sequentially filter the image set to be retrieved—the positive corpus is responsible for broadly recalling candidate images semantically relevant to the original retrieval intent from a positive perspective, reducing the image size to a manageable range. The mixed positive-negative corpus, based on the results of the previous round of filtering, further utilizes the comparative information of the positive and negative corpora for precise filtering, eliminating semantically confusing and noisy images. These two approaches complement each other and refine the image set step by step, achieving an effective balance between retrieval accuracy and computational efficiency, and providing a high-quality candidate image set for subsequent refined judgment.
[0106] Step S13: Input each target candidate image in the target candidate image set and the corresponding target retrieval corpus into the multimodal large language model to obtain the matching prediction result of each target candidate image for the target retrieval corpus.
[0107] In this embodiment of the application, after obtaining the target candidate image set and the target retrieval corpus corresponding to each target candidate image, a multimodal large language model is further used to perform a refined judgment on the consistency between the image and text of each target candidate image and its corresponding target retrieval corpus.
[0108] Specifically, for each target candidate image in the target candidate image set, it and the corresponding target retrieval corpus are input together into the multimodal large language model, along with structured discriminative prompts, to enable the multimodal large language model to perform image-text matching judgment tasks. These structured discriminative prompts instruct the multimodal large language model to comprehensively judge the semantic consistency between the input target candidate image and the target retrieval corpus, and output a binarized matching prediction result.
[0109] For example, the structured discrimination prompt could be: I will provide you with a query and a candidate sample. Please evaluate whether the candidate sample meets the query requirements. If it does, please reply "Yes"; if it does not, please reply "No".
[0110] After receiving the above input, the multimodal large language model, based on its visual understanding and natural language reasoning capabilities, performs a cross-modal comprehensive evaluation of the consistency between the content of the target candidate image and the semantic description of the target retrieval corpus, and outputs the corresponding matching prediction result. This matching prediction result is used to characterize whether the target candidate image satisfies the retrieval intent described in the target retrieval corpus.
[0111] By introducing a multimodal large language model for image-text consistency discrimination, we can fully utilize its superior deep semantic understanding and complex reasoning capabilities compared to conventional vision-language pre-trained models. This allows for accurate identification of semantically ambiguous samples that are difficult to distinguish in the initial screening stage, thereby effectively eliminating candidate images that do not semantically match the original retrieval corpus and further improving the accuracy of the retrieval results.
[0112] Step S14: Based on the matching prediction results of each target candidate image, filter the target candidate image set to obtain a target retrieval image set that matches the original retrieval corpus.
[0113] In this embodiment of the application, after obtaining the matching prediction results of each target candidate image for its corresponding target retrieval corpus, the target candidate image set is filtered according to the matching prediction results to obtain the target retrieval image set that matches the original retrieval corpus.
[0114] Specifically, the matching prediction result is used to characterize whether each target candidate image and its corresponding target retrieval corpus are semantically matched. For each target candidate image, if the matching prediction result indicates that the target candidate image is semantically matched with the corresponding target retrieval corpus, then the target candidate image is determined as an image that matches the original retrieval corpus and is included in the target retrieval image set; if the matching prediction result indicates that the target candidate image is not semantically matched with the corresponding target retrieval corpus, then the target candidate image is removed from the candidate set.
[0115] Through the above filtering operations, the target candidate images that are determined by the multimodal large language model to be semantically consistent with the text can be output as the final retrieval results.
[0116] In one embodiment, the matching prediction result is determined based on the matching prediction probability and the non-matching prediction probability between the target candidate image and the corresponding target retrieval corpus; the step of filtering the target candidate image set based on the matching prediction results of each target candidate image to obtain a target retrieval image set matching the original retrieval corpus includes: characterizing the matching prediction result as the target candidate image matching the target retrieval corpus, and determining it as an initial matching image; filtering each initial matching image based on the matching prediction probability and the non-matching prediction probability corresponding to each initial matching image to obtain a target retrieval image set matching the original retrieval corpus.
[0117] In this embodiment, the multimodal large language model outputs a corresponding matching prediction result for each target candidate image and its corresponding target retrieval corpus.
[0118] Specifically, the matching prediction result includes the matching prediction probability and the non-matching prediction probability between the target candidate image and the target retrieval corpus. The matching prediction probability represents the confidence of the multimodal large language model in determining that the target candidate image and the target retrieval corpus are semantically matched, and the non-matching prediction probability represents the confidence of the multimodal large language model in determining that the two are semantically mismatched.
[0119] A higher matching prediction probability indicates that the target candidate image is more likely to satisfy the retrieval intent described in the target retrieval corpus; conversely, a lower mismatch prediction probability indicates that the target candidate image is more likely to be semantically inconsistent with the target retrieval corpus.
[0120] Then, based on the above matching prediction results, the target candidate images that match the target retrieval corpus are identified as initial matching images. That is, candidate images that are determined to be semantically consistent with the text by the multimodal large language model are retained, and candidate images that are determined to be semantically mismatched are eliminated, thereby quickly eliminating candidate images that are semantically inconsistent with the target retrieval corpus and reducing the size of candidate images.
[0121] Based on this, in order to further improve the retrieval accuracy, the initial matching images are finely sorted and filtered according to the matching prediction probability and non-match prediction probability of each initial matching image.
[0122] Specifically, based on the matching prediction probability and non-matching prediction probability of each initial matching image, a semantic matching score is calculated for each initial matching image. This semantic matching score is used to quantitatively characterize the confidence level of the multimodal large language model in the semantic consistency between images and text; a higher score indicates a higher confidence level in the model's judgment of image-text matching.
[0123] After obtaining the semantic matching score of each initial matching image, the initial matching images are sorted in descending order of semantic matching score. A preset number of initial matching images at the top of the sorted list are selected as the final target retrieval images according to the actual retrieval needs, or the initial matching images with semantic matching scores exceeding a preset threshold are determined as target retrieval images, thereby obtaining the target retrieval image set.
[0124] By combining the aforementioned binarization judgment with refined ranking and filtering based on matching probability, we can fully utilize the fine-grained confidence information output by the multimodal large language model. While ensuring that the retrieval results are semantically consistent with the original retrieval corpus, we can further optimize the ranking quality of the retrieval results and improve the semantic matching accuracy between the final output target retrieval image and the original retrieval intent.
[0125] In one embodiment, the step of filtering each initial matching image based on the matching prediction probability and the non-matching prediction probability corresponding to each initial matching image to obtain a target retrieval image set that matches the original retrieval corpus includes: taking the ratio between the matching prediction probability and the sum of prediction probabilities corresponding to each initial matching image as the first matching score of the initial matching image, wherein the sum of prediction probabilities represents the sum of the matching prediction probability and the non-matching prediction probability corresponding to the initial matching image, and the higher the first matching score, the more the initial matching image matches the target retrieval corpus corresponding to the target candidate image; sorting the first matching scores of each initial matching image in descending order, and adding at least one of the first initial matching images to the target retrieval image set.
[0126] In this embodiment, to further improve the accuracy and ranking quality of the retrieval results, after obtaining the initial matching images determined by the multimodal large language model as matching, the first matching score is calculated based on the matching prediction probability and non-matching prediction probability corresponding to each initial matching image, so as to quantitatively characterize the confidence of the multimodal large language model in the consistency between the image and the text.
[0127] Specifically, for each initial matching image, the matching prediction probability and non-matching prediction probability output by the multimodal large language model are obtained, and the sum of the two is determined as the prediction probability sum. This prediction probability sum reflects the overall response confidence of the multimodal large language model to the image-text matching judgment task.
[0128] Based on this, the ratio between the predicted matching probability and the sum of the predicted probabilities corresponding to the initial matched image is taken as the first matching score of the initial matched image. Since both the predicted matching probability and the predicted non-matching probability are non-negative, the value of the first matching score ranges from 0 to 1.
[0129] When the predicted probability of a match is significantly higher than the predicted probability of a mismatch, the first matching score approaches 1, indicating that the multimodal large language model has a high confidence in the semantic consistency between the initial matched image and the target retrieval corpus; when the two are close, the first matching score approaches 0.5, indicating that there is uncertainty in the judgment result; when the predicted probability of a mismatch is significantly higher than the predicted probability of a match, the first matching score approaches 0, indicating that the model tends to think that the two do not match.
[0130] After calculating the first matching score for each initial matching image, the images are sorted in descending order of their first matching scores. A higher first matching score indicates a stronger semantic match between the initial matching image and the corresponding target retrieval corpus, and a higher confidence level in the multimodal large language model's matching determination. Based on this, and according to actual retrieval needs, at least one of the top-ranked initial matching images is selected from the sorted results and added to the target retrieval image set.
[0131] By using the above-mentioned filtering method based on the first matching score, the fine-grained confidence information output by the multimodal large language model can be further utilized to refine the sorting and filtering of the search results, based on the binarization judgment of the multimodal large language model. Under the premise of ensuring the semantic matching accuracy of the search results, the matching accuracy and sorting reliability between the final output target search image and the original search intent can be effectively improved.
[0132] The embodiments described above employ a two-level retrieval architecture that combines preliminary screening based on feature vectors with secondary screening using a multimodal large language model. In the preliminary screening stage, a visual-language contrastive learning model is used to map the retrieval corpus and the images to be retrieved to the same common feature space. Images that are semantically irrelevant to the retrieval corpus are quickly excluded through cross-modal similarity calculation, which significantly reduces the size of the image set to be retrieved and effectively reduces the computational overhead of subsequent processing stages. This avoids the massive computational resource consumption caused by directly calling the multimodal large language model from the entire image library.
[0133] Furthermore, based on the initial screening, this application introduces a multimodal large language model to perform refined image-text consistency judgment on the target candidate images and their corresponding target retrieval corpora. Leveraging its superior deep semantic understanding and cross-modal reasoning capabilities compared to conventional vision-language pre-trained models, the multimodal large language model can accurately determine semantically ambiguous samples that are difficult to distinguish in the initial screening stage, effectively eliminating candidate images that do not semantically match the original retrieval corpus, and significantly improving the accuracy of the retrieval results.
[0134] Furthermore, this application constructs a retrieval corpus containing both positive and negative data, and utilizes a semantic comparison mechanism of the mixed positive and negative corpus for multi-round iterative screening in the initial screening stage. This enhances the model's ability to recognize the semantic boundaries of the retrieval intent, reducing semantic confusion and mismatches, and improving the accuracy of the screening results while maintaining recall. Simultaneously, based on the multimodal large language model's determination of a match, a fine-grained semantic matching score is calculated using the model's output match prediction probability and non-match prediction probability. This score is then used to refine the ranking and screening of the retrieval results, effectively optimizing the final output ranking quality while ensuring semantic consistency of the retrieval results.
[0135] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0136] To implement the above-mentioned image and text retrieval method, this application also proposes an image and text retrieval device, for details please refer to [link / reference needed]. Figure 2 , Figure 2 This is a schematic diagram of an embodiment of the image and text retrieval device provided in this application.
[0137] The image and text retrieval device 400 of this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.
[0138] The processor 41, memory 42, and input / output device 43 are respectively connected to the bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the image and text retrieval method described in the above embodiment.
[0139] In this embodiment, processor 41 can also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 41 can be any conventional processor.
[0140] This application also provides a computer storage medium; please refer to the following: Figure 3 , Figure 3 This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61, which, when executed by a processor, is used to implement the image and text retrieval method of the above embodiment.
[0141] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0142] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for image and text retrieval, characterized in that, The image and text retrieval method includes: Obtain a retrieval corpus and a set of images to be retrieved, wherein the retrieval corpus includes several retrieval data, and the retrieval data is either the original retrieval data or data rewritten based on the original retrieval data; Based on the text feature vector of the retrieval corpus and the image feature vector of each image to be retrieved in the image set to be retrieved, the image set to be retrieved is filtered to obtain the target candidate image set and the target retrieval corpus corresponding to each target candidate image in the target candidate image set; Each target candidate image in the target candidate image set and its corresponding target retrieval corpus are input into a multimodal large language model to obtain the matching prediction result of each target candidate image for the target retrieval corpus. The target candidate image set is filtered based on the matching prediction results of each target candidate image to obtain a target retrieval image set that matches the original retrieval corpus.
2. The image and text retrieval method according to claim 1, characterized in that, The matching prediction result is determined based on the matching prediction probability and the non-matching prediction probability between the target candidate image and the corresponding target retrieval corpus; The step of filtering the target candidate image set based on the matching prediction results of each target candidate image to obtain a target retrieval image set that matches the original retrieval corpus includes: The matching prediction result is represented as the target candidate image that matches the target retrieval corpus, and determined as the initial matching image; Based on the matching prediction probability and the non-matching prediction probability corresponding to each of the initial matching images, the initial matching images are filtered to obtain a target retrieval image set that matches the original retrieval corpus.
3. The image and text retrieval method according to claim 2, characterized in that, The step of filtering each of the initial matching images based on the matching prediction probability and the non-matching prediction probability corresponding to each initial matching image to obtain a target retrieval image set that matches the original retrieval corpus includes: The ratio between the predicted matching probability and the sum of predicted probabilities corresponding to the initial matching image is used as the first matching score of the initial matching image, wherein the sum of predicted probabilities represents the sum of the predicted matching probability and the predicted non-matching probability corresponding to the initial matching image. The higher the first matching score, the more the initial matching image matches the target retrieval corpus corresponding to the target candidate image. The first matching scores of each of the initial matching images are sorted in descending order, and at least one of the first initial matching images is selected and added to the target retrieval image set.
4. The image and text retrieval method according to claim 1, characterized in that, The retrieval corpus is either a positive corpus or a mixed positive and negative corpus. Obtaining the positive corpus includes: The original retrieval corpus is forward rewritten to generate at least one forward rewritten retrieval corpus, wherein the retrieval intent of the forward rewritten retrieval corpus is the same as the retrieval intent of the original retrieval corpus. Using the original retrieval corpus and the forward-rewritten retrieval corpus, a forward corpus set is obtained; Obtaining the positive and negative mixed corpus includes: After obtaining at least one positively rewritten retrieval corpus of the original retrieval corpus, at least one corpus to be rewritten is negatively rewritten to obtain at least one negatively rewritten retrieval corpus, wherein the corpus to be rewritten is either the original retrieval corpus or the positively rewritten retrieval corpus, and the retrieval intent of the negatively rewritten retrieval corpus is different from the retrieval intent of the original retrieval corpus. The original retrieval corpus, the positively rewritten retrieval corpus, and at least one negatively rewritten retrieval corpus are used to form the positive-negative mixed corpus set.
5. The image and text retrieval method according to claim 4, characterized in that, The forward rewriting includes at least one of the following: syntactic structure transformation, reference resolution and reconstruction, synonym replacement of at least some words in the original retrieval corpus, and standardized rewriting of colloquial expressions in the original retrieval corpus. The negative rewriting includes at least one of the following: replacing attribute words in the retrieval corpus with other attribute words in the same attribute domain; replacing action verbs, spatial relation words or logical relation words in the retrieval corpus with action verbs, spatial relation words or logical relation words that are semantically different or have reversed relations; and swapping attribute words or action verbs corresponding to different subjects in the retrieval corpus.
6. The image and text retrieval method according to claim 1 or 4, characterized in that, The retrieval corpus has at least one; The step of filtering the image set to be retrieved based on the text feature vector of the retrieval corpus and the image feature vector of each image to be retrieved in the image set to be retrieved, to obtain a target candidate image set and the target retrieval corpus corresponding to each target candidate image in the target candidate image set, includes: Select one of the aforementioned retrieval corpora as the current corpus, and based on the feature similarity between the text feature vector of the current corpus and the image feature vector of each image to be retrieved in the image to be retrieved set, filter the image to be retrieved set to obtain a new image to be retrieved set; Repeat the above steps until all the search corpus sets are used as the current corpus set, and the final set of images to be searched is used as the target candidate image set. Then, determine the target search corpus for each target candidate image. The target search corpus for each target candidate image is: the positive search corpus with the highest matching degree between the target candidate image and the last current corpus set, based on the feature similarity. The search intent of the positive search corpus is the same as the search intent of the original search corpus.
7. The image and text retrieval method according to claim 6, characterized in that, There are two retrieval corpora: a positive corpus and a positive-negative mixed corpus. The positive corpus and the positive-negative mixed corpus are used as the current corpus in sequence. The positive corpus includes the positive rewritten corpus of the original retrieval corpus, and the positive-negative mixed corpus includes the positive rewritten corpus and the negative rewritten corpus of the original retrieval corpus.
8. The image and text retrieval method according to claim 6, characterized in that, The method of filtering the image set to obtain a new image set to be retrieved based on the feature similarity between the text feature vector of the current corpus and the image feature vector of each image in the image set to be retrieved includes: Calculate the feature similarity between the image feature vector of each image to be retrieved in the image set to be retrieved and the text feature vector of each corpus in the current corpus; For each of the images to be retrieved, based on the feature similarity between the image to be retrieved and each retrieval corpus, the matching retrieval corpus with the highest degree of matching with the image to be retrieved is selected from the current corpus set; Based on the feature similarity between the image to be retrieved and the matching retrieval corpus and / or the positive and negative attributes of the matching retrieval corpus, several images to be retrieved are selected as a new set of images to be retrieved.
9. The image and text retrieval method according to claim 8, characterized in that, The step of selecting the matching retrieval corpus with the highest degree of matching with the image to be retrieved from the current corpus set based on the feature similarity between the image to be retrieved and each retrieval corpus includes: When the current corpus is a forward corpus of the original retrieval corpus, the retrieval corpus with the highest feature similarity to the image to be retrieved is selected as the matching retrieval corpus; When the current corpus is a mixed positive and negative corpus of the original retrieval corpus, the feature similarity between the image to be retrieved and each of the retrieval corpora is normalized based on a preset temperature coefficient to obtain the matching confidence between the image to be retrieved and each of the retrieval corpora. The retrieval corpus with the highest matching confidence between the image to be retrieved is selected as the matching retrieval corpus. And / or, the step of selecting several images as a new set of images to be retrieved based on the feature similarity between the image to be retrieved and the matching retrieval corpus and / or the positive or negative attributes of the matching retrieval corpus includes: When the current corpus is a positive corpus of the original retrieval corpus, the feature similarity between the image to be retrieved and the matching retrieval corpus is used as the second matching score of the image to be retrieved. The higher the second matching score, the more closely the image to be retrieved matches the corresponding retrieval corpus. The second matching scores of each image to be retrieved are sorted in descending order, and a preset number of images to be retrieved at the top of the sorted list are added to a new set of images to be retrieved. If the current corpus is a mixed positive and negative corpus of the original retrieval corpus, in response to the matching retrieval corpus of the image to be retrieved being a positive retrieval corpus of the original retrieval corpus, the image to be retrieved is added to a new set of images to be retrieved.
10. A text and image retrieval device, characterized in that, The image and text retrieval device includes a memory and a processor, wherein the memory is coupled to the processor; The memory is used to store program data, and the processor is used to execute the program data to implement the image and text retrieval method according to any one of claims 1 to 9.
11. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the image and text retrieval method as described in any one of claims 1 to 9.
