Image retrieval method and system

By constructing an undirected graph and splitting it into target subgraphs, and aggregating similar image unit objects, the matching difficulties caused by differences in viewpoint and illumination in image retrieval are solved, achieving efficient and accurate image retrieval.

CN116244455BActive Publication Date: 2026-06-05TRANSN IOL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TRANSN IOL TECH CO LTD
Filing Date
2022-11-01
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, image retrieval methods struggle to achieve accurate and efficient image matching when dealing with images captured from different angles, under varying lighting conditions, or with occlusion.

Method used

By constructing an undirected graph of the target object set, performing multiple processing steps to obtain the target subgraph, aggregating similar image unit objects to form a target similarity set, and performing image retrieval based on this set.

Benefits of technology

It improves the efficiency and accuracy of image retrieval, and ensures the accuracy and timeliness of aggregating similar image elements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244455B_ABST
    Figure CN116244455B_ABST
Patent Text Reader

Abstract

The application provides an image retrieval method and system, the method comprising: obtaining an aggregation result of a target object set; obtaining a target similar set corresponding to each target subgraph in the aggregation result; and performing image retrieval on the target image based on the image unit objects in the target similar set. The system executes the method. The application takes the image unit objects corresponding to each target subgraph in the aggregation result of the target object set as a target similar set, and performs image retrieval based on the image unit objects in the target similar set, thereby improving the efficiency and accuracy of image retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an image retrieval method and system. Background Technology

[0002] Given a query image containing a specific instance (e.g., a specific target, scene, building, etc.), image retrieval aims to find images containing the same instance from a database of images. However, due to differences in shooting angle, lighting, or occlusion among different images, how to accurately and efficiently perform image retrieval from these images with intra-class differences is a problem that urgently needs to be solved. Summary of the Invention

[0003] The image retrieval method and system provided by this invention are used to solve the above-mentioned problems in the prior art. The method takes the image unit object corresponding to each target sub-image in the aggregation result of the target object set as a target similarity set, and performs image retrieval based on the image unit objects in the target similarity set, thereby improving the efficiency and accuracy of image retrieval.

[0004] The present invention provides an image retrieval method, comprising:

[0005] An aggregation result is obtained for a set of target objects, which includes multiple target objects. Each target object is a vector representation of an image unit object, which is obtained by segmenting a target image. The aggregation result is used to characterize the similarity between the target objects in the target set.

[0006] Obtain the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0007] Image retrieval is performed on the target image based on the image unit objects in the target similarity set.

[0008] According to an image retrieval method provided by the present invention, the method for obtaining the aggregation result of the target object set includes:

[0009] Perform the first processing step at least once until there are no elements left in the vertex difference set;

[0010] The aggregation result is obtained based on all target subgraphs obtained in at least one of the first processing steps;

[0011] The first processing step includes: obtaining a target subgraph corresponding to the target undirected graph; updating the undirected graph based on the vertex difference set and the first target edge difference set; updating the target undirected graph according to the updated undirected graph; the updated undirected graph serving as the undirected graph in the next first processing step; the updated target undirected graph serving as the target undirected graph in the next first processing step; the target undirected graph in the first first processing step is obtained based on the undirected graph in the first first processing step; and the undirected graph in the first first processing step is constructed based on the target object set.

[0012] The vertex difference set is the difference set between the first target set and the second target set. The first target set is determined based on the set of all vertices in the target subgraph obtained in each first processing step. The second target set is determined based on the set of all vertices in the target undirected graph in each first processing step.

[0013] The first target edge difference set is the difference set between the third target set and the fourth target set. The third target set is determined based on the set of all edges in the target subgraph obtained in each first processing step. The fourth target set is determined based on the set of all edges in the target undirected graph in each first processing step.

[0014] According to an image retrieval method provided by the present invention, the target undirected graph is obtained in the following manner:

[0015] Based on each of the target objects, determine the vertices of the undirected graph;

[0016] Determine the edges of the undirected graph based on the relative distance between any two target objects;

[0017] Construct the undirected graph based on its vertices and edges;

[0018] Delete edges in the undirected graph that exceed a preset threshold, and delete isolated vertices in the undirected graph to obtain the target undirected graph.

[0019] According to an image retrieval method provided by the present invention, obtaining the target subgraph corresponding to the target undirected graph includes:

