Graph-based object aggregation method and system

By constructing and processing undirected graphs and splitting them into similar subgraphs, the problem of clustering result deviation in existing clustering algorithms is solved, clustering accuracy is improved, and similar objects are correctly aggregated.

CN115795336BActive Publication Date: 2026-04-07TRANSN IOL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-01
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing clustering algorithms are prone to causing deviations in the clustering results, especially in large-scale applications where they are highly dependent on the quality of the initial samples and the selection of cluster centers is highly random, leading to inaccurate clustering results.

Method used

By constructing an undirected graph of the objects to be aggregated and splitting it into similar subgraphs, edges and isolated vertices are deleted using relative distance and a preset threshold, and a set of target vertices and edges is constructed. This process is repeated until the difference set is empty, thus obtaining similar subgraphs and improving clustering accuracy.

Benefits of technology

This effectively avoids deviations in clustering results, improves the accuracy of clustering results, and ensures that similar objects to be clustered are grouped together.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115795336B_ABST
    Figure CN115795336B_ABST
Patent Text Reader

Abstract

The application provides a graph-based object aggregation method and system. The method comprises: performing at least one aggregation process until a first difference set is empty; and taking all similar subgraphs obtained in the at least one aggregation process as an aggregation result of a set of objects to be aggregated. The system executes the method. The application can aggregate similar objects to be aggregated together by constructing an undirected graph of each object to be aggregated and splitting the undirected graph into similar subgraphs, thereby improving the accuracy of the clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a graph-based object aggregation method and system. BACKGROUND

[0002] Cluster analysis is an unsupervised learning method based on machine learning, which is used to divide samples of unknown categories into several class families according to certain rules, and to group similar (close distance) samples in the same class cluster and different samples in different class clusters, so as to reveal the inherent properties of samples and the connection rules between them. Cluster analysis has a wide range of applications in banks, retail, insurance, medicine, military and other fields.

[0003] Existing clustering algorithms, such as partition clustering: k-means; density-based clustering: DBSCAN; hierarchical clustering: Agglomerative, Divisive, etc., have the advantages of fast and efficient clustering, but also have some problems. For example: k-means is a typical partition clustering algorithm, which uses a cluster center to represent a cluster, and the clustering shape can only be spherical; the effectiveness of the clustering method CLARA in large applications depends on the size, distribution and quality of the samples, so the algorithm will depend on the quality of the initial sampling to some extent. In addition, CLARA does not change after the center is determined, which has certain randomness. Assuming that the determined k objects are far away from the best center, then how to select the center at the end of CLARA, the best clustering center cannot be obtained. k-means, CLARA, etc. will cause the clustering result to deviate. SUMMARY

[0004] The graph-based object aggregation method and system provided by the present application solve the problem that the existing clustering algorithm deviates the aggregation result in the prior art, by constructing an undirected graph of each object to be aggregated and splitting the undirected graph into similar subgraphs, the similar objects to be aggregated can be aggregated together, and the accuracy of the clustering result is improved.

[0005] The graph-based object aggregation method provided by the present application comprises:

[0006] performing at least one aggregation process until the first difference set is empty;

[0007] all similar subgraphs obtained in at least one aggregation process are taken as the aggregation result of the object set to be aggregated;

[0008] The aggregation process comprises: obtaining a similar subgraph corresponding to the first undirected graph, updating the undirected graph according to the first difference set and the second difference set, and updating the first undirected graph according to the updated undirected graph, wherein the updated undirected graph is used as the undirected graph in the next aggregation process, and the updated first undirected graph is used as the first undirected graph in the next aggregation process, the first undirected graph in the first aggregation process is obtained according to the undirected graph in the first aggregation process, and the undirected graph in the first aggregation process is constructed according to a set of objects to be aggregated, and the set of objects to be aggregated comprises a plurality of objects to be aggregated.

[0009] The first difference set is a difference set of a first vertex set and a second vertex set, the first vertex set is a set of all vertices in the similar subgraph obtained in each aggregation process, and the second vertex set is a set of all vertices in the first undirected graph in each aggregation process.

[0010] The second difference set is a difference set of a first edge set and a second edge set, the first edge set is a set of all edges in the similar subgraph obtained in each aggregation process, and the second edge set is a set of all edges in the first undirected graph in each aggregation process.

