Image retrieval method and device

Optimizing the image retrieval model through user tags solves the problem of poor adaptability of image retrieval scenes in the existing technology, improves the accuracy and generalization ability of image retrieval, and simplifies the update process of the feature extraction model.

CN112445928BActive Publication Date: 2024-09-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910820612.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-29
Publication Date
2024-09-20
Estimated Expiration
2039-08-29

AI Technical Summary

Technical Problem

Existing image retrieval technology has deficiencies in scene adaptability, resulting in low image retrieval accuracy, long update cycles for feature extraction models, large data requirements, and poor generalization capabilities.

Method used

By obtaining the image to be retrieved, using the initial image retrieval model to perform image retrieval, and optimizing the image retrieval model according to the user's marking operation, we can obtain updated images with higher matching degrees and improve the scene adaptability and accuracy of image retrieval.

Benefits of technology

It improves the accuracy and scene adaptability of image retrieval, reduces the update cycle of feature extraction models, reduces data requirements, and improves the generalization ability of image retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112445928B
    Figure CN112445928B
Patent Text Reader

Abstract

The present application provides an image retrieval method and device, which can be applied to, but not limited to, image retrieval application scenarios such as face recognition, pedestrian re-identification, and vehicle re-identification. The method may include: obtaining an image to be retrieved, the image to be retrieved contains a preset object; performing image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; obtaining at least one marked first feedback image based on a user's marking operation on at least one initial image; and performing image retrieval again on the image to be retrieved using a second image retrieval model based on at least one first feedback image to obtain at least one updated image. In the present application, by learning the user's retrieval preference for the current image, the image retrieval has better scene adaptability and improves the image retrieval accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision, and in particular to an image retrieval method and device. Background Art

[0002] Image retrieval is a basic technology in the field of computer vision and can be widely used in search engines, e-commerce, surveillance and security, etc. The implementation process of image retrieval mainly includes the following three aspects: on the one hand, the analysis and transformation of user needs to form questions that can be retrieved from the index database; on the other hand, the collection and processing of image resources, feature extraction, analysis and indexing, and the establishment of an image index database; the last aspect is to calculate the similarity between the user's question and the record in the index database according to the similarity algorithm, extract the records that meet the threshold as the result, and output them in descending order of similarity. Commonly used image retrieval methods include text-based image retrieval (TBIR) method, content-based image retrieval (CBIR) method and image retrieval method without initial input, which is also called mental image retrieval (MIR) method.

[0003] Usually, when performing image retrieval on an image to be retrieved, first, the feature extraction model is used to extract features from the image to be retrieved, and then the similarity model is used to measure the similarity of the extracted image features, and images similar to the image to be retrieved are retrieved from multiple template images. However, since image retrieval is mostly implemented by empirical and fixed image retrieval models, the scene adaptability of image retrieval is poor. Summary of the invention

[0004] The present application provides an image retrieval method and device to provide better scene adaptability.

[0005] In the first aspect, the present application provides an image retrieval method, which can be applied to an image retrieval device and is not limited to the application of the image retrieval device. The image retrieval device can be applied to image retrieval-related application scenarios such as face recognition, pedestrian re-identification, and vehicle re-identification. The method may include: obtaining an image to be retrieved, the image to be retrieved contains a preset object; performing image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; obtaining at least one marked first feedback image according to a user's marking operation on at least one initial image, the marking operation is used to indicate whether an image contains or does not contain a preset object; according to at least one first feedback image, performing image retrieval again on the image to be retrieved using a second image retrieval model to obtain at least one updated image, the second image retrieval model is an optimized model of the first image retrieval model, and the matching degree between at least one updated image and the image to be retrieved is higher than the matching degree between at least one initial image and the image to be retrieved.

[0006] In this application, by learning the user's retrieval preference for the current image, the image retrieval model is optimized, so that the image search engine has better scene adaptability and improves the image retrieval accuracy.

[0007] Based on the first aspect, in some possible implementations, image retrieval is performed again on the image to be retrieved based on at least one first feedback image to obtain at least one updated image, including: optimizing a first image retrieval model based on at least one first feedback image and the image to be retrieved to obtain a second image retrieval model; and performing image retrieval on the image to be retrieved using the second image retrieval model to obtain at least one updated image.

[0008] Based on the first aspect, in some possible implementations, a first image retrieval model is optimized according to at least one first feedback image and an image to be retrieved to obtain a second image retrieval model, including: optimizing a first matching module in the first image retrieval model according to at least one first feedback image and an image to be retrieved to obtain a second matching module in the second image retrieval model; and / or optimizing a first feature extraction module in the first image retrieval model according to at least one first feedback image and an image to be retrieved to obtain a second feature extraction module in the second image retrieval model.

[0009] Based on the first aspect, in some possible implementations, a first matching module in a first image retrieval model is optimized according to at least one first feedback image and an image to be retrieved to obtain a second matching module in a second image retrieval model, including: extracting features from at least one first feedback image and an image to be retrieved to obtain image features of the first feedback image and image features of the image to be retrieved; training the first matching module according to image features of at least one first feedback image and image features of the image to be retrieved to obtain a second matching module that satisfies the first objective function.

[0010] Based on the first aspect, in some possible implementations, the step of training the first matching module is implemented by the following formula:

[0011]

[0012] Wherein, W is the first matching module l W Parameters, W∈R n×n , the constraints of the formula are: the first matching module and ξ≥0, p i is the i-th image feature of the image to be retrieved, p j is the jth image feature of the image to be retrieved, is the i-th image feature of the first feedback image marked by the user and containing the same preset object as the image to be retrieved, The i-th image feature of the first feedback image marked by the user that does not contain the same preset object as the image to be retrieved, where i and j are both positive integers.

[0013] Based on the first aspect, in some possible implementations, a first feature extraction module in a first image retrieval model is optimized according to at least one first feedback image and an image to be retrieved to obtain a second feature extraction module in a second image retrieval model, including: determining multiple second feedback images according to multiple labeling operations of the user on at least one initial image; and training the first feature extraction module according to the multiple second feedback images and the image to be retrieved to obtain a second feature extraction module that satisfies the second objective function.

[0014] Based on the first aspect, in some possible implementations, the step of training the first feature extraction module is implemented by the following formula:

[0015]

[0016] Among them, f θ is the first feature extraction module, θ is the first feature extraction module f θ, θ0 is the initial value of θ, I is the image to be retrieved, i is the number of times the user performs retrieval, i is a positive integer, is the second feedback image marked by the user during the i-th retrieval that contains the same object as the image to be retrieved, is the second feedback image marked by the user during the i-th retrieval that does not contain the same preset object as the image to be retrieved, and the matching module l W The matching module in the current first image retrieval model.

[0017] Based on the first aspect, in some possible implementations, image retrieval is performed on the image to be retrieved using a second image retrieval model to obtain at least one updated image, including: extracting features from the image to be retrieved to obtain image features of the image to be retrieved; using a second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determining at least one updated image from the template image based on the similarity.

[0018] Based on the first aspect, in some possible implementations, performing image retrieval on the image to be retrieved using a second image retrieval model to obtain at least one updated image, including: performing feature extraction on the image to be retrieved using a second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; calculating the similarity between the image features of the image to be retrieved and the template features of the template image; and determining at least one updated image from the template image based on the similarity.