[0020] The set of the first edges with the smallest relative distance in the target undirected graph is taken as the fifth target set;

[0021] The set of target vertices constituting the first side is taken as the target vertex set;

[0022] Execute the second processing procedure at least once until the sixth target set is empty or there is no second edge with the smallest relative distance in the second target edge difference set, and obtain the target subgraph;

[0023] The second processing procedure includes: if the second edge exists in the second target edge difference set, and if a preset condition is met, then at least one third processing procedure is executed until the preset condition is not met, and the second edge in the sixth target set is deleted to update the sixth target set until there are no elements in the sixth target set.

[0024] The second target difference set is the difference set between the fifth target set and the sixth target set in each of the second processing steps;

[0025] The preset conditions include: in each second processing step, the non-target vertices constituting the second edge are connected to at least a preset number of target vertices in the target vertex set;

[0026] The third processing step includes: adding non-target vertices in the second edge as target vertices to the target vertex set to update the target vertex set; adding the third edge to the latest fifth target set to update the fifth target set; and updating the sixth target set according to the updated target vertex set. The third edge is the edge connecting the non-target vertex and the target vertex in each third processing step. The updated fifth target set is used as the fifth target set in the next second processing step, and the updated sixth target set is used as the sixth target set in the next second processing step.

[0027] The sixth target set is determined based on the set of all edges in the target undirected graph that are connected to at least one target vertex in the target vertex set during each second processing step.

[0028] According to an image retrieval method provided by the present invention, obtaining the target sub-image includes:

[0029] If no element exists in the sixth target set, the target subgraph is obtained based on the updated target vertex set and the updated fifth target set;

[0030] If the second edge does not exist in the second target edge difference set, the target subgraph is obtained based on the first edge and the target vertex corresponding to the first edge.

[0031] According to an image retrieval method provided by the present invention, the method for obtaining the relative distance includes:

[0032] Obtain the distance between any two target objects and each centroid, where the centroid is obtained after an initial clustering of the target object set;

[0033] The relative distance is obtained based on the distance between any two target objects and each centroid.

[0034] According to an image retrieval method provided by the present invention, obtaining the distance between any two target objects and each centroid includes:

[0035] The distance is obtained based on the Euclidean distance, Manhattan distance, or cosine similarity between any two target objects and each centroid.

[0036] The present invention also provides an image retrieval system, comprising:

[0037] The system comprises a first acquisition module, a second acquisition module, and an image retrieval module.

[0038] The first acquisition module is used to obtain the aggregation result of the target object set, the target object set including multiple target objects, the target object being a vector representation of an image unit object, the image unit object being obtained by segmenting the target image, and the aggregation result being used to characterize the similarity of each target object in the target set;

[0039] The second acquisition module is used to acquire the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0040] The image retrieval module is used to perform image retrieval on the target image based on image unit objects in the target similarity set.

[0041] The present invention also provides an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the image retrieval method as described above.

[0042] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image retrieval method as described above.

[0043] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the image retrieval method as described above.

[0044] The image retrieval method and system provided by this invention treats the image unit objects corresponding to each target sub-image in the aggregation result of the target object set as a target similarity set, and performs image retrieval based on the image unit objects in the target similarity set, thereby improving the efficiency and accuracy of image retrieval. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0046] Figure 1 This is a flowchart illustrating the image retrieval method provided by the present invention;

[0047] Figure 2 This is a schematic diagram of the image retrieval system provided by the present invention;

[0048] Figure 3 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0050] Grouping identical or similar image elements has significant applications in image retrieval and image classification. However, when grouping highly similar image elements, ordinary clustering algorithms either fail to achieve the required accuracy or cannot meet certain time constraints. Therefore, this invention provides an image retrieval method, specifically implemented as follows:

[0051] Figure 1 This is a flowchart illustrating the image retrieval method provided by the present invention, as shown below. Figure 1 As shown, the method includes:

[0052] Step 100: Obtain the aggregation result of the target object set, wherein the target object set includes multiple target objects, the target object is a vector representation of an image unit object, the image unit object is obtained by segmenting the target image, and the aggregation result is used to characterize the similarity of each target object in the target set;

[0053] Step 110: Obtain the target similarity set corresponding to each target sub-image in the aggregation result. The target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image.

[0054] Step 120: Perform image retrieval on the target image based on the image unit objects in the target similarity set.