[0011] According to the object aggregation method based on a graph provided by the application, the first undirected graph is obtained, comprising:

[0012] Each object to be aggregated is used as a vertex of the undirected graph, and a relative distance between any two objects to be aggregated is used as an edge of the undirected graph, so as to construct the undirected graph.

[0013] The edges greater than a preset threshold in the undirected graph are deleted, and the isolated vertices in the undirected graph are deleted, so as to obtain the first undirected graph.

[0014] According to the object aggregation method based on a graph provided by the application, the similar subgraph corresponding to the first undirected graph is obtained, comprising:

[0015] A first target edge set is constructed according to a first edge with the smallest relative distance in the first undirected graph.

[0016] A target vertex set is constructed according to target vertices constituting the first edge.

[0017] A first processing process is executed at least once until the second target edge set is empty or there is no second edge with the smallest relative distance in the third difference set, so as to obtain the similar subgraph.

[0018] The first processing process comprises: in the case that the second edge exists in the third difference set, if a preset condition is met, performing at least one second processing process until the preset condition is not met, deleting the second edge from the second target edge set to update the second target edge set until the second target edge set is empty.

[0019] The third difference set is a difference set of the first target edge set and the second target edge set in each first processing process.

[0020] The preset condition comprises: in each first processing process, the non-target vertex constituting the second edge is connected with at least a preset number of target vertices in the target vertex set.

[0021] The second processing process comprises: adding the non-target vertex in the second edge to the target vertex set as the target vertex to update the target vertex set, adding a third edge to the latest first target edge set to update the first target edge set, and updating the second target edge set according to the updated target vertex set, the third edge being an edge connecting the non-target vertex and the target vertex in each second processing process, the updated first target edge set being the first target edge set in the next first processing process, and the updated second target edge set being the second target edge set in the next first processing process.

[0022] The second target edge set is a set of all edges connecting at least one target vertex in the target vertex set in the first undirected graph in each first processing process.

[0023] According to the object aggregation method based on a graph provided by the application, the similar subgraph is obtained by:

[0024] In the case that the second target edge set is empty, the similar subgraph is obtained according to the updated target vertex set and the updated first target edge set.

[0025] In the case that the second edge does not exist in the third difference set, the similar subgraph is obtained according to the first edge and the target vertex corresponding to the first edge.

[0026] According to the object aggregation method based on a graph provided by the application, the relative distance is obtained by:

[0027] The distance between any two of the objects to be aggregated and each centroid is obtained, the centroid being obtained by performing an initial clustering on the object set to be aggregated once.

[0028] According to the distance between any two of the to-be-aggregated objects and each centroid, the relative distance is obtained.

[0029] According to the object aggregation method based on a graph provided by the application, the distance between any two of the to-be-aggregated objects and each centroid comprises:

[0030] According to the Euclidean distance, Manhattan distance or cosine similarity between any two of the to-be-aggregated objects and each centroid, the distance is determined.

[0031] The application further provides an object aggregation system based on a graph, comprising a processing module and an aggregation module.

[0032] The processing module is configured to perform at least one aggregation process until the first difference set is empty.

[0033] The aggregation module is configured to take all the similar subgraphs obtained in the at least one aggregation process as the aggregation result of the set of to-be-aggregated objects.

[0034] The aggregation process comprises: obtaining a similar subgraph corresponding to a first undirected graph, updating the undirected graph according to the first difference set and a second difference set, and updating the first undirected graph according to the updated undirected graph, wherein the updated undirected graph is used as the undirected graph in the next aggregation process, and the updated first undirected graph is used as the first undirected graph in the next aggregation process, the first undirected graph in the first aggregation process is obtained according to the undirected graph in the first aggregation process, and the undirected graph in the first aggregation process is constructed according to the set of to-be-aggregated objects, and the set of to-be-aggregated objects comprises a plurality of to-be-aggregated objects.

[0035] The first difference set is the difference set of a first vertex set and a second vertex set, the first vertex set is a set of all vertices in the similar subgraph obtained in each aggregation process, and the second vertex set is a set of all vertices in the first undirected graph in each aggregation process.

[0036] The second difference set is the difference set of a first edge set and a second edge set, the first edge set is a set of all edges in the similar subgraph obtained in each aggregation process, and the second edge set is a set of all edges in the first undirected graph in each aggregation process.

