Clustering method and device based on GCN, equipment and medium

By introducing a GCN-based classification network into the clustering algorithm, the neighbor node attributes in the sub-graph structure in the clustering algorithm are predicted and optimized, the problem of low purity of sub-graphs in the existing technology is solved, and clustering accuracy and efficiency are improved.

CN120182644APending Publication Date: 2025-06-20JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311770594.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing clustering algorithm filters neighbor nodes through threshold judgment when constructing subgraphs, resulting in low purity of subgraphs, affecting clustering accuracy and efficiency.

Method used

The GCN-based classification network is used to predict neighbor node attributes, optimize the initial subgraph structure, and obtain a purer subgraph structure.

Benefits of technology

The clustering accuracy and efficiency are improved, and neighbor nodes are screened more accurately through the GCN information mining capabilities, which improves the purity of the sub-graph structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182644A_ABST
    Figure CN120182644A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a clustering method and device based on GCN, equipment and a medium. The method comprises the steps of obtaining an initial sub-graph structure corresponding to each to-be-clustered sample according to feature information of a plurality of to-be-clustered samples; performing feature extraction on the initial sub-graph structure based on a classification network to obtain an attribute classification result between the neighbor node and the center node; wherein the classification network comprises a GCN network; optimizing the initial sub-graph structure according to an attribute classification result to obtain a target sub-graph structure; and clustering the to-be-clustered samples according to the target sub-graph structure to obtain a clustering result. According to the scheme, on the basis of the information mining capability of the GCN for the graph structure, the neighbor node attributes are predicted through the classification network comprising the GCN to optimize the initial sub-graph structure, so that the purer sub-graph structure is obtained, and the clustering precision and the clustering efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of clustering analysis, and in particular, to a clustering method, device, equipment and medium based on GCN. Background Technique

[0002] As one of the basic tasks of machine learning, clustering has been widely applied to various task scenarios, such as the image search task. In the early stage, most clustering algorithms adopted an unsupervised manner, such as K-Means and DBSCAN, but the accuracy and efficiency were relatively poor. With the development of deep learning, clustering methods based on supervised graph networks have gradually achieved better results.

[0003] In related solutions, community discovery-related algorithms (such as Infomap and Facemap) are introduced into the clustering task to improve the accuracy and efficiency of clustering. Among them, community discovery is a technique for revealing the aggregation behavior in a network and is suitable for processing graph-structured data. However, for both the Infomap and Facemap algorithms, a threshold judgment is used to filter neighbor nodes during subgraph construction, resulting in a relatively low purity of the subgraph, which directly affects the results of the next optimization algorithm. Summary of the Invention

[0004] The present invention provides a clustering method, device, equipment and medium based on GCN. Based on the information mining ability of GCN for graph structures, the initial subgraph structure is optimized by predicting the attributes of neighbor nodes through a classification network including GCN, so as to obtain a more pure subgraph structure, which helps to improve the clustering accuracy and efficiency.

[0005] According to one aspect of the present invention, a clustering method based on GCN is provided, and the method includes:

[0006] An initial subgraph structure corresponding to each sample to be clustered is obtained according to the feature information of a plurality of samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered;

[0007] Feature extraction is performed on the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network;

[0008] The initial subgraph structure is optimized according to the attribute classification result to obtain a target subgraph structure;

[0009] The samples to be clustered are clustered according to the target subgraph structure to obtain a clustering result.

[0010] According to another aspect of the present invention, a clustering device based on GCN is provided, including:

[0011] An initial subgraph structure determination module, configured to obtain an initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered.

[0012] An attribute classification result determination module, configured to perform feature extraction on the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network.

[0013] A target subgraph structure determination module, configured to optimize the initial subgraph structure according to the attribute classification result to obtain a target subgraph structure.

[0014] A clustering result determination module, configured to cluster the samples to be clustered according to the target subgraph structure to obtain a clustering result.