[0055] It should be noted that the above method can be implemented by computer equipment.

[0056] In this embodiment of the invention, the target object set can specifically be a collection of target objects. Each element in the target object set corresponds to a vector representation of an image unit object. The target object set contains at least two target objects or at least two vector representations of image unit objects. Specifically, the target object can be a vector representation of an image unit object, which can be obtained by segmenting the target image to be retrieved according to a certain granularity. For example, segmenting the target image according to pixel size yields image unit objects. All image unit objects corresponding to the target images are represented as vector representations of the same dimension to obtain individual target objects. A target object set is then constructed based on these individual target objects.

[0057] In this embodiment of the invention, the aggregation result can specifically be obtained after performing at least one first processing step on the aforementioned target object set. The aggregation result can specifically be the similarity degree of each target object in the target set, and can specifically include the target subgraph obtained in each of the first processing steps. The target subgraph can specifically be a similarity subgraph of the target undirected graph.

[0058] In this embodiment of the invention, the image unit object corresponding to each target sub-image in the aggregation result is taken as a target similarity set, and image retrieval is performed based on each image unit object in the target similarity set. This target similarity set can specifically be a high similarity set, or more specifically, a set of image unit objects with high similarity. The image retrieval can be specifically performed by using each image unit object in this similarity set as a subset of the image retrieval data, thereby improving the efficiency and accuracy of image retrieval.

[0059] The image retrieval method provided by this invention treats the image unit objects corresponding to each target sub-image in the aggregation result of the target object set as a target similarity set, and performs image retrieval based on the image unit objects in the target similarity set, thereby improving the efficiency and accuracy of image retrieval.

[0060] Furthermore, in one embodiment, the method for obtaining the aggregation result of the target object set includes:

[0061] Perform the first processing step at least once until there are no elements left in the vertex difference set;

[0062] The aggregation result is obtained based on all target subgraphs obtained in at least one of the first processing steps;

[0063] The first processing step includes: obtaining a target subgraph corresponding to the target undirected graph; updating the undirected graph based on the vertex difference set and the first target edge difference set; updating the target undirected graph according to the updated undirected graph; the updated undirected graph serving as the undirected graph in the next first processing step; the updated target undirected graph serving as the target undirected graph in the next first processing step; the target undirected graph in the first first processing step is obtained based on the undirected graph in the first first processing step; and the undirected graph in the first first processing step is constructed based on the target object set.

[0064] The vertex difference set is the difference set between the first target set and the second target set. The first target set is determined based on the set of all vertices in the target subgraph obtained in each first processing step. The second target set is determined based on the set of all vertices in the target undirected graph in each first processing step.

[0065] The first target edge difference set is the difference set between the third target set and the fourth target set. The third target set is determined based on the set of all edges in the target subgraph obtained in each first processing step. The fourth target set is determined based on the set of all edges in the target undirected graph in each first processing step.

[0066] In this embodiment of the invention, the first processing step may specifically involve obtaining a target subgraph corresponding to the target undirected graph, updating the undirected graph based on the vertex difference set and the first target edge difference set, and updating the target undirected graph based on the updated undirected graph. The updated undirected graph serves as the undirected graph in the next first processing step, and the updated target undirected graph serves as the target undirected graph in the next first processing step.

[0067] In this embodiment of the invention, the target undirected graph can be specifically obtained by preprocessing the undirected graph. For the undirected graph in the first processing step, it can be specifically constructed based on each target object in the target object set. For the undirected graph other than the first processing step, it can be specifically obtained by taking the vertex difference set as the vertices of the undirected graph and taking the first target edge difference set as the edges of the undirected graph.

[0068] In this embodiment of the invention, the absence of any element in the vertex difference set can specifically mean that the vertex difference set is an empty set. The vertex difference set can specifically be the difference set obtained by subtracting the first target set from the second target set in each first processing step. The first target set can specifically be the set composed of all vertices in the target subgraph in each first processing step. The target subgraph can specifically be constructed from various target objects of the same class in the target undirected graph. The second target set can specifically be the set composed of all vertices in the target undirected graph in each first processing step.

[0069] In this embodiment of the invention, the first target edge difference set can be specifically the difference set obtained by subtracting the third target set from the fourth target set in each first processing step. The third target set can be specifically the set composed of all edges in the target subgraph in each first processing step. The fourth target set can be specifically the set composed of all edges in the target undirected graph in each first processing step.