[0019] Based on the first aspect, in some possible implementations, image retrieval is performed on the image to be retrieved using a second image retrieval model to obtain at least one updated image, including: extracting features of the image to be retrieved using a second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; using a second matching module in the second image retrieval model to calculate the similarity between image features of the image to be retrieved and template features of a template image; and determining at least one updated image from the template image based on the similarity.

[0020] In a second aspect, the present application provides an image retrieval device, comprising: an interface module, used to obtain an image to be retrieved, wherein the image to be retrieved contains a preset object; a retrieval module, used to perform image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; an interaction module, used to obtain at least one marked first feedback image based on a marking operation performed by a user on at least one initial image, wherein the marking operation is used to indicate whether an image contains or does not contain the preset object; the retrieval module is also used to perform image retrieval again on the image to be retrieved using a second image retrieval model based on the at least one first feedback image to obtain at least one updated image, wherein the second image retrieval model is an optimized model of the first image retrieval model, and the degree of match between the at least one updated image and the image to be retrieved is higher than the degree of match between the at least one initial image and the image to be retrieved.

[0021] Based on the second aspect, in some possible implementations, the above-mentioned device also includes: an updating module, used to optimize the first image retrieval model according to at least one first feedback image and an image to be retrieved, to obtain a second image retrieval model; a retrieval module, specifically used to perform image retrieval on the image to be retrieved using the second image retrieval model, to obtain at least one updated image.

[0022] Based on the second aspect, in some possible implementations, the updating module is specifically used to optimize the first matching module in the first image retrieval model based on at least one first feedback image and an image to be retrieved, so as to obtain a second matching module in the second image retrieval model; and / or, to optimize the first feature extraction module in the first image retrieval model based on at least one first feedback image and an image to be retrieved, so as to obtain a second feature extraction module in the second image retrieval model.

[0023] Based on the second aspect, in some possible implementations, the updating module is specifically used to perform feature extraction on at least one first feedback image and an image to be retrieved to obtain image features of the first feedback image and image features of the image to be retrieved; and the first matching module is trained according to the image features of at least one first feedback image and the image features of the image to be retrieved to obtain a second matching module that satisfies the first objective function.

[0024] Based on the second aspect, in some possible implementations, the update module is implemented by the following formula:

[0025]

[0026] Wherein, W is the first matching module l W Parameters, W∈R n×n , the constraints of the formula are: the first matching module and ξ≥0, pi is the i-th image feature of the image to be retrieved, p j is the jth image feature of the image to be retrieved, is the i-th image feature of the first feedback image marked by the user and containing the same preset object as the image to be retrieved, The i-th image feature of the first feedback image marked by the user that does not contain the same preset object as the image to be retrieved, where i and j are both positive integers.

[0027] Based on the second aspect, in some possible implementations, the update module is specifically used to determine multiple second feedback images based on multiple marking operations of the user on at least one initial image; based on the multiple second feedback images and the image to be retrieved, the first feature extraction module is trained to obtain a second feature extraction module that satisfies the second objective function.

[0028] Based on the second aspect, in some possible implementations, the update module is implemented by the following formula:

[0029]

[0030] Among them, f θ is the first feature extraction module, θ is the first feature extraction module f θ , θ0 is the initial value of θ, I is the image to be retrieved, i is the number of times the user performs retrieval, i is a positive integer, is the second feedback image marked by the user during the i-th retrieval that contains the same object as the image to be retrieved, is the second feedback image marked by the user during the i-th retrieval that does not contain the same preset object as the image to be retrieved, and the matching module l W It is the matching module in the current first image retrieval model.

[0031] Based on the second aspect, in some possible implementations, the retrieval module is specifically used to perform feature extraction on the image to be retrieved to obtain image features of the image to be retrieved; use the second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0032] Based on the second aspect, in some possible implementations, the retrieval module is specifically used to perform feature extraction on the image to be retrieved using a second feature extraction module in a second image retrieval model to obtain image features of the image to be retrieved; calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0033] Based on the second aspect, in some possible implementations, the retrieval module is specifically used to perform feature extraction on the image to be retrieved using a second feature extraction module in a second image retrieval model to obtain image features of the image to be retrieved; use a second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0034] In a third aspect, the present application provides an image retrieval device, which may include: a processor and a communication interface; the communication interface is coupled to the processor, and the processor obtains the image to be retrieved through the communication interface; the processor is used to support the image retrieval device to implement the image retrieval method as described in the first aspect or any possible implementation method of the first aspect.

[0035] Based on the third aspect, in some possible implementations, the image retrieval device further includes: a memory for storing computer execution instructions and data necessary for the image retrieval device; when the image retrieval device is running, the processor executes the computer execution instructions stored in the memory so that the image retrieval device performs the image retrieval method as described in the first aspect or any possible implementation of the first aspect.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, the image retrieval method as described in the first aspect or any possible implementation of the first aspect is executed.

[0037] In a fifth aspect, the present application provides a computer program or a computer program product. When the computer program or the computer program product is executed on a computer, the computer implements the image retrieval method as described in the first aspect or any possible implementation of the first aspect.

[0038] It should be understood that the second to fifth aspects of the present application are consistent with the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0040] Figure 1 A schematic diagram of the structure of an image retrieval device in an embodiment of the present application;

[0041] Figure 2 The process diagram of the image retrieval method in the embodiment of the present application is as follows: Figure 1 ;

[0042] Figure 3 A schematic diagram of the process of obtaining an initial image in an embodiment of the present application;

[0043] Figure 4 This is a schematic diagram of a marking interface of a first feedback image in an embodiment of the present application;

[0044] Figure 5 This is a schematic diagram of a process for updating the first matching module in an embodiment of the present application;

[0045] Figure 6 A schematic diagram of a process for updating a first feature extraction module in an embodiment of the present application;

[0046] Figure 7 A schematic diagram of a process for obtaining an updated image in an embodiment of the present application;

