Heterogeneous graph embedded generative graph structure optimization system based on semantic aggregation meta-path
Through the heterogeneous graph embedding generation system based on semantic aggregation metapathic path, the problem of the poor performance of the existing technology on the unbalanced heterogeneous graph data set is solved, especially in the zero-sample scenario, effectively adapting node classification and clustering tasks is achieved.
Patent Information
- Application Number
- CN202411846879.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-16
AI Technical Summary
Existing graph neural networks perform poorly when dealing with unbalanced heterogeneous graph datasets, especially in the absence of labeled nodes in zero-sample scenarios.
A heterogeneous graph embedding generation system based on semantic aggregated metapaths is proposed. By manually defining multiple metapaths and heterogeneous graph embeddings to generate neural networks, the low-dimensional embedding of nodes is generated to adapt to various tasks in zero-sample scenarios.
Effectively adapt to node classification and clustering tasks in zero-sample scenarios, and improve the performance of the model under an unbalanced data set.
Smart Images

Figure CN119760179A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of graph structure data processing, specifically a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-path. Background Art
[0002] Graph structured data is a learning method that can effectively capture and express the relationships between nodes and edges in complex graph data. It is widely used in social network analysis, recommendation systems, knowledge graph construction and other fields, improving the accuracy of data analysis and the performance of applications, as well as supporting interpretability and sparse data processing, thereby promoting the development of scientific research and practical applications. Most existing graph neural networks are applied to balanced datasets, where each category has at least one labeled node, whether for heterogeneous or homogeneous graphs. However, in real-world application scenarios, many datasets are unbalanced, that is, some node types lack or even have no labeled nodes. This imbalance poses a major challenge to existing graph embedding models, because when faced with this situation, they often perform poorly in various downstream tasks. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-path, which aggregates multiple manually defined meta-paths and heterogeneous graph embedding generation neural networks in a heterogeneous graph based on semantic information extraction, and generates low-dimensional embeddings of corresponding nodes in the graph, so that the low-dimensional vectors between 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 well adapt 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).
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-path, comprising: a heterogeneous graph node embedding module and a semantic information extraction module, wherein: the heterogeneous graph node embedding module defines corresponding types of meta-paths according to different features of different data sets, and applies a double attention mechanism to obtain low-dimensional embedding features corresponding to different nodes in the graph structure data; the semantic information extraction module obtains a feature vector set corresponding to different types of nodes in the heterogeneous graph through an output function, extracts an extracted semantic feature vector corresponding to the node from the features obtained by the heterogeneous graph node embedding module through a fully connected layer, and optimizes by using the MSE between the vector and the vector corresponding to the initial semantic feature information of the node as a loss function, thereby achieving classification of different types of nodes under a completely unbalanced data set and improving the performance of the model in a zero-sample scenario.
[0006] The vectors in the feature vector set are the initial semantic feature information of the node.
[0007] The heterogeneous graph node embedding module includes: a linear transformation unit, a meta-path intra-class aggregation unit, a meta-path inter-class aggregation unit and a semantic extraction unit, wherein: the linear transformation unit multiplies the initial features of nodes of different categories by a linear transformation matrix associated with the node category according to the initial feature information of the node to obtain the node transformation features of a unified dimension; the meta-path intra-class aggregation unit encodes the meta-path instance according to the node transformation feature information and the feature information of the relationship between nodes to obtain the structure and semantic feature information of the node based on a certain type of meta-path; the meta-path inter-class aggregation unit obtains the heterogeneous node embedding features according to the intra-class aggregation information of the meta-path through which the node passes and the different importance of different types of meta-paths to the node; the semantic extraction unit introduces a fully connected layer to extract semantic information according to the heterogeneous node embedding features to obtain the node prediction semantic features. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a flow chart of the present invention;
[0009] Figure 2 A schematic diagram showing the effect of an implementation example of a node clustering task. DETAILED DESCRIPTION
[0010] like Figure 1 As shown, the method for optimizing graph structure by embedding heterogeneous graphs based on semantic aggregation meta-paths of the above system in this embodiment includes:
[0011] Step 1: Define the problem scenario, including:
[0012] Step 1.1: Define a heterogeneous graph corresponding to a DBLP citation network representing paper citation relations as a triple set in: Mapping function to node type The associated node set includes paper nodes, conference nodes, author nodes and paper keyword nodes. E is the mapping function with edge type The associated edge set, and are sets of predefined node types and edge types that satisfy | is the cardinality of the set, the node feature matrix set
[0013] Step 1.2: Define the meta-path A1A2...A k+1 for In the heterogeneous graph corresponding to the DBLP citation network, we pre-define the following relationships: author, paper, author, author, paper, conference, paper, author, author, paper, keyword, paper, author, describing the composite relationship between objects. in: is the composition operator of the relation. The node sequence starting from the author node v and ending at the author node u is an instance of the meta-path P. The nodes on the path except the node v are the neighbors of the node v based on the meta-path p.
[0014] Step 1.3: Define in the zero-shot scenario, is the label set containing all node labels belonging to the author type, It is an observable completely unbalanced label set, that is, there are one or more node categories without any labels, that is, one or more are arbitrarily removed from the above multiple label types.
[0015] Step 1.4: Define that the optimization goal is to learn the low-dimensional embedding of the author node 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 latent low-dimensional vector space.
[0016] Step 2: Embed and obtain the semantic features of heterogeneous graph node prediction, including:
[0017] Step 2.1: First, use the linear transformation matrix to project the feature vectors corresponding to authors, papers, conferences, and keywords into the vector space of the same dimension to facilitate the subsequent calculation in the neural network: Where: x v is the initial feature vector of a node v among the four types of nodes, h v ' is the feature vector after projection transformation, that is, the node transformation feature, Is a specific node type The projection transformation matrix of . The “·” operator is a vector multiplication operator.
[0018] Step 2.2: Perform intra-class aggregation of meta-paths. Given a predefined meta-path P, the semantic and structural information of the author is obtained by aggregating the features of all nodes on the meta-path. P(v,u) connects the meta-path instances of the target author node v and the neighbor node u based on this specific type of meta-path P. The aggregation operation embeds the information contained in the meta-path instance into a vector of fixed dimension. We consider the differences in multi-type relationships between nodes by introducing the relationship vector between every two nodes on the meta-path. Embedding of meta-path instances based on P type in: q0=h v ',h' n =h u ',q i =hi '+q i-1 ⊙r i ,h i ' is the feature vector of the i-th node on the meta-path instance, ⊙ is the element-by-element multiplication of the vector, r i is the relationship vector between nodes, which depends on the node type and the relationship type. For a specific type of meta-path P, there are multiple meta-path instances starting from the author node v and ending at u. The weighted sum of these meta-path representations generates a comprehensive embedding feature of the author node v for a specific type of meta-path P, that is, the feature vector of the author node v based on the meta-path P Where: The importance of a specific instance of meta-path P to the target node is the transpose of the attention vector specific to the meta-path P, || is the concatenation operator, σ(·) and LeakyReLU(·) are two activation functions, are the neighbors of node v based on meta-path P of author node v, is the importance of a specific instance of meta-path P to the target node, is the feature vector of node v based on meta-path P. In order to expand the model's ability to focus on different parts, the multi-head attention mechanism is used to further refine the attention layer: Apply an independent attention mechanism and concatenate N vectors to obtain The representative node is based on the structural and semantic feature information of a certain type of meta-path.
[0019] Step 2.5: Perform inter-class aggregation of meta-paths. In a heterogeneous graph, there are many types of predefined meta-paths. {P1,P2,...,P t}, where: t is the number of meta-path types. For nodes of type author, there are indivual A set of feature vectors about different types of meta-paths, where m represents the author type. The number of associated meta-path types, where m≤t. All nodes of The meta-path basis is averaged to summarize each meta-path P i Finally, the self-attention mechanism is applied to obtain heterogeneous node embedding features in: and are learnable parameters. is the importance of a certain meta-path to the target node v, is the node type in the heterogeneous graph A collection of meta-paths.
[0020] Step 2.6: Obtain the predicted semantic features of nodes with different labels through the node semantic information extraction module. This module includes a fully connected (FC) layer that maps the node embedding to a vector of fixed dimension (the same as the horizontal dimension of the semantic information matrix S obtained by preprocessing), that is, the extracted semantic information vector belonging to type c in: Embedding for heterogeneous nodes.
[0021] Step 3: Extract the initial semantic features of nodes. In the data preprocessing stage, set is the feature matrix of nodes (authors, papers, conferences, keywords) in the training dataset (for graphs without node features, their adjacency matrix can be used as the feature matrix), For node v i For nodes with label c, their common semantic information is extracted by applying an output function on them, that is, the semantic feature vector of nodes belonging to type c Where: C i v i The node type. is the output function, usually the mean function, and then the information matrix of the initial semantic features in the completely unbalanced training data set n is the number of training nodes, m' is the dimension of the semantic vector, and these vectors have the same dimension on nodes with different labels.
[0022] Step 4: Real-time graph structure optimization processing in the line stage, following the semi-supervised learning method for model optimization: the accuracy based on semantic feature extraction, that is, the difference between the initial semantic features of the node and the predicted semantic features of the node is used as the loss function, specifically: in: and They refer to the predicted semantic feature vector and the initial semantic feature vector corresponding to the node v of type c in the training set, respectively. The function loss(·,·) is a sample-by-sample loss function, which is generally a mean square error (MSE) loss function, and calculates the square average of the difference between the actual feature vector and the predicted feature vector.
[0023] After specific experiments, node classification and node clustering tasks were carried out on three real data sets, namely DBLP, IMDB, and ACM. The experiments were performed using the Pytorch framework and the dgl framework. When constructing the training set, nodes with a certain type of label in the selected type of nodes were removed to simulate a completely unbalanced data set for experiments in zero-sample scenarios. In the model training stage, Adam was selected as the optimizer to update the model parameters, and the learning rate was set to 0.005. In addition, the dropout technology was used to prevent overfitting problems, and the dropout size was set to 0.1; finally, the number of layers of the neural network was set to 3.
[0024] For the node classification task, the present invention uses the Micro-F1 index and the Macro-F1 index to evaluate the performance effect. For the node clustering task, the present invention uses the NMI (Normalized Mutual Information) and ARI (Adjusted Rand Index) indicators to evaluate the performance effect.
[0025] In summary, the present invention manually defines meta-paths and utilizes a self-attention mechanism to aggregate nodes of different meta-path types. A semantic layer is designed to extract semantic features corresponding to different node types, and compares them with semantic features synthesized from initial node features of the same type, minimizing the differences between semantic vectors based on nodes of the same type. Compared with the prior art, the present invention effectively extracts semantic features from various types of nodes, thereby not only being able to obtain performance effects comparable to existing methods in general universal balanced scenario downstream tasks, but also solving the problem that existing methods cannot be applied to zero-sample scenarios. Existing methods are unable to carry out related tasks in zero-sample scenarios, while the present invention can perform zero-sample learning in completely unbalanced data sets and complete related downstream tasks, such as node classification and node clustering.
[0026] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A graph structure optimization system for heterogeneous graph embedding generation based on semantic aggregation meta-path, characterized in that: include: Heterogeneous graph node embedding module and semantic information extraction module, wherein: the heterogeneous graph node embedding module defines corresponding types of meta-paths according to different features of different data sets, and applies a two-time attention mechanism to obtain low-dimensional embedding features corresponding to different nodes in the graph structure data; The semantic information extraction module obtains the set of feature vectors corresponding to different types of nodes in the heterogeneous graph through the output function, and extracts the extracted semantic feature vector corresponding to the node from the features obtained by the heterogeneous graph node embedding module through the fully connected layer. The MSE between this vector and the vector corresponding to the initial semantic feature information of the node is used as the loss function for optimization, thereby achieving classification of different types of nodes under completely unbalanced data sets and improving the performance of the model in zero-sample scenarios.
2. The heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-path according to claim 1 is characterized in that: The heterogeneous graph node embedding module includes: a linear transformation unit, a meta-path intra-class aggregation unit, a meta-path inter-class aggregation unit and a semantic extraction unit, wherein: the linear transformation unit multiplies the initial features of nodes of different categories by a linear transformation matrix associated with the node category according to the initial feature information of the node to obtain the node transformation features of a unified dimension; the meta-path intra-class aggregation unit encodes the meta-path instance according to the node transformation feature information and the feature information of the relationship between nodes to obtain the structure and semantic feature information of the node based on a certain type of meta-path; the meta-path inter-class aggregation unit obtains the heterogeneous node embedding features according to the intra-class aggregation information of the meta-path through which the node passes and the different importance of different types of meta-paths to the node; the semantic extraction unit introduces a fully connected layer to extract semantic information according to the heterogeneous node embedding features to obtain the node prediction semantic features.
3. A method for optimizing graph structure by embedding heterogeneous graphs based on semantic aggregation meta-paths according to the system of claim 1 or 2, characterized in that: include: Step 1: Define the problem scenario and optimization goals. Step 2: After linear transformation, intra-metapath aggregation and inter-metapath aggregation are performed by the semantic information extraction module, the node prediction semantic features are obtained by the semantic information extraction module; Step 3: Get the initial semantic feature vector of the node, that is, the semantic feature vector of the node belonging to type c Where: C i v i The node type; is the output function, n is the number of training nodes, m' is the dimension of the semantic vector, and the information matrix of the initial semantic features in the completely unbalanced training data set is Step 4: Real-time graph structure optimization processing in the online stage, following the semi-supervised learning method for model optimization.
4. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 3 is characterized in that: The step 1 specifically includes: Step 1.1: Define a heterogeneous graph corresponding to a DBLP citation network representing paper citation relations as a triple set in: Mapping function to node type The associated node set includes paper nodes, conference nodes, author nodes and paper keyword nodes. E is the mapping function with edge type The associated edge set, and are sets of predefined node types and edge types that satisfy is the cardinality of the set, the node feature matrix set Step 1.2: Define the meta-path A1A2...A k+1 for In the heterogeneous graph corresponding to the DBLP citation network, we pre-define the following relationships: author, paper, author, author, paper, conference, paper, author, author, paper, keyword, paper, author, describing the composite relationship between objects. in: is the composition operator of the relation, the node sequence starting from the author node v and ending at the author node u is an instance of the meta-path P, and the nodes on the path except the node v are the neighbors of the node v based on the meta-path p; Step 1.3: Define in the zero-shot scenario, is the label set containing all node labels belonging to the author type, It is an observable completely unbalanced label set, that is, one or more node categories do not have any labels, that is, arbitrarily remove one or more of the above multiple label types; Step 1.4: Define that the optimization goal is to learn the low-dimensional embedding of the author node 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 latent low-dimensional vector space.
5. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 3, characterized in that: The step 2 specifically includes: Step 2.1: Use the linear transformation matrix to project the feature vectors corresponding to authors, papers, conferences, and keywords into the vector space of the same dimension. Specifically: Where: x v The initial feature vector of a node v of the four types of nodes, h' v is the feature vector after projection transformation, that is, the node transformation feature, For a specific node type The projection transformation matrix, "·" operator is the vector multiplication operator; Step 2.2, perform intra-class aggregation of meta-paths: obtain the semantic information and structural information of the author by aggregating the features of all nodes on the meta-path, that is, the predefined meta-path P(v,u) connects the target author node v and the neighbor node u based on the meta-path instance of this specific type of meta-path P; Step 2.3: Consider the differences in multi-type relationships between nodes by introducing the relationship vector between every two nodes on the meta-path: Embedding of meta-path instances based on P types Where: q0 = h' v ,h' n =h' u ,q i =h' i +q i-1 ⊙r i , h' i is the feature vector of the ith node on the meta-path instance, ⊙ is the element-wise multiplication of the vector, r i is the relationship vector between nodes, which depends on the node type and relationship type; Step 2.4: For a specific type of meta-path P, weighted sum of multiple meta-paths starting from author node v and ending at u is performed to generate a comprehensive embedding feature of author node v for a specific type of meta-path P, i.e., a feature vector of author node v based on meta-path P. Where: The importance of a specific instance of meta-path P to the target node is the transpose of the attention vector specific to the meta-path P, || is the concatenation operator, σ(·) and LeakyReLU(·) are two activation functions, are the neighbors of node v based on meta-path P of author node v, is the importance of a specific instance of meta-path P to the target node, is the feature vector of node v based on meta-path P; Step 2.5: Perform inter-class aggregation of meta-paths: In a heterogeneous graph, there are multiple types of predefined meta-paths {P1, P2, ..., P t }, where: t is the number of meta-path types. For nodes of type author, there are indivual A set of feature vectors about different types of meta-paths, where m represents the author type. The number of associated meta-path types, with m≤t, for the author type All nodes of The meta-path basis is averaged to summarize each meta-path P i Finally, the self-attention mechanism is applied to obtain heterogeneous node embedding features in: and is a learnable parameter, is the importance of a certain meta-path to the target node v, is the node type in the heterogeneous graph The meta-path collection of ; Step 2.6: Obtain the predicted semantic features of nodes with different labels through the fully connected layer in the semantic information extraction module. Specifically, map the node embedding to a vector with a fixed dimension that is the same as the horizontal dimension of the semantic information matrix S obtained by preprocessing, that is, the extracted semantic information vector belonging to type c in: Embedding for heterogeneous nodes.
6. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 3, characterized in that: The step 3 is specifically as follows: in the data preprocessing stage, set is the feature matrix of the nodes in the training dataset, For node v i m-dimensional feature vector; for a node with label c, the common semantic information, i.e., the initial semantic feature vector, is obtained by applying the output function on the feature matrix.
7. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 3, characterized in that: The step 4 is specifically as follows: using the accuracy of semantic feature extraction, that is, the difference between the initial semantic feature of the node and the predicted semantic feature of the node as the loss function in: and are the predicted semantic feature vector and the initial semantic feature vector corresponding to the node v of type c in the training set, respectively. The function loss(·,·) is a sample-by-sample loss function that calculates the squared average of the difference between the actual feature vector and the predicted feature vector.
8. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 5, characterized in that: The aggregation described above embeds the information contained in the meta-path instance into a vector of fixed dimension.
9. The method for optimizing graph structure by embedding heterogeneous graphs according to claim 5, characterized in that: In order to expand the model's ability to focus on different parts, the multi-head attention mechanism is used to further refine the attention layer: Apply an independent attention mechanism and concatenate N vectors to obtain The representative node is based on the structural and semantic feature information of a certain type of meta-path.
Citation Information
Patent Citations
Construction method of universal embedding framework of multi-semantic heterogeneous graph
CN112989842A
Heterogeneous graph representation method and system based on heterogeneous graph conversion and attention mechanism
CN117725267A
Heterogeneous graph neural network node classification method of double-view normal form based on network mode and meta-path
CN118228103A
Heterogeneous tree graph neural network for label prediction
US20240330679A1
Cited By
Bacterial phenotype prediction method based on bacterial DNA
CN120412723A