[0070] In this embodiment of the invention, clustering divides a set of target objects into different classes according to a specific criterion (such as distance), maximizing the similarity of target objects within the same class and maximizing the differences between target objects in different classes. In other words, after clustering, target objects of the same class are grouped together as much as possible, while target objects of different classes are separated as much as possible. The specific class label is not considered during the partitioning process; the goal is simply to group similar target objects together.

[0071] In this embodiment of the invention, the first processing procedure is executed at least once until there are no elements in the vertex difference set, at which point the execution of the first processing procedure is stopped.

[0072] In this embodiment of the invention, updating the target undirected graph according to the updated undirected graph can specifically involve preprocessing the updated undirected graph to obtain the updated target undirected graph.

[0073] In this embodiment of the invention, after no element exists in the vertex difference set, all target subgraphs obtained through the first processing step are used as the aggregation result of each target object in the target object set.

[0074] The image retrieval method provided by this invention constructs an undirected graph of each target object and splits the undirected graph into individual target subgraphs. This enables the aggregation of similar target objects, improving the accuracy of the aggregation results and laying the foundation for subsequent image retrieval based on these aggregation results, thereby enhancing the efficiency and accuracy of image retrieval.

[0075] Furthermore, in one embodiment, the method for obtaining the target undirected graph may specifically include:

[0076] Based on each of the target objects, determine the vertices of the undirected graph;

[0077] Determine the edges of the undirected graph based on the relative distance between any two target objects;

[0078] Construct the undirected graph based on its vertices and edges;

[0079] Delete edges in the undirected graph that exceed a preset threshold, and delete isolated vertices in the undirected graph to obtain the target undirected graph.

[0080] In this embodiment of the invention, each target object is used as a vertex of an undirected graph, and the relative distance is used as an edge of the undirected graph to construct the undirected graph.

[0081] In this embodiment of the invention, all edges with a relative distance greater than a preset threshold and isolated vertices are deleted from the undirected graph to obtain the target undirected graph.

[0082] In this embodiment of the invention, the isolated vertex can specifically be a vertex that falls outside the undirected graph after all edges with a relative distance greater than a preset threshold are deleted from the undirected graph.

[0083] Furthermore, in one embodiment, the method for obtaining the relative distance may specifically include:

[0084] Obtain the distance between any two target objects and each centroid, where the centroid is obtained after an initial clustering of the target object set;

[0085] The relative distance is obtained based on the distance between any two target objects and each centroid.

[0086] In this embodiment of the invention, the centroid can specifically refer to the k cluster centers obtained after an initial clustering of the target object set, with each cluster center corresponding to a centroid. This initial clustering can specifically employ a common clustering algorithm, such as K-means or DBSCAN.

[0087] In this embodiment of the invention, the relative distance can be specifically obtained by subtracting the absolute values ​​of the distances from each target object to each centroid in pairs, and then summing the absolute values ​​and averaging them.

[0088] Furthermore, in one embodiment, obtaining the distance between any two target objects and each centroid may specifically include:

[0089] The distance is obtained based on the Euclidean distance, Manhattan distance, or cosine similarity between any two target objects and each centroid.

[0090] In this embodiment of the invention, the distance can be specifically the distance between vectors, or more specifically, it can be obtained by using the Euclidean distance, Manhattan distance, or cosine similarity between any two target objects and each centroid.

[0091] The image retrieval method provided by this invention constructs an undirected graph based on a set of target objects, and processes the undirected graph to obtain a target undirected graph. This lays the foundation for obtaining corresponding target subgraphs based on the target undirected graph, thereby grouping similar target objects together and improving the accuracy of clustering results.

[0092] Furthermore, in one embodiment, obtaining the target subgraph corresponding to the target undirected graph may specifically include:

[0093] The set of the first edges with the smallest relative distance in the target undirected graph is taken as the fifth target set;

[0094] The set of target vertices constituting the first side is taken as the target vertex set;

[0095] Execute the second processing procedure at least once until the sixth target set is empty or there is no second edge with the smallest relative distance in the second target edge difference set, and obtain the target subgraph;

[0096] The second processing procedure includes: if the second edge exists in the second target edge difference set, and if a preset condition is met, then at least one third processing procedure is executed until the preset condition is not met, and the second edge in the sixth target set is deleted to update the sixth target set until there are no elements in the sixth target set.