[0015] According to another aspect of the present invention, there is provided an electronic device, which includes:

[0016] At least one processor; and

[0017] A memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the GCN-based clustering method according to any embodiment of the present invention.

[0019] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the GCN-based clustering method according to any embodiment of the present invention when executed.

[0020] In the technical solution of the embodiment of the present invention, an initial subgraph structure corresponding to each sample to be clustered is obtained according to the feature information of a plurality of samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered; feature extraction is performed on the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network; the initial subgraph structure is optimized according to the attribute classification result to obtain a target subgraph structure; and the samples to be clustered are clustered according to the target subgraph structure to obtain a clustering result. In this technical solution, based on the information mining ability of GCN for graph structures, the initial subgraph structure is optimized by predicting the attributes of neighbor nodes through a classification network including GCN, so that a purer subgraph structure can be obtained, which helps to improve the clustering accuracy and efficiency.

[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0023] Figure 1 is a flowchart of a clustering method based on GCN according to Embodiment 1 of the present invention;

[0024] Figure 2 is a schematic diagram of an initial subgraph structure according to Embodiment 1 of the present invention;

[0025] Figure 3 is a schematic diagram of a classification network according to Embodiment 1 of the present invention;

[0026] Figure 4 is a flowchart of a clustering method based on GCN according to Embodiment 2 of the present invention;

[0027] Figure 5A is a schematic diagram of resetting the edge weight information in an initial subgraph structure according to Embodiment 2 of the present invention;

[0028] Figure 5B is another schematic diagram of resetting the edge weight information in an initial subgraph structure according to Embodiment 2 of the present invention;

[0029] Figure 6It is a schematic structural diagram of a clustering device based on GCN provided in Embodiment 3 of the present invention;

[0030] Figure 7 It is a schematic structural diagram of an electronic device implementing a clustering method based on GCN according to an embodiment of the present invention. Detailed implementation manners

[0031] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0032] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device including a series of steps or units does not necessarily need to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0033] Embodiment 1

[0034] Figure 1 It is a flowchart of a clustering method based on GCN provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of optimizing subgraphs through GCN. This method can be executed by a clustering device based on GCN, and the clustering device based on GCN can be implemented in the form of hardware and / or software. The clustering device based on GCN can be configured in an electronic device with data processing capabilities. As Figure 1 shown, the method includes:

[0035] S110, obtaining an initial subgraph structure corresponding to each sample to be clustered according to the feature information of a plurality of samples to be clustered.

[0036] Among them, the samples to be clustered can be face samples or other object samples. If the samples to be clustered are face samples, the initial subgraph structure corresponding to each face sample to be clustered is obtained according to the face feature information of multiple samples to be clustered. The subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered. Among them, the target sample to be clustered can refer to any one of the samples to be clustered. The similar samples to be clustered can refer to the first preset number of samples to be clustered with a relatively high similarity to the target sample to be clustered. Among them, the preset number can be set in advance according to actual needs, and this embodiment does not make specific limitations on this. The central node and the neighbor nodes can be used to represent the feature information of the target sample to be clustered and the similar samples to be clustered respectively.

[0037] In this embodiment, first, the initial subgraph structure corresponding to each sample to be clustered needs to be obtained according to the feature information of multiple samples to be clustered. Optionally, obtaining the initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered includes: obtaining the feature information of multiple samples to be clustered through an identification network and using the feature information of the samples to be clustered as nodes; obtaining the similarity between every two nodes according to the feature information and determining the edges between the nodes according to the similarity between every two nodes; obtaining a sample graph structure according to the nodes and the edges; traversing each node in the sample graph structure as a central node, and determining the neighbor nodes corresponding to the central node according to the similarity between the central node and other nodes; respectively determining the initial subgraph structure corresponding to each sample to be clustered according to each central node and the corresponding neighbor nodes.