[0037] The application further provides an electronic device comprising a processor and a memory storing a computer program, wherein the processor implements the object aggregation method based on a graph as described above when executing the program.

[0038] The application further provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the graph-based object aggregation method.

[0039] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the graph-based object aggregation method.

[0040] The application provides the graph-based object aggregation method and system, which can aggregate similar objects to be aggregated together by constructing a undirected graph of each object to be aggregated and splitting the undirected graph into similar subgraphs, and the accuracy of clustering results is improved. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0042] Figure 1 is a flowchart of the graph-based object aggregation method provided by the application;

[0043] Figure 2 is a structural diagram of the graph-based object aggregation system provided by the application;

[0044] Figure 3 is a physical structure diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application will be described clearly and completely in the following with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0046] Figure 1 is a flowchart of the graph-based object aggregation method provided by the application, as shown in Figure 1 , the method comprises:

[0047] Step 100: performing at least one aggregation process until the first difference set is empty;

[0048] In step 110, all similar subgraphs obtained in at least one of the aggregation processes are taken as an aggregation result of the set of objects to be aggregated.

[0049] The aggregation process comprises: obtaining a similar subgraph corresponding to the first undirected graph, updating the undirected graph according to the first difference set and the second difference set, and updating the first undirected graph according to the updated undirected graph, wherein the updated undirected graph is taken as the undirected graph in the next aggregation process, and the updated first undirected graph is taken as the first undirected graph in the next aggregation process.

[0050] The first difference set is a difference set of a first vertex set and a second vertex set, the first vertex set is a set of all vertices in the similar subgraph obtained in each aggregation process, and the second vertex set is a set of all vertices in the first undirected graph in each aggregation process.

[0051] The second difference set is a difference set of a first edge set and a second edge set, the first edge set is a set of all edges in the similar subgraph obtained in each aggregation process, and the second edge set is a set of all edges in the first undirected graph in each aggregation process.

[0052] It should be noted that the execution subject of the above method can be a computer device.

[0053] In the embodiment of the application, the aggregation process can specifically comprise: obtaining a similar subgraph corresponding to the first undirected graph, updating the undirected graph according to the first difference set and the second difference set, and updating the first undirected graph according to the updated undirected graph. The updated undirected graph is taken as the undirected graph in the next aggregation process, and the updated first undirected graph is taken as the first undirected graph in the next aggregation process.

[0054] In the embodiment of the application, the first undirected graph can be specifically obtained by preprocessing the undirected graph, the undirected graph in the first aggregation process can be specifically constructed according to each object to be aggregated in the set of objects to be aggregated, and the undirected graph in the aggregation process other than the first aggregation process can be specifically obtained by taking the first difference set as the vertex of the undirected graph and taking the second difference set as the edge of the undirected graph.

[0055] In the embodiment of the present application, the first difference set can be specifically a set without any element, and the first difference set can be specifically a difference set obtained by subtracting the first vertex set from the second vertex set in each aggregation process, the first vertex set can be specifically a set of all vertices in the similar subgraph in each aggregation process, the similar subgraph can be specifically constructed by each to-be-aggregated object belonging to the same class in the first undirected graph, and the second vertex set can be specifically a set of all vertices in the first undirected graph in each aggregation process.

[0056] In the embodiment of the present application, the second difference set can be specifically a difference set obtained by subtracting the first edge set from the second edge set in each aggregation process, the first edge set can be specifically a set of all edges in the similar subgraph in each aggregation process, and the second edge set can be specifically a set of all edges in the first undirected graph in each aggregation process.

[0057] In the embodiment of the present application, the to-be-aggregated object set can be specifically a set of to-be-aggregated objects, each element in the to-be-aggregated object set corresponds to a certain expression of a to-be-aggregated object or the to-be-aggregated object itself, and the to-be-aggregated object set contains at least two to-be-aggregated objects or at least two expression modes of the to-be-aggregated objects. The to-be-aggregated object can be specifically a text, an image, or the like, and the expression mode can be specifically a certain mathematical expression, such as a text represented as a vector, an image represented as a matrix, or the like.