[0097] The second target difference set is the difference set between the fifth target set and the sixth target set in each of the second processing steps;

[0098] The preset conditions include: in each second processing step, the non-target vertices constituting the second edge are connected to at least a preset number of target vertices in the target vertex set;

[0099] The third processing step includes: adding non-target vertices in the second edge as target vertices to the target vertex set to update the target vertex set; adding the third edge to the latest fifth target set to update the fifth target set; and updating the sixth target set according to the updated target vertex set. The third edge is the edge connecting the non-target vertex and the target vertex in each third processing step. The updated fifth target set is used as the fifth target set in the next second processing step, and the updated sixth target set is used as the sixth target set in the next second processing step.

[0100] The sixth target set is determined based on the set of all edges in the target undirected graph that are connected to at least one target vertex in the target vertex set during each second processing step.

[0101] Furthermore, in one embodiment, obtaining the target sub-graph may specifically include:

[0102] If no element exists in the sixth target set, the target subgraph is obtained based on the updated target vertex set and the updated fifth target set;

[0103] If the second edge does not exist in the second target edge difference set, the target subgraph is obtained based on the first edge and the target vertex corresponding to the first edge.

[0104] In this embodiment of the invention, the fifth target set can be specifically a set composed of the first edge, which can be specifically the edge with the smallest relative distance among all edges constituting the target undirected graph.

[0105] In this embodiment of the invention, the set formed by the first edge is taken as the fifth target set.

[0106] In this embodiment of the invention, the target vertex set is a set of target vertices connected to the first edge.

[0107] In the first processing step, there is only one first edge, and there are two target vertices connecting the first edge.

[0108] In this embodiment of the invention, the following second processing procedure is executed at least once until the sixth target set is empty or the second target edge difference set does not contain a second edge with the smallest relative distance. At this point, the execution of the second processing procedure stops, and the target subgraph for each second processing step is obtained. The sixth target set being empty can specifically mean that the sixth target set contains no elements. The second target edge difference set can specifically be the difference set obtained by subtracting the fifth target set from the sixth target set in each second processing step.

[0109] In this embodiment of the invention, the second processing step can specifically involve repeatedly executing the following third processing step when a second edge exists in the second target edge difference set, until a preset condition is not met, at which point the execution of the third processing step is stopped. The preset condition can specifically be that in each second processing step, the non-target vertices constituting the second edge are connected to at least a preset number of target vertices in the target vertex set; more specifically, in each second processing step, the non-target vertices constituting the second edge are connected to at least half of the target vertices in the target vertex set.

[0110] In this embodiment of the invention, the third processing step can specifically involve, if a preset condition is met, adding the non-target vertices in the second edge as target vertices to the target vertex set to update the target vertex set; adding the third edge to the fifth target set to update the fifth target set; and updating the sixth target set based on the updated target vertex set. If the preset condition is not met, deleting the second edge from the sixth target set to update the sixth target set, until the sixth target set is empty, at which point the third processing step stops. The third edge can specifically be the edge connecting the non-target vertex and the target vertex in each third processing step. The updated fifth target set serves as the fifth target set in the next second processing step, and the updated sixth target set serves as the sixth target set in the next second processing step.

[0111] In this embodiment of the invention, the sixth target set can specifically be the set of all edges in the target undirected graph that are connected to at least one target vertex in the target vertex set during each second processing step.

[0112] In this embodiment of the invention, there are two conditions for stopping the second processing: first, the sixth target set does not contain any elements; second, the second target edge difference set does not contain a second edge.

[0113] In this embodiment of the invention, when the sixth target set does not contain any elements, the updated target vertex set is used as the vertices of the target subgraph, and the updated fifth target set is used as the edges of the target subgraph to construct the target subgraph.

[0114] In this embodiment of the invention, when there is no second edge in the second target edge difference set, the first edge is used as the edge of the target subgraph, and the target vertex corresponding to the first edge is used as the vertex of the target subgraph to construct the target subgraph.

[0115] For example, in step 1, the n images to be aggregated are divided into image unit objects corresponding to the n images to be aggregated according to a certain granularity. For example, they can be divided into equal-sized segments according to pixel size.

[0116] Step 2: Represent the n image unit objects as vectors of the same dimension;

