A similar image retrieval method and device

The overall and detailed feature information of the target image is extracted through the edge detection method and Mask RCNN model, and the similarity is calculated based on the preset retrieval weight, which solves the problem of retrieval result deviation in the existing technology and improves the distinction and recognition effect of similar images.

CN110413824BActive Publication Date: 2024-09-06PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing similar image retrieval methods ignore non-salient features such as brand trademarks and text, resulting in large deviations between retrieval results and user needs.

Method used

The edge detection method is used to extract the overall feature information of the target image, combined with the Mask RCNN model to extract detailed feature information, and the retrieval similarity is calculated based on the overall similarity, detail similarity and preset retrieval weight, and the test items are displayed from large to small according to the similarity. picture.

Benefits of technology

By increasing the impact of detail similarity on retrieval similarity, detailed conflicts of similar objects can be distinguished, the discrimination of similar pictures can be improved, and the deviation between retrieval results and user needs can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110413824B
    Figure CN110413824B
Patent Text Reader

Abstract

The present invention discloses a method and device for retrieving similar images, which relates to the field of image processing technology and is invented to solve the problem of large deviation between the retrieval results and the user's retrieval requirements in the prior art. The method mainly includes: extracting the overall feature information of the target image according to the edge detection method; calculating the overall similarity between the image to be tested and the target image according to the overall feature information; extracting the detail feature information of the target image according to the MaskRCNN model; calculating the detail similarity between the image to be tested and the target image according to the detail feature information; calculating the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and the preset retrieval weight; displaying the image to be tested corresponding to the retrieval similarity in descending order of the numerical value of the retrieval similarity. The present invention is mainly applied to the process of image retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for retrieving similar images. Background Art

[0002] Using pictures as information storage, searching for similar pictures as a means, and obtaining required information as a purpose is a new way of retrieving information. In the prior art, the method of retrieving similar pictures includes: obtaining multiple salient areas of a target picture; extracting convolutional neural network (CNN) features of multiple salient areas; obtaining a feature vector of the target picture based on the CNN features of the multiple salient areas; and obtaining a similar picture matching the target picture from multiple candidate pictures included in a candidate picture group of the target picture based on the feature vector of the target picture.

[0003] Convolutional Neural Networks (CNN) is a type of feedforward neural network with deep structure and convolutional calculation. Convolutional neural network is constructed by imitating the visual perception mechanism of organisms, and can perform supervised learning and unsupervised learning. The convolution kernel parameter sharing in the hidden layer and the sparsity of the inter-layer connection enable convolutional neural network to learn grid features with less computational effort, and it is widely used in computer vision, natural language processing and other fields. When searching for similar images, users may need to find products with similar colors, styles, texts or brands. The existing method of searching for similar images is based on the CNN feature comparison search of the salient areas of the overall image, ignoring non-salient features such as brand trademarks and texts, resulting in a large deviation between the search results and the user's search needs. Summary of the invention

[0004] In view of this, the present invention provides a method and device for retrieving similar images, the main purpose of which is to solve the problem in the prior art that the retrieval results deviate greatly from the user's retrieval requirements.

[0005] According to one aspect of the present invention, a method for retrieving similar images is provided, comprising:

[0006] According to the edge detection method, the overall feature information of the target image is extracted;

[0007] Calculating the overall similarity between the image to be tested and the target image according to the overall feature information;

[0008] According to the Mask RCNN model, extract the detailed feature information of the target image;

[0009] Calculating the detail similarity between the image to be tested and the target image according to the detail feature information;

[0010] Calculating the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and the preset retrieval weight;

[0011] In the order of the values ​​of the retrieval similarity from large to small, the pictures to be tested corresponding to the retrieval similarity are displayed.

[0012] According to another aspect of the present invention, a similar image retrieval device is provided, comprising:

[0013] An extraction module is used to extract the overall feature information of the target image based on the edge detection method;

[0014] A first calculation module, used to calculate the overall similarity between the image to be tested and the target image according to the overall feature information;

[0015] The extraction module is used to extract detail feature information of the target image according to the Mask RCNN model;

[0016] The first calculation module is further used to calculate the detail similarity between the image to be tested and the target image according to the detail feature information;

[0017] A second calculation module, used to calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight;