[0038] In this embodiment, by way of example, when using face samples as the samples to be clustered and determining the initial subgraph structure corresponding to each face sample, first, the face feature information of multiple face samples needs to be extracted respectively through an identification network, and the face feature information of the face samples is used as nodes. Among them, the identification network can be set in advance according to actual needs, and this embodiment does not make specific limitations on this, as long as it can implement the feature extraction function. By way of example, assume that there are a total of N face samples, and a total of N*D face feature information can be obtained after feature extraction through the feature extraction network. Among them, N represents the number of face samples, and D represents the dimension of the face feature information of each face sample. Using the D-dimensional face feature information of each face sample as a node, a total of N nodes can be obtained.

[0039] After obtaining the nodes, the similarity between every two nodes can be calculated respectively according to the face feature information, and the similarity is used as the edge between the corresponding two nodes. By way of example, the similarity can be calculated by means of cosine similarity or Euclidean distance. After obtaining the nodes and the edges, a sample graph structure including the nodes and the edges can be generated.

[0040] After obtaining the sample graph structure, each node in the sample graph structure can be traversed as the central node respectively, and the similarities between the central node and other nodes are sorted in descending order, and the top preset number of other nodes with higher similarities are selected as the neighbor nodes corresponding to the central node. Then, the initial subgraph structure corresponding to each face sample can be determined according to each central node and the corresponding neighbor nodes respectively. Assuming there are N face samples in total, N initial subgraph structures can be obtained finally. It should be noted that each initial subgraph structure includes 1 central node and a preset number of neighbor nodes, and usually there are nodes in the neighbor nodes that belong to the same class as the central node, and there are also nodes that belong to different classes from the central node.

[0041] Figure 2 FIG. 4 is a schematic diagram of an initial subgraph structure provided in Embodiment 1 of the present invention. Wherein, K represents the preset number, and here K = 30; represents the central node, and ○ both represent neighbor nodes. As Figure 2 shown, there are 30 nodes in the initial subgraph structure, specifically including 1 central node and 30 neighbor nodes. Among them, represents the neighbor node that belongs to the same class as the central node, and ○ represents the neighbor node that belongs to a different class from the central node.

[0042] S120, perform feature extraction on the initial subgraph structure based on the classification network to obtain the attribute classification result between the neighbor node and the central node; wherein, the classification network includes a GCN network.

[0043] It should be noted that since there are usually neighbor nodes that belong to the same class as the central node and neighbor nodes that belong to different classes from the central node in the initial subgraph structure, in order to improve the clustering effect, the initial subgraph structure needs to be further optimized. In the related prior art, a first-order difference sliding window method is used to dynamically calculate the subgraph threshold, and the subgraph structure is optimized according to the subgraph threshold. However, the above-mentioned existing solutions are not applicable to subgraphs with fuzzy boundaries, and the theoretically purest subgraph structure may not be screened out using the calculated subgraph threshold in real tasks. Especially when the sample distribution is unbalanced and contains difficult samples, the above problems will be particularly prominent, so it is difficult to ensure the purity of the subgraph structure.

[0044] In this technical solution, when optimizing the initial subgraph structure, GCN (Graph Convolution Networks) is introduced. By learning the categories of adjacent nodes through the adjacency relationship and aggregation process between nodes, the included GCN classification network can not only learn simple subgraph structures but also complex subgraph structures. Among them, GCN is a class of processing methods for graph domain information based on deep learning. Similar to the convolutional neural network, the difference is that the convolutional neural network is more used for two-dimensional data structures, while GCN is used for graph data structures.

[0045] In this embodiment, after obtaining the initial subgraph structure, the initial subgraph structure can be feature-extracted based on the classification network to obtain the attribute classification result between neighbor nodes and the central node. Among them, the classification network includes a GCN network, and the attribute classification result includes that the neighbor node and the central node are of the same class or different classes. Optionally, feature-extracting the initial subgraph structure based on the classification network to obtain the attribute classification result between neighbor nodes and the central node includes: inputting the initial subgraph structure into the classification network; among them, the classification network includes at least two layers of GCN networks and at least two layers of fully connected layers; through the feature extraction of the initial subgraph structure by the classification network, the attribute classification result between neighbor nodes and the central node is obtained.