[0117] Step 3: For n image unit objects, establish a set S containing n image unit objects, where the elements of the set are the vector representations of these n image unit objects;

[0118] Step 4: Cluster the target object set S consisting of these n objects to be aggregated to obtain k cluster centers, each corresponding to a centroid. This initial clustering can specifically use a general clustering algorithm, such as K-means, DBSCAN, etc.

[0119] Step 5: Calculate pairwise distances between the n objects to be aggregated.

[0120] Step 5.1: Calculate the distance from each object to be aggregated in the target object set S to these k centroids. Specifically, this distance can be calculated using Euclidean distance, Manhattan distance, cosine similarity, or other distance calculation methods.

[0121] Step 5.2: Subtract the distances of each object to be aggregated from the k centroids in pairs and take the absolute values. Sum these k absolute values ​​and take the average value as the relative distance between the two objects to be aggregated.

[0122] Step 6: Denote the set S consisting of all objects to be aggregated as the vertex set of the undirected graph G as V, and the set consisting of the relative distances between any two objects to be aggregated as the edge set of the undirected graph G as E, thus obtaining the undirected graph G = (V, E).

[0123] Step 7: In the undirected graph G, delete all edges whose relative distance is greater than a preset threshold, and then delete isolated vertices to obtain the target undirected graph G_sim = (V_sim, E_sim), where V_sim is the set of all vertices of the target undirected graph G_sim, and E_sim is the set of all edges of the target undirected graph G_sim.

[0124] Step 8, construct the cluster set:

[0125] Step 8.1: Take the first edge with the smallest relative distance in E_sim, add the first edge to set E1, and add the vertex corresponding to the first edge to set V1;

[0126] Step 8.2: Find the set of all edges connecting vertices in V1 from the target undirected graph G_sim, denoted as E_tp;

[0127] Step 8.3: Calculate the difference between set E_tp and set E1, i.e. (E_tp–E1), and find the second edge with the smallest relative distance in the set of edges (E_tp–E1);

[0128] Step 8.3.1, if the second side exists:

[0129] Step 8.3.1.1: If the other vertex corresponding to the second edge (i.e., a vertex not in set V1) is connected to more than half of the vertices in set V1, then add the vertex not in set V1 to V1, and add the third edge connecting the vertex not in set V1 to all vertices in set V1 to set E1, then go to step 8.2.

[0130] Step 8.3.1.2, otherwise, remove the second edge from the set E_tp;

[0131] Step 8.3.1.3: If set E_tp is an empty set, then set V1 is completed and proceed to step 9; otherwise, proceed to step 8.3.

[0132] Step 8.3.2: If the second side does not exist, then set V1 is completed, proceed to step 9;

[0133] Step 9, the target subgraph, i.e. the similar subgraph G1 = (V1, E1), is the first maximum similar subgraph of the obtained target undirected graph, and its vertex set V1 is the set of objects of the same class to be aggregated;

[0134] Step 10: If the difference between set V_sim and set V1 (V_sim–V1) is empty, the algorithm ends; otherwise, (V_sim–V1, E_sim–E1) is used as a new undirected graph G, and proceed to step 7.

[0135] Step 11: The image unit objects corresponding to each maximum similarity sub-image are a set of highly similar images. Using image unit objects belonging to the same set of highly similar images as a subset of image retrieval can greatly reduce the efficiency and time of image retrieval.

[0136] The image retrieval method provided by this invention can group target objects of the same type together by splitting the preprocessed undirected graph into individual target subgraphs, thereby avoiding the problem of clustering results deviating and improving the accuracy of clustering results.

[0137] The image retrieval system provided by the present invention is described below. The image retrieval system described below can be referred to in correspondence with the image retrieval method described above.

[0138] Figure 2 This is a schematic diagram of the image retrieval system provided by the present invention, as shown below. Figure 2 As shown, it includes:

[0139] The first acquisition module 200, the second acquisition module 210, and the image retrieval module 220;

[0140] The first acquisition module 200 is used to obtain the aggregation result of the target object set, the target object set including multiple target objects, the target object being a vector representation of an image unit object, the image unit object being obtained by segmenting the target image, and the aggregation result being used to characterize the similarity of each target object in the target set;

[0141] The second acquisition module 210 is used to acquire the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0142] The image retrieval module 220 is used to perform image retrieval on the target image based on image unit objects in the target similarity set.