[0018] The display module is used to display the pictures to be tested corresponding to the search similarity in descending order of the values ​​of the search similarity.

[0019] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned similar image retrieval method.

[0020] According to another aspect of the present invention, there is provided a computer device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0021] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned similar image retrieval method.

[0022] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0023] The present invention provides a method and device for retrieving similar images. First, according to the edge detection method, the overall feature information of the target image is extracted, and the overall similarity between the image to be tested and the target image is calculated. Then, according to the Mask RCNN model, the detail feature information of the target image is extracted, and then the detail similarity between the image to be tested and the target image is calculated according to the detail feature information. Then, according to the overall similarity, the detail similarity and the preset retrieval weight, the retrieval similarity between the image to be tested and the target image is calculated. Finally, according to the numerical value of the retrieval similarity from large to small, the image to be tested corresponding to the retrieval similarity is displayed. Compared with the prior art, the embodiment of the present invention calculates the retrieval similarity between the image to be tested and the target image by setting different preset retrieval weights for the overall similarity and the detail similarity. By increasing the influence of the detail similarity on the retrieval similarity, the detail conflict of similar objects can be distinguished, and the discrimination of similar images can be improved to improve the recognition effect and reduce the deviation between the retrieval result and the user's retrieval demand.

[0024] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0026] Figure 1 A flow chart of a similar picture retrieval method provided by an embodiment of the present invention is shown;

[0027] Figure 2 A flow chart of another similar picture retrieval method provided by an embodiment of the present invention is shown;

[0028] Figure 3 A block diagram showing a similar picture retrieval device according to an embodiment of the present invention;

[0029] Figure 4 A block diagram showing another similar picture retrieval device provided by an embodiment of the present invention;

[0030] Figure 5 A schematic structural diagram of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0031] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0032] The embodiment of the present invention provides a method for retrieving similar images. Figure 1 As shown, the method includes:

[0033] 101. Based on the edge detection method, extract the overall feature information of the target image.

[0034] The target image refers to the product image that the user has searched for. The purpose of the present invention is to retrieve similar images of the target image. The overall feature information refers to the overall information of the object in the target image, including color and outline. Assuming that the target image content is a white coat of brand A, the white coat is the overall feature information.

[0035] The use of edge detection methods can greatly reduce the amount of data and eliminate irrelevant information, while retaining important structural properties of the image, which is conducive to extracting overall feature information. Edge detection methods can be divided into two categories: first-order derivative search method and second-order derivative zero-crossing method. The search-based method detects the boundary by finding the maximum and minimum values ​​in the first-order derivative of the image, usually locating the boundary in the direction of the largest gradient. The zero-crossing-based method finds the boundary by finding the zero-crossing of the second-order derivative of the image, usually the zero-crossing point of the Laplacian or the zero-crossing point of the nonlinear differential representation. For example, the target image content is a white coat of brand A, and the shape and color of the coat are extracted.

[0036] 102. Calculate the overall similarity between the image to be tested and the target image according to the overall feature information.

[0037] The pictures to be tested refer to all pictures that may be similar to the target pictures, which may be all pictures in the system, may be related pictures retrieved based on the text description of the target pictures, or may be related graphics retrieved based on the attributes of the objects in the target pictures. In the embodiment of the present invention, the source and quantity of the pictures to be tested are not limited. The overall feature information of the pictures to be tested is obtained in the same way as the method for obtaining the overall feature information of the target pictures, and then the overall similarity between the pictures to be tested and the target pictures is calculated. The overall similarity can be calculated according to methods such as Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity or Pearson correlation coefficient.

[0038] 103. According to the Mask RCNN model, extract detailed feature information of the target image.

[0039] The target image refers to the product image that the user has searched for. The purpose of the present invention is to retrieve similar images of the target image. Detail feature information refers to the detail part of the target image, which refers to the image part that is small in proportion to the entire image but has rich information. Assuming that the target image content is a white coat of brand A, brand A is the detail feature information, and brand A refers to the trademark shape of the brand, or the shape and color of the trademark.

[0040] If the Mask RCNN algorithm is used to extract detailed feature information, the algorithm model of the Mask RCNN algorithm needs to be trained with training images that annotate the detailed feature information of the target image. For example, the target image is a white coat of brand A. When training the training image, the shape of the trademark and the shape of the general coat are annotated. Through training, the target image can distinguish between the coat and the trademark on the coat.