[0046] Figure 3 It is a schematic diagram of a classification network provided in the first embodiment of the present invention. Among them, the classification network includes two layers of GCN networks (i.e., GCN1 and GCN2) and two layers of fully connected layers (i.e., FC1 and FC2), and the two layers of fully connected layers are connected by a Prelu layer. Among them, Prelu is an activation function of a neuron. The core of this solution is to screen out neighbor nodes of the same class as the central node through graph learning, so as to obtain a more pure subgraph structure. Among them, the optimization problem of the subgraph structure can be understood as a graph node classification problem.

[0047] Specifically, as Figure 3 shown, input the initial subgraph structure into the classification network, feature-extract the initial subgraph structure through two layers of GCN networks, and compare and discriminate the extracted features through two layers of fully connected layers, so as to obtain the output result of the classification network. This output result can be used to represent the attribute classification result between neighbor nodes and the central node. Exemplarily, the output result of the classification network can adopt a classification prediction value. If the classification prediction value is 1, it indicates that the attribute classification result is that the neighbor node and the central node are of the same class; if the classification prediction value is 0, it indicates that the attribute classification result is that the neighbor node and the central node are of different classes.

[0048] Among them, the formula of GCN can be expressed as: Among them, σ is the activation function, is the degree matrix (used to characterize the feature information of each node in the initial subgraph structure), is the adjacency matrix (used to characterize the position information of each node in the initial subgraph structure), H (l) is the output feature of the current graph convolutional layer, H (l+1) is the input feature of the next graph convolutional layer, W (l) represents the weight of the current graph convolutional layer (a trainable parameter of the classification network).

[0049] S130. Optimize the initial subgraph structure according to the attribute classification result to obtain the target subgraph structure.

[0050] In this embodiment, after obtaining the attribute classification result between the neighbor nodes and the central node, the initial subgraph structure can be optimized according to the attribute classification result to obtain the target subgraph structure. Optionally, optimizing the initial subgraph structure according to the attribute classification result to obtain the target subgraph structure includes: deleting the neighbor nodes that are of different classes from the central node in the initial subgraph structure to obtain the target subgraph structure.

[0051] Specifically, through the attribute classification result, it can be clearly known which neighbor nodes are of the same class and different classes as the central node. Therefore, by deleting the neighbor nodes that are of different classes from the central node in the initial subgraph structure, it can be ensured that only the central node and the neighbor nodes that are of the same class as the central node are retained in the optimized target subgraph structure, thereby effectively realizing the optimization of the initial subgraph structure.

[0052] S140. Cluster the samples to be clustered according to the target subgraph structure to obtain the clustering result.

[0053] In this embodiment, after obtaining the target subgraph structure, the samples to be clustered can be clustered according to the target subgraph structure to obtain the clustering result. Exemplarily, the target subgraph structure can be input into the community discovery algorithm model for solution, and its optimization goal is to minimize the average coding length. Since the information entropy is equivalent to the shortest coding length, this process can also be understood as minimizing the information entropy, which can be specifically expressed as where G is the target subgraph structure and M is the clustering cluster.

[0054] The technical solution of the embodiment of the present invention obtains the initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered; wherein, the subgraph structure includes the central node corresponding to the target sample to be clustered and the neighbor nodes corresponding to the similar samples to be clustered; based on the classification network, feature extraction is performed on the initial subgraph structure to obtain the attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network; the initial subgraph structure is optimized according to the attribute classification result to obtain the target subgraph structure; the samples to be clustered are clustered according to the target subgraph structure to obtain the clustering result. In this technical solution, based on the information mining ability of GCN for graph structures, the initial subgraph structure is optimized by predicting the attributes of neighbor nodes through a classification network including GCN, so that a more pure subgraph structure can be obtained, which helps to improve the clustering accuracy and efficiency.