[0143] The image retrieval system provided by this invention treats the image unit objects corresponding to each target sub-image in the aggregation result of the target object set as a target similarity set, which can push image unit objects belonging to the same target similarity set to the same user in a short time, thus ensuring the timeliness and accuracy of image retrieval.

[0144] Figure 3 This is a schematic diagram of the physical structure of an electronic device provided by the present invention, such as... Figure 3 As shown, the electronic device may include a processor 310, a communication interface 311, a memory 312, and a bus 313, wherein the processor 310, the communication interface 311, and the memory 312 communicate with each other via the bus 313. The processor 310 can call logical instructions in the memory 312 to execute the following methods:

[0145] An aggregation result is obtained for a set of target objects, which includes multiple target objects. Each target object is a vector representation of an image unit object, which is obtained by segmenting a target image. The aggregation result is used to characterize the similarity between the target objects in the target set.

[0146] Obtain the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0147] Image retrieval is performed on the target image based on the image unit objects in the target similarity set.

[0148] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer power supply (which may be a personal computer, server, or network power supply, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0149] Furthermore, this invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when these instructions are executed by a computer, the computer can perform the image retrieval methods provided in the above-described method embodiments, such as including:

[0150] An aggregation result is obtained for a set of target objects, which includes multiple target objects. Each target object is a vector representation of an image unit object, which is obtained by segmenting a target image. The aggregation result is used to characterize the similarity between the target objects in the target set.

[0151] Obtain the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0152] Image retrieval is performed on the target image based on the image unit objects in the target similarity set.

[0153] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the image retrieval methods provided in the above embodiments, including, for example:

[0154] An aggregation result is obtained for a set of target objects, which includes multiple target objects. Each target object is a vector representation of an image unit object, which is obtained by segmenting a target image. The aggregation result is used to characterize the similarity between the target objects in the target set.

[0155] Obtain the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image;

[0156] Image retrieval is performed on the target image based on the image unit objects in the target similarity set.

[0157] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0158] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer power supply (which may be a personal computer, server, or network power supply, etc.) to execute the methods described in various embodiments or some parts of the embodiments.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An image retrieval method, characterized in that, include: An aggregation result of a target object set is obtained, wherein the target object set includes multiple target objects, the target object is a vector representation of an image unit object, the image unit object is obtained by segmenting the target image, and the aggregation result is used to characterize the similarity of each target object in the target object set; Obtain the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image; Image retrieval is performed on the target image based on image unit objects in the target similarity set; The methods for obtaining the aggregation result of the target object set include: Perform the first processing step at least once until there are no elements left in the vertex difference set; The aggregation result is obtained based on all target subgraphs obtained in at least one of the first processing steps; The first processing step includes: obtaining the target subgraph corresponding to the target undirected graph; The step of obtaining the target subgraph corresponding to the target undirected graph includes: The set of the first edges with the smallest relative distance in the target undirected graph is taken as the fifth target set; The set of target vertices constituting the first side is taken as the target vertex set; Execute the second processing procedure at least once until the sixth target set is empty or there is no second edge with the smallest relative distance in the second target edge difference set, and obtain the target subgraph; The second processing procedure includes: if the second edge exists in the second target edge difference set, and if a preset condition is met, then at least one third processing procedure is executed until the preset condition is not met, and the second edge in the sixth target set is deleted to update the sixth target set until there are no elements in the sixth target set. The second target difference set is the difference set between the fifth target set and the sixth target set in each of the second processing steps; The preset conditions include: in each second processing step, the non-target vertices constituting the second side are connected to at least a preset number of target vertices in the target vertex set; The third processing step includes: adding non-target vertices in the second edge as target vertices to the target vertex set to update the target vertex set; adding the third edge to the latest fifth target set to update the fifth target set; and updating the sixth target set according to the updated target vertex set. The third edge is the edge connecting the non-target vertex and the target vertex in each third processing step. The updated fifth target set is used as the fifth target set in the next second processing step, and the updated sixth target set is used as the sixth target set in the next second processing step. The sixth target set is determined based on the set of all edges in the target undirected graph that are connected to at least one target vertex in the target vertex set during each second processing step.