[0041] 104. Calculate detail similarity between the image to be tested and the target image according to the detail feature information.

[0042] The method of obtaining the detail feature information of the target image is the same as that of obtaining the detail feature information of the target image, and then the detail similarity between the target image and the target image is calculated. The detail similarity can be calculated using methods such as Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity or Pearson correlation coefficient.

[0043] 105. Calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight.

[0044] The preset search weight refers to the ratio of overall similarity to detail similarity in calculating search similarity. Assuming the preset search weight is 1:2, the weight corresponding to overall similarity is 1, the weight corresponding to detail similarity is 2, and the search similarity is the sum of overall similarity multiplied by 1 and detail similarity multiplied by 2. When calculating search similarity, you can set the sum of preset search weights to 1. Then, assuming the preset search weight is 1:2, the weight corresponding to overall similarity is 1 / 3, the weight corresponding to detail similarity is 2 / 3, and the search similarity is the sum of overall similarity multiplied by 1 / 3 and detail similarity multiplied by 2 / 3.

[0045] 106. Display the pictures to be tested corresponding to the search similarities in descending order of the values ​​of the search similarities.

[0046] Sort the values ​​of the retrieval similarity from large to small, search for the pictures to be tested that correspond to the retrieval similarity according to the arrangement order, and then display the pictures to be tested. When displaying, set the number of pictures to be displayed at the same time according to the size of the display area. When displaying, you can select the number of pictures that can be displayed at the same time in the display area according to the arrangement order of the pictures to be tested, and display the pictures to be tested.

[0047] The present invention provides a method for retrieving similar images. First, according to an edge detection method, the overall feature information of a target image is extracted, and the overall similarity between the image to be tested and the target image is calculated. Then, according to a Mask RCNN model, the detail feature information of the target image is extracted, and then, according to the detail feature information, the detail similarity between the image to be tested and the target image is calculated. Then, according to the overall similarity, the detail similarity and a preset retrieval weight, the retrieval similarity between the image to be tested and the target image is calculated. Finally, according to the numerical value of the retrieval similarity from large to small, the image to be tested corresponding to the retrieval similarity is displayed. Compared with the prior art, the embodiment of the present invention calculates the retrieval similarity between the image to be tested and the target image by setting different preset retrieval weights for the overall similarity and the detail similarity. By increasing the influence of the detail similarity on the retrieval similarity, the detail conflict of similar objects can be distinguished, and the discrimination of similar images can be improved to improve the recognition effect and reduce the deviation between the retrieval result and the user's retrieval demand.

[0048] The embodiment of the present invention provides another similar image retrieval method, such as Figure 2 As shown, the method includes:

[0049] 201. Extract the overall feature information of the target image based on the edge detection method.

[0050] The target image refers to the product image that the user is searching for. The purpose of the present invention is to retrieve similar images of the target image. The overall feature information refers to the overall information of the object in the target image, including color and outline. Assuming that the target image content is a white coat of brand A, the white coat is the overall feature information.

[0051] Existing clothing, shoes, hats, electronic products and other items usually include two aspects of similarity when searching for similar products: one is the same detail features, and the other is similar overall features. The overall feature information includes the color of the target object and the target edge contour. Obtaining the overall feature information of the target image specifically includes: using the edge detection method to identify and extract the target edge contour of the target object in the target image; extracting the target object color of the target object within the target edge contour. Image edge detection greatly reduces the amount of data, eliminates information that can be considered irrelevant, and retains important structural properties of the image. The target edge contour is extracted and identified by the edge detection algorithm. The target edge contour is the contour of the target object in the target image, so the color within the target edge contour is the actual color of the target object.

[0052] Extracting the target object color of the target object within the target edge contour specifically includes: dividing the target image into multiple grid images according to a first preset division granularity; querying the grid color of each grid image within the target edge contour in the target image, wherein the grid color includes a single color and a mixed color; calculating the mixed color ratio of the number of images with mixed colors to the total number of grid images; if the mixed color ratio is greater than the first preset ratio, re-dividing the target image according to a second preset division granularity; if the mixed color ratio is not greater than the first preset ratio, recording the number of single color images of each color of the grid image with a single color; if the single color ratio of the number of single color images to the total number of grid images is greater than the second preset ratio, determining the grid color corresponding to the number of single color images as the target object color; if the difference between the number of single color images of each color is less than a third preset number, determining the grid color of the grid image as the target object color. The determined target object color may be a single color or a combination of multiple colors.

