Method for acquiring object clustering model, object clustering method and device

By training the object clustering model, using the graph category label of the graph data and the mean vector of the real clustering center, the problem of low node clustering accuracy in the existing technology is solved, and higher clustering accuracy is achieved.

CN114358111BActive Publication Date: 2025-06-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111296472.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2025-06-06
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

The existing node clustering method is difficult to distinguish nodes whose similarity is within the preset range with multiple cluster centers, resulting in low clustering accuracy.

Method used

By obtaining sample data, including K sample graph data, the graph category label of each sample graph data, and the mean vector of c real cluster centers of K sample graph data, the object clustering model is trained. The model inputs the original feature vector and the set of neighbor nodes for each sample node, outputs updates the hidden feature representation, and calculates the consensus loss function to optimize the model parameters.

Benefits of technology

The accuracy of object clustering is improved, and the clustering effect is enhanced by using graph category labels to assist in training the model by learning the impact of local node features on graph classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114358111B_ABST
    Figure CN114358111B_ABST
Patent Text Reader

Abstract

The present application provides an object clustering model acquisition method, an object clustering method and a device, and relates to the technical field of graph data processing. The method comprises: for each sample node included in each sample graph data, the original feature vector of each sample node and the neighbor node set of each sample node are used as the input of the object clustering model, and the updated hidden feature representation of each sample graph data is output, and the consensus loss function is calculated according to the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers and the graph category label of each sample graph data, and the model parameters of the object clustering model are adjusted by back propagation to obtain an optimized consensus loss function, and the object clustering model is obtained according to the target model parameters of the object clustering model corresponding to the optimized consensus loss function. The object clustering model obtained by this method can improve the accuracy of object clustering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the technical field of graph data processing, and in particular to a method for acquiring an object clustering model, an object clustering method, and a device. Background Art

[0002] Clustering is to divide a data set into different classes or clusters according to a certain standard, so that the similarity of data objects in the same cluster is as large as possible, and the similarity of data objects in different clusters is as small as possible. The node clustering task has been studied in the field of graph learning for a long time and has been widely used in tasks such as community detection, point cloud image segmentation, and social network user profiling.

[0003] In the current node clustering method, the feature similarity or structural similarity between nodes is generally calculated first, and the cluster center of each cluster is determined according to the feature similarity or structural similarity between nodes. For the cluster center of each cluster, the nodes whose similarity with the cluster center is within a preset range are classified into the cluster cluster corresponding to the cluster center, thereby completing the node clustering.

[0004] However, for nodes whose similarities with multiple cluster centers are within a preset range, the above method is difficult to distinguish nodes of different clusters, so the clustering accuracy is low. Summary of the invention

[0005] The present application provides a method for acquiring an object clustering model, an object clustering method and a device to improve the accuracy of object clustering.

[0006] In a first aspect, the present application provides a method for obtaining an object clustering model, comprising:

[0007] Acquire sample data, the sample data including K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, where K and c are both positive integers;

[0008] For each sample node included in each sample graph data, taking the original feature vector of each sample node and the neighbor node set of each sample node as the input of the object clustering model, outputting the updated hidden feature representation of each sample graph data;

[0009] Calculating a consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the c cluster centers to be learned, the mean vector of the c real cluster centers, and the graph category label of each sample graph data;

[0010] Back-propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, wherein the optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range;

[0011] The object clustering model is obtained according to the target model parameters of the object clustering model corresponding to the optimized consensus loss function.

[0012] In a second aspect, the present application provides an object clustering method, comprising:

[0013] Obtain M graph data, each of which includes a plurality of nodes and association information between the nodes, where M is a positive integer;

[0014] For each of the graph data, determining a hidden layer vector representation of each of the multiple nodes according to a pre-trained graph neural network model;

[0015] For each of the nodes, determining the clustering of each of the nodes according to the similarity between the hidden layer vector representation of each of the nodes and the mean vector of each of the cluster centers in the pre-trained c cluster centers;

[0016] Among them, the mean vector of the c cluster centers is obtained according to the method for obtaining the object clustering model described in the first aspect, the mean vector of the c cluster centers is the mean vector of the c cluster centers to be learned included in the target model parameters, and the object clustering model includes the graph neural network model.

[0017] In a third aspect, the present application provides a device for acquiring an object clustering model, comprising:

[0018] An acquisition module, used to acquire sample data, wherein the sample data includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, wherein both K and c are positive integers;

[0019] Model training module, used to:

[0020] For each sample node included in each sample graph data, taking the original feature vector of each sample node and the neighbor node set of each sample node as the input of the object clustering model, outputting the updated hidden feature representation of each sample graph data;

[0021] Calculating a consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the c cluster centers to be learned, the mean vector of the c real cluster centers, and the graph category label of each sample graph data;

[0022] Back-propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, wherein the optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range;

[0023] The object clustering model is obtained according to the target model parameters of the object clustering model corresponding to the optimized consensus loss function.

[0024] In a fourth aspect, the present application provides an object clustering device, comprising:

[0025] An acquisition module, used to acquire M graph data, each of which includes a plurality of nodes and association information between the nodes, and M is a positive integer;

[0026] A first determination module is used to determine, for each of the graph data, a hidden layer vector representation of each of the multiple nodes according to a pre-trained graph neural network model;

[0027] A second determination module is used to determine the cluster of each node according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained c cluster centers;

[0028] Among them, the mean vector of the c cluster centers is obtained according to the method for obtaining the object clustering model described in the first aspect, the mean vector of the c cluster centers is the mean vector of the c cluster centers to be learned included in the target model parameters, and the object clustering model includes the graph neural network model.

[0029] In a fifth aspect, the present application provides an object clustering device, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method of the first aspect or the second aspect.

[0030] In a sixth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method of the first aspect or the second aspect.

[0031] In a seventh aspect, the present application provides a computer program product, comprising a computer program, wherein the computer program implements the method of the first aspect or the second aspect when executed by a processor.

[0032] In summary, in the present application, when training an object clustering model based on sample data, for each sample node included in each sample graph data, the original feature vector of each sample node and the set of neighbor nodes of each sample node are used as the input of the object clustering model, and the updated hidden feature representation of each sample graph data is output. According to the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers and the graph category label of each sample graph data, the consensus loss function is calculated, and the model parameters of the object clustering model are adjusted by back propagation to obtain the optimized consensus loss function. According to the target model parameters of the object clustering model corresponding to the optimized consensus loss function, the object clustering model is obtained. In the process of model training, the graph category labels of the graph data are fully utilized, and the weakly supervised node clustering task is effectively solved. The graph category labels of the graph data are used to assist in the training model, and the global attributes of the graph structure are used to learn the influence of local node features on graph classification, thereby improving the clustering effect of the object clustering model. Therefore, the object clustering model can improve the accuracy of object clustering. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 A schematic diagram of the structure of a graph data provided in an embodiment of the present application;

[0035] Figure 2 A flowchart of an object clustering method provided in an embodiment of the present application;

[0036] Figure 3 A flowchart of a method for obtaining an object clustering model provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of a process for obtaining an updated hidden feature representation of a sample graph data provided by an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a training process of an object clustering model in an object clustering method provided in an embodiment of the present application;