[0058] In the embodiment of the present application, clustering is to divide the to-be-aggregated object set into different classes according to a certain specific standard (such as distance), so that the similarity of to-be-aggregated objects in the same class is as large as possible, and the difference of to-be-aggregated objects not in the same class is as large as possible. That is, after clustering, to-be-aggregated objects in the same class are as close as possible, and to-be-aggregated objects in different classes are as far apart as possible. When dividing, the label of the class is not concerned, and the goal is to aggregate similar to-be-aggregated objects.

[0059] In the embodiment of the present application, at least one aggregation process is performed, and the aggregation process is stopped when there is no element in the first difference set.

[0060] In the embodiment of the present application, updating the first undirected graph based on the updated undirected graph can be specifically preprocessing the updated undirected graph to obtain the updated first undirected graph.

[0061] In the embodiment of the present application, after there is no element in the first difference set, all similar subgraphs obtained through the above aggregation process are taken as the aggregation result of each to-be-aggregated object in the to-be-aggregated object set.

[0062] The application provides a graph-based object aggregation method, which can realize the aggregation of similar objects to be aggregated by constructing a undirected graph of each object to be aggregated and splitting the undirected graph into similar subgraphs, and improves the accuracy of clustering results.

[0063] Further, in an embodiment, the first undirected graph is obtained by:

[0064] Each object to be aggregated is taken as a vertex of the undirected graph, and the relative distance between any two objects to be aggregated is taken as an edge of the undirected graph, so as to construct the undirected graph.

[0065] The edges greater than a preset threshold in the undirected graph are deleted, and the isolated vertices in the undirected graph are deleted, so as to obtain the first undirected graph.

[0066] Further, in an embodiment, the relative distance is obtained by:

[0067] The distance between any two objects to be aggregated and each centroid is obtained, and the centroid is obtained by performing initial clustering on the set of objects to be aggregated.

[0068] The relative distance is obtained according to the distance between any two objects to be aggregated and each centroid.

[0069] In the embodiment of the application, the centroid can be specifically k clustering centers obtained by performing initial clustering on the set of objects to be aggregated, and each clustering center corresponds to a centroid. The initial clustering can be specifically a general clustering algorithm, such as K-means, DBSCAN, etc.

[0070] In the embodiment of the application, the relative distance can be specifically the distance from each object to be aggregated to each centroid, the absolute value obtained by subtracting each other and taking the absolute value, and the sum of each absolute value obtained by taking the average value.

[0071] Further, in an embodiment, the distance between any two objects to be aggregated and each centroid can be specifically obtained by:

[0072] The distance is determined according to the Euclidean distance, Manhattan distance or cosine similarity between any two objects to be aggregated and each centroid.

[0073] In the embodiment of the application, the distance can be specifically the distance between vectors, and can be specifically obtained by the Euclidean distance, Manhattan distance or cosine similarity between any two objects to be aggregated and each centroid.

[0074] In the embodiment of the present application, the isolated vertex can be specifically a vertex falling outside the undirected graph after all edges with a relative distance greater than a preset threshold are deleted from the undirected graph.

[0075] In the embodiment of the present application, each to-be-aggregated object is taken as a vertex of an undirected graph, the relative distance is taken as an edge of the undirected graph, and all edges with a relative distance greater than a preset threshold and isolated vertices are deleted from the undirected graph to obtain a first undirected graph.

[0076] The method for aggregating objects based on a graph provided by the present application is based on a set of to-be-aggregated objects, constructs an undirected graph, and processes the undirected graph to obtain a first undirected graph, so that similar to-be-aggregated objects can be aggregated together based on a similar subgraph corresponding to the first undirected graph, and the accuracy of the clustering result is improved.

[0077] Further, in an embodiment, the obtaining of the similar subgraph corresponding to the first undirected graph comprises:

[0078] constructing a first target edge set according to the first edge with the minimum relative distance in the first undirected graph;

[0079] constructing a target vertex set according to the target vertices constituting the first edge;

[0080] performing at least one first processing process until the second target edge set is empty or there is no second edge with the minimum relative distance in the third difference set, to obtain the similar subgraph;

[0081] The first processing process comprises: in the case where the second edge exists in the third difference set, if a preset condition is met, performing at least one second processing process until the preset condition is not met, deleting the second edge from the second target edge set to update the second target edge set, and stopping until the second target edge set is empty.

[0082] The third difference set is a difference set of the first target edge set and the second target edge set in each first processing process.