[0055] Embodiment 2

[0056] Figure 4 FIG. is a flowchart of a clustering method based on GCN provided in Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiment. The specific optimization is as follows: before performing feature extraction on the initial subgraph structure based on the classification network, it further includes: resetting the edge weight information in the initial subgraph structure, and determining the adjacency matrix according to the edge weight information; determining the feature extraction method of the classification network according to the adjacency matrix.

[0057] As Figure 4 shown, the method of this embodiment specifically includes the following steps:

[0058] S210, obtaining the initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered.

[0059] Wherein, the subgraph structure includes the central node corresponding to the target sample to be clustered and the neighbor nodes corresponding to the similar samples to be clustered.

[0060] S220, resetting the edge weight information in the initial subgraph structure, and determining the adjacency matrix according to the edge weight information.

[0061] It should be noted that, from the formula of GCN, it can be seen that the construction of the adjacency matrix directly affects the feature expression of GCN. The traditional method is to directly construct the adjacency matrix through similarity That is to say, each initial subgraph structure contains different However, this will largely affect the classification results because GCN is often suitable for transductive tasks rather than inductive tasks. Therefore, in order to simplify the network training difficulty, accelerate network convergence, and improve the clustering and generalization capabilities of the network, before extracting features from the initial subgraph structure based on the classification network, it is necessary to reset the edge weight information in the initial subgraph structure and determine the adjacency matrix according to the edge weight information. The classification network is trained based on the adjacency matrix after resetting the edge weight information, and the trainable parameters of the classification network are optimized during the training process. And after the classification network is trained, when using the classification network to extract features from the initial subgraph structure, the classification network still uses the adjacency matrix after resetting the edge weight information to ensure the accuracy of feature extraction by the classification network.

[0062] In this embodiment, optionally, resetting the edge weight information in the initial subgraph structure includes: setting the edge weight information in the initial subgraph structure to a unified value.

[0063] In this embodiment, the edge weight information in the initial subgraph structure can be set to a unified value (such as 1). Figure 5A FIG. is a schematic diagram of resetting the edge weight information in an initial subgraph structure provided in Embodiment 2 of the present invention. Among them, represents the central node, and ○ both represent neighbor nodes, and are of the same class, and ○ and are of different classes. At this time, only care about whether two nodes in the initial subgraph structure are connected, so that it can be ensured that each subgraph shares the same adjacency matrix.

[0064] In this embodiment, optionally, resetting the edge weight information in the initial subgraph structure includes: determining the similarity between each neighbor node and the central node in the initial subgraph structure, and sorting the neighbor nodes according to the similarity between each neighbor node and the central node; according to the preset edge weight interval, determining the edge weight information in the initial subgraph structure according to the sorting result of the neighbor nodes.

[0065] It should be noted that setting the edge weight information in the initial subgraph structure to a unified value can only provide the connection relationship between nodes during network training, but cannot provide the structural information of the nodes. Therefore, the edge weight information in the initial subgraph structure can be further optimized.

[0066] Based on prior knowledge, it can be known that in the initial subgraph structure, the similarity between the central node and the neighbor nodes of the same class is relatively high, while the similarity with the neighbor nodes of different classes is relatively low. Based on this prior knowledge, in this embodiment, a fixed set of edge weights is set to reset the edge weight information in the initial subgraph structure. Specifically, first, the similarity between each neighbor node and the central node in the initial subgraph structure is determined, and the neighbor nodes are sorted in descending order of similarity. Then, according to the preset edge weight interval, the edge weight information in the initial subgraph structure is determined based on the sorting result of the neighbor nodes, as Figure 5B shown. Figure 5B FIG. 2 is another schematic diagram for resetting the edge weight information in the initial subgraph structure provided in the second embodiment of the present invention. Among them, represents the central node, and ○ both represent neighbor nodes, and are of the same class, and ○ and are of different classes.