[0039] Figure 6 A schematic diagram of the structure of a device for acquiring an object clustering model provided in an embodiment of the present application;

[0040] Figure 7 A schematic diagram of the structure of an object clustering device provided in an embodiment of the present application;

[0041] Figure 8 It is a schematic block diagram of an object clustering device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, 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 inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0044] In some practical scenarios, there is a widespread demand for clustering objects. For example, objects can be classified through clustering. Objects can be any entity (such as cities, devices, users, commodities, user social accounts, images, text or multimedia data, etc.). For example, in a social network, how to divide the social network into several communities with the help of the global attributes of the social network and the characteristics of the users, where users in the same community have similar interests or characteristics, while users in different communities have different interests or characteristics. For another example, if point cloud segmentation is regarded as a clustering task of point cloud nodes, then the items contained in the point cloud, such as furniture, ceilings, floors, etc., are regarded as global labels of the point cloud image. How to achieve the clustering task of point cloud nodes.

[0045] In some embodiments, an object may have multiple attributes or features, and objects may have association relationships. Therefore, graph data may be constructed based on multiple objects and the association relationships between objects. The graph data may include multiple nodes and association information between nodes, wherein the nodes may correspond to objects.

[0046] In some embodiments, node clustering may be defined as: given a set of graph data, how to segment the nodes in the graph into different classes or clusters based on the characteristics of the nodes and the graph structure.

[0047] In the node clustering method of the related art, for nodes whose similarities with multiple cluster centers are all within a preset range, it is difficult to distinguish nodes of different cluster clusters, so the clustering accuracy is low. In order to solve this technical problem, the present application trains an object clustering model based on sample data, and the sample data includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data. Combined with the graph category label of each sample graph data and the mean vector of c real cluster centers of the K sample graph data, the object clustering model is pre-trained to learn and obtain the mean vector of c cluster centers, so that when clustering all nodes included in the M graph data, the clustering of each node can be determined based on the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained mean vector of c cluster centers. Since the mean vector of c cluster centers is obtained through model training, the accuracy of the mean vector of c cluster centers is high, and the graph category labels of the graph data are combined when training the object clustering model. When the clustering of nodes is determined according to the similarity between the hidden layer vector representation of the node and the mean vector of the cluster center, the accuracy of node clustering can be improved.

[0048] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0049] The object clustering method provided in the embodiment of the present application can be applied to scenarios where it is necessary to cluster nodes in one or more graph data. For example, it can be applied to the task of inferring the category of nodes in the graph when the graph category label information is known, such as being able to solve practical problems such as identifying rumor spreaders in a rumor propagation network (for example, identifying which users are rumor spreaders in a group conversation where rumors appear), or identifying chemical functional groups with special properties in chemical molecules, or realizing error location in a program control flow graph, or realizing user portraits of social software.

[0050] Figure 1 A schematic diagram of the structure of a graph data provided in an embodiment of the present application, such as Figure 1 As shown, Figure 1 There are 5 graph data in it, each of which includes multiple nodes and the association information between nodes. Figure 1 The association information between nodes shown in is the edge between nodes, for example, Figure 1The graph data marked in includes 6 nodes. Optionally, there may be a connection relationship between graph data and graph data. The object clustering method provided in this embodiment can divide all nodes in the graph data into different classes or clusters according to the characteristics of the nodes in the graph data and the graph structure, and obtain a cluster cluster (also called a cluster or category) of each node.

[0051] Figure 2 The present invention provides a flowchart of an object clustering method according to an embodiment of the present invention. The method can be executed by an object clustering device, which can be implemented by software and / or hardware. The object clustering device can be a server. Figure 2 As shown, the method may include the following steps:

[0052] S101. Obtain M graph data, each graph data includes multiple nodes and association information between nodes, and M is a positive integer.

[0053] Specifically, M graph data may be received as input, and the type of the M graph data may be, for example, Figure 1 Similar type as shown.

[0054] S102. For each graph data, determine the hidden layer vector representation of each node in the multiple nodes according to the pre-trained graph neural network model.

[0055] Specifically, the graph neural network model can be a graph convolutional neural network model or a graph attention neural network model, wherein the graph convolutional neural network model can be, for example, a graph convolutional network model (Graph Convolutional Network, GCN) or GraphSAGE (Graph Sample and Aggregate).

[0056] For each graph data, according to the pre-trained graph neural network model, the hidden layer vector representation of each node in the multiple nodes is determined. Specifically, for each graph data, for each node included in each graph data, the original feature vector of each node and the set of neighbor nodes of each node are used as the input of the graph neural network model, and the hidden layer vector representation of each node is output.

[0057] The graph attention neural network can apply different attention aggregation neighbor node features during the node update process. Taking the pre-trained graph neural network model as an example, the graph attention neural network model can be a multi-head graph attention convolutional layer. The graph attention neural network model can be described by the following formula 1:

[0058]

[0059] in, is the original feature vector of node i, N(i) is the set of neighbor nodes of node i, is the hidden layer vector representation of node i, || represents the concatenation operation, σ(·) is the nonlinear activation function, Θ is the first weight matrix, is the weight coefficient of the kth attention mechanism, K is the number of heads of the graph attention convolutional layer, It is calculated by a single-layer feedforward neural network and can be obtained by the following formula:

[0060]

[0061] in, is the weight vector, LeakyReLU is the nonlinear activation function, and || represents the concatenation operation.

[0062] Optionally, the number of layers of the graph neural network model used in this embodiment is 2, that is, K is equal to 2.

[0063] S103. For each node, the clustering of each node is determined according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained mean vector of c cluster centers, the mean vector of the c cluster centers is obtained according to the acquisition method of the object clustering model, the mean vector of the c cluster centers is the mean vector of the c cluster centers to be learned included in the target model parameters, and the object clustering model includes a graph neural network model.

[0064] Specifically, the object clustering model is obtained by Figure 3 The illustrated embodiment is described in detail. Optionally, the object clustering model may be acquired by training the object clustering model based on sample data, wherein the sample data includes K sample graph data, a graph category label for each sample graph data, and a mean vector of c real clustering centers of the K sample graph data, where K and c are both positive integers.

[0065] Specifically, as an implementable method, for each node, the clustering of each node is determined according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained c cluster centers, which can be:

[0066] The similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the mean vector of the c cluster centers is calculated, and the cluster corresponding to the mean vector of the cluster center with the greatest similarity among the mean vectors of the c cluster centers is determined as the cluster of each node.

[0067] For example, the hidden layer vector representation of each node is calculated by the following formula The mean vector of each cluster center Similarity between

[0068]

[0069] For each node, Maximum The corresponding cluster is determined as the cluster of each node.

[0070] Optionally, the similarity may be a distance or an angle, and the distance may be a cosine distance or a Euclidean distance.

[0071] The object clustering method provided in this embodiment is to train a Gaussian mixture hierarchical graph convolutional neural network model according to sample data, wherein the sample data includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, and the mean vector of c real cluster centers of the K sample graph data is learned by pre-training the Gaussian mixture hierarchical graph convolutional neural network model in combination with the graph category label of each sample graph data and the mean vector of c real cluster centers of the K sample graph data, so that when clustering all nodes included in the graph data, the clustering of each node can be determined according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained mean vector of c cluster centers. Since the mean vector of c cluster centers is obtained by training the object clustering model, the accuracy of the mean vector of c cluster centers is high, and the graph category label of the graph data is combined when training the object clustering model, the accuracy of node clustering can be improved when determining the clustering of nodes according to the similarity between the hidden layer vector representation of the node and the mean vector of the cluster center.