[0083] The preset condition comprises: in each first processing process, the non-target vertex constituting the second edge is connected to at least a preset number of target vertices in the target vertex set.

[0084] The second processing process comprises: adding a non-target vertex in the second edge to the target vertex set as the target vertex to update the target vertex set, adding a third edge to the latest first target edge set to update the first target edge set, and updating the second target edge set according to the updated target vertex set, the third edge being an edge connecting the non-target vertex and the target vertex in each second processing process, the updated first target edge set being the first target edge set in the next first processing process, and the updated second target edge set being the second target edge set in the next first processing process.

[0085] The second target edge set is a set of all edges connecting at least one target vertex in the target vertex set in the first undirected graph in each first processing process.

[0086] Further, in an embodiment, the obtaining the similar subgraph comprises:

[0087] In the case that the second target edge set is empty, the similar subgraph is obtained according to the updated target vertex set and the updated first target edge set.

[0088] In the case that the second edge does not exist in the third difference set, the similar subgraph is obtained according to the first edge and the target vertex corresponding to the first edge.

[0089] In the embodiment of the application, the first target edge set can specifically be a set composed of the first edge, and the first edge can specifically be an edge with the smallest relative distance among all edges in the first undirected graph.

[0090] In the embodiment of the application, the first target edge set is constructed according to the set composed of the first edge.

[0091] In the embodiment of the application, the target vertex set is a set of target vertices connected by the first edge.

[0092] In the first aggregation process, the first edge has only one edge, and the target vertices connected by the first edge have two target vertices.

[0093] In the embodiment of the application, the first processing process is repeatedly executed until the second target edge set is empty or the second edge with the smallest relative distance does not exist in the third difference set, the first processing process is stopped, and the similar subgraph in each first processing process is obtained. The second target edge set being empty can specifically mean that there is no element in the second target edge set, and the third difference set can specifically be a difference set obtained by subtracting the first target edge set from the second target edge set in each first processing process.

[0094] In the embodiment of the present application, the first processing process can be specifically repeated as follows: in the case that the second edge exists in the third difference, the second processing process is repeatedly executed until the second processing process is stopped when the preset condition is not met. The preset condition can be specifically that in each first processing process, the non-target vertex constituting the second edge is connected to at least a preset number of target vertices in the target vertex set, and more specifically that in each first processing process, the non-target vertex constituting the second edge is connected to more than half of the target vertices in the target vertex set.

[0095] In the embodiment of the present application, the second processing process can be specifically that in the case that the preset condition is met, the non-target vertex in the second edge is added to the target vertex set as a target vertex to update the target vertex set, the third edge is added to the first target edge set to update the first target edge set, and the second target edge set is updated according to the updated target vertex set; in the case that the preset condition is not met, the second edge is deleted from the second target edge set to update the second target edge set, and the second processing process is stopped until there is no element in the second target edge set. The third edge can be specifically the edge connecting the non-target vertex and the target vertex in each second processing process. The updated first target edge set is the first target edge set in the next first processing process, and the updated second target edge set is the second target edge set in the next first processing process.

[0096] In the embodiment of the present application, the second target edge set can be specifically a set of all edges in the first undirected graph connected to at least one target vertex in the target vertex set in each first processing process.

[0097] In the embodiment of the present application, the condition for stopping the first processing process includes two kinds: the first kind is that the second target edge set has no element; and the second kind is that the second edge does not exist in the third difference.

[0098] In the embodiment of the present application, in the case that the second target edge set has no element, the updated target vertex set is taken as the vertex of the similar subgraph, and the updated first target edge set is taken as the edge of the similar subgraph, to construct the similar subgraph.

[0099] In the embodiment of the present application, in the case that the second edge does not exist in the third difference, the first edge is taken as the edge of the similar subgraph, and the target vertex connected to the first edge is taken as the vertex of the similar subgraph, to construct the similar subgraph.

[0100] For example, in step 1, for N objects to be aggregated, a set S of objects to be aggregated containing N elements is established. Each element of the set S corresponds to a certain expression of the object to be aggregated or is itself (expression refers to a certain mathematical expression of the object to be aggregated, such as text can be represented as a vector; an image can be represented as a matrix).

[0101] Step 2: Cluster the set S of N objects to be aggregated to obtain k cluster centers, each corresponding to a centroid. This initial clustering can be performed using a general clustering algorithm, such as K-means or DBSCAN.