2. The image retrieval method according to claim 1, characterized in that, Based on the vertex difference set and the first target edge difference set, the undirected graph is updated, and the target undirected graph is updated according to the updated undirected graph. The updated undirected graph serves as the undirected graph in the next first processing step, and the updated target undirected graph serves as the target undirected graph in the next first processing step. The target undirected graph in the first first processing step is obtained based on the undirected graph in the first first processing step, and the undirected graph in the first first processing step is constructed based on the target object set. The vertex difference set is the difference set between the first target set and the second target set. The first target set is determined based on the set of all vertices in the target subgraph obtained in each first processing step. The second target set is determined based on the set of all vertices in the target undirected graph in each first processing step. The first target edge difference set is the difference set between the third target set and the fourth target set. The third target set is determined based on the set of all edges in the target subgraph obtained in each first processing step. The fourth target set is determined based on the set of all edges in the target undirected graph in each first processing step.

3. The image retrieval method according to claim 2, characterized in that, The target undirected graph is obtained in the following way: Based on each of the target objects, determine the vertices of the undirected graph; Determine the edges of the undirected graph based on the relative distance between any two target objects; Construct the undirected graph based on its vertices and edges; Delete edges in the undirected graph that exceed a preset threshold, and delete isolated vertices in the undirected graph to obtain the target undirected graph.

4. The image retrieval method according to claim 1, characterized in that, The step of obtaining the target sub-graph includes: If no element exists in the sixth target set, the target subgraph is obtained based on the updated target vertex set and the updated fifth target set; If the second edge does not exist in the second target edge difference set, the target subgraph is obtained based on the first edge and the target vertex corresponding to the first edge.

5. The image retrieval method according to claim 3, characterized in that, The method for obtaining the relative distance includes: Obtain the distance between any two target objects and each centroid, where the centroid is obtained after an initial clustering of the target object set; The relative distance is obtained based on the distance between any two target objects and each centroid.

6. The image retrieval method according to claim 5, characterized in that, The step of obtaining the distance between any two target objects and each centroid includes: The distance is obtained based on the Euclidean distance, Manhattan distance, or cosine similarity between any two target objects and each centroid.

7. An image retrieval system, characterized in that, include: The system comprises a first acquisition module, a second acquisition module, and an image retrieval module. The first acquisition module is used to obtain the aggregation result of the target object set, the target object set including multiple target objects, the target object being a vector representation of an image unit object, the image unit object being obtained by segmenting the target image, and the aggregation result being used to characterize the similarity of each target object in the target object set; The second acquisition module is used to acquire the target similarity set corresponding to each target sub-image in the aggregation result, wherein the target similarity set corresponding to the target sub-image includes the image unit object corresponding to the target sub-image; The image retrieval module is used to perform image retrieval on the target image based on image unit objects in the target similarity set; The methods for obtaining the aggregation result of the target object set include: Perform the first processing step at least once until there are no elements left in the vertex difference set; The aggregation result is obtained based on all target subgraphs obtained in at least one of the first processing steps; The first processing step includes: obtaining the target subgraph corresponding to the target undirected graph; The step of obtaining the target subgraph corresponding to the target undirected graph includes: The set of the first edges with the smallest relative distance in the target undirected graph is taken as the fifth target set; The set of target vertices constituting the first side is taken as the target vertex set; Execute the second processing procedure at least once until the sixth target set is empty or there is no second edge with the smallest relative distance in the second target edge difference set, and obtain the target subgraph; The second processing procedure includes: if the second edge exists in the second target edge difference set, and if a preset condition is met, then at least one third processing procedure is executed until the preset condition is not met, and the second edge in the sixth target set is deleted to update the sixth target set until there are no elements in the sixth target set. The second target difference set is the difference set between the fifth target set and the sixth target set in each of the second processing steps; The preset conditions include: in each second processing step, the non-target vertices constituting the second side are connected to at least a preset number of target vertices in the target vertex set; The third processing step includes: adding non-target vertices in the second edge as target vertices to the target vertex set to update the target vertex set; adding the third edge to the latest fifth target set to update the fifth target set; and updating the sixth target set according to the updated target vertex set. The third edge is the edge connecting the non-target vertex and the target vertex in each third processing step. The updated fifth target set is used as the fifth target set in the next second processing step, and the updated sixth target set is used as the sixth target set in the next second processing step. The sixth target set is determined based on the set of all edges in the target undirected graph that are connected to at least one target vertex in the target vertex set during each second processing step.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the image retrieval method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the image retrieval method as described in any one of claims 1 to 6.