[0072] In this embodiment, the pre-trained object clustering model includes a graph neural network model, and the mean vector of the c cluster centers is obtained by training the object clustering model according to the sample data. Figure 3 Describe in detail the training process of the object clustering model.

[0073] Figure 3 The present invention provides a flowchart of a method for obtaining an object clustering model, which can be performed by an object clustering device, which can be implemented by software and / or hardware. The object clustering device can be a server. Figure 3 As shown, the method may include the following steps:

[0074] S201. Obtain sample data, where the sample data includes K sample graph data, a graph category label for each sample graph data, and a mean vector of c true clustering centers of the K sample graph data, where K and c are both positive integers.

[0075] S202: For each sample node included in each sample graph data, the original feature vector of each sample node and the neighbor node set of each sample node are used as inputs of the object clustering model, and an updated hidden feature representation of each sample graph data is output.

[0076] Specifically, the sample data used to train the object clustering model includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, wherein the graph category label is a category identifier of the graph data, and the category identifier of the graph data may be, for example, furniture, ceiling, floor, and specific object, etc. The mean vector of c real cluster centers refers to the mean vector of c real cluster centers determined according to the K sample graph data, and the number of c is determined according to the sample graph data.

[0077] First, for each sample graph data among the K sample graph data, an updated hidden feature representation of each sample graph data is obtained through S201. Figure 4 A schematic diagram of a process for obtaining an updated hidden feature representation of a sample graph data provided by an embodiment of the present application is shown in FIG. Figure 4 As shown, taking one sample graph data among K sample graph data as an example, for example, the sample graph data includes N sample nodes, and the original feature vector of each sample node and the neighbor node set of each sample node are used as the input of the object clustering model, that is, the original feature vector of each sample node and the neighbor node set of each sample node are input respectively, and the input is N times, and the updated hidden feature representation of the sample graph data is obtained as the output.

[0078] Optionally, the object clustering model in this embodiment further includes a Gaussian mixture layer model, a graph attention pooling layer model, and a hierarchical graph convolutional neural network model. Accordingly, as an implementable method, S202 may specifically include:

[0079] S2021. Take the original feature vector of each sample node and the set of neighbor nodes of each sample node as the input of the graph neural network model, and output the hidden layer vector representation of each sample node.

[0080] Taking the graph neural network model as a graph attention neural network model as an example, the graph attention neural network model can be a multi-head graph attention convolutional layer. The graph attention neural network model can be described by the following formula 1:

[0081]

[0082] in, is the original feature vector of sample node i, N(i) is the set of neighbor nodes of sample node i, is the hidden layer vector representation of sample node i, || represents the concatenation operation, σ(·) is the nonlinear activation function, σ(·) can use the ReLU nonlinear activation function, Θ is the first weight matrix, is the weight coefficient of the kth attention mechanism, K is the number of heads of the graph attention convolutional layer, It is calculated by a single-layer feedforward neural network and can be obtained by the following formula 2:

[0083]

[0084] in, is the weight vector, LeakyReLU represents the LeakyReLU nonlinear activation function, and || represents the concatenation operation.

[0085] Optionally, the number of layers of the graph attention neural network model used in this embodiment is 2, that is, K is equal to 2.

[0086] Through the above formula 1, the hidden layer vector representation of each sample node can be obtained

[0087] Optionally, when the number of layers of the graph neural network model is 2, the hidden layer vector representation of all sample nodes included in a sample graph data can be represented by a matrix H, which can be described by the following formula:

[0088]

[0089] Among them, X is a matrix composed of the original feature vectors of all sample nodes included in the sample graph data, σ(·) is a nonlinear activation function, Θ a1 is the first weight matrix of the first layer of graph attention neural network, Θ a2 is the first weight matrix of the second-layer graph attention neural network, || represents the concatenation operation, α k is a matrix of weight coefficients of k attention mechanisms, and α is a matrix of weight vectors.

[0090] S2022. Take the hidden layer vector representation of each sample node and the mean vector of the cluster center to be learned of each sample node as the input of the Gaussian mixture layer model, output the Gaussian mixture hidden vector representation of each sample node, and the mean vector of the cluster center to be learned is one of the mean vectors of c cluster centers to be learned.

[0091] Specifically, the mean vector of the cluster centers to be learned may be a set of pre-stored data, and during training, a mean vector is selected from the set of data as the mean vector of the cluster centers to be learned of all sample nodes in a graph data.

[0092] Optionally, the Gaussian mixture layer model can be described by the following formula 4 and formula 5:

[0093]

[0094]

[0095] in, is the hidden layer vector representation of each sample node, is the mean vector of the cluster center to be learned for each sample node, Θ GML is the second weight matrix, is the Gaussian mixture hidden vector representation of each sample node, ω c (·) is the c-th Gaussian weight function, ω c The covariance matrix in (·) can be updated trainably.

[0096] S2023. Use the Gaussian mixture hidden representation of each sample graph data as the input of the graph attention pooling layer model, and output the hidden feature vector representation of each sample graph data. The Gaussian mixture hidden representation of each sample graph data is obtained by concatenating the Gaussian mixture hidden vector representations of multiple sample nodes included in each sample graph data.

[0097] Specifically, for each sample graph data, after obtaining the Gaussian mixture hidden vector representation of each sample node through S2012, the Gaussian mixture hidden vector representations of multiple sample nodes included in each sample graph data are concatenated to obtain the Gaussian mixture hidden vector representation of each sample graph data. For example, a sample graph data includes N sample nodes, and the Gaussian mixture hidden vector representations of the N sample nodes are concatenated. By splicing them into a matrix, we can get the Gaussian mixture hidden representation H' of the sample graph data.

[0098] Optionally, a graph attention pooling layer model is used to:

[0099] According to the Gaussian mixture hidden representation of each sample graph data, the weight matrix of the first layer perceptron and the weight matrix of the second layer perceptron, a node attention score of each node included in each sample graph data is determined.

[0100] Specifically, the node attention score of each sample node included in each sample graph data can be determined by taking the product of the inverse tangent function of the product of the weight matrix of the first layer perceptron and the transformed rank of the Gaussian mixture hidden representation of each sample graph data and the weight matrix of the second layer perceptron.

[0101] The node attention score of each sample node included in each sample graph data is used as a weight to perform weighted summation on the Gaussian mixture hidden representation of each sample graph data to obtain the hidden feature vector representation of each sample graph data.

[0102] Optionally, the graph attention pooling layer model can be described by the following formula 6:

[0103] e=Attn(H')=softmax(Θ s2 tanh(Θ s1 H ’T ))H' Formula 6

[0104] Among them, H' is a Gaussian mixture hidden representation of a sample graph data, Θ s1 is the weight matrix of the first layer of perceptron, Θ s2 is the weight matrix of the second layer perceptron. The softmax function is used to normalize the importance of each sample node in the sample graph data. s2 tanh(Θ s1 H ’T )) is the node attention score of each sample node included in each sample graph data, tanh() is the inverse tangent function, softmax(Θ s2 tanh(Θ s1 H ’T The product of )) and H' is the hidden feature vector representation of each sample graph data.

[0105] S2024. Use the hidden feature representation of the K sample graph data as the input of the hierarchical graph convolutional neural network model, and output the updated hidden feature representation of the K sample graph data, where the hidden feature representation of the K sample graph data is obtained by concatenating the hidden feature vectors of each sample graph data in the K sample graph data.

[0106] Specifically, for example, there are K sample graph data, and the first sample graph data has N1 sample nodes. Through S2011-S2013, the Gaussian mixture hidden representation H' of the first sample graph data is obtained. The dimension of H' is N1*D1. Enter H' into Formula 6, H ’T The dimension is D1*N1, Θ s1 The dimension of is D2*D1, so Θ s1 H ’T The dimension is D2*N1, Θ s2 The dimension of is 1*D2, so Θ s2 tanh(Θ s1 H ’T ) is 1*N1, and the dimension of H' is N1*D1, so softmax(Θ s2 tanh(Θ s1H ’T )) and H' has a dimension of 1*D1, that is, the dimension of the hidden feature vector representation e1 of the first sample graph data is 1*D1. Similarly, the dimension of the hidden feature vector representation e2 of the second sample graph data is 1*D1. The dimension of the hidden feature vector representation e3 of the third sample graph data is 1*D1, … The dimension of the hidden feature vector representation ek of the third sample graph data is 1*D1, and K 1*D1 vectors are obtained. The K 1*D1 vectors are concatenated to obtain a matrix E with a dimension of K*D1, where E is the hidden feature representation of the K sample graph data.

[0107] After obtaining the hidden feature representation E of the K sample graph data, the hidden feature representation E of the K sample graph data is input into the hierarchical graph convolutional neural network model, and the updated hidden feature representation of the K sample graph data is output.

[0108] In this embodiment, the hierarchical graph convolutional neural network model refers to a model obtained by performing a convolutional neural network on a hierarchical graph.

[0109] Optionally, the hierarchical graph convolutional neural network model is used to: According to the level l of the hierarchical graph convolutional neural network model, the hierarchical graph attention coefficient matrix α hier The hidden feature representation of K sample graph data is updated by the target parameter β to obtain the updated hidden feature representation of K sample graph data, l is greater than or equal to 2, and the hierarchical graph attention coefficient matrix α hier By the attention weight coefficient Composition. It can be described by the above formula 2.

[0110] Furthermore, according to the level l of the hierarchical graph convolutional neural network model and the hierarchical graph attention coefficient matrix α hier The hidden feature representation of the K sample graph data is updated by the target parameter β to obtain the updated hidden feature representation of the K sample graph data, which can be specifically:

[0111] Obtain updated hidden feature representations of K sample graph data according to the sum of the first result and the second result;

[0112] Among them, the first result is β and α hier and the updated hidden feature representation of the K sample graph data of the l-1th layer, and the second result is the product of (1-β) and the hidden feature representation of the K sample graph data.

[0113] Optionally, the hierarchical graph convolutional neural network model can be described by the following formula 7:

[0114]

[0115] In the above formula 7, l∈{0,1,2…} represents the level of the hierarchical graph attention network, is the hidden feature representation E of the input K sample graph data, is the updated hidden feature representation of the K sample graph data in the l-1th layer, It is the updated hidden feature representation of K sample graph data. The target parameter β can take a value between 0 and 1. When β=0, the hierarchical graph convolutional neural network model will output the original input E. At this time, it can be used in the case where there is a lack of connection relationship between graph data in the K sample graph data.

[0116] S2025. Obtain an updated hidden feature representation for each sample graph data according to the updated hidden feature representations of the K sample graph data.

[0117] Specifically, we obtain the updated hidden feature representation of K sample graph data back, The dimension is also K*D1, It is composed of the updated hidden feature representation of each sample graph data in K sample graph data, Each row of is an updated hidden feature representation of a sample graph data.

[0118] S203. Calculate the consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers, and the graph category label of each sample graph data.

[0119] Specifically, as an implementable manner, S203 may specifically be:

[0120] S2031. Updated hidden feature representation of sample graph data, mean vector of c cluster centers to be learned and mean vector of c real cluster centers, determine the distance matrix between updated hidden feature representation of K sample graph data and mean vector of c cluster centers to be learned.

[0121] Specifically, S2031 may include: first, for each sample graph data, calculating a first distance between an updated hidden feature representation of each sample graph data and a mean vector of each to-be-learned cluster center.

[0122] Optionally, the first distance can be described by Formula 8:

[0123]

[0124] in, For each sample graph data, the updated hidden feature representation is is the mean vector of each cluster center to be learned, d kcFor example, taking a sample graph data as an example, if there are c mean vectors of cluster centers to be learned, it is necessary to calculate the distance between the sample graph data and the mean vector of each of the c mean vectors of cluster centers to be learned.

[0125] Next, a second distance between the updated hidden feature representation of each sample graph data and the mean vector of each true cluster center is calculated.

[0126] For example, taking a sample graph data as an example, if there are c mean vectors of real cluster centers, it is necessary to calculate the distance between the sample graph data and the mean vector of each real cluster center in the mean vector of the c real cluster centers.

[0127] Next, a third distance obtained by adding the product of the second distance and the discount hyperparameter to the first distance is determined as the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned, and the discount hyperparameter is a constant.

[0128] Optionally, the third distance can be described by the following formula 9:

[0129]

[0130] Among them, (d kc ) enhance is the third distance, Update the hidden feature representation for each sample graph data The mean vector of each true cluster center The second distance between them, δ is a discount hyperparameter, which can be a value between 0 and 1, such as 0.1 or 0.01, d kc is the first distance.

[0131] Finally, the distance matrix is ​​obtained according to the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned.

[0132] Specifically, the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned is obtained (d kc ) enhance Then, K (d kc ) enhance Splicing, get the distance matrix D with dimension K*c enhance .

[0133] S2032. Normalize the distance matrix to obtain a similarity matrix.

[0134] Specifically, S = softmax(-D enhance), where S is a similarity matrix, the dimension of S is K*c, the sum of the probabilities of each row of S is 1, and the value of each element in S represents the probability that a sample graph data belongs to a cluster.

[0135] S2033. Obtain a consensus loss function based on the cross entropy between the similarity matrix and the graph category label of each sample graph data.

[0136] Specifically, the cross entropy between the similarity matrix and the graph category label of each sample graph data is calculated to obtain the consensus loss function.

[0137] S204. Back-propagation is used to adjust the model parameters of the object clustering model to obtain an optimized consensus loss function. The optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range.

[0138] Specifically, after obtaining the consensus loss function, the model parameters of the object clustering model are continuously adjusted to obtain the optimized consensus loss function. The optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the clustering center corresponding to the graph category label of each sample graph data within a preset range. The preset range can be, for example, the highest similarity. Thus, it can be achieved that the higher the similarity of graph data with the same graph category label, the lower the similarity of graph data with different graph category labels.

[0139] In this embodiment, the object clustering model includes a graph neural network model, a Gaussian mixture layer model, a graph attention pooling layer model and a hierarchical graph convolutional neural network model, and the model parameters of the object clustering model are adjusted, specifically: the model parameters of the graph neural network model, the model parameters of the Gaussian mixture layer model, the model parameters of the graph attention pooling layer model and the model parameters of the hierarchical graph convolutional neural network model are adjusted to obtain an optimized consensus loss function.

[0140] Specifically, the model parameters of the graph neural network model include K first weight matrices and K weight vectors, where K is equal to the number of layers of the graph neural network model. The model parameters of the Gaussian mixture layer model include the second weight matrix Θ GML And the mean vector of c cluster centers to be learned.

[0141] The model parameters of the graph attention pooling layer model include the weight matrix Θ of the first layer perceptron s1 and the weight matrix Θ of the second layer perceptron s2 The model parameters of the hierarchical graph convolutional neural network model include the hierarchical graph attention coefficient matrix α hier .

[0142] S205. Obtain an object clustering model according to target model parameters of the object clustering model corresponding to the optimized consensus loss function.

[0143] Specifically, after the optimized consensus loss function is obtained, the target model parameters of the object clustering model corresponding to the optimized consensus loss function are used as model parameters of the object clustering model to obtain the object clustering model.

[0144] Among them, the mean vector of c cluster centers is the mean vector of c cluster centers to be learned included in the target model parameters. Specifically, after obtaining the optimized consensus loss function, the mean vector of c cluster centers to be learned corresponding to the optimized consensus loss function is determined as the mean vector of the final c cluster centers obtained by training.

[0145] The object clustering model acquisition method provided in the present embodiment, when training the object clustering model according to the sample data, for each sample node included in each sample graph data, the original feature vector of each sample node and the neighbor node set of each sample node are used as the input of the object clustering model, and the updated hidden feature representation of each sample graph data is output. According to the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers and the graph category label of each sample graph data, the consensus loss function is calculated, and the model parameters of the object clustering model are adjusted by back propagation to obtain the optimized consensus loss function. According to the target model parameters of the object clustering model corresponding to the optimized consensus loss function, the object clustering model is obtained. In the process of model training, the graph category labels of the graph data are fully utilized, and the weakly supervised node clustering task is effectively solved. The graph category labels of the graph data are used to assist the training model, and the global attributes of the graph structure are used to learn the influence of local node features on graph classification, thereby improving the clustering effect of the object clustering model. Therefore, the object clustering model can improve the accuracy of object clustering.

[0146] The training process of the object clustering model is described in detail below in conjunction with a specific embodiment.

[0147] Figure 5 A schematic diagram of the training process of an object clustering model in an object clustering method provided in an embodiment of the present application. In this embodiment, K=5 sample graph data and the mean vector of the cluster center to be learned is 3 as an example. There is a connection relationship between the 5 sample graph data, such as Figure 5 As shown, the method may include the following steps:

[0148] S301. For each sample node included in each sample graph data, the original feature vector of each sample node and the neighbor node set of each sample node are used as the input of the graph neural network model, and the hidden layer vector representation of each sample node is output.

[0149] In this embodiment, the graph neural network model is taken as a graph attention neural network model as an example. The graph attention neural network model can be a multi-head graph attention convolution layer. In this embodiment, a two-head graph attention convolution layer is used. The graph attention neural network model can be described by the above formula 1:

[0150]

[0151] in, is the original feature vector of sample node i, N(i) is the set of neighbor nodes of sample node i, is the hidden layer vector representation of sample node i, || represents the concatenation operation, σ(·) is the nonlinear activation function, Θ is the first weight matrix, is the weight coefficient of the kth attention mechanism, K is the number of heads of the graph attention convolutional layer (K=2 in this embodiment), It is calculated by a single-layer feedforward neural network and can be obtained by the above formula 2.

[0152] In this embodiment, the hidden layer vector representation of all sample nodes included in a sample graph data can be represented by a matrix H, and H can be described by the following formula:

[0153]

[0154] Among them, X is a matrix composed of the original feature vectors of all sample nodes included in the sample graph data, σ(·) is a nonlinear activation function, Θ a1 is the first weight matrix of the first layer of graph attention neural network, Θ a2 is the first weight matrix of the second-layer graph attention neural network, || represents the concatenation operation, α k is a matrix of weight coefficients of k attention mechanisms, and α is a matrix of weight vectors.

[0155] S302. Take the hidden layer vector representation of each sample node and the mean vector of the cluster center to be learned of each sample node as the input of the Gaussian mixture layer model, and output the Gaussian mixture hidden vector representation of each sample node, where the mean vector of the cluster center to be learned is one of the mean vectors of the three cluster centers to be learned.

[0156] Specifically, the Gaussian mixture layer model can be described by the above formula 4 and formula 5. Through S302, the Gaussian mixture hidden vector representation of each sample node is obtained:

[0157] S303. Gaussian mixture hidden representation of each sample graph data is obtained by concatenating Gaussian mixture hidden vector representations of multiple sample nodes included in each sample graph data, and the Gaussian mixture hidden representation of each sample graph data is used as the input of the graph attention pooling layer model, and the hidden feature vector representation of each sample graph data is output.

[0158] For example, a sample graph data includes 6 sample nodes, and the Gaussian mixture hidden vectors of the 6 sample nodes are represented as By splicing them into a matrix, we can get the Gaussian mixture hidden representation H' of the sample graph data.

[0159] The graph attention pooling layer model can be described by the following formula 6:

[0160] e=Attn(H')=softmax(Θ s2 tanh(Θ s1 H ’T ))H' Formula 6

[0161] Among them, H' is a Gaussian mixture hidden representation of a sample graph data, Θ s1 is the weight matrix of the first layer of perceptron, Θ s2 is the weight matrix of the second layer perceptron. The softmax function is used to normalize the importance of each sample node in the sample graph data. s2 tanh(Θ s1 H ’T )) is the node attention score of each sample node included in each sample graph data, tanh() is the inverse tangent function, softmax(Θ s2 tanh(Θ s1 H ’T The product of )) and H' is the hidden feature vector representation of each sample graph data.

[0162] Input the sample graph data H' to the graph attention pooling layer model, and output the hidden feature vector representation e of the sample graph data.

[0163] S304. Obtain hidden feature representations of the five sample graph data by concatenating the hidden feature vectors of each sample graph data in the five sample graph data, use the hidden feature representations of the five sample graph data as inputs of a hierarchical graph convolutional neural network model, output updated hidden feature representations of the five sample graph data, and then obtain updated hidden feature representations of each sample graph data based on the updated hidden feature representations of the five sample graph data.

[0164] Specifically, in this embodiment, a three-layer hierarchical graph convolutional neural network model is adopted, and the hidden feature representation E of the five sample graph data is obtained by concatenating the hidden feature vector representation e of each sample graph data in the five sample graph data. The hierarchical graph convolutional neural network model can be described by the following formula 7:

[0165]

[0166] In the above formula 7, l∈{0,1,2} represents the level of the hierarchical graph attention network in this embodiment, is the hidden feature representation E of the input K sample graph data, is the updated hidden feature representation of the 5 sample graph data of the l-1th layer, It is the updated hidden feature representation of the 5 sample graph data. The target parameter β can take a value between 0 and 1. When β=0, the hierarchical graph convolutional neural network model will output the original input E. At this time, it can be used in the case where there is a lack of connection relationship between the graph data in the 5 sample graph data.

[0167] Updated hidden feature representation based on 5 sample graph data Get the updated hidden feature representation of each sample graph data

[0168] S305. Calculate the consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the three cluster centers to be learned, the mean vector of the three real cluster centers, and the graph category label of each sample graph data.

[0169] Specifically, firstly, the distance (d ) between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned is calculated by using Formula 8 and Formula 9 in the above embodiment. kc ) enhance , Figure 5 There are three mean vectors of cluster centers to be learned, u 1 、u 2 and u 3 There are three cluster centers to be learned. The updated hidden feature representation of each sample graph data is the mean vector of the first cluster center to be learned. The distance between The updated hidden feature representation of each sample graph data and the mean vector of the second cluster center to be learned The distance between The updated hidden feature representation of each sample graph data and the mean vector of the third cluster center to be learned The distance between

[0170] Next, we obtain the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned (d kc ) enhance After that, 5 (d kc ) enhance Splicing to get a distance matrix D with a dimension of 5*3 enhance .

[0171] Next, normalize the distance matrix D enhance Get the similarity matrix.

[0172] Specifically, S = softmax(-D enhance ), where S is a similarity matrix, the dimension of S is K*c, the sum of the probabilities of each row of S is 1, and the value of each element in S represents the probability that a sample graph data belongs to a cluster.

[0173] Then, the cross entropy between the similarity matrix and the graph category label of each sample graph data is calculated to obtain the consensus loss function.

[0174] S306. Back-propagation is used to adjust the model parameters of the graph neural network model, the model parameters of the Gaussian mixture layer model, the model parameters of the graph attention pooling layer model, and the model parameters of the hierarchical graph convolutional neural network model to obtain an optimized consensus loss function. The optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range.

[0175] S307. Determine the mean vector of the three cluster centers to be learned corresponding to the optimized consensus loss function as the mean vector of the three cluster centers.

[0176] In this embodiment, when training the object clustering model according to the sample data, the hidden layer vector representation of each sample node is output through the graph neural network model, the Gaussian mixture hidden vector representation of each sample node is obtained through the Gaussian mixture layer model, the hidden feature vector representation of each sample graph data is obtained through the graph attention pooling layer model, and the updated hidden feature representation of the K sample graph data is obtained through the hierarchical graph convolutional neural network model, and then the updated hidden feature representation of each sample graph data is obtained. Then, according to the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers and the graph category label of each sample graph data, the consensus loss function is calculated, and the model parameters of the object clustering model are adjusted to obtain the optimized consensus loss function. Finally, according to the mean vector of the c cluster centers to be learned corresponding to the optimized consensus loss function, the mean vector of the c cluster centers to be trained can be obtained. In the process of model training, the graph category labels of graph data are fully utilized to effectively solve the weakly supervised node clustering task. Compared with the traditional unsupervised learning method, the object clustering method of this embodiment uses the graph category labels of graph data to assist in training the model, and uses the global attributes of the graph structure to learn the influence of local node features on graph classification, thereby improving the clustering effect of the object clustering model. In addition, the object clustering model can improve the accuracy of object clustering.

[0177] The following is an embodiment of the device of the present application, which can be used to execute the above method embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, reference can be made to the above method embodiment of the present application.

[0178] Figure 6 A schematic diagram of a structure of an object clustering model acquisition device provided in an embodiment of the present application, such as Figure 6 As shown, the device of this embodiment may include: an acquisition module 11 and a model training module 12, wherein:

[0179] An acquisition module is used to acquire sample data, where the sample data includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, where K and c are both positive integers;

[0180] The model training module 12 is used to:

[0181] For each sample node included in each sample graph data, the original feature vector of each sample node and the neighbor node set of each sample node are used as inputs of the object clustering model, and an updated hidden feature representation of each sample graph data is output;

[0182] Calculate the consensus loss function based on the updated hidden feature representation of each sample graph data, the mean vector of c cluster centers to be learned, the mean vector of c real cluster centers, and the graph category label of each sample graph data;

[0183] Back-propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, where the optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range;

[0184] According to the target model parameters of the object clustering model corresponding to the optimized consensus loss function, the object clustering model is obtained.

[0185] Optionally, the object clustering model includes a graph neural network model, a Gaussian mixture layer model, a graph attention pooling layer model, and a hierarchical graph convolutional neural network model.

[0186] Optionally, the model training module 12 is used to:

[0187] The original feature vector of each sample node and the set of neighbor nodes of each sample node are used as the input of the graph neural network model, and the hidden layer vector representation of each sample node is output;

[0188] The Gaussian mixture layer model is input with the hidden layer vector representation of each sample node and the mean vector of the cluster center to be learned of each sample node, and the Gaussian mixture hidden vector representation of each sample node is output, and the mean vector of the cluster center to be learned is one of the mean vectors of the c cluster centers to be learned;

[0189] The Gaussian mixture hidden representation of each sample graph data is used as the input of the graph attention pooling layer model, and the hidden feature vector representation of each sample graph data is output, where the Gaussian mixture hidden representation of each sample graph data is obtained by concatenating the Gaussian mixture hidden vector representations of multiple sample nodes included in each sample graph data;

[0190] Taking the hidden feature representation of K sample graph data as the input of the hierarchical graph convolutional neural network model, outputting the updated hidden feature representation of the K sample graph data, wherein the hidden feature representation of the K sample graph data is obtained by concatenating the hidden feature vectors of each sample graph data in the K sample graph data;

[0191] An updated hidden feature representation of each sample graph data is obtained according to the updated hidden feature representations of the K sample graph data.

[0192] Optionally, a graph attention pooling layer model is used to:

[0193] Determine a node attention score of each node included in each sample graph data according to the Gaussian mixture hidden representation of each sample graph data, the weight matrix of the first layer perceptron, and the weight matrix of the second layer perceptron;

[0194] The node attention score of each node included in each sample graph data is used as the weight to perform weighted summation on the Gaussian mixture hidden representation of each sample graph data to obtain the hidden feature vector representation of each sample graph data.

[0195] Optionally, the graph attention pooling layer model is specifically used to determine the node attention score of each node included in each sample graph data by taking the product of the inverse tangent function of the product of the weight matrix of the first layer perceptron and the transformed rank of the Gaussian mixture hidden representation of each sample graph data and the weight matrix of the second layer perceptron.

[0196] Optionally, a hierarchical graph convolutional neural network model is used to:

[0197] According to the level l of the hierarchical graph convolutional neural network model, the hierarchical graph attention coefficient matrix α hier The hidden feature representation of K sample graph data is updated by the target parameter β to obtain the updated hidden feature representation of K sample graph data, l is greater than or equal to 2, and the hierarchical graph attention coefficient matrix α hier It is composed of attention weight coefficients.

[0198] Optionally, the hierarchical graph convolutional neural network model is specifically used for:

[0199] Perform a weighted summation of the first result and the second result according to β to obtain an updated hidden feature representation of the K sample graph data;

[0200] Among them, the first result is α hier and the product of the updated hidden feature representations of the K sample graph data of the l-1th layer, and the second result is the hidden feature representation of the K sample graph data.

[0201] Optionally, the model training module 12 is used to:

[0202] Determine a distance matrix between the updated hidden feature representation of the K sample graph data and the mean vector of the c cluster centers to be learned according to the updated hidden feature representation of the K sample graph data, the mean vector of the c cluster centers to be learned, and the mean vector of the c real cluster centers;

[0203] Normalize the distance matrix to get the similarity matrix;

[0204] The cross entropy between the similarity matrix and the graph category label of each sample graph data is calculated to obtain the consensus loss function.

[0205] Optionally, the model training module 12 is specifically used for:

[0206] For each sample graph data, calculating a first distance between an updated hidden feature representation of each sample graph data and a mean vector of each cluster center to be learned;

[0207] Calculate the second distance between the updated hidden feature representation of each sample graph data and the mean vector of each true cluster center;

[0208] A third distance obtained by adding the product of the second distance and the discount hyperparameter to the first distance is determined as the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned, and the discount hyperparameter is a constant;

[0209] The distance matrix is ​​obtained according to the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned.

[0210] Optionally, the model training module 12 is specifically used to: back-propagate and adjust the model parameters of the graph neural network model, the model parameters of the Gaussian mixture layer model, the model parameters of the graph attention pooling layer model, and the model parameters of the hierarchical graph convolutional neural network model to obtain an optimized consensus loss function.

[0211] Optionally, the model parameters of the graph neural network model include K first weight matrices and K weight vectors, where K is equal to the number of layers of the graph neural network model;

[0212] The model parameters of the Gaussian mixture layer model include a second weight matrix and a mean vector of c cluster centers to be learned;

[0213] The model parameters of the graph attention pooling layer model include the weight matrix of the first layer perceptron and the weight matrix of the second layer perceptron;

[0214] The model parameters of the hierarchical graph convolutional neural network model include the hierarchical graph attention coefficient matrix α hier .

[0215] Optionally, the similarity includes distance or angle, and the distance is cosine distance or Euclidean distance.

[0216] The device provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.

[0217] Figure 7 A schematic diagram of the structure of an object clustering device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the device of this embodiment may include: an acquisition module 21, a first determination module 22 and a second determination module 23, wherein:

[0218] The acquisition module 21 is used to acquire M graph data, each graph data includes multiple nodes and association information between nodes, and M is a positive integer;

[0219] The first determination module 22 is used to determine, for each graph data, a hidden layer vector representation of each node in a plurality of nodes according to a pre-trained graph neural network model;

[0220] The second determination module 23 determines the clustering of each node according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained c cluster centers;

[0221] Among them, the mean vector of c cluster centers is obtained according to the above-mentioned object clustering model acquisition method, the mean vector of c cluster centers is the mean vector of c cluster centers to be learned included in the target model parameters, and the object clustering model includes a graph neural network model.

[0222] Optionally, the second determination module 23 is used to calculate the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the mean vector of c cluster centers, and determine the cluster corresponding to the mean vector of the cluster center with the greatest similarity among the mean vectors of the c cluster centers as the cluster of each node.

[0223] The device provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.

[0224] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 7 The object clustering device shown can execute the method embodiment corresponding to the server, and the aforementioned and other operations and / or functions of each module in the object clustering device are respectively for implementing the method embodiment corresponding to the server, which will not be described again for brevity.

[0225] The object clustering device of the embodiment of the present application is described above from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or a combination of hardware and software modules in the decoding processor to execute. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0226] Figure 8 It is a schematic block diagram of an object clustering device provided in an embodiment of the present application.