[0047] Figure 8 It is a structural schematic diagram of the image retrieval device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. In the following description, reference is made to the drawings that form a part of the present application and show specific aspects of the embodiments of the present application or specific aspects of the embodiments of the present application in an illustrative manner. It should be understood that the embodiments of the present application can be used in other aspects and may include structural or logical changes not depicted in the drawings. For example, it should be understood that the disclosure of the described method in conjunction with the disclosed content can also be applied to the corresponding device or system for performing the method, and vice versa. For example, if one or more specific method steps are described, the corresponding device may include one or more units such as functional units to perform the one or more method steps described (for example, one unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the drawings. On the other hand, for example, if a specific device is described based on one or more units such as functional units, the corresponding method may include a step to perform the functionality of one or more units (for example, one step performs the functionality of one or more units, or multiple steps, each of which performs the functionality of one or more units in multiple units), even if such one or more steps are not explicitly described or illustrated in the drawings. Further, it should be understood that, unless explicitly stated otherwise, features of the various exemplary embodiments and / or aspects described herein may be combined with each other.

[0049] In video surveillance, pedestrian re-identification, vehicle re-identification, and face recognition can all be summarized as: image matching problems across cameras, locations, and time. Potential factors affecting this problem include illumination, viewing angle, occlusion, etc. Image retrieval algorithms must be able to distinguish different targets with similar appearances, and also be able to recognize the same target under different imaging conditions. Therefore, image retrieval algorithms are required to have high generalization capabilities and scene adaptability.

[0050] Usually, when performing image retrieval on an image to be retrieved, first, a feature extraction model is used to extract features of the image to be retrieved, and then a similarity model is used to measure the similarity of the extracted image features, and images similar to the image to be retrieved are retrieved from multiple template images. However, since most similarity models are empirical and fixed models (such as similarity models based on the Euclidean distance algorithm, similarity models based on the cosine angle similarity algorithm, etc.), the scene adaptability of image retrieval is poor.

[0051] Furthermore, since the feature extraction model is obtained through offline training with a large amount of data, once the feature extraction model is deployed, if you want to update the feature extraction model, you need to collect a large amount of data again for offline training. However, the cost of collecting large-scale data is high and it cannot cover all actual application scenarios. Moreover, after the amount of collected data reaches a certain scale, the improvement of algorithm capabilities brought about by continuing to increase the amount of data will also reach a bottleneck, resulting in the update of feature extraction models with problems such as long update cycle, large data demand, and poor generalization ability.

[0052] In order to solve the above problems, an embodiment of the present application provides an image retrieval method, which can be applied to, but is not limited to, an image retrieval device, and the image retrieval device can be applied to, but is not limited to, image retrieval-related application scenarios such as face recognition, pedestrian re-identification, and vehicle re-identification. Figure 1 This is a schematic diagram of the structure of the image retrieval device in the embodiment of the present application, see Figure 1 As shown by the solid line in the middle, the image retrieval device 100 may include: an interface module 101, a retrieval module 102 and an interaction module 103; wherein the interface module 101 is used to obtain an image to be retrieved; the retrieval module 102 is used to perform image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; the interaction module 103 is used to obtain at least one marked first feedback image based on a marking operation of the user on at least one initial image; the retrieval module 102 is also used to perform image retrieval again on the image to be retrieved using a second image retrieval model based on the at least one first feedback image to obtain at least one updated image.

[0053] In some possible implementations, see Figure 1As shown by the middle dotted line, the image retrieval device 100 may further include: an updating module 104; the updating module 104 may be configured to optimize the first image retrieval model according to at least one first feedback image and an image to be retrieved, so as to obtain a second image retrieval model.

[0054] In an embodiment of the present application, the interface module 101 may include an application programming interface (API) in a browser for uploading images, so that the user can input the image to be retrieved through the browser; or, the interface module 101 can also be an interface module for reading images from other applications in an application, so as to read images in the program files of the application from other applications. For example, the interface module 101 can read a specific image from the "Album" application, or the interface module 101 can also read a specific image from images sent by other users received by the communication application; these specific images can be selected by the user, or can be obtained by the application according to preset selection rules. Optionally, the selection rules can be images with the latest creation date, images taken in "portrait" mode, etc., which are not specifically limited in the embodiment of the present application.

[0055] In addition, the interaction module 103 may include an input interface for communicating with an input device (such as a touch screen, keyboard, mouse, microphone, etc.) for receiving the above-mentioned user input marking operation. Optionally, the interaction module 103 can be but is not limited to being implemented by an input interface circuit, an input interface module or an input interface device, and the embodiments of the present application do not make specific limitations on this.

[0056] As a possible implementation, the above-mentioned image retrieval device can be, but is not limited to, applied to image retrieval devices, such as smart phones, video monitors, access control, parking gates, etc. The image retrieval device can be physically combined with the above-mentioned input device, that is, the image retrieval device and the input device are the same device; or, the image retrieval device can be physically separated from the above-mentioned input device, and the image retrieval device and the input device can communicate by wire or wirelessly, which is not specifically limited in the embodiments of the present application.

[0057] The image retrieval method in the embodiment of the present application is described below in conjunction with the structure of the above-mentioned image retrieval device.

[0058] Figure 2 The process diagram of the image retrieval method in the embodiment of the present application is as follows: Figure 1 , see Figure 2 As shown, the image retrieval method may include:

[0059] S201: Acquire the image to be retrieved;

[0060] In the embodiment of the present application, an image to be retrieved can be input into the image retrieval device to trigger the image retrieval device to perform image retrieval on the image to be retrieved. Optionally, the image retrieval device can also read a pre-stored base image (i.e., a template image) and input the base image and the image to be retrieved into the image retrieval device together. The template image can be used to measure feature similarity with the image to be retrieved, realize mutual search of image features, and complete image retrieval of the image to be retrieved.

[0061] In some possible implementations, the template image can be input into the retrieval module together with the image to be retrieved, and the first feature extraction module can be used to extract features, and then compared with the features of the image to be retrieved; or, the template image can be input into the retrieval module in advance, and the first feature extraction module can be used to complete the feature extraction, and then the template features of the template image can be stored, so that after the features of the image to be retrieved are obtained later, the template features of each template image can be read and compared, and then the image retrieval can be completed. Optionally, the image to be retrieved and the template image can also be feature extracted and compared in other ways, as long as the image retrieval can be completed, and the embodiments of the present application are not specifically limited.

[0062] As a possible implementation manner, the above-mentioned images to be retrieved and the base library images may be images containing one or more objects (ie, preset objects), and these objects may include faces, vehicles, pedestrians, animals, plants, etc.

[0063] S202: performing image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image;

[0064] In an embodiment of the present application, the retrieval module can use the first image retrieval model to retrieve the image to be retrieved. Optionally, the first image retrieval model may include two parts, one part may be a first feature extraction module, and the other part may be a first matching module. In some possible implementations, the above-mentioned first feature extraction module may be implemented using a neural network, such as a convolutional neural network (CNN). CNN is essentially an input-to-output mapping, which can learn a large number of mapping relationships between inputs and outputs without requiring any precise mathematical expressions between inputs and outputs. After collecting training samples, CNN is trained, and CNN has the mapping ability between input and output pairs. Of course, the feature extraction module can also be implemented by other image processing methods, such as scale invariant feature transform (SIFT), speeded uprobust features (SURF), local binary pattern (LBP) and other methods. CNN is only one possible implementation method, and the implementation method of the present application embodiment is not specifically limited to the implementation method of the specific module.

[0065] The first matching module can be used to calculate the degree of matching between the features of the image to be retrieved and the features of the template image, such as the distance and similarity between the features, so as to achieve image feature matching. The first matching module can be implemented based on, but not limited to, a metric function. For example, the first matching module can be a distance model based on a Euclidean distance algorithm, a similarity model based on a cosine angle similarity algorithm, a distance model based on a Manhattan distance algorithm, etc., which is not specifically limited in the embodiments of the present application.

[0066] In an embodiment of the present application, after the retrieval module obtains the image to be retrieved through the interface module, it can use the first image retrieval model to retrieve the image to be retrieved and obtain at least one initial image. The at least one initial image can be at least one template image that is most similar to the image to be retrieved in this retrieval. Optionally, the retrieval module can use the first feature extraction module to extract features from the image to be retrieved, and use the first matching module to match the extracted image features with the template features of the template image, and output the retrieval result of this image retrieval, that is, at least one initial image. For example, Figure 3 This is a schematic diagram of the process of obtaining at least one initial image in an embodiment of the present application, see Figure 3As shown, the image to be retrieved is an image including a "pug" (i.e., a preset object). The user inputs the image to be retrieved into the retrieval module through the interface module. The retrieval module uses the first feature extraction module to extract features of the image to be retrieved, and obtains image features of the image to be retrieved, i.e., features of the "pug". Then, the retrieval module uses the first matching module to measure the similarity between the features of the "pug" and the template features of the template image, and obtains at least one template image most similar to the image to be retrieved, i.e., at least one initial image. According to the accuracy of the first matching template, the at least one initial image may include a template image similar to the image to be retrieved, or may include a template image that is not similar to the image to be retrieved. It should be noted that the template image similar to the image to be retrieved may refer to a template image that contains the same preset object as the image to be retrieved, i.e., a correct retrieval result, i.e., a template image that also contains "pug", and the image that is not similar to the image to be retrieved may refer to a template image that does not contain the same preset object as the image to be retrieved, i.e., an incorrect retrieval result, i.e., a template image that does not contain "pug". The preset object may be a specific object, such as a specific person, a specific car, a specific animal, etc.

[0067] Furthermore, in the embodiments of the present application, for scenarios where the image retrieval accuracy is not required to be high, the preset objects contained in the original image may also include objects of the same category (such as identity category, species category, user attribute, vehicle category, etc.) as the objects contained in the image to be retrieved. For example, the image to be retrieved contains "Pug", and the original image may contain "Husky" which belongs to the same category of "dog" as "Pug", or the image to be retrieved contains "User A", and the original image may contain "User B" which belongs to the same category of "female user" as "User A". Optionally, depending on the different image retrieval accuracy requirements of the application scenario, there may be other situations between the objects contained in the initial image and the preset objects contained in the image to be retrieved, which are not specifically limited in the embodiments of the present application.

[0068] In the embodiment of the present application, the objects contained in the above-mentioned images may be but are not limited to faces, vehicles, pedestrians, animals and other objects in the images.

[0069] Optionally, the at least one initial image obtained by the retrieval module in S202 may be a retrieval result obtained by the retrieval module for the first retrieval of the image to be retrieved, or may be a retrieval result of the ith retrieval of the image to be retrieved by the retrieval module, where i is a positive integer.

[0070] S203: Obtaining at least one marked first feedback image according to a marking operation of the user on at least one initial image;

[0071] The user's marking operation can be used to indicate whether an image contains or does not contain the preset object in the image to be retrieved, and the marked at least one initial image is the above-mentioned at least one first feedback image. If the user's marking operation is used to mark the initial image containing the preset object, the marked at least one first feedback image may only include at least one initial image containing the preset object; if the user's marking operation is used to mark the initial image not containing the preset object, the marked at least one first feedback image may only include at least one initial image not containing the preset object; if the user's marking operation includes multiple marking operations, part of these marking operations can be used to mark the initial image containing the preset object, and another part can be used to mark the initial image not containing the preset object, and the marked at least one first feedback image can be multiple first feedback images, and part of the multiple first feedback images can include at least one initial image containing the preset object, and another part can include at least one initial image not containing the preset image. For example, the image to be retrieved contains the preset object "Pug", and the user's marking operation marks K first feedback images, where K is a positive integer greater than or equal to 1. Among them, the K (K≥1) first feedback images may include only K initial images containing "pug", and such K first feedback images may be called positive feedback; or, the K (K≥1) first feedback images may include only K initial images not containing "pug", and such K first feedback images may be called negative feedback; further, the K (K>1) first feedback images may include both M initial images containing "pug" and N initial images not containing "pug", and such K first feedback images contain both positive feedback and negative feedback, K=N+M, N and M are both positive integers greater than or equal to 1.

[0072] In the embodiment of the present application, after the retrieval module obtains at least one initial image through S202, the interactive module can output the at least one initial image to a display device such as a smart phone, a laptop computer, a desktop computer, a tablet computer or a projector through an interface module to display it to the user, and the display device can also be physically combined or separated from the above-mentioned image retrieval device. After seeing at least one initial image, the user determines at least one first feedback image in the at least one initial image that the user believes contains the same preset object and / or does not contain the same preset object as the image to be retrieved, and marks the at least one first feedback image through an input device such as a touch screen, a mouse, a keyboard, a microphone, etc.

[0073] It should be noted that the above-mentioned user marking operation may include a touch operation performed by the user on a touch screen, a selection operation performed by the user using a mouse, a voice input operation performed by the user using a microphone, etc., which is not specifically limited in the embodiment of the present application. When marking the first feedback image, the user may mark only part of the images in the template image, or may mark all the images in the template image.

[0074] For example, Figure 4 This is a schematic diagram of the marking interface of the first feedback image in the embodiment of the present application, see Figure 4 As shown, the interactive module can display at least one initial image obtained by S202 to the user on the marking interface, wherein the marking interface 400 displays template images a, b, c, d, e and f, a total of 6 template images (i.e., at least one initial image), and then the user can perform a touch operation on the touch screen, and the interactive module responds to the user's touch operation and marks the first feedback image from the template images a, b, c, d, e and f on the marking interface 400, wherein the interactive module marks "√" for images in the template images that the user believes are similar to the image to be retrieved and marks "×" for images that the user believes are not similar to the image to be retrieved. It is assumed that the first feedback images in the template images that are marked to be similar to the image to be retrieved are template images a, e and f (as shown in FIG. 1 ). Figure 4 The images marked with "√" in the figure), and the first feedback images that are not similar to the image to be retrieved among the template images a, b, c, d, e and f can also be marked as template images c and d (such as Figure 4 (images marked with “×” in the figure).

[0075] In some possible implementations, the user may also mark only the first feedback image that is similar to the image to be retrieved. For example, the user may use a mouse to perform a point-selection operation, and the interactive module responds to the user's point-selection operation and marks the first feedback image that is not similar to the image to be retrieved from the template images a, b, c, d, e, and f on the marking interface 400. The interactive module marks "√" for the image in the template image that the user considers to be similar to the image to be retrieved. Assume that the first feedback images in the template image that are marked to be similar to the image to be retrieved are the template images a, e, and f (e.g. Figure 4 Alternatively, the user may also mark only the first feedback image that is not similar to the image to be retrieved. For example, the user may input voice through a microphone, and the interactive module responds to the user's voice input and marks the first feedback image that is not similar to the image to be retrieved from the template images a, b, c, d, e and f on the marking interface 400, wherein the interactive module marks "×" for the image in the template image that the user believes is not similar to the image to be retrieved. Assume that the first feedback images in the template image that are not similar to the image to be retrieved are the template images c and d (i.e. Figure 4As a possible implementation manner, the interaction module may also use other methods to mark the first feedback image, which is not specifically limited in the embodiment of the present application.

[0076] In the embodiment of the present application, if the user is satisfied with at least one initial image obtained through S202, that is, the user believes that all template images in at least one initial image are similar to the image to be retrieved, and these template images and the image to be retrieved contain the same preset object, then the user can make no mark on at least one initial image, and the image retrieval device can output at least one initial image as the result of the image retrieval, and the process ends, completing the image retrieval of the image to be retrieved. If the user is not satisfied with at least one initial image obtained through S202, that is, the user believes that at least one initial image contains a template image that is not similar to the image to be retrieved, the user can mark the first search result, and the interactive module executes the above S203.

[0077] S204: Based on the at least one first feedback image, perform image retrieval again on the image to be retrieved using a second image retrieval model to obtain at least one updated image.

[0078] The second image retrieval model is an optimized model of the first image retrieval model, and the matching degree between at least one updated image and the image to be retrieved is higher than the matching degree between at least one initial image and the image to be retrieved.

[0079] In the embodiment of the present application, after executing S203, the interactive module can feed back the obtained at least one first feedback image to the update module, the update module optimizes the first image retrieval model according to the at least one first feedback image, and obtains the optimized second image retrieval model, and the retrieval module uses the second image retrieval model to perform image retrieval again on the image to be retrieved, and obtains at least one updated image. Since the second image retrieval model is more optimized than the first image retrieval model, the updated image obtained by the retrieval module by using the second image retrieval model will have a higher degree of match with the image to be retrieved than the initial image obtained in S202.

[0080] As a possible implementation manner, when the first feedback image fed back by the interaction module is one image, this first feedback image may be an initial image containing a preset object or an initial image not containing the preset object; and when the first feedback image fed back by the interaction module is multiple images, the multiple first feedback images may all be initial images containing the preset object, or the multiple first feedback images may all be initial images not containing the preset object, or some of the multiple first feedback images may be initial images containing the preset object, while the other parts may be initial images not containing the preset object.

[0081] Optionally, since the first image retrieval model may include a first matching module and a first feature extraction module, the update module may optimize the first matching module in the first image retrieval model according to at least one first feedback image and an image to be retrieved, to obtain a second matching module in the second image retrieval model; and / or, optimize the first feature extraction module in the first image retrieval model according to the first feedback image and the image to be retrieved, to obtain a second feature extraction module in the second image retrieval model. That is, the update module may update the first matching module or the first feature extraction module, or may update both the first matching module and the first feature extraction module. In an embodiment of the present application, the second image retrieval model may include a second matching module and / or a second feature extraction module.

[0082] The updating processes of the first matching module and the first feature extraction module are respectively introduced below.

[0083] In an embodiment of the present application, the updating process of the first matching module by the updating module may include: performing feature extraction on at least one first feedback image and an image to be retrieved to obtain image features of at least one first feedback image and image features of the image to be retrieved; training the first matching module according to the image features of at least one first feedback image and the image features of the image to be retrieved to obtain a second matching module that satisfies the first objective function.

[0084] Figure 5 This is a schematic diagram of the process of updating the first matching module in the embodiment of the present application, see Figure 5 As shown, the interaction module can send at least one first feedback image determined by S203 as a training sample to the update module, and the update module trains the first matching module. As a possible implementation, the update module first obtains the image to be retrieved from the interface module and obtains at least one first feedback image from the interaction module. Then, the update module extracts features of the image to be retrieved and the first feedback image, respectively obtaining image features of the image to be retrieved and image features of the first feedback image. Then, the update module inputs the image features of the image to be retrieved and the image features of the first feedback image as training sample features into the first matching module, and according to the first objective function, if the feature distance of the same type of image is close and the feature distance of the different types of images is far, the parameters of the first matching module are adjusted until the first objective function converges, and the second matching module, that is, the trained second matching module, is obtained. The second matching module has better scene adaptability than the first matching module. In some possible implementations, the same type of images may include images carrying the same object identifier, such as face images carrying the same identity information, vehicle images carrying the same vehicle information, and plant and animal images carrying the same species category identifier.

[0085] As a possible implementation manner, when performing feature extraction on the image to be retrieved and the first feedback image, the first feature extraction module may be used, the second feature extraction module may be used, or other feature extraction modules may be used. As long as the same feature extraction module can be used to extract the image features of the image to be retrieved and the image features of the first feedback image, the embodiment of the present application does not make any specific limitations.

[0086] In some possible implementations, the image feature of the image to be retrieved extracted by the update module can be denoted as p, p∈R n×1 , calculate the two training sample features p i and p j The distance measurement function between (used to implement the first matching module) can be recorded as S w (p i ,p j )=p i T Wp j , W∈R n×n , p i T For p i The transpose of S, i and j are both positive integers, and the update module updates S w (p i ,p j ) is adjusted to obtain the second matching module.

[0087] Optionally, the parameter W may be a bilinear transformation matrix, and the step of adjusting the parameter W by the updating module is implemented by the following formula (1):

[0088]

[0089] The constraints of formula (1) may include:

[0090] (1) And ξ≥0;

[0091] (2)

[0092] (3)

[0093] Among them, p i is the i-th image feature of the image to be retrieved, p j is the jth image feature of the image to be retrieved, is the i-th image feature of the first feedback image marked by the user and containing the same preset object as the image to be retrieved, The i-th image feature of the first feedback image marked by the user and not containing the same preset object as the image to be retrieved. The second matching module has better scene adaptability than the first matching module.

[0094] In the embodiment of the present application, the metric function used to implement the first matching module may also be other metric functions, and correspondingly, the parameters adjusted by the update module may also be other parameters, which is not specifically limited in the embodiment of the present application.

[0095] In an embodiment of the present application, the updating process of the first feature extraction module by the updating module may include: determining multiple second feedback images based on multiple marking operations of the user on at least one initial image; training the first feature extraction module based on the second feedback images and the image to be retrieved to obtain a second feature extraction module that satisfies the second objective function.

[0096] Figure 6 This is a schematic diagram of the process of updating the first feature extraction module in the embodiment of the present application, see Figure 6 As shown, after the interaction module obtains the marking operation of at least one user each time, the second feedback image marked by this marking operation can be recorded, and after the preset conditions are met, the interaction module can send the multiple second feedback images marked by the user for multiple times to the update module at one time; or, the interaction module can send the second feedback image to the update module after recording the second feedback image marked by this marking operation each time, until the preset conditions are met and the update module obtains the multiple second feedback images marked by the user for multiple times. Then, the updating module inputs the image to be retrieved and multiple second feedback images into the current first feature extraction module in the first image retrieval model (that is, the feature extraction module in the first image retrieval model during this image retrieval), and the current first feature extraction module performs feature extraction on the image to be retrieved and multiple second feedback images to obtain the image features of each second feedback image and the image features of the image to be retrieved. Next, the updating model measures the similarity between the image features of each second feedback image and the image features of the image to be retrieved, and according to the second objective function, if the feature distances extracted from images of the same type are closer and the feature distances from images of different types are farther, the parameters of the current first feature extraction module are adjusted until the second objective function converges to obtain the second feature extraction module, that is, the trained feature extraction module.

[0097] As a possible implementation manner, when performing similarity measurement on the image features of the image to be retrieved and the image features of the second feedback image, the first matching module may be used, or the second matching module may be used, or other matching modules may be used, as long as the same measurement function can be used to perform similarity measurement on the image features extracted from the image to be retrieved and the image features of the second feedback image, and the embodiments of the present application do not make specific limitations.

[0098] Optionally, the above preset condition may be after a period of time, such as one day, one week, one month, etc.; the preset condition may also be when the number of user searches reaches a certain number, such as when the number of searches reaches 3 times, 5 times, 10 times, etc.; the preset condition may also be when the number of first feedback images marked by the user reaches a certain number, such as when the number of first feedback images marked by the user reaches 10, 50, 100, etc. Of course, there may be other situations for the preset condition, which are not specifically limited in the embodiments of the present application.

[0099] Optionally, the second feedback image may include a template image that is the same as the first feedback image, or may include a template image that is different from the first feedback image, which is not specifically limited in the present application.

[0100] In some possible implementations, the step of training the first feature extraction module by the updating module can be implemented by the following formula (2):

[0101]

[0102] Among them, f θ is the first feature extraction module, θ is the first feature extraction module f θ , θ0 is the initial value of θ, I is the image to be retrieved, i is the number of times the user performs retrieval, i is a positive integer, is the second feedback image marked by the user during the i-th retrieval that contains the same object as the image to be retrieved, is the second feedback image marked by the user during the i-th retrieval that does not contain the same preset object as the image to be retrieved, and the matching module l W The matching module in the current first image retrieval model.

[0103] Optionally, the updating module may update the first feature extraction module f according to the second objective function. θ The parameter θ in is adjusted to obtain the second feature extraction module, that is, the trained feature extraction module. Compared with the first feature extraction module, the second feature extraction module has better generalization ability.

[0104] In some possible implementations, the step of training the first feature extraction module may also be implemented using other methods, which are not specifically limited in the embodiments of the present application.

[0105] It should be noted that the training process of the first matching module by the update module and the training process of the first feature extraction module are two independent processes. The update module can train the first feature extraction module during the training of the first matching module; the update module can also only train the first matching module, or only train the first feature extraction module, which is not specifically limited in the embodiments of the present application.

[0106] After the updating module retrieves the second image model through the above process, the retrieval module can perform image retrieval on the image to be retrieved using the second image retrieval model to obtain at least one updated image.

[0107] Among them, at least one initial image is not completely identical to at least one updated image, and optionally, at least one updated image has a higher degree of matching with the image to be retrieved than at least one initial image, for example, the similarity between the updated image and the image to be retrieved is greater than the similarity between the initial image and the image to be retrieved, or the feature distance between the updated image and the image to be retrieved is closer than the feature distance between the initial image and the image to be retrieved. In the embodiment of the present application, the degree of matching between the initial image or the updated image and the image to be retrieved can also be reflected by other parameters, which are not specifically limited.

[0108] In the embodiment of the present application, after the update module optimizes the first image retrieval model through the above process, it uses the second image retrieval model to perform image retrieval again on the image to be retrieved to obtain at least one updated image. Since the second image retrieval model has better generalization ability than the first image retrieval model and can adapt to various scenes, the at least one updated image has better image retrieval accuracy than the at least one initial image. For example, Figure 7 This is a schematic diagram of the process of obtaining an updated image in an embodiment of the present application, see Figure 7 As shown, the image to be retrieved is still an image including a "pug". The user inputs the image to be retrieved into the retrieval module through the interface module. The retrieval module uses the first feature extraction module or the second feature extraction module to extract features of the image to be retrieved, and obtains the image features of the image to be retrieved, that is, the features of the "pug". Then, the retrieval module uses the second matching module to measure the similarity between the features of the "pug" and the image features of the template image, and obtains three updated images that are most similar to the image to be retrieved.

[0109] As a possible implementation, since the second image retrieval model may include a second feature extraction module and / or a second matching module, after obtaining the second image retrieval model, the update module may only send the obtained second matching module to the retrieval module, so that the retrieval module can use the second matching module to measure the similarity between the image features of the image to be retrieved and the image features of the template image after extracting the image features of the image to be retrieved, determine one or more template images (i.e., at least one updated image) that are most similar to the image to be retrieved, and complete the re-retrieval of the image to be retrieved. Further, the retrieval module may also output at least one updated image and display at least one updated image to the user. The retrieved image this time will be more accurate than the retrieved image obtained by S201, and the user satisfaction will be greatly improved. If the user is satisfied with the retrieved image this time, the user may not mark the at least one template image, and the image retrieval device outputs at least one template image to complete the image retrieval; and if the user is not satisfied with the retrieved image this time, the image retrieval device repeats the above S201 to S204 until the retrieval image that satisfies the user is obtained.

[0110] In the embodiment of the present application, in the above-mentioned image retrieval method, the process of optimizing the first matching module is a short-term online learning process. By adopting short-term online learning, the current matching module is adjusted immediately, the user's retrieval preference for the current image is learned, and the current search results are optimized, so that the image retrieval device has better scene adaptability. The process of optimizing the first feature extraction module is a long-term offline learning process. By adopting long-term offline learning, the parameters of the feature extraction module are adjusted, and the user's feedback on the retrieval over a period of time is learned, the basic capabilities of the image retrieval device are optimized, and the generalization ability of the image retrieval device is improved, which is effective for each subsequent image retrieval.

[0111] Combine the following Figure 3 , Figure 4 and Figure 7 , the image retrieval method described in the above embodiment is explained with a specific example.

[0112] Assume that user A uploads an image 1 to be retrieved through the API (i.e., interface module) in the browser, and user B uploads an image 2 to be retrieved through the API (i.e., interface module) in the browser;

[0113] The first step is that the interface module inputs the image 1 to be retrieved into the retrieval module;

[0114] Step 2: The retrieval module uses the first feature extraction module to extract features of the image 1 to be retrieved, and obtains image features of the image 1 to be retrieved;

[0115] Step 3: The retrieval module obtains the image features of the template image;

[0116] Step 4: The retrieval module uses the first matching module to measure the similarity between the image features of the image to be retrieved 1 and the image features of the template image to obtain at least one initial image, such as template images a, b, c, d, e and f;

[0117] Step 5: The retrieval module inputs the template images a, b, c, d, e and f into the interaction module;

[0118] Step 6: The interactive module outputs the template images a, b, c, d, e and f to a display device (such as a touch screen of a smart phone), so that user A can mark the first feedback image that he thinks is similar to the image to be retrieved 1, namely, the template images a, e and f, by touching the touch screen;

[0119] Step 7: The interaction module obtains the touch operation of user A on the touch screen;

[0120] Optionally, the interaction module records each marking operation when the user performs the marking operation.

[0121] Step 8: The interactive module responds to the touch operation and determines the first feedback image;

[0122] Step 9: The interaction module inputs the first feedback image into the update module;

[0123] Step 10: The updating module inputs the image to be retrieved 1 and the first feedback image into the current feature extraction module for feature extraction to obtain image features of the image to be retrieved 1 and image features of the first feedback image;

[0124] Optionally, the current feature extraction module may be a first feature extraction module or a second feature extraction module;

[0125] In the ninth step, the updating module inputs the image features of the image 1 to be retrieved and the image features of the first feedback image into the first matching module for training according to the first objective function until the first objective function converges, thereby obtaining a second matching module;

[0126] Step 10: The retrieval module uses the second matching module to calculate the image features of the image to be retrieved 1 and the image features of the template image again to measure the similarity, and obtain updated images, such as template images a, e and f;

[0127] The first step to the tenth step may be repeatedly performed on the image 2 to be retrieved uploaded by user B to obtain an updated image corresponding to the image 2 to be retrieved.

[0128] Step 11: The interaction module obtains multiple touch operations of user A and user B on the touch screen from the marking operation record;

[0129] Step 12: The interactive module responds to the touch operation and determines a plurality of second feedback images;

[0130] Step 13: the interaction module inputs the plurality of second feedback images into the updating module;

[0131] Step 14: The updating module inputs the to-be-retrieved image 1, the to-be-retrieved image 2 and the plurality of second feedback images into the first feature extraction module for feature extraction, and performs training according to the second objective function until the second objective function converges, thereby obtaining a second feature extraction module;

[0132] Step 15: The retrieval module uses the second feature extraction model to perform feature extraction on the image to be retrieved 1, the image to be retrieved 2, and the plurality of second feedback images to obtain image features of the image to be retrieved 1, the image features of the image to be retrieved 2, and the image features of the plurality of second feedback images;

[0133] Step 16: The retrieval module inputs the image features of the image 1 to be retrieved, the image features of the image 2 to be retrieved, and the image features of the second feedback image into the current matching module to measure the similarity between the image features respectively, and determines one or more template images (i.e., at least one updated image) that are most similar to the images 1 and 2 to be retrieved;

[0134] Optionally, the current matching module may be a first matching module or a second matching module;

[0135] Step 17: The retrieval module outputs at least one updated image and displays it to users A and B respectively.

[0136] In the above process, steps 1 to 10 are short-term online learning processes, and steps 11 to 17 are long-term offline learning processes.

[0137] In an embodiment of the present application, the image retrieval device learns the user's retrieval preference for the current image through the above-mentioned short-term online learning process and / or long-term offline learning process, so that the image retrieval device has better scene adaptability and improves the image retrieval accuracy.

[0138] Based on the same inventive concept as the above method, an embodiment of the present application provides an image retrieval device, which can be a chip or system on chip in the image retrieval device described in the above embodiment, or a functional module in the image retrieval device for implementing the methods described in the above embodiments. The image retrieval device can implement the functions performed by the image retrieval device in the above embodiments, and the functions can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. For example, in one possible implementation, still refer to Figure 1As shown by the solid line in the middle, the image retrieval device 100 may include: an interface module 101, used to obtain an image to be retrieved, wherein the image to be retrieved contains a preset object; a retrieval module 102, used to perform image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; an interaction module 103, used to obtain at least one marked first feedback image according to a marking operation performed by a user on at least one initial image, wherein the marking operation is used to indicate whether an image contains or does not contain the preset object; the retrieval module 101 is also used to perform image retrieval again on the image to be retrieved using a second image retrieval model according to the at least one first feedback image to obtain at least one updated image, wherein the second image retrieval model is an optimized model of the first image retrieval model, and the matching degree between the at least one updated image and the image to be retrieved is higher than the matching degree between the at least one initial image and the image to be retrieved.

[0139] In some possible implementations, see Figure 1 As shown by the middle dotted line, the above-mentioned device 100 also includes: an updating module 104, which is used to optimize the first image retrieval model according to at least one first feedback image and an image to be retrieved to obtain a second image retrieval model; a retrieval module, which is specifically used to perform image retrieval on the image to be retrieved using the second image retrieval model to obtain at least one updated image.

[0140] In some possible implementations, the update module 104 is specifically used to optimize the first matching module in the first image retrieval model based on at least one first feedback image and an image to be retrieved, so as to obtain a second matching module in the second image retrieval model; and / or, to optimize the first feature extraction module in the first image retrieval model based on at least one first feedback image and an image to be retrieved, so as to obtain a second feature extraction module in the second image retrieval model.

[0141] In some possible implementations, the update module 104 is specifically used to perform feature extraction on at least one first feedback image and an image to be retrieved to obtain image features of the first feedback image and image features of the image to be retrieved; and train the first matching module according to the image features of the at least one first feedback image and the image features of the image to be retrieved to obtain a second matching module that satisfies the first objective function.

[0142] In some possible implementations, the updating module 104 may implement training of the first matching module by using the above formula (1).

[0143] In some possible implementations, the update module 104 is specifically used to determine multiple second feedback images based on multiple marking operations performed by the user on at least one initial image; and train the first feature extraction module based on the multiple second feedback images and the image to be retrieved to obtain a second feature extraction module that satisfies the second objective function.

[0144] In some possible implementations, the updating module 104 may implement training of the first feature extraction module by using the above formula (2).

[0145] In some possible implementations, the retrieval module 102 is specifically used to perform feature extraction on the image to be retrieved to obtain image features of the image to be retrieved; use the second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0146] In some possible implementations, the retrieval module 102 is specifically used to perform feature extraction on the image to be retrieved using a second feature extraction module in a second image retrieval model to obtain image features of the image to be retrieved; calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0147] In some possible implementations, the retrieval module 102 is specifically used to perform feature extraction on the image to be retrieved using a second feature extraction module in a second image retrieval model to obtain image features of the image to be retrieved; use a second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine at least one updated image from the template image based on the similarity.