[0067] Among them, the preset edge weight interval can be preset according to actual needs. For example, it can be set as [max = 0.99, min = 0.01, num = k], where k represents the number of neighbor nodes, that is, the edge weight between the neighbor node corresponding to the maximum similarity and the central node is 0.99, and the edge weight between the neighbor node corresponding to the minimum similarity and the central node is 0.01. The edge weights between the remaining neighbor nodes and the central node decrease sequentially according to the sorting result of each neighbor node. Optionally, there are multiple choices for the decreasing method, such as decreasing in an arithmetic progression, decreasing in a cosine function, etc.

[0068] In this embodiment, the classification network is trained based on the batch size. Among them, the batch size can refer to the number of samples included in one training. Each time during training, the samples of the batch are fed into the classification network, and the corresponding parameter adjustment values are calculated, and the network parameters are continuously adjusted and optimized based on this. Among them, each batch contains different subgraph node features, but shares the same subgraph structure.

[0069] S230. Determine the feature extraction method of the classification network according to the adjacency matrix.

[0070] In this embodiment, after determining the adjacency matrix according to the reset edge weight information, the formula of the GCN can be updated according to the adjacency matrix, thereby determining the feature extraction method of the classification network.

[0071] S240. Input the initial subgraph structure into the classification network.

[0072] Among them, the classification network includes at least two layers of GCN networks and at least two layers of fully connected layers.

[0073] S250, extract the features of the initial subgraph structure through a classification network based on the feature extraction method to obtain the attribute classification result between the neighbor nodes and the central node.

[0074] Among them, the attribute classification result includes that the neighbor nodes and the central node are of the same class or different classes.

[0075] S260, delete the neighbor nodes in the initial subgraph structure that are of different classes from the central node according to the attribute classification result to obtain the target subgraph structure.

[0076] S270, cluster the samples to be clustered according to the target subgraph structure to obtain the clustering result.

[0077] In this embodiment, 1,497 classes and 20,000 pictures are selected as the test set to verify the effectiveness of the proposed solution. Specifically, first, 512-dimensional feature information is extracted through the recognition model, and then four methods, namely GCN-V / E, Infomap, Facemap, and GCNmap (the proposed solution in this paper), are respectively used for clustering. The clustering metrics are Pairwise F-score and Bcubed F-score. The results are shown in Table 1:

[0078] Table 1 Comparison of clustering effects of different methods

[0079] Clustering algorithm Pairwise F-score Bcubed F-score GCN-V / E 88.77% 90.08% Infomap 90.02% 90.51% Facemap 90.08% 92.17% GCNmap 92.10% 92.77%

[0080] It can be seen from Table 1 that the GCNmap algorithm proposed in this solution has a significant improvement compared with the GCN-V / E algorithm, and there are also varying degrees of improvements for the two community discovery algorithms, Infomap and Facemap. Especially for the Pairwise F-score metric, which proves that the improvement of this solution for the clustering task is significantly effective.

[0081] The GCNmap algorithm proposed in this solution can better serve security-related services. One is the face image search service at local points. GCNmap can obtain a more generalized model by quickly training the face materials in multiple monitoring scenarios. When performing image search at a specific local point, it can greatly reduce the complexity of the face image set, while accelerating the time-consuming of face image search and improving the efficiency and accuracy. The other is the face annotation task. Since the cost of manual annotation is very high, with the help of GCNmap, fast and massive face clustering can be realized, and pseudo-labels can be predicted. After collision and cleaning, the relatively accurate pseudo-labels and materials are sent into the model for training, which can improve the metrics of the face recognition model and reduce the labor cost at the same time.