[0053] 202. Calculate the overall similarity between the image to be tested and the target image according to the overall feature information.

[0054] The picture to be tested refers to all pictures that may be similar to the target picture, which may be all pictures in the system, may be related pictures retrieved based on the text description of the target picture, or may be related graphics retrieved based on the attributes of the object in the target picture. In the embodiment of the present invention, the source and quantity of the pictures to be tested are not limited. This step specifically includes: obtaining the overall feature information of the picture to be tested, the overall feature information of the picture to be tested includes the color of the object to be tested and the edge contour to be tested; according to the overall feature information of the picture to be tested, the color of the target object and the edge contour of the target, calculating the object color similarity and edge contour similarity between the target picture and the picture to be tested; according to the preset overall proportion, calculating the overall similarity between the target picture and the picture to be tested. The preset overall proportion refers to the proportion of the object color similarity and the edge contour similarity in calculating the overall similarity.

[0055] 203. Extract detailed feature information of the target image according to the Mask RCNN model.

[0056] The target image refers to the product image that the user is searching for. The purpose of the present invention is to retrieve similar images of the target image. The detail feature information refers to the detail part of the target image, which refers to the image part that is small in proportion to the whole image but has rich information. Assuming that the target image content is a white coat of brand A, brand A is the detail feature information.

[0057] Existing clothing, shoes, hats, electronic products and other items usually include two aspects of similarity when searching for similar products: one is the same detail features, and the other is similar overall features. Detail feature information includes special graphics such as word trademarks, pattern trademarks, printing, embroidery, etc., which are often similar to the overall color of the target graphics or have a large color contrast, and this distinction is used as the basis for obtaining detail feature information. Extracting the detail feature information of the target image specifically includes: extracting the grid image with mixed color as the grid color; filtering out the target object color in the grid image with mixed color as the grid color, and obtaining the grid feature image; judging whether the image contour in the grid feature image is a closed contour; if the judgment result is yes, determining the character or graphic contour in the grid feature image as the detail feature information; if the judgment result is no, merging the grid image with mixed color as the grid color and its adjacent grid images, and filtering out the target object color, and re-obtaining the grid feature image. Merging the grid image with mixed color as the grid color and its adjacent grid images means merging the grid image with mixed color as the center and the adjacent grid images around it.

[0058] In order to improve the speed and accuracy of extracting detail feature information, the target image detail feature information is extracted, specifically including: matching the target image with the target edge contour, screening the target physical image in the target image; inputting the target physical image into the Mask RCNN model, extracting the binary mask image of the target physical image; marking the image contour in the binary mask image; matching the target physical image with the marked binary mask image, screening the detail feature image in the target physical image corresponding to the image contour; determining the character or graphic contour in the grid feature image as detail feature information. The Mask RCNN model is used to accelerate the segmentation of the target image, so as to achieve accurate extraction of the image contour in the target physical image with low time and space complexity, so as to obtain accurate detail feature information.

[0059] 204. Calculate detail similarity between the image to be tested and the target image according to the detail feature information.

[0060] This step specifically includes: obtaining the detail feature information of the image to be tested; and calculating the detail similarity between the target image and the image to be tested according to the detail feature information of the image to be tested and the detail feature information of the target image. The detail feature information of the image to be tested is obtained in the same way as the method for obtaining the detail feature information of the target image.

[0061] 205. Calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight.

[0062] The preset search weight refers to the ratio of overall similarity to detail similarity in calculating search similarity. Assuming the preset search weight is 1:2, the weight corresponding to the overall similarity is 1, the weight corresponding to the detail similarity is 2, and the search similarity is the sum of the overall similarity multiplied by 1 and the detail similarity multiplied by 2. When calculating search similarity, you can set the sum of the preset search weights to 1. Then, assuming the preset search weight is 1:2, the weight corresponding to the overall similarity is 1 / 3, the weight corresponding to the detail similarity is 2 / 3, and the search similarity is the sum of the overall similarity multiplied by 1 / 3 and the detail similarity multiplied by 2 / 3.