[0227] like Figure 8 As shown, the object clustering device may include:

[0228] The memory 210 and the processor 220, the memory 210 is used to store the computer program and transmit the program code to the processor 220. In other words, the processor 220 can call and run the computer program from the memory 210 to implement the method in the embodiment of the present application.

[0229] For example, the processor 220 may be configured to execute the above method embodiments according to instructions in the computer program.

[0230] In some embodiments of the present application, the processor 220 may include but is not limited to:

[0231] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0232] In some embodiments of the present application, the memory 210 includes but is not limited to:

[0233] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0234] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 210 and executed by the processor 220 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the object clustering device.

[0235] like Figure 8 As shown, the object clustering device may also include:

[0236] The transceiver 230 may be connected to the processor 220 or the memory 210 .

[0237] The processor 220 may control the transceiver 230 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 230 may include a transmitter and a receiver. The transceiver 230 may further include an antenna, and the number of antennas may be one or more.

[0238] It should be understood that the various components in the object clustering device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0239] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0240] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0241] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0242] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0243] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0244] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for obtaining an object clustering model, It is characterized in that include: Acquire sample data, the sample data including K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, wherein K and c are both positive integers, the graph category label of the sample graph data is a category identifier of the sample graph data, the sample graph data includes a plurality of nodes and association information between the nodes, the nodes correspond to objects, and the objects include any one of users, point cloud nodes, cities, devices, social accounts, images, texts, and multimedia data in a social network; For each sample node included in each sample graph data, taking the original feature vector of each sample node and the neighbor node set of each sample node as the input of the object clustering model, outputting the updated hidden feature representation of each sample graph data; Calculating a consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the c cluster centers to be learned, the mean vector of the c real cluster centers, and the graph category label of each sample graph data; Back-propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, wherein the optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range; The object clustering model is obtained according to the target model parameters of the object clustering model corresponding to the optimized consensus loss function.