[0082] In the technical solution of the embodiment of the present invention, before extracting features from the initial subgraph structure based on the classification network, the edge weight information in the initial subgraph structure is reset, and the adjacency matrix is determined according to the edge weight information; the feature extraction method of the classification network is determined according to the adjacency matrix. According to this technical solution, based on the information mining ability of the GCN for the graph structure, the attributes of neighbor nodes can be predicted through the classification network including the GCN to optimize the initial subgraph structure, so as to obtain a purer subgraph structure, which helps to improve the clustering accuracy and clustering efficiency. In addition, the fixed adjacency matrix can be determined by resetting the edge weight information in the initial subgraph structure, thereby simplifying the training difficulty of the classification network, accelerating the convergence speed of the classification network, and enhancing the clustering and generalization capabilities of the classification network.

[0083] Embodiment III

[0084] Figure 6 FIG. is a schematic structural diagram of a clustering device based on GCN provided in Embodiment III of the present invention. This device can execute the clustering method based on GCN provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. As Figure 6 shown, the device includes:

[0085] An initial subgraph structure determination module 310, configured to obtain an initial subgraph structure corresponding to each sample to be clustered according to the feature information of a plurality of samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered;

[0086] An attribute classification result determination module 320, configured to extract features from the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network;

[0087] A target subgraph structure determination module 330, configured to optimize the initial subgraph structure according to the attribute classification result to obtain a target subgraph structure;

[0088] A clustering result determination module 340, configured to cluster the samples to be clustered according to the target subgraph structure to obtain a clustering result.

[0089] Optionally, the device further includes:

[0090] An adjacency matrix determination module, configured to reset the edge weight information in the initial subgraph structure before extracting features from the initial subgraph structure based on the classification network, and determine an adjacency matrix according to the edge weight information;

[0091] A feature extraction method determination module, configured to determine the feature extraction method of the classification network according to the adjacency matrix.

[0092] Optionally, the adjacency matrix determination module is configured to:

[0093] Set the edge weight information in the initial subgraph structure to a unified value.

[0094] Optionally, the adjacency matrix determination module is further configured to:

[0095] Determine the similarity between each neighbor node and the central node in the initial subgraph structure, and sort the neighbor nodes according to the similarity between each neighbor node and the central node;

[0096] Determine the edge weight information in the initial subgraph structure according to the sorting result of the neighbor nodes according to a preset edge weight interval.

[0097] Optionally, the attribute classification result determination module 320 is specifically configured to:

[0098] Input the initial subgraph structure into a classification network; wherein, the classification network includes at least two layers of GCN networks and at least two layers of fully connected layers;

[0099] Extract the features of the initial subgraph structure through the classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the attribute classification result includes that the neighbor nodes and the central node are of the same class or different classes.

[0100] Optionally, the target subgraph structure determination module 330 is specifically configured to:

[0101] Delete the neighbor nodes in the initial subgraph structure that are of different classes from the central node according to the attribute classification result to obtain a target subgraph structure.

[0102] Optionally, the initial subgraph structure determination module 310 is specifically configured to:

[0103] Obtain the feature information of multiple samples to be clustered through an identification network, and use the feature information of the samples to be clustered as nodes;

[0104] Obtain the similarity between every two nodes according to the feature information, and determine the edges between the nodes according to the similarity between every two nodes;

[0105] Obtain a sample graph structure according to the nodes and edges;

[0106] Traverse each node in the sample graph structure as the central node, and determine the neighbor nodes corresponding to the central node according to the similarity between the central node and other nodes;

[0107] Determine the initial subgraph structure corresponding to each sample to be clustered according to each central node and its corresponding neighbor nodes respectively.

[0108] A clustering device based on GCN provided by an embodiment of the present invention can execute a clustering method based on GCN provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution of the method.

[0109] Embodiment 4

[0110] Figure 7 The structural schematic diagram of an electronic device 10 that can be used to implement the embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0111] As Figure 7 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0112] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0113] The processor 11 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the GCN-based clustering method.