[0063] 206 . Display the pictures to be tested corresponding to the search similarities in descending order of the values ​​of the search similarities.

[0064] Sort the values ​​of the retrieval similarity from large to small, search for the pictures to be tested that correspond to the retrieval similarity according to the arrangement order, and then display the pictures to be tested. When displaying, set the number of pictures to be displayed at the same time according to the size of the display area. When displaying, you can select the number of pictures that can be displayed at the same time in the display area according to the arrangement order of the pictures to be tested, and display the pictures to be tested.

[0065] 207. If the user operation meets the preset condition, the preset search weight is modified according to the preset rule.

[0066] The preset condition is that the user does not select the image to be tested corresponding to the maximum retrieval similarity value for the first time, or the number of times that the image to be tested selected by the user for the first time after searching for similar images of different target images is not the image with the highest similarity is greater than the preset number of times. When correcting the preset retrieval weight, the overall similarity and detail similarity of the image to be tested selected by the user and the image to be tested corresponding to the maximum retrieval similarity value can be compared to determine whether the overall similarity or the detail similarity has a greater impact on the user, and then increase the weight of the user's greater response, so as to correct the preset retrieval weight.

[0067] In order to ensure that the display order of the pictures to be detected is more in line with user needs and that the updated weights can reflect the users' true thoughts, it can also be set that the preset retrieval weights will be corrected only when the number of times the picture to be detected selected for the first time by the user after searching for similar pictures of different target pictures is not the picture with the highest similarity is greater than the preset number of times.

[0068] The present invention provides a method for retrieving similar images. First, according to an edge detection method, the overall feature information of a target image is extracted, and the overall similarity between a test image and a target image is calculated. Then, according to a Mask RCNN model, the detail feature information of the target image is extracted, and then, according to the detail feature information, the detail similarity between the test image and the target image is calculated. Then, according to the overall similarity, the detail similarity and a preset retrieval weight, the retrieval similarity between the test image and the target image is calculated. Finally, according to the numerical values ​​of the retrieval similarity from large to small, the test image corresponding to the retrieval similarity is displayed. If the user does not select the test image corresponding to the maximum retrieval similarity value for the first time, the preset retrieval weight is adjusted according to a preset rule, or the preset retrieval weight can be changed when the number of times that the first test image selected by the user after searching for similar images of different target images is not the image with the highest similarity is greater than the preset number. Compared with the prior art, the embodiment of the present invention calculates the retrieval similarity between the test image and the target image by setting different preset retrieval weights for the overall similarity and the detail similarity. By increasing the influence of detail similarity on retrieval similarity, it is possible to distinguish detail conflicts of similar objects and improve the distinction of similar images, thereby improving the recognition effect and reducing the deviation between retrieval results and user retrieval requirements.

[0069] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a similar image retrieval device, such as Figure 3 As shown, the device comprises:

[0070] An extraction module 31 is used to extract the overall feature information of the target image according to an edge detection method;

[0071] A first calculation module 32, used to calculate the overall similarity between the image to be tested and the target image according to the overall feature information;

[0072] The extraction module 31 is used to extract the detail feature information of the target image according to the Mask RCNN model;

[0073] The first calculation module 32 is further used to calculate the detail similarity between the image to be tested and the target image according to the detail feature information;

[0074] A second calculation module 33, used to calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight;

[0075] The display module 34 is used to display the pictures to be tested corresponding to the search similarity in descending order of the values ​​of the search similarity.

[0076] The present invention provides a similar image retrieval device. First, according to the edge detection method, the overall feature information of the target image is extracted, and the overall similarity between the image to be tested and the target image is calculated. Then, according to the Mask RCNN model, the detail feature information of the target image is extracted, and then the detail similarity between the image to be tested and the target image is calculated according to the detail feature information. Then, according to the overall similarity, the detail similarity and the preset retrieval weight, the retrieval similarity between the image to be tested and the target image is calculated. Finally, according to the numerical value of the retrieval similarity from large to small, the image to be tested corresponding to the retrieval similarity is displayed. Compared with the prior art, the embodiment of the present invention calculates the retrieval similarity between the image to be tested and the target image by setting different preset retrieval weights for the overall similarity and the detail similarity. By increasing the influence of the detail similarity on the retrieval similarity, the detail conflict of similar objects can be distinguished, and the discrimination of similar images can be improved to improve the recognition effect and reduce the deviation between the retrieval result and the user's retrieval demand.