2. The method according to claim 1, It is characterized in that The object clustering model includes a graph neural network model, a Gaussian mixture layer model, a graph attention pooling layer model and a hierarchical graph convolutional neural network model.

3. The method according to claim 2, It is characterized in that The method of taking the original feature vector of each sample node and the neighbor node set of each sample node as input of the object clustering model and outputting the updated hidden feature representation of each sample graph data includes: Taking the original feature vector of each sample node and the neighbor node set of each sample node as the input of the graph neural network model, outputting the hidden layer vector representation of each sample node; Taking the hidden layer vector representation of each sample node and the mean vector of the cluster center to be learned of each sample node as inputs of the Gaussian mixture layer model, outputting the Gaussian mixture hidden vector representation of each sample node, wherein the mean vector of the cluster center to be learned is one of the mean vectors of c cluster centers to be learned; Taking the Gaussian mixture hidden representation of each sample graph data as the input of the graph attention pooling layer model, outputting the hidden feature vector representation of each sample graph data, wherein the Gaussian mixture hidden representation of each sample graph data is obtained by concatenating the Gaussian mixture hidden vector representations of multiple sample nodes included in each sample graph data; Taking the hidden feature representations of the K sample graph data as inputs of the hierarchical graph convolutional neural network model, outputting updated hidden feature representations of the K sample graph data, wherein the hidden feature representations of the K sample graph data are obtained by concatenating the hidden feature vectors of each sample graph data in the K sample graph data; The updated hidden feature representation of each sample graph data is obtained according to the updated hidden feature representations of the K sample graph data.