[0102] Step 3: Calculate pairwise distances between the N objects to be aggregated.

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

[0104] Step 3.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.

[0105] Step 4: The set S consisting of all objects to be aggregated is denoted as V, which is the set of vertices of the undirected graph G. The set consisting of the relative distances between any two objects to be aggregated is denoted as E, which is the set of edges of the undirected graph G. Thus, the undirected graph G = (V, E) is obtained.

[0106] Step 5: 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 first undirected graph G_sim = (V_sim, E_sim), where V_sim is the set of all vertices of the first undirected graph G_sim, and E_sim is the set of all edges of the first undirected graph G_sim.

[0107] Step 6, construct the cluster set:

[0108] Step 6.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;

[0109] Step 6.2: Find the set of all edges connecting vertices in V1 from the first undirected graph G_sim, denoted as E_tp;

[0110] Step 6.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);

[0111] Step 6.3.1, if the second side exists:

[0112] Step 6.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 6.2.

[0113] Step 6.3.1.2, otherwise, remove the second edge from the set E_tp;

[0114] Step 6.3.1.3: If set E_tp is an empty set, then set V1 is completed and proceed to step 7; otherwise, proceed to step 6.3.

[0115] Step 6.3.2: If the second side does not exist, then set V1 is completed and proceed to step 7.

[0116] Step 7, similar subgraph G1 = (V1, E1), is the first maximum similar subgraph of the obtained first undirected graph, and its vertex set V1 is the set of objects of the same class to be aggregated;

[0117] Step 8: 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 the process returns to step 5.

[0118] The graph-based object aggregation method provided by this invention can aggregate objects of the same type together by splitting the preprocessed undirected graph into similar subgraphs, thus avoiding the problem of clustering results deviating and improving the accuracy of clustering results.

[0119] The graph-based object aggregation system provided by the present invention is described below. The graph-based object aggregation system described below can be referred to in correspondence with the graph-based object aggregation method described above.

[0120] Figure 2 This is a schematic diagram of the graph-based object aggregation system provided by the present invention, such as... Figure 2 As shown, it includes:

[0121] Processing module 200 and aggregation module 210;

[0122] The processing module 200 is used to perform at least one aggregation process until the first difference set is an empty set;

[0123] The aggregation module 210 is used to take all similar subgraphs obtained in at least one aggregation process as the aggregation result of the set of objects to be aggregated;

[0124] The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated.

[0125] The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process.

[0126] The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process.

[0127] The graph-based object aggregation system provided by this invention constructs an undirected graph of each object to be aggregated and splits the undirected graph into similar subgraphs, which enables the aggregation of similar objects to be aggregated together and improves the accuracy of clustering results.

[0128] 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:

[0129] Perform the aggregation process at least once until the first difference set is empty;

[0130] All similar subgraphs obtained in at least one of the aggregation processes will be used as the aggregation result of the set of objects to be aggregated;

[0131] The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated.

[0132] The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process.

[0133] The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process.

[0134] 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.

[0135] 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 execute the graph-based object aggregation method provided in the above-described method embodiments, for example including:

[0136] Perform the aggregation process at least once until the first difference set is empty;

[0137] All similar subgraphs obtained in at least one of the aggregation processes will be used as the aggregation result of the set of objects to be aggregated;

[0138] The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated.

[0139] The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process.

[0140] The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process.

[0141] 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 graph-based object aggregation methods provided in the above embodiments, including, for example:

[0142] Perform the aggregation process at least once until the first difference set is empty;

[0143] All similar subgraphs obtained in at least one of the aggregation processes will be used as the aggregation result of the set of objects to be aggregated;

[0144] The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated.

[0145] The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process.

[0146] The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process.

[0147] 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.

[0148] 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.

[0149] 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. A graph-based object aggregation method, characterized in that, include: Perform the aggregation process at least once until the first difference set is empty; All similar subgraphs obtained in at least one of the aggregation processes will be used as the aggregation result of the set of objects to be aggregated; The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated. The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process. The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process. Obtaining the first undirected graph includes: The undirected graph is constructed by using each of the objects to be aggregated as vertices of the undirected graph and the relative distance between any two objects to be aggregated as edges of the undirected graph. Delete edges in the undirected graph that exceed a preset threshold, and delete isolated vertices in the undirected graph to obtain the first undirected graph; The objects to be aggregated include at least one of text or images.

