Similar image judgment method based on target recognition

Through recognition and hash value calculation combined with adaptive algorithms, the problems of low accuracy and poor robustness in image similarity detection are solved, and more accurate and flexible image similarity evaluation is achieved, suitable for image search and security monitoring, etc. field.

CN119251526APending Publication Date: 2025-01-03LINKER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411348343.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art has low accuracy in image similarity detection, especially in complex scenarios, and is poor in robustness, so it is impossible to fully consider the multi-faceted information of the target object.

Method used

By identifying the target object in the image, extracting its hash value, and calculating the IOU value and hash similarity, adjusting the threshold value in combination with the adaptive algorithm, comprehensively considering the spatial position and feature information of the target object, and determining the image similarity.

Benefits of technology

The accuracy and robustness of image similarity determination are improved, and the adaptive algorithm enables the threshold to be dynamically adjusted according to the specific scene, enhancing the flexibility and practicality of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251526A_ABST
    Figure CN119251526A_ABST
Patent Text Reader

Abstract

The invention discloses a similar image judgment method based on target recognition, and the method comprises the following steps: S1, recognizing all target objects in an input image, and distributing a label for each target object; s2, extracting a hash value of each target object image; s3, matching the target objects on the two pictures one by one, and forming an image pair if the target objects have the same labels; s4, for the two target objects in each image pair, calculating an IOU value and a Hash similarity; s5, determining a final IOU threshold value and a final Hash similarity threshold value; s6, if the IOU value and the Hash similarity of each image pair are both greater than respective final threshold values, regarding the image pair as a final similar target pair; and S7, if the ratio of the number of the final similar target pairs to the number of the total image pairs is greater than a set threshold value of the similar target pairs, determining that the input image is a similar image. The method can be applied to the fields of image search, similar image detection, safety monitoring systems and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of computer image processing, and in particular to a similar image judgment method based on target recognition. Background Art

[0002] In the field of image processing, image similarity detection is an important task, which is often used in scenarios such as image search, similar image detection, and security monitoring systems. In the existing technology, a single feature or a single indicator is often used to determine the similarity of images, but this method often fails to fully consider the multi-faceted information of the target object, resulting in low accuracy or poor robustness for complex scenes. Summary of the invention

[0003] The present invention mainly aims to solve the technical problems of low accuracy and poor robustness to complex scenes in the prior art, and to provide a similar image judgment method based on target recognition that can fully consider various information of the target object and has strong robustness.

[0004] The present invention aims to solve the above technical problems mainly through the following technical solutions: a similar image judgment method based on target recognition, comprising the following steps:

[0005] S1. Input a set of images, identify all target objects in each image, and assign a label to each target object; each set of images includes two pictures, and the label indicates the category of the target object;

[0006] S2, extracting the hash value of each identified target object image;

[0007] S3, match each target object in the first image with each target object in the second image one by one. If the two target objects have the same label, an image pair is formed. For example, in the first image, there are 2 target objects with the label of car, and in the second image, there are 3 target objects with the label of car, and finally 6 image pairs are generated.

[0008] S4, for each image pair, the two target objects are calculated, and the IOU (Intersection over Union) value and hash similarity between them are calculated;

[0009] S5, determining the IOU threshold and the hash similarity threshold according to the input image group;

[0010] S6, judging whether the IOU value and hash similarity of the two target objects in each image pair are both greater than their respective thresholds, if both are greater than their respective thresholds, the pair of target objects is regarded as a similar target pair;

[0011] S7. Calculate the ratio of the number of similar target pairs to the total number of image pairs. If the ratio is greater than a set similar target pair threshold, determine that the input image is a similar image.

[0012] Preferably, the step S5 is specifically as follows:

[0013] S501, initializing the IOU threshold and the hash similarity threshold as the IOU current threshold and the hash similarity current threshold respectively;

[0014] S502, judging whether the IOU value of the two target objects in each image pair is greater than the current IOU threshold, judging whether the hash similarity of the two target objects in each image pair is greater than the current hash similarity threshold, if the results of both judgments are yes, then judging that the two target objects in this image pair are the current similar target pair;

[0015] S503, set the objective function J to:

[0016]

[0017] In the formula, λ is the regularization parameter, N sim is the current number of similar target pairs, N all is the total target logarithm, t iou is the current IOU threshold, t hash is the current threshold of hash similarity, G iou is the highest target IOU, G hash is the highest target hash similarity;

[0018] S504, calculate the partial derivative of the objective function to obtain the gradient under the current threshold. The gradient of the objective function is expressed as:

[0019]

[0020] S505. According to the gradient value, a new IOU threshold t is obtained. iou-new and hash similarity threshold t hash-new :

[0021]

[0022] In the formula, α is the learning rate;

[0023] S506, use t iou-new Instead of iou , use t hash-new Instead of hash , jump to step S502;

[0024] S507, repeat step S502 to step S506, and iterate repeatedly until the objective function converges to obtain the final IOU threshold and the final hash similarity threshold.

[0025] Preferably, in step S501, the initialized IOU threshold is 0.5; the initialized hash similarity threshold is 0.7.

[0026] Preferably, in step S7, the similar target pair threshold is 0.6.

[0027] The substantial effect of the present invention is that, by comprehensively considering the spatial position and feature information of the target object, the accuracy and robustness of the determination of image similarity are effectively improved. The introduction of the adaptive algorithm enables the threshold to be dynamically adjusted according to the specific application scenario, thereby improving the flexibility and practicality of the method. Compared with the prior art, the present invention can more comprehensively evaluate the similarity between images and has higher application value and practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a similar image judgment flow chart of the present invention. DETAILED DESCRIPTION