[0148] It should also be noted that the specific implementation process of the interface module 101, the search module 102, the interaction module 103 and the update module 104 can be referred to in Figures 2 to 7 In the embodiment of the present application, the interface module 101 can be used to execute S201 in the above embodiment, the search module 102 can be used to execute S202 and S204 in the above embodiment, and the interaction module 103 can be used to execute S203 in the above embodiment.

[0149] The interface module mentioned in the embodiments of the present application may be an input interface, an interface circuit or an interface device, the interaction module may be an input interface, an input circuit or an input device, and the retrieval module and the update module may be one or more processors.

[0150] Based on the same inventive concept as the above method, an embodiment of the present application provides an image retrieval device, and the image retrieval device may include the image retrieval device described in the above embodiment. Figure 8 This is a schematic diagram of the structure of the image retrieval device in the embodiment of the present application, see Figure 8As shown by the solid line, the image retrieval device 800 may include: a processor 801 and a communication interface 802, wherein the communication interface 802 is coupled to the processor 801, and the processor 801 obtains the image to be retrieved through the communication interface 802; the processor 801 is used to support the image retrieval device 800 to implement the image retrieval method described in the above embodiments.

[0151] In some possible implementations, see Figure 8 As shown by the dotted line, the image retrieval device 800 also includes: a memory 803, which is used to store computer execution instructions and data necessary for the image retrieval device 800; when the image retrieval device 800 is running, the processor 801 executes the computer execution instructions stored in the memory 803, so that the image retrieval device 800 performs the image retrieval method as described in the above embodiments.