4. The method according to claim 3, It is characterized in that The graph attention pooling layer model is used to: Determine a node attention score of each node included in each sample graph data according to the Gaussian mixture hidden representation of each sample graph data, the weight matrix of the first layer perceptron, and the weight matrix of the second layer perceptron; The Gaussian mixture hidden representation of each sample graph data is weighted and summed using the node attention score of each sample node included in each sample graph data as a weight to obtain the hidden feature vector representation of each sample graph data.

5. The method according to claim 4, It is characterized in that The determining, according to the Gaussian mixture hidden representation of each sample graph data, the weight matrix of the first layer perceptron, and the weight matrix of the second layer perceptron, a node attention score of each node included in each sample graph data comprises: The product of the inverse tangent function of the product of the weight matrix of the first layer of perceptrons and the transformed rank of the Gaussian mixture hidden representation of each sample graph data and the weight matrix of the second layer of perceptrons is determined as the node attention score of each sample node included in each sample graph data.

6. The method according to claim 3, It is characterized in that The hierarchical graph convolutional neural network model is used to: According to the hierarchy of the hierarchical graph convolutional neural network model , hierarchical graph attention coefficient matrix and target parameters The hidden feature representation of the K sample graph data is updated to obtain the updated hidden feature representation of the K sample graph data, Greater than or equal to 2, the hierarchical graph attention coefficient matrix It is composed of attention weight coefficients.