[0029] The technical solution of the present invention is further specifically described below through embodiments and in conjunction with the accompanying drawings.

[0030] Embodiment: A similar image determination method based on target recognition in this embodiment is as follows: Figure 1 As shown, the following steps are included:

[0031] S1. Input a set of images, identify all target objects in each image, and assign a label to each target object; each set of images includes two pictures, and the label indicates the category of the target object;

[0032] S2, extracting the hash value of each identified target object image;

[0033] S3, match each target object in the first image with each target object in the second image one by one. If the two target objects have the same label, an image pair is formed. For example, in the first image, there are 2 target objects with the label of car, and in the second image, there are 3 target objects with the label of car, and finally 6 image pairs are generated.

[0034] S4, for each image pair, the two target objects are calculated, and the IOU (Intersection over Union) value and hash similarity between them are calculated;

[0035] S5, determining the IOU threshold and the hash similarity threshold according to the input image group;

[0036] S6, judging whether the IOU value and hash similarity of the two target objects in each image pair are both greater than their respective thresholds, if both are greater than their respective thresholds, the pair of target objects is regarded as a similar target pair;

[0037] S7. Calculate the ratio of the number of similar target pairs to the total number of image pairs. If the ratio is greater than a set similar target pair threshold, determine that the input image is a similar image.

[0038] The step S5 is specifically as follows:

[0039] S501, initializing the IOU threshold and the hash similarity threshold as the IOU current threshold and the hash similarity current threshold respectively;

[0040] S502, judging whether the IOU value of the two target objects in each image pair is greater than the current IOU threshold, judging whether the hash similarity of the two target objects in each image pair is greater than the current hash similarity threshold, if the results of both judgments are yes, then judging that the two target objects in this image pair are the current similar target pair;

[0041] S503, set the objective function J to:

[0042]

[0043] In the formula, λ is the regularization parameter, N sim is the current number of similar target pairs, N all is the total target logarithm, t iou is the current IOU threshold, t hash is the current threshold of hash similarity, G iou is the highest target IOU, G hash is the highest target hash similarity;

[0044] S504, calculate the partial derivative of the objective function to obtain the gradient under the current threshold. The gradient of the objective function is expressed as:

[0045]

[0046] S505. According to the gradient value, a new IOU threshold t is obtained. iou-new and hash similarity threshold t hash-new :

[0047]

[0048] In the formula, α is the learning rate;

[0049] S506, use t iou-new Instead of iou , use t hash-newInstead of hash , jump to step S502;

[0050] S507, repeat step S502 to step S506, and iterate repeatedly until the objective function converges to obtain the final IOU threshold and the final hash similarity threshold.

[0051] In step S501, the initialized IOU threshold is 0.5; the initialized hash similarity threshold is 0.7.

[0052] In step S7, the similar target pair threshold is 0.6.

[0053] This method can be applied to image search, similar image detection, security monitoring systems and other fields.

[0054] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

[0055] Although this article uses more terms such as IOU value, hash similarity, and objective function, it does not exclude the possibility of using other terms. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional restrictions is contrary to the spirit of the present invention.

Claims

1. A similar image judgment method based on target recognition, characterized in that: The following steps are involved: S1. Input a set of images, identify all target objects in each image, and assign a label to each target object; a set of images includes two pictures; S2, extracting the hash value of each identified target object image; S3, matching each target object in the first image with each target object in the second image one by one, and if the two target objects have the same label, an image pair is formed; S4, for the two target objects in each image pair, calculate the IOU value and hash similarity between them; S5, determining the final IOU threshold and the final hash similarity threshold based on the input image group; S6, judging whether the IOU values ​​and hash similarities of the two target objects in each image pair are both greater than their respective final thresholds, if both are greater than their respective final thresholds, the pair of target objects is regarded as a final similar target pair; S7. Calculate the ratio of the number of final similar target pairs to the total number of image pairs. If the ratio is greater than a set similar target pair threshold, determine that the input image is a similar image.

2. The similar image judgment method based on target recognition according to claim 1 is characterized in that: The step S5 is specifically as follows: S501, initializing the IOU threshold and the hash similarity threshold as the IOU current threshold and the hash similarity current threshold respectively; S502, judging whether the IOU value of the two target objects in each image pair is greater than the current IOU threshold, judging whether the hash similarity of the two target objects in each image pair is greater than the current hash similarity threshold, if the results of both judgments are yes, then judging that the two target objects in this image pair are the current similar target pair; S503, set the objective function J to: In the formula, λ is the regularization parameter, N sim is the current number of similar target pairs, N all is the total target logarithm, t iou is the current IOU threshold, t hash is the current threshold of hash similarity, G iou is the highest target IOU, G hash is the highest target hash similarity; S504, calculate the partial derivative of the objective function to obtain the gradient under the current threshold. The gradient of the objective function is expressed as: S505. According to the gradient value, a new IOU threshold t is obtained. iou-new and hash similarity threshold t hash-new : In the formula, α is the learning rate; S506, use t iou-new Instead of iou , use t hash-new Instead of hash , jump to step S502; S507, repeat step S502 to step S506, and iterate repeatedly until the objective function converges to obtain the final IOU threshold and the final hash similarity threshold.

3. The similar image judgment method based on target recognition according to claim 2 is characterized in that: In step S501, the initialized IOU threshold is 0.5; the initialized hash similarity threshold is 0.

7.

4. A similar image judgment method based on target recognition according to claim 1 or 3, characterized in that: In step S7, the similar target pair threshold is 0.6.