[0152] Based on the same inventive concept as the above method, an embodiment of the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a computer, they are used to execute the image retrieval method described in the above embodiments.

[0153] In a fifth aspect, the present application provides a computer program or a computer program product. When the computer program or the computer program product is executed on a computer, the computer implements the image retrieval method as described in the above embodiments.

[0154] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any communication media that facilitates the transfer of computer programs from one place to another (e.g., according to a communication protocol). In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.

[0155] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM,

[0156] ROM or other optical disk storage device, magnetic disk storage device or other magnetic storage device, flash memory or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. And, any connection is properly referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwave are used to transmit instructions from a website, server or other remote source, then the coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage medium and data storage medium do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs) and Blu-ray disks, where disks usually reproduce data magnetically, and optical disks reproduce data optically using lasers. Combinations of the above items should also be included in the scope of computer-readable media.

[0157] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.

[0158] The techniques of the present application may be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of devices for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in a codec hardware unit in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).

[0159] In the above embodiments, the description of each embodiment has different emphases. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0160] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An image retrieval method, characterized in that: The method comprises: Acquire an image to be retrieved, wherein the image to be retrieved contains a preset object; Performing image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; Obtaining at least one marked first feedback image according to a marking operation performed by a user on the at least one initial image, wherein the marking operation is used to indicate whether an image contains the preset object or not; According to the at least one first feedback image, image retrieval is performed again on the image to be retrieved using a second image retrieval model to obtain at least one updated image, wherein the second image retrieval model is an optimized model of the first image retrieval model, and the degree of matching between the at least one updated image and the image to be retrieved is higher than the degree of matching between the at least one initial image and the image to be retrieved.

