A method, apparatus, device and medium for searching images
By combining semantic feature vectors and image feature vectors in image search, the problem of low image search accuracy in existing technologies is solved, and high-precision image search under multi-attribute text information is achieved.
Patent Information
- Application Number
- CN202611426003.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies suffer from low image search accuracy, especially when the text information description attributes increase, leading to a decrease in accuracy due to search generalization, and the limited range of specific target recognition.
By using the semantic feature vector of the known target corresponding to each image in the preset database and the first text feature vector containing the attribute information of the target to be searched, the filter image that matches the first text feature vector is determined, and the image feature vector is used for accurate retrieval, thus avoiding the generalization of large model search.
It achieves high-precision image search under diverse textual information description attributes, improves the accuracy and scope of the search, and avoids the decrease in accuracy caused by generalization of large model search.
Smart Images

Figure CN123178669A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device and medium for searching images. Background Technology
[0002] In the current field of video data recognition and retrieval, the main methods for searching for images corresponding to a target include: I. A method for object recognition and search based on a trained large-scale model. The search accuracy of this method depends on the content and quantity of the sample data. During subsequent target searches, textual information describing the target is input into the trained large-scale model. The model compares the feature vector corresponding to the textual information with the feature vectors of each image stored in the database, selecting images with similar feature vectors. While this method can recognize multiple targets, as the attributes describing the target in the textual information increase, the large-scale model becomes more generalized during target searches, leading to lower search accuracy.
[0003] II. A method for target attribute feature extraction, target recognition, and search based on deep learning algorithms. This method pre-extracts attribute feature vectors for specific targets and stores them in a database. During subsequent target search, it first extracts the attribute feature vectors from the text information describing the target, then compares these vectors with those in the database to identify perfectly matching targets and their corresponding images. However, this method can only identify specific targets, thus limiting its scope. In other words, this method suffers from limitations in target selection and low search accuracy.
[0004] Therefore, there is an urgent need for a high-precision image search method. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for searching images, which addresses the problem of low image search accuracy in the prior art.
[0006] In a first aspect, embodiments of this application provide a method for searching images, the method comprising: Based on text information containing attribute information of the target to be searched, a first text feature vector is determined; based on the semantic feature vector of the known target corresponding to each image stored in the preset database, a filter image matching the first text feature vector is determined. The first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database (excluding the selected image) is determined, and the other image corresponding to the highest first similarity is determined as the image containing the target to be searched.
[0007] In one possible implementation, the semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to that image; The step of determining the selected image that matches the first text feature vector based on the semantic feature vector of each image stored in a preset database includes: Based on the second text feature vector of the known target corresponding to each image stored in the preset database, and the second similarity of the first text feature vector, the maximum second similarity is determined; If the maximum second similarity is greater than the first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
[0008] In one possible implementation, the method further includes: The first text feature vector is used to update the second text feature vector corresponding to the filtered image already saved in the preset database.
[0009] In one possible implementation, the semantic feature vector includes a large model feature vector, wherein the large model feature vector of a known target corresponding to any image is obtained by semantic understanding of the image based on a large language model; The method further includes: If the maximum second similarity is not greater than the first preset threshold, then based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with the third similarity greater than the second preset threshold is determined; and based on each second image and the corresponding third similarity, the filter image is determined.
[0010] In one possible implementation, determining the selected images based on each second image and its corresponding third similarity includes: For each second image, the large model feature vector corresponding to the second image is used to calculate the fourth similarity with the large model feature vector corresponding to each other second image, and the second images with the fourth similarity greater than the third preset threshold are divided into the same group. Based on the number of second images in each group, the second image corresponding to the third largest model feature vector with the highest similarity among the largest groups is selected as the screening image.
[0011] In one possible implementation, before determining the second image corresponding to the large model feature vector whose third similarity is greater than a second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the method further includes: Each first attribute of the target to be searched in the text information is determined; for each first attribute, according to the second attribute set of known targets corresponding to each image stored in the preset database, each second attribute set containing the first attribute is determined, and for each second attribute set, a third image corresponding to the second attribute set is determined; wherein, the second attribute set includes at least one attribute; Based on the large model feature vector of the known target corresponding to each image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold is determined as follows: Based on the large model feature vector of the known target corresponding to each third image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than the second preset threshold is determined.
[0012] In one possible implementation, determining each first attribute of the target to be searched in the text information includes: Determine whether a first preset text matching the text information exists in the preset language database; If so, then based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, determine the default attribute set corresponding to the first preset text, and determine each attribute in the default attribute set as each first attribute of the target in the text information; If not, the text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0013] Secondly, embodiments of this application provide an apparatus for searching images, the apparatus comprising: The determination module is used to determine a first text feature vector based on text information containing attribute information of the target to be searched; and to determine a filter image that matches the first text feature vector based on the semantic feature vector of the known target corresponding to each image stored in a preset database. The processing module is used to determine the first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database other than the selected image, and to determine the other image corresponding to the highest first similarity as the image containing the target to be searched.
[0014] The semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to that image; In one possible implementation, the determining module is specifically used to determine the maximum second similarity based on the second text feature vector of the known target corresponding to each image stored in the preset database and the second similarity of the first text feature vector; if the maximum second similarity is greater than a first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
[0015] In one possible implementation, the processing module is further configured to update the second text feature vector corresponding to the matched filtered image stored in the preset database using the first text feature vector.
[0016] The semantic feature vector includes a large model feature vector, wherein the large model feature vector of a known target corresponding to any image is obtained based on the semantic understanding of the image using a large language model. In one possible implementation, the determining module is further configured to, if the maximum second similarity is not greater than the first preset threshold, determine the second image corresponding to the large model feature vector whose third similarity is greater than the second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector; and determine the filter image based on each second image and the corresponding third similarity.
[0017] In one possible implementation, the determining module is specifically used to perform a fourth similarity calculation on the large model feature vector corresponding to each second image and the large model feature vector corresponding to each other second image, and to divide the second images with the fourth similarity greater than a third preset threshold into the same group; based on the number of second images in each group, the second image corresponding to the large model feature vector with the highest third similarity among the most numerous images is selected as the screening image.
[0018] In one possible implementation, the determining module is further configured to determine each first attribute of the target to be searched in the text information; for each first attribute, based on the second attribute set of known targets corresponding to each image stored in a preset database, determine each second attribute set containing the first attribute, and for each second attribute set, determine the third image corresponding to the second attribute set; wherein, the second attribute set includes at least one attribute; determining the second image corresponding to the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector includes: determining the second image corresponding to the large model feature vector of the known target corresponding to each third image stored in the preset database and the third similarity of the first text feature vector.
[0019] In one possible implementation, the determining module is specifically used to determine whether a first preset text matching the text information exists in a preset language database; if so, then based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, the default attribute set corresponding to the first preset text is determined, and each attribute in the default attribute set is determined as each first attribute of the target in the text information; if not, then the text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0020] Thirdly, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory is used to store program instructions, and the processor is used to execute the computer program stored in the memory to implement the steps of any of the methods described above for searching images.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above for searching images.
[0022] Fifthly, embodiments of this application provide a computer program product comprising: computer program code, which, when executed on a computer, causes the computer to perform the steps of any of the methods described above for searching images.
[0023] In this embodiment, by using the semantic feature vector of the known target corresponding to each image in the preset database, and the first text feature vector corresponding to the text information containing the attribute information of the target to be searched, a filter image matching the first text feature vector is determined. That is, through semantic search, the search based on the attribute information in the text information is transformed into an image-based search, avoiding the problem of many restrictions on the target when using attribute features for search. Subsequently, for the filter image, the first similarity between the image feature vector corresponding to the filter image and the image feature vectors corresponding to other images in the preset database other than the filter image is determined, and the other image corresponding to the highest first similarity is determined as the image containing the target to be searched. Thus, by using image search, the problems of large model search generalization and low search accuracy when searching for images corresponding to the target are avoided. Attached Figure Description
[0024] 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 accompanying 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.
[0025] Figure 1 This is a schematic diagram illustrating a method for searching images provided in an embodiment of this application; Figure 2 A schematic diagram of target analysis provided for an embodiment of this application; Figure 3 A binding example diagram provided for an embodiment of this application; Figure 4 This is a schematic diagram illustrating the overall process of an image search method provided in an embodiment of this application; Figure 5 A schematic diagram of a device structure for searching images provided in an embodiment of this application; Figure 6 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0026] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0027] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0028] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0029] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0030] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0031] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0032] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
[0033] Example 1: Figure 1 This application provides a schematic diagram of a method for searching images, which includes the following steps: S101: Determine the first text feature vector based on the text information containing the attribute information of the target to be searched.
[0034] The image search method provided in this application is applied to an electronic device, which may be a computer (PC), server, etc.
[0035] The attribute information of the target to be searched refers to the semantic information describing the target's own characteristics, state, or behavior, used for precise searching, such as "red clothes," "black pants," "riding an electric scooter," etc. The target can be a person, vehicle, animal, etc.
[0036] The text information of the attribute information of the target to be searched refers to the information that the searched image needs to meet the conditions. For example, the text information can be "a person riding an electric bike wearing red clothes and black pants".
[0037] The first text feature vector is the digital semantic feature vector that transforms text information into a digital semantic feature vector, which is the foundation for feature vector search.
[0038] The electronic device inputs text information containing attribute information of the target to be searched into a preset large language model to obtain the first text feature vector of the text information. The large language model can be an existing bag-of-words model, an existing static word embedding model, etc.
[0039] S102: Based on the semantic feature vector of the known target corresponding to each image stored in the preset database, determine the filter image that matches the first text feature vector.
[0040] A preset database stores at least one image containing a known target. These images can be: images captured by a front-end camera connected to an electronic device after intelligently identifying the target; or images obtained by the electronic device periodically extracting frames from video frames captured by the front-end camera. This involves analyzing the video source data from the front-end camera, performing object detection on the first frame to identify targets, and then matting out each target to obtain an image containing that target. For subsequent non-first-frame images obtained through frame extraction, these images are compared with adjacent previous frames to identify differences, detect targets corresponding to these differences, and then matte out each target to obtain an image containing that target. The comparison of non-first-frame images with adjacent previous frames to identify differences is existing technology and will not be elaborated further.
[0041] Figure 2 A schematic diagram of target analysis provided for an embodiment of this application, such as Figure 2 The left image shown illustrates how an electronic device extracts frames from a video captured by a front-end camera to obtain the first frame image. From this first frame, target analysis is performed to detect target A, such as the person in the left image. Figure 2The right image shown is the second frame image obtained by the electronic device after extracting frames from the video frames captured by the front-end camera. The second frame image is compared with the first frame image, i.e., a difference analysis is performed to identify the difference between the second frame image and the first frame image as the region where the target B is located. The target B in the image corresponding to the difference is detected, for example, the car in the right image. The image containing the target B is then cut out, reducing the identification and storage of duplicate targets.
[0042] In this embodiment, the preset database stores not only images containing known targets, but also semantic feature vectors of the known targets corresponding to the images. These semantic feature vectors represent the semantic content of the corresponding targets in the image. This semantic content may include one or more of the following: target category, target features, target state, the scene in which the target is located, and the positional relationship between targets. The semantic feature vectors of the known targets can be obtained by the electronic device after acquiring an image or text information containing known targets and inputting that image or text information into a preset large language model.
[0043] In one possible implementation, if the front-end camera has the function of extracting the semantic feature vector of the known target corresponding to the image and the function of image matting, that is, the front-end camera has a large built-in model, then the front-end camera can perform image matting for each target in the acquired image to obtain an image containing the target; and directly use the pre-built large model to extract the semantic feature vector of the known target corresponding to the image containing the target, and send the image containing the target and the corresponding semantic feature vector of the known target to an electronic device for storage.
[0044] Based on the semantic feature vectors of known targets corresponding to each image stored in the preset database, the filter images that match the first text feature vector are determined. Specifically, for the semantic feature vectors of known targets corresponding to each image stored in the preset database, the semantic similarity between the semantic feature vector and the first text feature vector is determined. Then, based on each semantic similarity, the matching filter image is determined. For example, the image corresponding to the highest semantic similarity can be selected as the matching filter image.
[0045] The process of determining the selected image that matches the first text feature vector based on the semantic feature vector of the known target corresponding to each image stored in the preset database can also be called semantic retrieval.
[0046] S103: Determine the first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database other than the selected image, and determine the other image corresponding to the highest first similarity as the image containing the target to be searched.
[0047] In this embodiment, the preset database stores not only images containing known targets and semantic feature vectors of the known targets corresponding to the images, but also image feature vectors corresponding to the images. These image feature vectors represent the content of the image, i.e., the key visual information of the image. The content of the image may include texture details, color distribution, contour shape, edge distribution, the relative positions of targets in the image, etc. The image feature vectors corresponding to the images are obtained by the electronic device after acquiring the image and inputting it into a preset large model.
[0048] For the selected image, the image feature vector corresponding to the selected image is obtained from the preset database. Then, the first similarity between the image feature vector and the image feature vectors of other images stored in the preset database is determined. The other images refer to images in the preset database other than the selected image. The other image with the highest first similarity is determined as the image containing the target to be searched.
[0049] In other words, based on the selected filter image in step 102, also known as result N, the image feature vector corresponding to the filter image is obtained. The image feature vector is then compared with the image feature vectors corresponding to other images stored in the preset database, except for the filter image, to obtain the image that best matches the filter image. Since the image feature vector focuses on the local texture or edge of the target and has strong invariance to transformations such as rotation and scaling, it is suitable for determining whether two targets are the same physical object. Therefore, the search accuracy is higher, thereby achieving accurate retrieval of image feature vectors through generalized search of a large model.
[0050] In one possible implementation, for a determined image containing the target to be searched, the image is bound to the text information to generate a search tag, and the search tag, image, and text information are stored in the bound database accordingly. Subsequently, the image can be searched directly through the search tag to achieve fast and accurate multi-tag retrieval.
[0051] In this embodiment, by using the semantic feature vector of the known target corresponding to each image in the preset database, and the first text feature vector corresponding to the text information containing the attribute information of the target to be searched, a filter image matching the first text feature vector is determined. That is, through semantic search, the search based on the attribute information in the text information is transformed into an image-based search, avoiding the problem of many restrictions on the target when using attribute features for search. Subsequently, for the filter image, the first similarity between the image feature vector corresponding to the filter image and the image feature vectors corresponding to other images in the preset database other than the filter image is determined, and the other image corresponding to the highest first similarity is determined as the image containing the target to be searched. Thus, by using image search, the problems of large model search generalization and low search accuracy when searching for images corresponding to the target are avoided.
[0052] Example 2: To achieve fast retrieval, in this embodiment of the application, the semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to the image; The step of determining the selected image that matches the first text feature vector based on the semantic feature vector of each image stored in a preset database includes: Based on the second text feature vector of the known target corresponding to each image stored in the preset database, and the second similarity of the first text feature vector, the maximum second similarity is determined; If the maximum second similarity is greater than the first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
[0053] In this embodiment of the application, the semantic feature vector of the known target corresponding to each image stored in the preset database includes a second text feature vector.
[0054] The second text feature vector is determined based on the historical text information corresponding to the image. That is, during the historical image search process, after the electronic device determines the matching filter image based on the input historical text information, it will also bind the text feature vector corresponding to the historical text information to the matching filter image and save it in the preset database. In other words, in the preset database, for the matching filter image, the text feature vector corresponding to the historical text information is saved, which is the second text feature vector.
[0055] When determining the selected image that matches the first text feature vector, the electronic device determines the second similarity between the first text feature vector and the second text feature vector of the known target corresponding to each image stored in the preset database and the first text feature vector obtained in step 101, and determines the maximum second similarity.
[0056] If the maximum second similarity is greater than the first preset threshold, it proves that the preset database stores the first text feature vector, that is, the text information corresponding to the first text feature vector has been searched before this search task, or it can also be understood that the text information corresponding to the first text feature vector has not been input into the electronic device for image search for the first time. Therefore, the first image corresponding to the second text feature vector with the maximum second similarity can be directly determined as the filter image. The first preset threshold can be set according to actual needs. For example, to ensure high matching accuracy, it can be set to 99%, 98%, etc.
[0057] In other words, this application embodiment compares the first text feature vector of the input text information with the second text feature vector in the preset database through text information search. For each second text feature vector, the second similarity between the first text feature vector and the second text feature vector is determined. If the largest second similarity is greater than the first preset threshold, the first image corresponding to the second text feature vector matched in the preset database is used as the filtering image, thereby directly performing accurate retrieval of subsequent image feature vectors and realizing fast memory retrieval.
[0058] For example, if the text information containing the attribute information of the target to be searched is "delivery person of food delivery software M", and the preset database stores the second text feature vector corresponding to "delivery person of food delivery software M", and the first text feature vector of the text information has the highest second similarity with the second text feature vector, and the second similarity is greater than the first preset threshold, then the first image corresponding to the second text feature vector in the preset database is automatically used as the filtering image.
[0059] In this embodiment of the application, after the electronic device determines the filter image that matches the first text feature vector, it will also update the second text feature vector corresponding to the filter image. Specifically, the first text feature vector is used to update the second text feature vector corresponding to the filter image that is already stored in the preset database.
[0060] This can be achieved by replacing the second text feature vector corresponding to the selected image already saved in the preset database with the first text feature vector; or by adding the first text feature vector as the second text feature vector corresponding to the selected image already saved in the preset database.
[0061] In other words, after determining the filter image, the first text feature vector is locked to the filter image. This can be understood as saving the first text feature vector corresponding to the filter image in a preset database for quick retrieval when searching for duplicate text information in the future.
[0062] In one possible implementation, text information can be bound to a filter image. That is, the text information is saved in a preset database corresponding to the filter image. For example, if the text information is "deliveryman in blue clothes" and the filter image is M, then the text information "deliveryman in blue clothes" is saved in the preset database corresponding to the filter image M. This binding of text information and image and saving it in the preset database speeds up the search process. Figure 3 A binding example diagram is provided for an embodiment of this application, such as... Figure 3 As shown, in the first search, the text information is "a person in a suit," and the final filtered image is the third image from the left. This text information is then linked to the image and saved in a preset database. Subsequent searches will directly retrieve the filtered image if the user enters the text information "a person in a suit," resulting in faster search speeds.
[0063] In this embodiment, based on the second text feature vector of each image corresponding to a known target in the preset database and the first text feature vector corresponding to the input text information, the second similarity between the first text feature vector and the second text feature vector is calculated. When the maximum second similarity is greater than the first preset threshold, it proves that the first text feature vector is stored in the preset database, that is, the text information is not being input into the electronic device for image search for the first time. At this time, the first image corresponding to the second text feature vector with the maximum second similarity is directly determined as the filter image, thereby achieving fast search.
[0064] In order to accurately determine the images to be selected, in this embodiment of the application, the semantic feature vector includes a large model feature vector, wherein the large model feature vector of the known target corresponding to any image is obtained by semantic understanding of the image based on a large language model; The method further includes: If the maximum second similarity is not greater than the first preset threshold, then based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with the third similarity greater than the second preset threshold is determined; and based on each second image and the corresponding third similarity, the filter image is determined.
[0065] The semantic feature vectors of known targets corresponding to each image stored in the pre-set database also include large model feature vectors.
[0066] Among them, the large model feature vector is obtained by semantic understanding of the image based on the large language model. That is, after the electronic device acquires the image, it inputs the image into the preset large language model to obtain the large model feature vector corresponding to the image; when saving the image, the large model feature vector of the image is also saved.
[0067] In this embodiment, if the maximum second similarity is not greater than the first preset threshold, it proves that the first text feature vector does not exist in the preset database. That is, the text information corresponding to the first text feature vector has not been searched before this search task, or it can be understood that the text information corresponding to the first text feature vector is being input into the electronic device for the first time to search for images. In order to accurately determine the selected images, the electronic device can determine the third similarity between the first text feature vector and the large model feature vector of the known target corresponding to each image stored in the preset database, based on the large model feature vector of the known target corresponding to each image stored in the preset database and the first text feature vector. It can also determine the large model feature vector with a third similarity greater than the second preset threshold, and the second image corresponding to the large model feature vector. In other words, by performing a large model feature vector search, the second image with a third similarity greater than the second preset threshold with the first text feature vector is determined. The second preset threshold can be set according to actual needs.
[0068] For example, the second preset threshold is set to 80%. Based on the large model feature vector of the known target corresponding to each image and the first text feature vector stored in the preset database, the third similarity between the first text feature vector and the large model feature vector of the known target corresponding to each image is determined. For example, if the third similarity between the large model feature vector of the known target corresponding to image A1 and the first text feature vector is 85%, since 85% > 80%, then image A1 is determined to be the second image.
[0069] The electronic device determines the selected images based on each second image and its corresponding third similarity. Specifically, for each second image, the large model feature vector corresponding to the second image is used to calculate a fourth similarity with the large model feature vectors corresponding to each other second image, and the second images whose fourth similarity is greater than a third preset threshold are grouped together. Based on the number of second images in each group, the second image corresponding to the third largest model feature vector with the highest similarity among the largest groups is selected as the screening image.
[0070] For example, suppose the third preset threshold is set to 90%; the determined second images are A1, A2, B1, B2, B3, and B4, where the third similarity between the large model feature vector of A1 and the first text feature vector is 85%, the third similarity between the large model feature vector of A2 and the first text feature vector is 90%, the third similarity between the large model feature vector of B1 and the first text feature vector is 95%, the third similarity between the large model feature vector of B2 and the first text feature vector is 99%, the third similarity between the large model feature vector of B3 and the first text feature vector is 90%, and the third similarity between the large model feature vector of B4 and the first text feature vector is 85%.
[0071] For each second image, the electronic device performs a fourth similarity calculation on the large model feature vector corresponding to the second image and the large model feature vector corresponding to each other second image. The fourth similarity of the second image with each other second image is obtained. The specific values of the fourth similarity of each second image with each other second image are shown in Table 1. The corresponding values are just examples.
[0072]
[0073] For the second image A1, since the fourth similarity between A2 and A1 is 98% > the third preset threshold of 90%, A1 and A2 are divided into the same group, and it can be determined that the number of second images in this group is 2. For the second image A2, since the fourth similarity between A1 and A2 is 98% > the third preset threshold of 90%, A1 and A2 are divided into the same group, and it can be determined that the number of second images in this group is 2. For the second image B1, since the fourth similarity between B2 and B1 is 97% > the third preset threshold of 90%, the fourth similarity between B3 and B1 is 94% > the third preset threshold of 90%, and the fourth similarity between B4 and B1 is 95% > the third preset threshold of 90%, B1 is grouped with B2, B3, and B4, and it can be determined that the number of second images in this group is 4. For the second image B2, since the fourth similarity between B1 and B2 is 97% > the third preset threshold of 90%, B1 and B2 are grouped together, and it can be determined that the number of second images in this group is 2. For the second image B3, since the fourth similarity between B1 and B3 is 94% > the third preset threshold of 90%, and the fourth similarity between B4 and B3 is 96% > the third preset threshold of 90%, B3 is grouped with B1 and B4, and it can be determined that the number of second images in this group is 3. For the second image B4, since the fourth similarity between B1 and B4 is 95% > the third preset threshold of 90%, and the fourth similarity between B3 and B4 is 96% > the third preset threshold of 90%, B4 is grouped with B1 and B3, that is, the number of this group is 3. As shown above, the number of second images in the same group is the largest, which is 4. In this group, the third similarity between the large model feature vector of B1 and the first text feature vector is 95%, the third similarity between the large model feature vector of B2 and the first text feature vector is 99%, the third similarity between the large model feature vector of B3 and the first text feature vector is 90%, and the third similarity between the large model feature vector of B4 and the first text feature vector is 85%. Since 99% > 95% > 90% > 85%, the second image B2 is selected as the screening image.
[0074] In one possible implementation, the second image corresponding to the largest third similarity can be determined directly based on the third similarity between the large model feature vector of each second image and the first text feature vector, and this second image can be determined as the screening image.
[0075] In one possible implementation, all the second images can be displayed on the front-end user interface of the electronic device in descending order of third similarity, allowing the user to select and filter images.
[0076] In this embodiment, for cases where the first text feature vector does not exist in the preset database, i.e., when the text information corresponding to the first text feature vector is being input into the electronic device for the first time to search for images, the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold is determined based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector; and based on each second image and the corresponding third similarity, the filter image is determined, thereby adaptively and accurately determining the filter image, thus ensuring the basis for subsequent searches of images containing the target to be searched.
[0077] Example 3: To improve the accuracy of the selected second image, based on the above embodiments, before determining the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the method further includes: Each first attribute of the target to be searched in the text information is determined; for each first attribute, according to the second attribute set of known targets corresponding to each image stored in the preset database, each second attribute set containing the first attribute is determined, and for each second attribute set, a third image corresponding to the second attribute set is determined; wherein, the second attribute set includes at least one attribute; Based on the large model feature vector of the known target corresponding to each image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold is determined as follows: Based on the large model feature vector of the known target corresponding to each third image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than the second preset threshold is determined.
[0078] For text information containing attribute information of the target to be searched, this text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information. For example, if the text information containing attribute information of the target to be searched is "a person wearing red clothes and black pants riding an electric scooter", the first attributes determined by the attribute extraction model are "red clothes", "black pants", "riding an electric scooter", and "person". The pre-trained attribute extraction model is trained based on multiple sample data, where each sample data includes text information and the different attributes contained in that text information.
[0079] In this embodiment of the application, in addition to storing images containing known targets, semantic feature vectors of known targets corresponding to images, and image feature vectors corresponding to images, the preset database also stores a second attribute set of known targets corresponding to each image. The second attribute set includes at least one attribute. For example, the second attribute set of known targets corresponding to image 1 includes attributes such as "person"; the second attribute set of known targets corresponding to image 2 includes attributes such as "person", "riding an electric bicycle", and "yellow clothes".
[0080] For each determined first attribute, based on the set of second attributes of known targets corresponding to each image stored in the preset database, each set of second attributes containing the first attribute is determined, and for each set of second attributes, the corresponding third image is determined. In other words, all third images corresponding to the set of second attributes containing the first attribute in the preset database are filtered out.
[0081] For example, if the first attribute is "person", the second attribute set of the known target corresponding to image 1 includes attributes such as "person"; the second attribute set of the known target corresponding to image 2 includes attributes such as "person", "riding an electric bicycle", and "yellow clothes". Then, for the case where the first attribute is "person", the attribute set containing "person" is determined to be the second attribute set corresponding to image 1 and image 2, and image 1 and image 2 are determined to be the third image.
[0082] This can be understood as follows: a user enters text information containing attribute information of the target to be searched into the search interface of an electronic device. The electronic device then inputs this text information into a pre-trained attribute extraction model for attribute recognition and extraction, extracting the first attribute. For example, if the text information is "a person riding an electric scooter wearing red clothes and black pants", the electronic device extracts the first attribute as "red clothes, black pants, riding an electric scooter". Subsequently, for each first attribute, a precise initial screening is performed based on that first attribute to select all second attribute sets containing that first attribute from a preset database. For each selected second attribute set, the corresponding third image is marked for subsequent further screening of images containing the target to be searched, thereby reducing the target search range.
[0083] Subsequently, when determining the second image through large model feature vector retrieval, the second image corresponding to the large model feature vector of the known target corresponding to each third image is determined based on the third similarity of the first text feature vector and the third similarity of the large model feature vector with a third similarity greater than the second preset threshold. This enables the large model feature vector retrieval to be performed on the basis of attribute retrieval, making the target search more accurate.
[0084] In this embodiment, the first attribute in the text information is matched with the second attribute set of the known target corresponding to each image stored in the preset database to initially filter out the image containing the target with the first attribute, i.e., the third image, thereby reducing the target search range. Then, based on the large model feature vector of the known target corresponding to each third image stored in the preset database and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with the third similarity greater than the second preset threshold is determined. That is, a second filtering is performed on the basis of attribute filtering, thereby improving the accuracy of the filtered second image.
[0085] To quickly determine the first attribute in the text information, based on the above embodiments of this application, determining each first attribute of the target to be searched in the text information includes: Determine whether a first preset text matching the text information exists in the preset language database; If so, then based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, determine the default attribute set corresponding to the first preset text, and determine each attribute in the default attribute set as each first attribute of the target in the text information; If not, the text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0086] In this embodiment, a pre-defined language database is provided to store preset text and the corresponding default attribute set. The default attribute set contains at least one attribute. For example, the preset text is "food delivery platform A deliveryman," and the corresponding default attribute set is "yellow clothes, riding an electric scooter, person."
[0087] Based on the text information and preset texts in the preset language database, it is determined whether there is a first preset text matching the text information in the preset language database. Specifically, for each preset text in the preset language database, the text similarity between the preset text and the text information is calculated. It is then determined whether the maximum text similarity is greater than a preset threshold. If so, it is determined that there is a first preset text matching the text information in the preset language database, and the preset text corresponding to the maximum text similarity is determined as the first preset text. If not, it is determined that there is no first preset text matching the text information in the preset language database.
[0088] If a first preset text matching the text information exists in the preset language database, the default attribute set corresponding to the first preset text is determined according to the preset text and the default attribute set corresponding to the preset text stored in the preset language database, and each attribute in the default attribute set is determined as each first attribute of the target in the text information.
[0089] If there is no first preset text matching the text information in the preset language database, the text information is input into the pre-trained attribute extraction model to determine each first attribute of the target in the text information, which is the specific content described above, and will not be repeated here.
[0090] In one possible implementation, if the electronic device has weak computing power and does not support large-scale model systems or devices, the large-scale model system can be set up on a cloud central server. The electronic device reports text information containing attribute information of the target to be searched to the cloud central server. The cloud central server uses a pre-trained attribute extraction large model to determine each first attribute of the target in the text information, that is, to decompose the text information into multiple attributes. For example, the text information "a person wearing white clothes and black pants" is decomposed into three attributes: "white clothes", "black pants", and "person". In addition, the cloud central server can also use a preset large language model to determine the first text feature vector corresponding to the text information. The first text feature vector and each first attribute of the target to be searched contained in the text information are sent to the electronic device, thereby enabling non-large-scale model devices to search images. That is, for existing devices that do not support large-scale models, the task of extracting text feature vectors and attributes of text information is given to the cloud central server, which determines the first text feature vector and first attribute of the text information.
[0091] In one possible implementation, if the text information is input into a pre-trained attribute extraction large model and each first attribute of the target in the text information is not determined, then it is also possible to directly determine the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, that is, to directly perform large model feature vector retrieval.
[0092] In other words, a pre-set language database is established, which includes preset text and a default attribute set corresponding to the preset text. The text information containing the target to be searched is matched with the preset text in the pre-set language database. If the match is successful, each attribute in the default attribute set is determined as the first attribute of the target in the text information. If the match fails, the text information is input into a pre-trained attribute extraction model to determine the first attribute of the target in the text information. In one possible implementation, if the pre-trained attribute extraction model does not extract the first attribute, the feature vector search of the model is performed directly.
[0093] In this embodiment, a preset language database is used to store preset text and the default attribute set corresponding to the preset text. If a first preset text matching the text information exists in the preset language database, the first attribute corresponding to the text information is directly determined, thereby achieving rapid determination of the first attribute of the text information. Simultaneously, for text information that may not explicitly contain attribute information, a preset default attribute set can also be used to ensure attribute determination, thereby enabling image search.
[0094] Example 4: Figure 4 This is a schematic diagram of the overall process of a method for searching images provided in an embodiment of this application. The process includes the following steps: S401: Determine the first text feature vector based on the text information containing the attribute information of the target to be searched.
[0095] S402: Based on the second text feature vector of the known target corresponding to each image stored in the preset database, and the second similarity of the first text feature vector, determine the maximum second similarity; if the maximum second similarity is greater than the first preset threshold, then execute S403; if the maximum second similarity is not greater than the first preset threshold, then execute S404.
[0096] S403: Determine the first image corresponding to the second text feature vector with the highest second similarity as the filter image, and execute S410.
[0097] S404: Determine whether a first preset text matching the text information exists in the preset language database; if yes, execute S405; if no, execute S406.
[0098] S405: Based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, determine the default attribute set corresponding to the first preset text, and determine each attribute in the default attribute set as the first attribute of the target in the text information, and execute S407.
[0099] S406: Input the text information into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0100] S407: For each first attribute, based on the second attribute set of the known target corresponding to each image stored in the preset database, determine each second attribute set containing the first attribute, and for each second attribute set, determine the third image corresponding to the second attribute set; wherein, the second attribute set includes at least one attribute.
[0101] S408: Based on the large model feature vector of the known target corresponding to each third image stored in the preset database, and the third similarity of the first text feature vector, determine the second image corresponding to the large model feature vector whose third similarity is greater than the second preset threshold.
[0102] S409: Determine the selection images based on each second image and its corresponding third similarity.
[0103] S410: Determine the first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database, excluding the selected image, and determine the other image corresponding to the highest first similarity as the image containing the target to be searched.
[0104] In this embodiment, the advantages of attribute search, large model feature vector search, and image feature vector search are combined. The first attribute is extracted from the text information using a large model. Attribute search is performed first to accurately narrow the search range and achieve initial screening of the target. Then, a second large model feature vector search is performed on the search results to obtain relatively accurate search results. After determining the selected image, the image feature vector of the selected image is used to achieve accurate search of image feature vectors, thereby improving the search accuracy of text information. At the same time, it avoids the problems of large model search having high generalization strength, insufficient search accuracy, and many restrictions on attribute feature retrieval targets.
[0105] Example 5
[0106] Based on the same technical concept and the above embodiments, this application provides an image search device. Figure 5 Please refer to the schematic diagram of a device structure for searching images provided in this application embodiment. Figure 5 The device includes: The determining module 501 is used to determine a first text feature vector based on text information containing attribute information of the target to be searched; and to determine a filter image that matches the first text feature vector based on the semantic feature vector of the known target corresponding to each image stored in a preset database. Processing module 502 is used to determine the first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database other than the selected image, and to determine the other image corresponding to the highest first similarity as the image containing the target to be searched.
[0107] The semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to that image; In one possible implementation, the determining module 501 is specifically used to determine the maximum second similarity based on the second text feature vector of the known target corresponding to each image stored in the preset database and the second similarity of the first text feature vector; if the maximum second similarity is greater than a first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
[0108] In one possible implementation, the processing module 502 is further configured to update the second text feature vector corresponding to the matched filtered image stored in the preset database using the first text feature vector.
[0109] The semantic feature vector includes a large model feature vector, wherein the large model feature vector of a known target corresponding to any image is obtained based on the semantic understanding of the image using a large language model. In one possible implementation, the determining module 501 is further configured to, if the maximum second similarity is not greater than the first preset threshold, determine the second image corresponding to the large model feature vector whose third similarity is greater than the second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector; and determine the filter image based on each second image and the corresponding third similarity.
[0110] In one possible implementation, the determining module 501 is specifically used to perform a fourth similarity calculation on the large model feature vector corresponding to each second image and the large model feature vector corresponding to each other second image, and to divide the second images with the fourth similarity greater than a third preset threshold into the same group; based on the number of second images in each group, the second image corresponding to the large model feature vector with the highest third similarity among the most numerous images is selected as the screening image.
[0111] In one possible implementation, the determining module 501 is further configured to determine each first attribute of the target to be searched in the text information; for each first attribute, based on the second attribute set of known targets corresponding to each image stored in a preset database, determine each second attribute set containing the first attribute, and for each second attribute set, determine the third image corresponding to the second attribute set; wherein, the second attribute set includes at least one attribute; determining the second image corresponding to the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector includes: determining the second image corresponding to the large model feature vector of the known target corresponding to each third image stored in the preset database and the third similarity of the first text feature vector.
[0112] In one possible implementation, the determining module 501 is specifically used to determine whether there is a first preset text matching the text information in the preset language database; if so, then according to the preset text and the default attribute set corresponding to the preset text stored in the preset language database, the default attribute set corresponding to the first preset text is determined, and each attribute in the default attribute set is determined as each first attribute of the target in the text information; if not, then the text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0113] Example 6: Based on the same technical concept, this application also provides an electronic device. Figure 6 This application provides a schematic diagram of an electronic device structure, such as... Figure 6 As shown, it includes: processor 601, communication interface 602, memory 603 and communication bus 604, wherein processor 601, communication interface 602 and memory 603 communicate with each other through communication bus 604. The memory 603 stores a computer program, which, when executed by the processor 601, causes the processor 601 to perform the following steps: Based on text information containing attribute information of the target to be searched, a first text feature vector is determined; based on the semantic feature vector of the known target corresponding to each image stored in the preset database, a filter image matching the first text feature vector is determined. The first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database (excluding the selected image) is determined, and the other image corresponding to the highest first similarity is determined as the image containing the target to be searched.
[0114] The semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to that image; In one possible implementation, the processor 601 is specifically configured to determine the maximum second similarity based on the second text feature vector of the known target corresponding to each image stored in the preset database and the second similarity of the first text feature vector; if the maximum second similarity is greater than a first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
[0115] In one possible implementation, the processor 601 is further configured to update the second text feature vector corresponding to the matched filtered image stored in the preset database using the first text feature vector.
[0116] The semantic feature vector includes a large model feature vector, wherein the large model feature vector of a known target corresponding to any image is obtained based on the semantic understanding of the image using a large language model. In one possible implementation, the processor 601 is further configured to, if the maximum second similarity is not greater than the first preset threshold, determine the second image corresponding to the large model feature vector whose third similarity is greater than the second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector; and determine the filter image based on each second image and the corresponding third similarity.
[0117] In one possible implementation, the processor 601 is specifically configured to, for each second image, perform a fourth similarity calculation on the large model feature vector corresponding to the second image and the large model feature vector corresponding to each other second image, and divide the second images whose fourth similarity is greater than a third preset threshold into the same group; based on the number of second images in each group, select the second image corresponding to the large model feature vector with the highest third similarity among the most numerous images as the filtered image.
[0118] In one possible implementation, the processor 601 is further configured to determine each first attribute of the target to be searched in the text information; for each first attribute, based on the second attribute set of known targets corresponding to each image stored in a preset database, determine each second attribute set containing the first attribute, and for each second attribute set, determine the third image corresponding to the second attribute set; wherein, the second attribute set includes at least one attribute; determining the second image corresponding to the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector includes: determining the second image corresponding to the large model feature vector of the known target corresponding to each third image stored in the preset database and the third similarity of the first text feature vector.
[0119] In one possible implementation, the processor 601 is specifically configured to determine whether a first preset text matching the text information exists in a preset language database; if so, it determines the default attribute set corresponding to the first preset text based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, and determines each attribute in the default attribute set as each first attribute of the target in the text information; if not, it inputs the text information into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
[0120] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0121] The communication interface 602 is used for communication between the above-mentioned electronic device and other devices.
[0122] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0123] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0124] Example 7: Based on the same technical concept, embodiments of this application provide a computer-readable storage medium storing a computer program executable by a processor. When the program runs on the processor, it causes the processor to execute any of the image search methods described above. Since the principle by which the above-described computer-readable storage medium solves the problem is similar to that of an image search method, the implementation of the above-described computer-readable storage medium can be referred to the implementation of the method, and repeated details will not be elaborated further.
[0125] The aforementioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in an electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.
[0126] Based on the same technical concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the above-described methods for searching images. Since the principle by which the above-described computer program product solves the problem is similar to that of the method for searching images, the implementation of the above-described computer program product can be referred to the implementation of the method, and repeated details will not be described again.
[0127] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0128] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0131] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for searching images, characterized in that, The method includes: Based on text information containing attribute information of the target to be searched, a first text feature vector is determined; based on the semantic feature vector of the known target corresponding to each image stored in the preset database, a filter image matching the first text feature vector is determined. The first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database (excluding the selected image) is determined, and the other image corresponding to the highest first similarity is determined as the image containing the target to be searched.
2. The method according to claim 1, characterized in that, The semantic feature vector includes a second text feature vector, wherein the second text feature vector of a known target corresponding to any image is determined based on the historical text information corresponding to that image; The step of determining the selected image that matches the first text feature vector based on the semantic feature vector of each image stored in a preset database includes: Based on the second text feature vector of the known target corresponding to each image stored in the preset database, and the second similarity of the first text feature vector, the maximum second similarity is determined; If the maximum second similarity is greater than the first preset threshold, then the first image corresponding to the second text feature vector corresponding to the maximum second similarity is determined as the selected image.
3. The method according to claim 2, characterized in that, The method further includes: The first text feature vector is used to update the second text feature vector corresponding to the filtered image already saved in the preset database.
4. The method according to claim 2, characterized in that, The semantic feature vector includes a large model feature vector, wherein the large model feature vector of a known target corresponding to any image is obtained based on the semantic understanding of the image using a large language model. The method further includes: If the maximum second similarity is not greater than the first preset threshold, then based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with the third similarity greater than the second preset threshold is determined; and based on each second image and the corresponding third similarity, the filter image is determined.
5. The method according to claim 4, characterized in that, The process of determining the images to be selected based on each second image and its corresponding third similarity includes: For each second image, the large model feature vector corresponding to the second image is used to calculate the fourth similarity with the large model feature vector corresponding to each other second image, and the second images with the fourth similarity greater than the third preset threshold are divided into the same group. Based on the number of second images in each group, the second image corresponding to the third largest model feature vector with the highest similarity among the largest groups is selected as the screening image.
6. The method according to claim 4, characterized in that, Before determining the second image corresponding to the large model feature vector whose third similarity is greater than a second preset threshold based on the large model feature vector of the known target corresponding to each image stored in the preset database and the third similarity of the first text feature vector, the method further includes: Each first attribute of the target to be searched in the text information is determined; for each first attribute, according to the second attribute set of known targets corresponding to each image stored in the preset database, each second attribute set containing the first attribute is determined, and for each second attribute set, a third image corresponding to the second attribute set is determined; wherein, the second attribute set includes at least one attribute; Based on the large model feature vector of the known target corresponding to each image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than a second preset threshold is determined as follows: Based on the large model feature vector of the known target corresponding to each third image stored in the preset database, and the third similarity of the first text feature vector, the second image corresponding to the large model feature vector with a third similarity greater than the second preset threshold is determined.
7. The method according to claim 6, characterized in that, Determining each first attribute of the target to be searched in the text information includes: Determine whether a first preset text matching the text information exists in the preset language database; If so, then based on the preset text and the default attribute set corresponding to the preset text stored in the preset language database, determine the default attribute set corresponding to the first preset text, and determine each attribute in the default attribute set as each first attribute of the target in the text information; If not, the text information is input into a pre-trained attribute extraction model to determine each first attribute of the target in the text information.
8. An apparatus for searching images, characterized in that, The device includes: The determination module is used to determine a first text feature vector based on text information containing attribute information of the target to be searched; and to determine a filter image that matches the first text feature vector based on the semantic feature vector of the known target corresponding to each image stored in a preset database. The processing module is used to determine the first similarity between the image feature vector corresponding to the selected image and the image feature vectors corresponding to other images stored in the preset database other than the selected image, and to determine the other image corresponding to the highest first similarity as the image containing the target to be searched.
9. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory stores a computer program that, when executed by the processor, causes the processor to perform the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by a processor, which, when run on the processor, causes the processor to perform the method according to any one of claims 1-7.