7. The method according to claim 6, It is characterized in that The hierarchical graph convolutional neural network model , hierarchical graph attention coefficient matrix and target parameters Updating the hidden feature representations of the K sample graph data to obtain updated hidden feature representations of the K sample graph data includes: According to the Performing a weighted summation on the first result and the second result to obtain an updated hidden feature representation of the K sample graph data; Among them, the first result is the and The product of the updated hidden feature representations of the K sample graph data of the layer, and the second result is the hidden feature representation of the K sample graph data.

8. The method according to claim 1, It is characterized in that The calculating the consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the c cluster centers to be learned, the mean vector of the c real cluster centers and the graph category label of each sample graph data includes: Determine a distance matrix between the updated hidden feature representations of the K sample graph data and the mean vectors of the c cluster centers to be learned according to the updated hidden feature representations of the K sample graph data, the mean vectors of the c cluster centers to be learned, and the mean vectors of the c real cluster centers; Normalizing the distance matrix to obtain a similarity matrix; The cross entropy between the similarity matrix and the graph category label of each sample graph data is calculated to obtain the consensus loss function.

9. The method according to claim 8, It is characterized in that The determining, according to the updated hidden feature representations of the K sample graph data, the mean vectors of the c cluster centers to be learned, and the mean vectors of the c real cluster centers, a distance matrix between the updated hidden feature representations of the K sample graph data and the mean vectors of the c cluster centers to be learned, comprises: For each sample graph data, calculating a first distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned; Calculating a second distance between the updated hidden feature representation of each sample graph data and the mean vector of each true cluster center; Determine a third distance obtained by adding the product of the second distance and a discount hyperparameter to the first distance as the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned, wherein the discount hyperparameter is a preset value; The distance matrix is ​​obtained according to the distance between the updated hidden feature representation of each sample graph data and the mean vector of each cluster center to be learned.

10. The method according to claim 2, It is characterized in that The back propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, including: Back propagation adjusts the model parameters of the graph neural network model, the model parameters of the Gaussian mixture layer model, the model parameters of the graph attention pooling layer model, and the model parameters of the hierarchical graph convolutional neural network model to obtain the optimized consensus loss function.

11. The method according to claim 10, It is characterized in that The model parameters of the graph neural network model include K first weight matrices and K weight vectors, where K is equal to the number of layers of the graph neural network model; The model parameters of the Gaussian mixture layer model include a second weight matrix and a mean vector of the c cluster centers to be learned; The model parameters of the graph attention pooling layer model include a weight matrix of the first layer perceptron and a weight matrix of the second layer perceptron; The model parameters of the hierarchical graph convolutional neural network model include the hierarchical graph attention coefficient matrix .

12. The method according to claim 1, It is characterized in that The similarity includes distance or angle, and the distance is cosine distance or Euclidean distance.

13. A method for clustering objects. It is characterized in that include: Obtain M graph data, each of which includes a plurality of nodes and association information between the nodes, where M is a positive integer; For each of the graph data, determining a hidden layer vector representation of each of the multiple nodes according to a pre-trained graph neural network model; For each of the nodes, determining the clustering of each of the nodes according to the similarity between the hidden layer vector representation of each of the nodes and the mean vector of each of the cluster centers in the pre-trained c cluster centers; Among them, the mean vector of the c cluster centers is obtained according to the method for obtaining the object clustering model according to any one of claims 1-12, the mean vector of the c cluster centers is the mean vector of the c cluster centers to be learned included in the target model parameters, and the object clustering model includes the graph neural network model.

14. The method according to claim 13, It is characterized in that Determining the clustering of each node according to the similarity between the hidden layer vector representation of each node and the mean vector of each of the pre-trained c cluster centers, comprises: Calculate the similarity between the hidden layer vector representation of each node and the mean vector of each of the c cluster centers, and determine the cluster corresponding to the mean vector of the cluster center with the greatest similarity among the mean vectors of the c cluster centers as the cluster of each node.

15. A device for acquiring an object clustering model, It is characterized in that include: An acquisition module is used to acquire sample data, wherein the sample data includes K sample graph data, a graph category label of each sample graph data, and a mean vector of c real cluster centers of the K sample graph data, wherein K and c are both positive integers, the graph category label of the sample graph data is a category identifier of the sample graph data, and the sample graph data includes a plurality of nodes and association information between the nodes, wherein the nodes correspond to objects, and the objects include any one of users, point cloud nodes, cities, devices, social accounts, images, texts, and multimedia data in a social network; Model training module, used to: For each sample node included in each sample graph data, taking the original feature vector of each sample node and the neighbor node set of each sample node as the input of the object clustering model, outputting the updated hidden feature representation of each sample graph data; Calculating a consensus loss function according to the updated hidden feature representation of each sample graph data, the mean vector of the c cluster centers to be learned, the mean vector of the c real cluster centers, and the graph category label of each sample graph data; Back-propagation adjusts the model parameters of the object clustering model to obtain an optimized consensus loss function, wherein the optimized consensus loss function is used to make the similarity between the updated hidden feature representation of each sample graph data and the mean vector of the cluster center corresponding to the graph category label of each sample graph data within a preset range; The object clustering model is obtained according to the target model parameters of the object clustering model corresponding to the optimized consensus loss function.

16. An object clustering device, It is characterized in that include: An acquisition module, used to acquire M graph data, each of which includes a plurality of nodes and association information between the nodes, and M is a positive integer; A first determination module is used to determine, for each of the graph data, a hidden layer vector representation of each of the multiple nodes according to a pre-trained graph neural network model; A second determination module is used to determine the cluster of each node according to the similarity between the hidden layer vector representation of each node and the mean vector of each cluster center in the pre-trained c cluster centers; Among them, the mean vector of the c cluster centers is obtained according to the method for obtaining the object clustering model according to any one of claims 1-12, the mean vector of the c cluster centers is the mean vector of the c cluster centers to be learned included in the target model parameters, and the object clustering model includes the graph neural network model.

17. An object clustering device, It is characterized in that include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 12 or 13 to 14.

18. A computer-readable storage medium, It is characterized in that Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 12 or 13 to 14.

19. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 or 13 to 14 are implemented.

Citation Information

Patent Citations

  • Unbalanced polarimetric SAR terrain classification method based on cost sensitivity auxiliary learning

    CN109934292A

  • Image processing method and apparatus, device, and computer readable storage medium

    WO2021098796A1