2. The method according to claim 1, characterized in that The step of performing image retrieval again on the image to be retrieved according to the at least one first feedback image to obtain at least one updated image comprises: Optimizing the first image retrieval model according to the at least one first feedback image and the image to be retrieved to obtain the second image retrieval model; Perform image retrieval on the image to be retrieved using the second image retrieval model to obtain the at least one updated image.

3. The method according to claim 2, characterized in that The step of optimizing the first image retrieval model according to the at least one first feedback image and the image to be retrieved to obtain a second image retrieval model includes: According to the at least one first feedback image and the image to be retrieved, optimizing the first matching module in the first image retrieval model to obtain the second matching module in the second image retrieval model; and / or, According to the at least one first feedback image and the image to be retrieved, the first feature extraction module in the first image retrieval model is optimized to obtain the second feature extraction module in the second image retrieval model.

4. The method according to claim 3, characterized in that: The step of optimizing the first matching module in the first image retrieval model according to the at least one first feedback image and the image to be retrieved to obtain the second matching module in the second image retrieval model includes: Performing feature extraction on the at least one first feedback image and the image to be retrieved to obtain image features of the first feedback image and image features of the image to be retrieved; The first matching module is trained according to the image features of the at least one first feedback image and the image features of the image to be retrieved to obtain the second matching module that satisfies the first objective function.