2. The graph-based object aggregation method according to claim 1, characterized in that, The step of obtaining the similar subgraphs corresponding to the first undirected graph includes: Construct a first target edge set based on the first edge with the smallest relative distance in the first undirected graph; Construct a target vertex set based on the target vertices that constitute the first side; Execute the first processing procedure at least once until the second target edge set is empty or there is no second edge with the smallest relative distance in the third difference set, and obtain the similar subgraph; The first processing procedure includes: if the second edge exists in the third difference set, and if a preset condition is met, then the second processing procedure is executed at least once until the preset condition is not met, and the second edge is deleted from the second target edge set to update the second target edge set until the second target edge set is an empty set. The third difference set is the difference set between the first target edge set and the second target edge set in each of the first processing steps; The preset conditions include: in each of the first processing steps, 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 second processing procedure includes: adding a non-target vertex in the second edge as the target vertex to the target vertex set to update the target vertex set; adding a third edge to the latest first target edge set to update the first target edge set; and updating the second target edge 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 second processing procedure. The updated first target edge set is used as the first target edge set in the next first processing procedure, and the updated second target edge set is used as the second target edge set in the next first processing procedure. The second target edge set is the set of all edges in the first undirected graph that are connected to at least one target vertex in the target vertex set during each of the first processing steps.

3. The graph-based object aggregation method according to claim 2, characterized in that, The step of obtaining the similar subgraph includes: If the second target edge set is empty, the similar subgraph is obtained based on the updated target vertex set and the updated first target edge set; If the second edge does not exist in the third difference set, the similar subgraph is obtained based on the first edge and the target vertex corresponding to the first edge.

4. The graph-based object aggregation method according to claim 1, characterized in that, The relative distance is obtained in the following way: Obtain the distance between any two objects to be aggregated and each centroid, wherein the centroid is obtained by performing an initial clustering on the set of objects to be aggregated; The relative distance is obtained based on the distance between any two objects to be aggregated and each centroid.

5. The graph-based object aggregation method according to claim 4, characterized in that, The step of obtaining the distance between any two objects to be aggregated and each centroid includes: The distance is determined based on the Euclidean distance, Manhattan distance, or cosine similarity between any two objects to be aggregated and each centroid.

6. A graph-based object aggregation system, characterized in that, include: Processing module and aggregation module; The processing module is used to perform at least one aggregation process until the first difference set is an empty set; The aggregation module is used to take all similar subgraphs obtained in at least one aggregation process as the aggregation result of the set of objects to be aggregated; The aggregation process includes: obtaining similar subgraphs corresponding to the first undirected graph; updating the undirected graph according to the first difference set and the second difference set; updating the first undirected graph according to the updated undirected graph; using the updated undirected graph as the undirected graph in the next aggregation process; using the updated first undirected graph as the first undirected graph in the next aggregation process; the first undirected graph in the first aggregation process is obtained based on the undirected graph in the first aggregation process; the undirected graph in the first aggregation process is constructed based on the set of objects to be aggregated; the set of objects to be aggregated includes multiple objects to be aggregated. The first difference set is the difference between the first vertex set and the second vertex set. The first vertex set is the set of all vertices in the similar subgraphs obtained in each aggregation process. The second vertex set is the set of all vertices in the first undirected graph in each aggregation process. The second difference set is the difference between the first edge set and the second edge set. The first edge set is the set of all edges in the similar subgraphs obtained in each aggregation process, and the second edge set is the set of all edges in the first undirected graph in each aggregation process. Obtaining the first undirected graph includes: The undirected graph is constructed by using each of the objects to be aggregated as vertices of the undirected graph and the relative distance between any two objects to be aggregated as edges of the undirected graph. Delete edges in the undirected graph that exceed a preset threshold, and delete isolated vertices in the undirected graph to obtain the first undirected graph; The objects to be aggregated include at least one of text or images.

7. 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 graph-based object aggregation method according to any one of claims 1 to 5.

8. 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 graph-based object aggregation method as described in any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the graph-based object aggregation method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image clustering method and device, computer equipment and storage medium

    CN114428871A

  • Image clustering method and device, equipment and storage medium

    CN115147633A