[0114] In some embodiments, the GCN-based clustering method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the GCN-based clustering method described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute the GCN-based clustering method by any other suitable means (e.g., by means of firmware).

[0115] Various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0116] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to the processors of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the computer programs are executed by the processors, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0118] To provide for interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0119] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0120] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0121] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0122] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A clustering method based on GCN, characterized in that, The method includes: Obtaining an initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered; Performing feature extraction on the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network; Optimizing the initial subgraph structure according to the attribute classification result to obtain a target subgraph structure; Clustering the samples to be clustered according to the target subgraph structure to obtain a clustering result.

2. The method according to claim 1, characterized in that, Before performing feature extraction on the initial subgraph structure based on the classification network, the method further includes: Resetting the edge weight information in the initial subgraph structure and determining an adjacency matrix according to the edge weight information; Determining the feature extraction method of the classification network according to the adjacency matrix.

3. The method according to claim 2, characterized in that, Resetting the edge weight information in the initial subgraph structure includes: Setting the edge weight information in the initial subgraph structure to a unified value.

4. The method according to claim 2, characterized in that, Resetting the edge weight information in the initial subgraph structure includes: Determining the similarity between each neighbor node and the central node in the initial subgraph structure, and sorting the neighbor nodes according to the similarity between each neighbor node and the central node; Determining the edge weight information in the initial subgraph structure according to the sorting result of the neighbor nodes according to a preset edge weight interval.

5. The method according to any one of claims 2 - 4, characterized in that, Performing feature extraction on the initial subgraph structure based on the classification network to obtain an attribute classification result between the neighbor nodes and the central node, including: Inputting the initial subgraph structure into the classification network; wherein, the classification network includes at least two layers of GCN networks and at least two layers of fully connected layers; Obtaining an attribute classification result between the neighbor nodes and the central node through feature extraction of the initial subgraph structure by the classification network; wherein, the attribute classification result includes that the neighbor nodes and the central node are of the same class or different classes.

6. The method according to claim 5, characterized in that, Optimizing the initial subgraph structure according to the attribute classification result to obtain a target subgraph structure, including: Deleting the neighbor nodes in the initial subgraph structure that are of different classes from the central node according to the attribute classification result to obtain a target subgraph structure.

7. The method according to claim 1, characterized in that, Obtaining an initial subgraph structure corresponding to each sample to be clustered according to the feature information of multiple samples to be clustered, including: Obtaining the feature information of multiple samples to be clustered through an identification network and using the feature information of the samples to be clustered as nodes; Obtaining the similarity between every two nodes according to the feature information, and determining the edges between the nodes according to the similarity between every two nodes; Obtaining a sample graph structure according to the nodes and edges; Traversing each node in the sample graph structure as a central node, and determining neighbor nodes corresponding to the central node according to the similarity between the central node and other nodes; Respectively determining an initial subgraph structure corresponding to each sample to be clustered according to each central node and the corresponding neighbor nodes.

8. A clustering device based on GCN, characterized in that, The device includes: An initial subgraph structure determination module, configured to obtain an initial subgraph structure corresponding to each sample to be clustered according to the feature information of a plurality of samples to be clustered; wherein, the subgraph structure includes a central node corresponding to the target sample to be clustered and neighbor nodes corresponding to similar samples to be clustered; An attribute classification result determination module, configured to perform feature extraction on the initial subgraph structure based on a classification network to obtain an attribute classification result between the neighbor nodes and the central node; wherein, the classification network includes a GCN network; A target subgraph structure determination module, configured to optimize the initial subgraph structure according to the attribute classification result to obtain a target subgraph structure; A clustering result determination module, configured to cluster the samples to be clustered according to the target subgraph structure to obtain a clustering result.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the GCN-based clustering method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a processor to implement the GCN-based clustering method according to any one of claims 1-7 when executed.