5. The method according to claim 3, characterized in that: The step of optimizing the first feature extraction module in the first image retrieval model according to the at least one first feedback image and the image to be retrieved to obtain the second feature extraction module in the second image retrieval model comprises: Determining a plurality of second feedback images according to a plurality of marking operations performed by the user on the at least one initial image; The first feature extraction module is trained according to the multiple second feedback images and the image to be retrieved to obtain the second feature extraction module that satisfies a second objective function.

6. The method according to claim 4, characterized in that The step of optimizing the first feature extraction module in the first image retrieval model according to the at least one first feedback image and the image to be retrieved to obtain the second feature extraction module in the second image retrieval model comprises: Determining a plurality of second feedback images according to a plurality of marking operations performed by the user on the at least one initial image; The first feature extraction module is trained according to the multiple second feedback images and the image to be retrieved to obtain the second feature extraction module that satisfies a second objective function.

7. The method according to any one of claims 2 to 6, characterized in that: The step of performing image retrieval on the image to be retrieved using the second image retrieval model to obtain the at least one updated image comprises: Extracting features of the image to be retrieved to obtain image features of the image to be retrieved; Using the second matching module in the second image retrieval model, calculating the similarity between the image features of the image to be retrieved and the template features of the template image; According to the similarity, the at least one updated image is determined from the template image.

