Node classification clustering method, device and equipment based on semantic information extraction
The multi-layer graph convolutional network addresses the challenge of node classification and clustering in unbalanced heterogeneous graphs by extracting meta-path information and minimizing semantic vector differences, enhancing performance in various tasks.
Patent Information
- Application Number
- CN202410729240.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2025-01-03
AI Technical Summary
Existing graph neural networks struggle with node classification and clustering in heterogeneous graphs, particularly in unbalanced datasets where some node types lack labeled nodes, leading to poor performance in downstream tasks.
A method involving a multi-layer graph convolutional network that extracts meta-path information from heterogeneous graphs, using a linear transformation matrix to project feature vectors, aggregates adjacency matrices, and employs a semantic information extraction function to generate low-dimensional embeddings, minimizing differences between semantic vectors of the same type.
The method effectively extracts semantic features from nodes in heterogeneous graphs, improving performance in both balanced and unbalanced scenarios by reducing the impact of meta-path design factors and enhancing node representation learning.
Smart Images

Figure CN119249215A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining, and in particular to a node classification and clustering method, device and equipment based on semantic information extraction. Background Art
[0002] Since the introduction of graph convolutional neural networks (GCNs), many graph representation learning methods based on convolutional neural networks have emerged in recent years. These methods have provided significant improvements for a wide range of downstream tasks, such as node classification, link prediction, and network visualization. Some of the best performing examples include node embedding techniques such as simplified graph convolutional neural networks (SGCs) and graph attention networks (GATs). These methods are mainly designed for homogeneous graphs, where both the node type and the relationship between nodes are single. However, in practical application scenarios, many graphs and networks, such as social networks and recommender systems, are naturally heterogeneous, containing various types of nodes, various types of edge connections between different types of nodes, and attribute feature information of different feature dimensions corresponding to different types of nodes.
[0003] Most existing graph neural networks are applied on balanced datasets, i.e., each category has at least one labeled node, whether it is a heterogeneous or homogeneous graph. However, in practical application scenarios, many datasets are unbalanced, i.e., some node types lack or even have no labeled nodes. This imbalance poses a major challenge to traditional graph embedding models, as they often perform poorly in various downstream tasks when faced with this situation. Summary of the invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and provide a node classification and clustering method based on semantic information extraction, comprising the following steps:
[0005] S1: Divide the original heterogeneous graph data set into a training set and a test set, perform data processing on the training set, generate a subgraph according to the edge connection type, project the initial feature vectors of the subgraph nodes of the subgraph to the vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, obtain a subgraph adjacency matrix through the subgraph, and obtain an aggregated adjacency matrix according to the subgraph adjacency matrix with aggregated edge types;
[0006] S2: the first feature matrix and the aggregated adjacency matrix are input into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and a second feature matrix is obtained according to the meta-path information, wherein the meta-path information includes information including semantic information and structural information;
[0007] S3: The semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set. The multi-layer perceptron MLP extracts the semantic information vector according to the second feature matrix, and makes the semantic information vector and the semantic information matrix have the same horizontal dimension. The difference value is calculated according to the semantic information matrix and the semantic information vector, and it is judged whether the training of the neural network is completed according to the difference value. If the difference value is not greater than the predetermined threshold, the neural network training is completed to generate the neural network training model. If not satisfied, return to step S2 to continue training.
[0008] S4: The test set is input into the neural network training model to achieve node classification and node clustering of heterogeneous graph nodes.
[0009] Preferably, in step S1, the initial feature vector of the subgraph node is projected to the vector space through a linear transformation matrix, further comprising:
[0010] The calculation formula of the linear transformation matrix is as follows:
[0011]
[0012] Among them, x v is the initial feature vector of subgraph node v, h' v is the eigenvector after the projection transformation of the initial eigenvector, Is node type A i The projection transformation matrix of , and the · operator represents the vector multiplication operation.
[0013] Preferably, in step S1, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type further comprises:
[0014] Subgraph G r It is expressed as:
[0015] {G r |r=1,2,…,|R|},
[0016] Among them, each subgraph has a corresponding adjacency matrix A r , where r represents different relations;
[0017] The calculation formula for obtaining the aggregate adjacency matrix with the aggregate edge type is as follows:
[0018]
[0019] Among them, the weight set β r Expressed as {β r |r=1,2,…,|R|}, and is not a fixed set of hyperparameters.
[0020] Preferably, in step S2, the multi-layer graph convolutional network further comprises:
[0021] When the multi-layer graph convolutional network is a single layer, the single-layer convolutional network H (1) The calculation formula that captures the meta-path information is as follows:
[0022]
[0023] in, is the output of the first layer in the convolutional network, is the aggregated adjacency matrix, is the first feature matrix of uniform dimension, W (1) is the weight matrix;
[0024] When the multi-layer graph convolutional network is double-layer, the double-layer convolutional network H (2) The calculation formula that captures the meta-path information is as follows:
[0025]
[0026] Among them, W (2) is the parameter matrix of the second layer of the convolutional network;
[0027] When the multi-layer graph convolution network is L layers, the double-layer convolution network H (L) The calculation formula that captures the meta-path information is as follows:
[0028]
[0029] Preferably, in step S2, the second feature matrix further comprises:
[0030] The calculation formula of the second characteristic matrix is as follows:
[0031]
[0032] Among them, H (0) is the first characteristic matrix of uniform dimension The node embedding corresponding to each dimension of the second feature matrix H contains all meta-path information with a length of 1 to L.
[0033] Preferably, in step S3, the semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set, further comprising:
[0034] The calculation formula of the semantic information extraction function is as follows:
[0035]
[0036] Among them, S c Indicates the semantic feature vector of the node type c in the node classification process, C i Indicates v i Node type, F(·) is the mean function;
[0037] The semantic information matrix Wherein n represents the number of training nodes in the subgraph node, m' represents the dimension of the semantic feature vector, and the semantic feature vector has a unified dimension on nodes with different labels.
[0038] Preferably, the multi-layer perceptron MLP extracts the semantic information vector according to the second feature matrix, further comprising:
[0039] The calculation formula for mapping the subgraph node embedding to a vector of fixed dimension through a multi-layer perceptron MLP is as follows:
[0040]
[0041] Among them, h v represents the node feature vector in the second feature matrix, Represents the extracted semantic information vector belonging to the node type c in the second feature matrix.
[0042] Preferably, the calculating the difference value according to the semantic information matrix and the semantic information vector further comprises:
[0043] The calculation formula of the difference value is as follows:
[0044]
[0045] in, and They respectively refer to the semantic information vector and the semantic information matrix corresponding to the node v of node type c in the training node, wherein the function loss(·,·) is a sample-by-sample loss function that calculates the square average of the differences between the semantic information vector and the semantic information matrix.
[0046] The present invention also provides a heterogeneous graph node classification device based on semantic information extraction, comprising:
[0047] A heterogeneous graph node generation module, used for dividing an original heterogeneous graph data set into a training set and a test set, performing data processing on the training set, generating a subgraph according to an edge connection type, projecting an initial feature vector of a subgraph node of the subgraph to a vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, and simultaneously used for obtaining a subgraph adjacency matrix through the subgraph, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type, and outputting the first feature matrix and the aggregated adjacency matrix;
[0048] A heterogeneous graph node embedding module, configured to receive the first feature matrix and the aggregated adjacency matrix, and input the first feature matrix and the aggregated adjacency matrix into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and obtain a second feature matrix according to the meta-path information;
[0049] A semantic extraction module, which is used for a semantic information extraction function to obtain semantic feature vectors corresponding to different labels according to the initial feature vector, and to generate a semantic information matrix corresponding to the nodes in the training set, and to implement a multi-layer perceptron MLP to extract semantic information vectors according to the second feature matrix;
[0050] A judgment module is used to calculate a difference value according to the semantic information matrix and the semantic information vector, and judge whether the training of the neural network is completed according to the difference value.
[0051] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the node classification and clustering method based on semantic information extraction as described in an embodiment of the present invention.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1) The present invention uses a heterogeneous graph convolutional network to extract the semantic features of nodes in the same category. The design of the multi-layer network can extract the semantic information contained in meta-paths of different lengths. Compared with the traditional method that requires manual definition of multiple types and meta-paths of different lengths, this method greatly reduces the impact of meta-path design factors on the performance of downstream tasks.
[0054] 2) The present invention extracts semantic features corresponding to different node types through a semantic information extraction function, so that the low-dimensional vector representations of nodes of the same type and nodes with similar distances in the original graph are as close as possible in the latent vector space. The low-dimensional embedding representation of the nodes generated in this way can be well adapted to various tasks in zero-sample scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0056] Figure 1 It is a flow chart of the node classification and clustering method based on semantic information extraction of the present invention;
[0057] Figure 2 This is a clustering effect diagram of the node classification and clustering method based on semantic information extraction of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0059] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0060] Example 1
[0061] A heterogeneous graph is represented as a triple set G = (V, E, X), where V is a mapping function to the node type The node set associated with E is an edge set associated with the edge type mapping function ψ:E→R. A and R represent the sets of predefined node types and edge types, respectively, and satisfy |A|+|R|≥2, |·| represents the cardinality of the set, and the node feature matrix set X={X i |i=1,2,…,|A|} includes |A| different matrices, each of which represents the node features of a specific type. Generally speaking, these matrices have different dimensions due to the different types and numbers of nodes. Heterogeneous graph embedding aims to learn low-dimensional embedding representations of all nodes v∈V.
[0062] A meta-path is defined as a (Abbreviated as O1O2…O k+1 ) path, describing objects O1 and O k+1 The compound relationship between in Combination operator representing relations,Consider a node sequence p in a heterogeneous graph that follows the definition of a predefined meta-path P, then this is an instance of the meta-path P.
[0063] In the zero-sample scenario, if there is only one node category A i The labels are totally unbalanced. is a i type is the label set of all node labels, while Represents a completely unbalanced label set that we can observe, that is, there are one or more node categories without any labels. The goal of this invention is to learn the low-dimensional embeddings of these nodes so that the low-dimensional embeddings of nodes that are connected to each other and nodes of the same category are as close as possible in the potential low-dimensional vector space.
[0064] The present invention specifically designs a ZSHGCN heterogeneous graph convolutional neural network based on semantic information extraction, and generates a low-dimensional embedding representation of the corresponding nodes in the graph, so that the low-dimensional vector representations of the same type of nodes and the nodes with similar distances in the original graph are as close as possible in the latent vector space. The low-dimensional embedding representation of the nodes generated in this way can be well adapted to various tasks in zero-sample scenarios (i.e., the data set is completely unbalanced, and some node types lack or even have no labeled nodes).
[0065] In heterogeneous graphs, different node types and multiple types of edges play various roles in the generation of node representations and bring different degrees of influence. In the context of graph representation learning on e-commerce platforms, different relationships (edge types) between user and product nodes reflect different dependency semantic information. Users exhibit various behaviors, such as clicking, adding to favorites, or purchasing. Each behavior reflects a unique preference. Therefore, multiple types of user-product interactions, with different relationship semantics, affect the learning process of user representation in different ways.
[0066] See also Figure 1 As shown, the node classification and clustering method based on semantic information extraction provided in this embodiment includes the following steps:
[0067] S1: Divide the original heterogeneous graph data set into a training set and a test set, perform data processing on the training set, generate a subgraph according to the edge connection type, project the initial feature vectors of the subgraph nodes of the subgraph to the vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, obtain a subgraph adjacency matrix through the subgraph, and obtain an aggregated adjacency matrix according to the subgraph adjacency matrix by aggregating edge types. Specifically, in this embodiment, multiple subgraphs are generated according to the edge connection type, and the feature vectors of each type of node are projected to the vector space of the same dimension using a linear transformation matrix to facilitate calculations in subsequent neural networks;
[0068] S2: the first feature matrix and the aggregated adjacency matrix are input into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and a second feature matrix is obtained according to the meta-path information, wherein the meta-path information includes information including semantic information and structural information;
[0069] S3: The semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set. The multi-layer perceptron MLP extracts the semantic information vector according to the second feature matrix, and makes the semantic information vector and the semantic information matrix have the same horizontal dimension. The difference value is calculated according to the semantic information matrix and the semantic information vector, and it is judged whether the training of the neural network is completed according to the difference value. If the difference value is not greater than the predetermined threshold, the neural network training is completed to generate the neural network training model. If it is not satisfied, return to step S2 to continue training. Specifically, in this embodiment, the predetermined threshold can be set according to the needs, the previous overall neural network is trained, and the parameters are optimized by gradient descent until the difference value is less than the predetermined threshold.
[0070] S4: The test set is input into the neural network training model to achieve node classification and node clustering of heterogeneous graph nodes.
[0071] Preferably, in step S1, the initial feature vector of the subgraph node is projected to the vector space through a linear transformation matrix, further comprising:
[0072] The calculation formula of the linear transformation matrix is as follows:
[0073]
[0074] Among them, x v is the initial feature vector of subgraph node v, h' v is the eigenvector after the projection transformation of the initial eigenvector, Is node type A iThe projection transformation matrix, · operator represents a vector multiplication operation. Specifically, in this embodiment, after performing this operation, a feature matrix of uniform dimension is obtained, which is recorded as Contains all the nodes in the original heterogeneous graph. This matrix serves as the input of the heterogeneous graph convolutional neural network and helps generate embeddings for each node.
[0075] Preferably, in step S1, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type further comprises:
[0076] Subgraph G r It is expressed as:
[0077] {G r |r=1,2,…,|R|},
[0078] Among them, each subgraph has a corresponding adjacency matrix A r , where r represents different relations;
[0079] The calculation formula for obtaining the aggregate adjacency matrix with the aggregate edge type is as follows:
[0080]
[0081] Among them, the weight set β r Expressed as {β r |r=1,2,…,|R|}, and is not a set of fixed hyperparameters. Specifically, in this embodiment, the learning relationship perception weight β r Then, the subgraph adjacency matrix of the specific edge type is aggregated to obtain the aggregated adjacency matrix, and the weight set β r Rather than a fixed set of hyperparameters, they dynamically adapt to different tasks, and therefore, we treat these weights as trainable parameters, allowing them to be learned during model training.
[0082] Compared with homogeneous graphs, heterogeneous graphs cover various node and edge types, forming meta-paths that significantly affect representation learning. Traditional methods require manual definition of meta-paths for learning node representations on sampled paths, which is a complex task in large-scale networks with a large number of potential meta-paths. Manually setting and sampling meta-paths for aggregation into a meta-path graph will result in significant time and memory overhead. In addition, the choice of meta-path type has a great impact on the generation of network embeddings, which in turn plays a key role in the performance in different downstream tasks.
[0083] In this embodiment, a multi-layer graph convolution module is used to automatically capture shorter meta-paths and longer meta-paths between various relationships in the original heterogeneous graph. It is worth noting that the model of this embodiment adopts a multi-layer fused GCN, which includes multiple graph convolution layers to capture meta-path information of different lengths.
[0084] Preferably, in step S2, the multi-layer graph convolutional network further comprises:
[0085] When the multi-layer graph convolutional network is a single layer, the single-layer convolutional network H (1) The calculation formula that captures the meta-path information is as follows:
[0086]
[0087] in, is the output of the first layer in the convolutional network (i.e., the hidden representation of the first layer in the convolutional network), is the aggregate adjacency matrix, is the first characteristic matrix of uniform dimension, W (1) is the weight matrix;
[0088] When the multi-layer graph convolutional network is double-layer, the double-layer convolutional network H (2) The calculation formula that captures the meta-path information is as follows:
[0089]
[0090] Among them, W (2) is the parameter matrix of the second layer of the convolutional network;
[0091] When the multi-layer graph convolutional network is L layers, the double-layer convolutional network H (L) The calculation formula that captures the meta-path information is as follows:
[0092]
[0093] Specifically, in this embodiment, in order to obtain meta-paths of different lengths in a heterogeneous graph, the number of network layers is increased to L layers, and the meta-path information required in all network layers can be obtained through this method.
[0094] More preferably, in order to improve the efficiency of the model, the idea of SGC is adopted in this embodiment, and the use of nonlinear activation function is omitted.
[0095] Preferably, in step S2, the second feature matrix further comprises:
[0096] The calculation formula of the second characteristic matrix is as follows:
[0097]
[0098] Among them, H (0) is the first characteristic matrix of uniform dimension The node embedding corresponding to each dimension of the second feature matrix H contains all meta-path information with lengths from 1 to L.
[0099] Preferably, in the data preprocessing stage, by applying the semantic information extraction function to the selected completely unbalanced training data set (i.e., the original heterogeneous graph), the features corresponding to different labels are obtained. is the feature matrix of the nodes in the training dataset (for graphs without node features, their adjacency matrix can be used as the feature matrix), Represents node v i The m-dimensional feature vectors, for nodes with label c, can extract their common semantic information by applying an output function on them.
[0100] Preferably, in step S3, the semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set, further comprising:
[0101] The calculation formula of the semantic information extraction function is as follows:
[0102]
[0103] Among them, S c Indicates the semantic feature vector of the node type (i.e. with label) c during node classification, C i Indicates v i Node type, F(·) is the mean function;
[0104] Semantic Information Matrix Where n represents the number of training nodes in the subgraph node, m' represents the dimension of the semantic feature vector, and the semantic feature vector has a unified dimension on nodes with different labels. Specifically, in this embodiment, after this calculation, the information matrix of the initial semantic features in the completely unbalanced training data set is obtained:
[0105] Preferably, the multi-layer perceptron MLP extracts the semantic information vector according to the second feature matrix, further comprising:
[0106] The calculation formula for mapping the subgraph node embedding to a vector of fixed dimension through the multi-layer perceptron MLP is as follows:
[0107]
[0108] Among them, h vRepresents the node feature vector in the second feature matrix, Represents the extracted semantic information vector belonging to the node type c in the second feature matrix. Specifically, in this embodiment, MLP maps the node embedding to a fixed dimension (the same as the horizontal dimension of the semantic information matrix S obtained by preprocessing).
[0109] Preferably, calculating the difference value according to the semantic information matrix and the semantic information vector further includes:
[0110] The calculation formula of the difference value is as follows:
[0111]
[0112] in, and They respectively refer to the semantic information vector and semantic information matrix corresponding to the node v of node type c in the training node, wherein the function loss(·,·) is a sample-by-sample loss function, which calculates the square average of the difference between the semantic information vector and the semantic information matrix. Specifically, in this embodiment, following the semi-supervised learning method, the training loss function of the heterogeneous graph convolutional neural network ZSHGCN is based on the accuracy of semantic feature extraction.
[0113] Furthermore, the ZSHGCN heterogeneous graph convolutional neural network algorithm is as follows:
[0114]
[0115]
[0116] See also Figure 2 As shown in the figure, the clustering effect produced by the method in this embodiment using the IMDB dataset and the DBLP dataset is shown in Figure (a), where the a1 node is a drama node, a2 is a comedy node, and a3 is an action movie node. The b1 node in Figure (b) is a database, the b2 node is data mining, the b3 node is artificial intelligence, and the b4 node is information retrieval. It can be seen that different nodes are close to each other.
[0117] Most semi-supervised network embedding methods assume that different categories of graph nodes are labeled in a balanced manner, that is, each category has at least one labeled node. However, in the present invention, we consider the more challenging scenario of a completely unbalanced labeled node (i.e., zero-shot) in a heterogeneous graph. In a zero-shot scenario, some categories of a specific node type have no labeled nodes at all. Research in this situation is very necessary. We have investigated the research on the zero-shot problem in the field of graphs, and except for some research on isomorphic graphs, the research on heterogeneous graphs is very limited. Therefore, our invention is of great significance in this field of research, and considering that graph data in life are basically heterogeneous graph data, our invention has a wider range of application scenarios.
[0118] By introducing a heterogeneous graph convolutional network to extract semantic features of nodes within the same category, the design of the multi-layer network layer can extract the semantic information contained in meta-paths of different lengths. Compared with the traditional method that requires manual definition of multiple types and meta-paths of different lengths, this method greatly reduces the impact of meta-path design factors on the performance of downstream tasks. Finally, a semantic layer is designed to extract semantic features corresponding to different node types and compare them with the semantic features synthesized from the initial node features of the same type. By minimizing the differences between semantic vectors based on the same type, ZSHGCN effectively extracts semantic features from various types of nodes, thereby not only achieving good performance in general universal downstream tasks of balanced scenarios, but also greatly improving the performance of downstream tasks in zero-shot scenarios.
[0119] Example 2
[0120] The present invention also provides a heterogeneous graph node classification device based on semantic information extraction, comprising:
[0121] A heterogeneous graph node generation module, used for dividing an original heterogeneous graph data set into a training set and a test set, performing data processing on the training set, generating a subgraph according to an edge connection type, projecting an initial feature vector of a subgraph node of the subgraph to a vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, and simultaneously used for obtaining a subgraph adjacency matrix through the subgraph, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type, and outputting the first feature matrix and the aggregated adjacency matrix;
[0122] A heterogeneous graph node embedding module, configured to receive the first feature matrix and the aggregated adjacency matrix, and input the first feature matrix and the aggregated adjacency matrix into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and obtain a second feature matrix according to the meta-path information;
[0123] A semantic extraction module, which is used for a semantic information extraction function to obtain semantic feature vectors corresponding to different labels according to the initial feature vector, and to generate a semantic information matrix corresponding to the nodes in the training set, and to implement a multi-layer perceptron MLP to extract semantic information vectors according to the second feature matrix;
[0124] A judgment module is used to calculate a difference value according to the semantic information matrix and the semantic information vector, and judge whether the training of the neural network is completed according to the difference value.
[0125] Example 3
[0126] Based on the same concept, in some embodiments of the present application, a computer device is also provided, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor performs the steps of the node classification and clustering method based on semantic information extraction as described in any one of claims 1 to 8.
[0127] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A node classification and clustering method based on semantic information extraction, characterized in that: The following steps are involved: S1: Divide the original heterogeneous graph data set into a training set and a test set, perform data processing on the training set, generate a subgraph according to the edge connection type, project the initial feature vectors of the subgraph nodes of the subgraph to the vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, obtain a subgraph adjacency matrix through the subgraph, and obtain an aggregated adjacency matrix according to the subgraph adjacency matrix with aggregated edge types; S2: the first feature matrix and the aggregated adjacency matrix are input into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and a second feature matrix is obtained according to the meta-path information, wherein the meta-path information includes information including semantic information and structural information; S3: The semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set. The multi-layer perceptron MLP extracts the semantic information vector according to the second feature matrix, and makes the semantic information vector and the semantic information matrix have the same horizontal dimension. The difference value is calculated according to the semantic information matrix and the semantic information vector, and it is judged whether the training of the neural network is completed according to the difference value. If the difference value is not greater than the predetermined threshold, the neural network training is completed to generate the neural network training model. If not satisfied, return to step S2 to continue training. S4: The test set is input into the neural network training model to achieve node classification and node clustering of heterogeneous graph nodes.
2. The node classification and clustering method based on semantic information extraction according to claim 1 is characterized in that: In step S1, the initial feature vector of the subgraph node is projected into the vector space through a linear transformation matrix, further comprising: The calculation formula of the linear transformation matrix is as follows: Among them, x v is the initial feature vector of subgraph node v, h' v is the eigenvector after the projection transformation of the initial eigenvector, Is node type A i The projection transformation matrix of , and the · operator represents the vector multiplication operation.
3. The node classification and clustering method based on semantic information extraction according to claim 2 is characterized in that: In step S1, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type further includes: Subgraph G r It is expressed as: {G r |r=1,2,…,|R|}, Among them, each subgraph has a corresponding adjacency matrix A r , where r represents different relationships; The calculation formula for obtaining the aggregate adjacency matrix with the aggregate edge type is as follows: Among them, the weight set β r Expressed as {β r |r=1,2,…,|R|} and is not a fixed set of hyperparameters.
4. The node classification and clustering method based on semantic information extraction according to claim 3 is characterized in that: In step S2, the multi-layer graph convolutional network further comprises: When the multi-layer graph convolutional network is a single layer, the single-layer convolutional network H (1) The calculation formula that captures the meta-path information is as follows: in, is the output of the first layer in the convolutional network, is the aggregated adjacency matrix, is the first feature matrix of uniform dimension, W (1) is the weight matrix; When the multi-layer graph convolutional network is double-layer, the double-layer convolutional network H (2) The calculation formula that captures the meta-path information is as follows: Among them, W (2) is the parameter matrix of the second layer of the convolutional network; When the multi-layer graph convolution network is L layers, the double-layer convolution network H (L) The calculation formula that captures the meta-path information is as follows:
5. The node classification and clustering method based on semantic information extraction according to claim 4 is characterized in that: In step S2, the second feature matrix further includes: The calculation formula of the second characteristic matrix is as follows: Among them, H (0) is the first characteristic matrix of uniform dimension The node embedding corresponding to each dimension of the second feature matrix H contains meta-path information of length 1 to L.
6. The node classification and clustering method based on semantic information extraction according to claim 5 is characterized in that: In step S3, the semantic information extraction function obtains the semantic feature vectors of the corresponding nodes of different labels according to the initial feature vector, and generates the semantic information matrix corresponding to the nodes in the training set, further comprising: The calculation formula of the semantic information extraction function is as follows: Among them, S c Indicates the semantic feature vector of the label c in the node classification process, C i Indicates v i Node type, F(·) is the mean function; The semantic information matrix Wherein n represents the number of training nodes in the subgraph node, m′ represents the dimension of the semantic feature vector, and the semantic feature vector has a unified dimension on nodes with different labels.
7. The node classification and clustering method based on semantic information extraction according to claim 6 is characterized in that: The multi-layer perceptron MLP extracts a semantic information vector according to the second feature matrix, further comprising: The calculation formula for mapping the subgraph node embedding to a vector of fixed dimension through a multi-layer perceptron MLP is as follows: Among them, h v represents the node feature vector in the second feature matrix, Represents the extracted semantic information vector belonging to the label c in the second feature matrix.
8. The node classification and clustering method based on semantic information extraction according to claim 7, characterized in that: The calculating of the difference value according to the semantic information matrix and the semantic information vector further comprises: The calculation formula of the difference value is as follows: in, and They respectively refer to the semantic information vector and the semantic information matrix corresponding to the node v with label c in the training node, wherein the function loss(·, ·) is a sample-by-sample loss function, which calculates the square average of the difference between the semantic information vector and the semantic information matrix.
9. A node classification and clustering device based on semantic information extraction, characterized in that: include: A heterogeneous graph node generation module, used for dividing an original heterogeneous graph data set into a training set and a test set, performing data processing on the training set, generating a subgraph according to an edge connection type, projecting an initial feature vector of a subgraph node of the subgraph to a vector space through a linear transformation matrix to obtain a first feature matrix of uniform dimension, and at the same time for obtaining a subgraph adjacency matrix through the subgraph, obtaining an aggregated adjacency matrix according to the subgraph adjacency matrix with an aggregated edge type, and outputting the first feature matrix and the aggregated adjacency matrix; A heterogeneous graph node embedding module, configured to receive the first feature matrix and the aggregated adjacency matrix, and input the first feature matrix and the aggregated adjacency matrix into a multi-layer graph convolutional network to extract meta-path information included in meta-paths of different lengths associated with each node in the training set, and obtain a second feature matrix according to the meta-path information; A semantic extraction module, which is used for a semantic information extraction function to obtain semantic feature vectors corresponding to different labels according to the initial feature vector, and to generate a semantic information matrix corresponding to the nodes in the training set, and to implement a multi-layer perceptron MLP to extract semantic information vectors according to the second feature matrix; A judgment module is used to calculate a difference value according to the semantic information matrix and the semantic information vector, and judge whether the training of the neural network is completed according to the difference value.
10. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the node classification and clustering method based on semantic information extraction as described in any one of claims 1 to 8.
Citation Information
Cited By
Digital integrated circuit perceptible optimization before-wiring time sequence prediction method, electronic equipment and storage medium
CN119918478A