[0077] Furthermore, as a response to the above Figure 2 The embodiment of the present invention provides another similar image retrieval device, such as Figure 4 As shown, the device comprises:

[0078] An extraction module 41 is used to extract the overall feature information of the target image according to an edge detection method;

[0079] A first calculation module 42, used to calculate the overall similarity between the image to be tested and the target image according to the overall feature information;

[0080] The extraction module 41 is used to extract detail feature information of the target image according to the Mask RCNN model;

[0081] The first calculation module 42 is further used to calculate the detail similarity between the image to be tested and the target image according to the detail feature information;

[0082] A second calculation module 43, used to calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight;

[0083] The display module 44 is used to display the pictures to be tested corresponding to the search similarity in descending order of the values ​​of the search similarity.

[0084] Furthermore, the overall feature information includes the target object color and the target edge contour;

[0085] The extraction module 41 comprises:

[0086] A first extraction unit 411 is used to identify and extract the target edge contour of the target object in the target image by using an edge detection method;

[0087] The second extraction unit 412 is configured to extract the target object color of the target object within the target edge contour.

[0088] Furthermore, the second extraction unit 412 includes:

[0089] A division subunit 4121, configured to divide the target image into a plurality of grid images according to a first preset division granularity;

[0090] A query subunit 4122, configured to query a grid color of each of the grid images within the target edge contour in the target image, wherein the grid color includes a single color and a mixed color;

[0091] A calculation subunit 4123, configured to calculate a mixed color ratio of the number of pictures whose grid colors are mixed colors to the total number of pictures in the grid;

[0092] The division subunit 4121 is further configured to re-divide the target image according to a second preset division granularity if the mixed color ratio is greater than the first preset ratio;

[0093] The recording subunit 4124 is configured to record the number of single-color pictures of each color of the grid picture whose grid color is a single color if the mixed color ratio is not greater than the first preset ratio;

[0094] A determination subunit 4125 is configured to determine that the grid color corresponding to the number of single-color pictures is the target object color if the single-color ratio of the number of single-color pictures to the total number of grid pictures is greater than a second preset ratio;

[0095] The determining subunit 4125 is further configured to determine that the grid color of the grid image is the target object color if the difference between the numbers of the single-color images of each color is less than a third preset number.

[0096] Furthermore, the extraction module 41 includes:

[0097] A screening unit 413 is used to match the target image with the target edge contour, and screen the target physical object image in the target image;

[0098] An extraction unit 414 is used to input the target physical object picture into the Mask RCNN model to extract a binary mask image of the target physical object picture;

[0099] A marking unit 415, used for marking the image contour in the binary mask image;

[0100] The screening unit 413 is further used to match the target physical object image with the marked binary mask image, and screen the detail feature image in the target physical object image corresponding to the image contour;

[0101] The determination unit 416 is used to determine the character or graphic outline in the grid feature image as detail feature information.

[0102] Furthermore, the first calculation module 42 includes:

[0103] An acquisition unit 421 is used to acquire the overall feature information of the image to be tested, where the overall feature information of the image to be tested includes the color of the object to be tested and the edge contour to be tested;

[0104] A calculation unit 422 is used to calculate the object color similarity and edge contour similarity between the target image and the image to be tested according to the overall feature information of the image to be tested, the target object color and the target edge contour;

[0105] The calculation unit 422 is further configured to calculate the overall similarity between the target image and the image to be tested according to a preset overall weight.

[0106] Furthermore, the first calculation module 42 includes:

[0107] The acquisition unit 421 is further used to acquire the detailed feature information of the image to be tested;

[0108] The calculation unit 422 is further configured to calculate the detail similarity between the target image and the image to be tested according to the detail feature information of the image to be tested and the detail feature information of the target image.

[0109] Furthermore, the method further comprises:

[0110] The correction module 45 is used for displaying the pictures to be tested corresponding to the retrieval similarity in the order from large to small according to the numerical value of the retrieval similarity. If the user operation meets the preset conditions, the preset retrieval weight is corrected according to the preset rules. The preset conditions are that the user does not select the picture to be tested corresponding to the maximum value of the retrieval similarity for the first time, or the number of times that the picture to be tested selected for the first time after the user has searched for similar pictures of different target pictures is not the picture with the highest similarity is greater than the preset number of times.

[0111] The present invention provides a similar image retrieval device. First, according to the edge detection method, the overall feature information of the target image is extracted, and the overall similarity between the image to be tested and the target image is calculated. Then, according to the Mask RCNN model, the detail feature information of the target image is extracted, and then the detail similarity between the image to be tested and the target image is calculated according to the detail feature information. Then, according to the overall similarity, the detail similarity and the preset retrieval weight, the retrieval similarity between the image to be tested and the target image is calculated. Finally, according to the numerical value of the retrieval similarity from large to small, the image to be tested corresponding to the retrieval similarity is displayed. If the user does not select the image to be tested corresponding to the maximum retrieval similarity for the first time, the preset retrieval weight can be adjusted according to the preset rule, or the preset retrieval weight can be changed when the number of times that the image to be tested selected by the user for the first time after searching for similar images of different target images is not the image with the highest similarity is greater than the preset number. Compared with the prior art, the embodiment of the present invention calculates the retrieval similarity between the image to be tested and the target image by setting different preset retrieval weights for the overall similarity and the detail similarity. By increasing the influence of detail similarity on retrieval similarity, it is possible to distinguish detail conflicts of similar objects and improve the distinction of similar images, thereby improving the recognition effect and reducing the deviation between retrieval results and user retrieval requirements.

[0112] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the similar image retrieval method in any of the above method embodiments.

[0113] Figure 5 A schematic diagram of the structure of a computer device provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.

[0114] like Figure 5 As shown, the computer device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 , and a communication bus 508 .

[0115] The processor 502 , the communication interface 504 , and the memory 506 communicate with each other via a communication bus 508 .

[0116] The communication interface 504 is used to communicate with other devices such as clients or other servers.

[0117] The processor 502 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned similar image retrieval method embodiment.

[0118] Specifically, the program 510 may include program codes, which include computer operation instructions.

[0119] The processor 502 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0120] The memory 506 is used to store the program 510. The memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0121] The program 510 may be specifically configured to enable the processor 502 to perform the following operations:

[0122] According to the edge detection method, the overall feature information of the target image is extracted;

[0123] Calculating the overall similarity between the image to be tested and the target image according to the overall feature information;

[0124] According to the Mask RCNN model, extract the detailed feature information of the target image;

[0125] Calculating the detail similarity between the image to be tested and the target image according to the detail feature information;

[0126] Calculating the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and the preset retrieval weight;

[0127] In the order of the values ​​of the retrieval similarity from large to small, the pictures to be tested corresponding to the retrieval similarity are displayed.

[0128] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0129] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A similar image retrieval method, It is characterized in that include: Extracting overall feature information of the target image according to the edge detection method, wherein the overall feature information includes the color of the target object and the edge contour of the target; Calculating the overall similarity between the image to be tested and the target image according to the overall feature information; Matching the target image with the target edge contour, screening the target real object image in the target image, and inputting the target real object image into the MaskRCNN model, and extracting the detail feature information of the target image according to the MaskRCNN model; Calculating the detail similarity between the image to be tested and the target image according to the detail feature information; Calculating the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and the preset retrieval weight; Displaying the pictures to be tested corresponding to the search similarities in descending order of the search similarity values; The extracting detail feature information of the target image includes: Divide the target image into a plurality of grid images, and query the grid color of each grid image within the target edge contour in the target image, wherein the grid color includes a single color and a mixed color; Extracting a grid image in which the grid color is a mixed color, filtering out the target object color in the grid image in which the grid color is a mixed color, and obtaining a grid feature image; Determine whether the image contour in the grid feature image is a closed contour; If the judgment result is yes, the character or graphic outline in the grid feature image is determined as detail feature information; If the judgment result is no, then the grid image with the mixed color of the grid and its adjacent grid images are merged, and the target object color is filtered out to re-acquire the grid feature image.