8. The method according to any one of claims 2 to 6, characterized in that: The step of performing image retrieval on the image to be retrieved using the second image retrieval model to obtain the at least one updated image comprises: Performing feature extraction on the image to be retrieved using a second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; Calculating the similarity between the image features of the image to be retrieved and the template features of the template image; According to the similarity, the at least one updated image is determined from the template image.

9. The method according to any one of claims 2 to 6, characterized in that: The step of performing image retrieval on the image to be retrieved using the second image retrieval model to obtain the at least one updated image comprises: Performing feature extraction on the image to be retrieved using a second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; Using the second matching module in the second image retrieval model, calculating the similarity between the image features of the image to be retrieved and the template features of the template image; According to the similarity, the at least one updated image is determined from the template image.

10. An image retrieval device, characterized in that: The device comprises: An interface module, used for acquiring an image to be retrieved, wherein the image to be retrieved contains a preset object; A retrieval module, configured to perform image retrieval on the image to be retrieved using a first image retrieval model to obtain at least one initial image; An interactive module, configured to obtain at least one marked first feedback image according to a marking operation performed by a user on the at least one initial image, wherein the marking operation is used to indicate whether an image contains the preset object or not; The retrieval module is further used to perform image retrieval again on the image to be retrieved using a second image retrieval model based on the at least one first feedback image to obtain at least one updated image, wherein the second image retrieval model is an optimized model of the first image retrieval model, and the degree of matching between the at least one updated image and the image to be retrieved is higher than the degree of matching between the at least one initial image and the image to be retrieved.

11. The device according to claim 10, characterized in that The device further includes: an updating module, configured to optimize the first image retrieval model according to the at least one first feedback image and the image to be retrieved, so as to obtain the second image retrieval model; The retrieval module is specifically configured to perform image retrieval on the image to be retrieved using the second image retrieval model to obtain the at least one updated image.

12. The device according to claim 11, characterized in that The updating module is specifically used to optimize the first matching module in the first image retrieval model according to the at least one first feedback image and the image to be retrieved, so as to obtain the second matching module in the second image retrieval model; and / or, to optimize the first feature extraction module in the first image retrieval model according to the at least one first feedback image and the image to be retrieved, so as to obtain the second feature extraction module in the second image retrieval model.

13. The device according to claim 12, characterized in that The updating module is specifically used to extract features from the at least one first feedback image and the image to be retrieved to obtain image features of the first feedback image and the image features of the image to be retrieved; and train the first matching module according to the image features of the at least one first feedback image and the image features of the image to be retrieved to obtain the second matching module that satisfies the first objective function.

14. The device according to claim 12, characterized in that The updating module is specifically used to determine multiple second feedback images according to the user's multiple marking operations on the at least one initial image; and train the first feature extraction module according to the multiple second feedback images and the image to be retrieved to obtain the second feature extraction module that satisfies the second objective function.

15. The device according to claim 13, characterized in that The updating module is specifically used to determine multiple second feedback images according to the user's multiple marking operations on the at least one initial image; and train the first feature extraction module according to the multiple second feedback images and the image to be retrieved to obtain the second feature extraction module that satisfies the second objective function.

16. The device according to any one of claims 11 to 15, characterized in that The retrieval module is specifically used to extract features from the image to be retrieved to obtain image features of the image to be retrieved; use the second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine the at least one updated image from the template image based on the similarity.

17. The device according to any one of claims 11 to 15, characterized in that The retrieval module is specifically used to perform feature extraction on the image to be retrieved using the second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine the at least one updated image from the template image based on the similarity.

18. The device according to any one of claims 11 to 15, characterized in that The retrieval module is specifically used to perform feature extraction on the image to be retrieved using the second feature extraction module in the second image retrieval model to obtain image features of the image to be retrieved; use the second matching module in the second image retrieval model to calculate the similarity between the image features of the image to be retrieved and the template features of the template image; and determine the at least one updated image from the template image based on the similarity.

19. An image retrieval device, characterized in that: include: Processor and communication interface; The communication interface is coupled to the processor, and the processor obtains the image to be retrieved through the communication interface; The processor is used to support the image retrieval device to implement the image retrieval method according to any one of claims 1 to 9.

20. The image retrieval device according to claim 19, characterized in that: The image retrieval device also includes: a memory for storing computer-executable instructions and data necessary for the image retrieval device; when the image retrieval device is running, the processor executes the computer-executable instructions stored in the memory so that the image retrieval device performs the image retrieval method as described in any one of claims 1 to 9.