2. The method according to claim 1, It is characterized in that The method of extracting the overall feature information of the target image according to the edge detection method includes: Using the edge detection method, identifying and extracting the target edge contour of the target object in the target image; The target object color of the target object within the target edge contour is extracted.

3. The method according to claim 2, It is characterized in that The step of extracting the target object color of the target object within the target edge contour comprises: Dividing the target image into a plurality of grid images according to a first preset division granularity; Calculate the mixed color ratio of the number of pictures whose grid colors are mixed colors to the total number of pictures in the grid; If the mixed color ratio is greater than the first preset ratio, re-dividing the target image according to a second preset division granularity; If the mixed color ratio is not greater than the first preset ratio, recording the number of single-color pictures of each color of the grid picture whose grid color is a single color; If the single color ratio of the number of the single color pictures to the total number of the grid pictures is greater than a second preset ratio, determining the grid color corresponding to the number of the single color pictures as the target object color; If the difference between the number of single-color images of each color is less than a third preset number, the grid color of the grid image is determined to be the target object color.

4. The method according to claim 2, It is characterized in that The step of extracting detailed feature information of the target image according to the MaskRCNN model includes: Extracting a binary mask image of the target object image; marking an image contour in the binary mask image; Matching the target physical object image with the marked binary mask image, and screening the detail feature image in the target physical object image corresponding to the image contour; The character or graphic outline in the grid feature image is determined as detail feature information.

5. The method according to claim 1, It is characterized in that The calculating the overall similarity between the image to be tested and the target image according to the overall feature information includes: Acquire the overall characteristic information of the image to be tested, wherein the overall characteristic information of the image to be tested includes the color of the object to be tested and the edge contour to be tested; Calculating the object color similarity and edge contour similarity between the target image and the image to be tested according to the overall feature information of the image to be tested, the color of the target object and the edge contour of the target; The overall similarity between the target image and the image to be tested is calculated according to the preset overall weight.

6. The method according to claim 1, It is characterized in that The calculating the detail similarity between the image to be tested and the target image according to the detail feature information includes: Obtaining detailed feature information of the image to be tested; The detail similarity between the target image and the image to be tested is calculated according to the detail feature information of the image to be tested and the detail feature information of the target image.

7. The method according to claim 1, It is characterized in that After displaying the pictures to be tested corresponding to the search similarities in descending order of the values ​​of the search similarities, the method further includes: If the user operation meets the preset conditions, the preset retrieval weight is modified according to the preset rules. The preset conditions are that the user does not select the picture to be tested corresponding to the maximum retrieval similarity value for the first time, or the number of times the picture to be tested selected for the first time by the user after searching for similar pictures of different target pictures is not the picture with the highest similarity is set to be greater than the preset number of times.

8. A similar image retrieval device, It is characterized in that include: An extraction module, used to extract overall feature information of a target image according to an edge detection method, wherein the overall feature information includes the color of the target object and the edge contour of the target; A first calculation module, used for calculating the overall similarity between the image to be tested and the target image according to the overall feature information; The extraction module is used to match the target image with the target edge contour, filter the target real object image in the target image, input the target real object image into the MaskRCNN model, and extract detail feature information of the target image according to the MaskRCNN model; The first calculation module is further used to calculate the detail similarity between the image to be tested and the target image according to the detail feature information; A second calculation module, used to calculate the retrieval similarity between the image to be tested and the target image according to the overall similarity, the detail similarity and a preset retrieval weight; A display module, used for displaying the pictures to be tested corresponding to the search similarity in descending order of the values ​​of the search similarity; The extraction module is further used to divide the target image into a plurality of grid images, and query the grid color of each grid image within the target edge contour in the target image, wherein the grid color includes a single color and a mixed color; Extracting a grid image in which the grid color is a mixed color, filtering out the target object color in the grid image in which the grid color is a mixed color, and obtaining a grid feature image; Determine whether the image contour in the grid feature image is a closed contour; If the judgment result is yes, the character or graphic outline in the grid feature image is determined as detail feature information; If the judgment result is no, then the grid image with the mixed color of the grid and its adjacent grid images are merged, and the target object color is filtered out to re-acquire the grid feature image.

9. A storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute an operation corresponding to the similar image retrieval method as described in any one of claims 1 to 7.

10. A computer device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the similar image retrieval method as described in any one of claims 1-7.