Graph structure optimization system based on semantic aggregated meta-path of heterogeneous graph embedding generation

By using a heterogeneous graph embedding generation system based on semantic aggregation meta-path, the problem of poor performance of graph neural networks under imbalanced datasets is solved, and effective node classification and clustering are achieved in zero-shot scenarios.

CN119760179BActive Publication Date: 2025-12-30SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411846879.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-12-30
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Existing graph neural networks perform poorly when faced with imbalanced datasets, especially in zero-shot scenarios (where some node types lack or have no labeled nodes), making it difficult to effectively classify and cluster nodes.

Method used

By using a heterogeneous graph embedding generation system based on semantic aggregation meta-paths, a variety of class meta-paths are defined using a heterogeneous graph node embedding module and a semantic information extraction module. Attention mechanisms and fully connected layers are applied to generate low-dimensional embedding features and optimize the graph structure to adapt to imbalanced datasets.

Benefits of technology

It improves the model's performance in zero-shot scenarios, effectively classifying and clustering nodes, and enhancing the model's performance on imbalanced datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760179B_ABST
    Figure CN119760179B_ABST
Patent Text Reader

Abstract

The application discloses a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-path, which comprises a heterogeneous graph node embedding module and a semantic information extraction module. The application aggregates various types of meta-paths defined manually in a heterogeneous graph and generates a low-dimensional embedding of corresponding nodes in the graph by means of a heterogeneous graph embedding generation neural network based on semantic information extraction, so that the low-dimensional vectors of nodes of the same type and nodes close to each other in the original graph are as close as possible in a latent vector space. The low-dimensional node embedding representation generated in this way can well adapt to various tasks in a zero-shot scenario (i.e., a completely unbalanced data set, some node types lack or even have no labeled nodes).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This 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 Technology

[0002] Graph-structured data learning can effectively capture and represent the relationships between nodes and edges in complex graph data. It is widely used in fields such as social network analysis, recommender systems, and knowledge graph construction, improving the accuracy of data analysis and the performance of applications, as well as supporting interpretability and sparse data processing, thereby driving 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 applications, many datasets are imbalanced, meaning that some node types lack or have no labeled nodes. This imbalance poses a significant challenge to existing graph embedding models because they often perform poorly on various downstream tasks when faced with this situation. Summary of the Invention

[0003] To address the aforementioned shortcomings of existing technologies, this invention proposes a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-paths. This system aggregates various manually defined meta-paths from heterogeneous graphs and a heterogeneous graph embedding generation neural network based on semantic information extraction, generating low-dimensional embeddings for corresponding nodes in the graph. This ensures that the low-dimensional vectors between nodes of the same type and those with close proximity in the original graph are as close as possible in the latent vector space. The node low-dimensional embeddings generated in this way are well-suited for various tasks in zero-shot scenarios (i.e., completely imbalanced datasets where some node types lack or have no labeled nodes).

[0004] This invention is achieved through the following technical solution:

[0005] This invention relates to a heterogeneous graph embedding generation graph structure optimization system based on semantic aggregation meta-paths, comprising: a heterogeneous graph node embedding module and a semantic information extraction module, wherein: the heterogeneous graph node embedding module defines corresponding type meta-paths according to different features of different datasets, and applies a two-stage attention mechanism to obtain low-dimensional embedding features corresponding to different nodes in the graph structure data; the semantic information extraction module obtains the feature vector set corresponding to different types of nodes in the heterogeneous graph through an 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 a fully connected layer, and uses the MSE between the vector and the vector corresponding to the initial semantic feature information of the node as a loss function to achieve optimization, thereby realizing the classification of different types of nodes in a completely imbalanced dataset and improving the performance of the model in zero-shot scenarios.

[0006] The vectors in the feature vector set are the initial semantic feature information of the nodes.

[0007] The heterogeneous graph node embedding module includes: a linear transformation unit, a metapath intra-class aggregation unit, a metapath inter-class aggregation unit, and a semantic extraction unit. Specifically: the linear transformation unit multiplies the initial features of different node categories by a linear transformation matrix associated with the node category, based on the initial feature information of the nodes, to obtain node transformation features of a unified dimension; the metapath intra-class aggregation unit encodes metapath instances based on the node transformation features and inter-node relationship features, obtaining structural and semantic feature information of nodes based on a certain type of metapath; the metapath inter-class aggregation unit obtains heterogeneous node embedding features based on the intra-class aggregation information of the metapaths through which nodes pass, and according to the different importance of different types of metapaths to nodes; and the semantic extraction unit introduces a fully connected layer to extract semantic information based on the heterogeneous node embedding features, obtaining predicted semantic features of the nodes. Attached Figure Description

[0008] Figure 1 This is a flowchart of the present invention;

[0009] Figure 2 This is a schematic diagram illustrating the effect of an implementation example of a node clustering task. Detailed Implementation

[0010] like Figure 1 As shown, this embodiment presents a heterogeneous graph embedding generation graph structure optimization method based on semantic aggregation meta-paths of the aforementioned system, comprising:

[0011] Step 1: Define the problem scenario, which includes:

[0012] Step 1.1: Define a heterogeneous graph corresponding to a DBLP citation network representing paper citation relationships as a ternary set. in: For mapping functions with node types The associated node set includes paper nodes, conference nodes, author nodes, and paper keyword nodes, where E is a mapping function to the edge type. Associated edge set, and They are sets of predefined node types and edge types that satisfy... ·| represents the cardinality of the set, and the set of node feature matrices.

[0013] Step 1.2: Define metapaths A1A2···A k+1 for In the heterogeneous graph corresponding to the DBLP citation network, predefined relationships are defined as: author and paper and author, author and paper and conference, paper and author, and author and paper and keyword and paper and author, describing the composite relationships between objects. in: For relational composition operators, the sequence of nodes starting from author node v and ending at author node u is an instance of metapath P, where nodes on the path other than node v are neighbors of node v based on metapath p.

[0014] Step 1.3: Define the zero-sample scenario. A tag set that contains all node tags belonging to the author type. It is an observable set of completely unbalanced labels, meaning that there are one or more node categories that have no labels, i.e., one or more can be removed from the above multiple label types.

[0015] Step 1.4: Define the optimization goal as learning the low-dimensional embeddings of the author node, so that the low-dimensional embeddings of interconnected nodes and nodes of the same category are as close as possible in the latent low-dimensional vector space.

[0016] Step 2: Embedding to obtain the predicted semantic features of heterogeneous graph nodes, specifically including:

[0017] Step 2.1: First, use a linear transformation matrix to project the feature vectors corresponding to the author, paper, conference, and keywords into a vector space of the same dimension, which facilitates subsequent calculations in the neural network. Where: x v h is the initial feature vector of a node v among the four types of nodes. v ' is the feature vector after projection transformation, i.e., the nodal transformation feature. It is a specific node type The projection transformation matrix. The "·" operator is the vector multiplication operator.

[0018] Step 2.2: Perform intra-class aggregation of metapaths. Given a predefined metapath P, we obtain the semantic and structural information of the author by aggregating the features of all nodes on the metapath. P(v,u) is a metapath instance based on this specific type of metapath P, connecting the target author node v and its neighbor node u. The aggregation operation embeds the information contained in the metapath instance into a fixed-dimensional vector. We consider the differences in multi-type relationships between nodes by introducing a relationship vector between every two nodes on the metapath. Embedding of metapath instances based on type P in:

[0019] q0 = h v ',h' n =h u ',qi =h i '+q i-1 ⊙r i h i ' represents the feature vector of the i-th node on the metapath instance, ⊙ represents the element-wise multiplication of the vector, and r i The relationship vector between nodes depends on the node type and the relationship type. For a specific type of metapath P, there exist multiple metapath instances that start with author node v and end with u. These metapath representations are weighted and summed to generate a comprehensive embedding feature of author node v for a specific type of metapath P, i.e., a feature vector of author node v based on metapath P. Wherein: the importance of a specific instance of metapath P to the target node Let || be the transpose of the attention vector specific to the metapath P, || be the concatenation operator, and σ(·) and LeakyReLU(·) be two activation functions. For the neighboring nodes of author node v based on meta-path P, The importance of a specific instance of metapath P to the target node. Let V be the feature vector of node v based on the meta-path P. To extend the model's ability to focus on different parts, a multi-head attention mechanism is used to further refine the attention layer: Apply an independent attention mechanism and concatenate the N vectors to obtain The representative node represents the structural and semantic features of a certain type of meta-path.

[0020] Step 2.5: Perform meta-path aggregation between classes. In heterogeneous graphs, there are various types of predefined meta-paths.

[0021] {P1,P2,...,P t}, where t is the number of metapath types. For a node of type author, there exists indivual Regarding the feature vector set of different types of metapaths, where m represents the relationship with author type. The number of associated metapath types, where m ≤ t. For those belonging to the author type... All nodes, through all nodes The meta-path basis is to summarize each meta-path P by averaging. i Then, a self-attention mechanism is applied to obtain the embedding features of heterogeneous nodes. in:

[0022] and These are learnable parameters. The importance of a certain metapath to the target node v. For node types in heterogeneous graphs The set of metapaths.

[0023] Step 2.6: Obtain 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 node embeddings to vectors of fixed dimension (the same horizontal dimension as the preprocessed semantic information matrix S), i.e., the extracted semantic information vectors belonging to type c. in: Embedded for heterogeneous nodes.

[0024] Step 3: Extract initial semantic features of nodes. In the data preprocessing stage, let... To train the feature matrix of nodes (authors, papers, conferences, keywords) in the dataset (for graphs without node features, their adjacency matrix can be used as the feature matrix), For node v i The m-dimensional feature vectors. For nodes with label c, their common semantic information, i.e., the semantic feature vectors of nodes belonging to type c, is extracted by applying an output function to them. Where: C i For v i The node type. It is the output function, usually the mean function, which is used to initialize the semantic feature information matrix in a completely imbalanced training dataset. n is the number of training nodes, and m' is the dimension of the semantic vectors, which have a uniform dimension across nodes with different labels.

[0025] Step 4: Real-time graph structure optimization in the line stage, following a semi-supervised learning method for model optimization: The loss function is based on the accuracy of semantic feature extraction, specifically the difference between the initial semantic features of a node and the predicted semantic features of the node. in: and These refer to the predicted semantic feature vector and the initial semantic feature vector corresponding to the node v belonging to type c in the training set, respectively. The function loss(·,·) is a sample-by-sample loss function, generally the mean squared error (MSE) loss function, which calculates the squared average of the differences between the actual feature vector and the predicted feature vector.

[0026] Through specific experiments, node classification and clustering tasks were carried out on three real-world datasets: DBLP, IMDB, and ACM. The experiments were conducted using the PyTorch and dgl frameworks. During the construction of the training set, nodes with a specific label were removed from selected node types to simulate a completely imbalanced dataset, allowing for zero-shot experiments. During model training, Adam was chosen as the optimizer to update model parameters, with a learning rate of 0.005. Furthermore, dropout was used to prevent overfitting, with the dropout size set to 0.1; finally, the number of layers in the neural network was set to 3.

[0027] For node classification tasks, this invention uses the Micro-F1 and Macro-F1 metrics to evaluate performance. For node clustering tasks, this invention uses the NMI (Normalized Mutual Information) and ARI (Adjusted Rand Index) metrics to evaluate performance.

[0028] In summary, this 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 to existing technologies, this invention effectively extracts semantic features from various types of nodes, achieving comparable performance in general balanced downstream tasks and solving the problem that existing methods cannot be applied to zero-shot scenarios. Existing methods cannot perform related tasks in zero-shot scenarios, while this invention can perform zero-shot learning on completely imbalanced datasets to complete related downstream tasks such as node classification and node clustering.

[0029] The above-described specific implementations can be partially adjusted by those skilled in the art in different ways without departing from the principles and purpose of the present invention. The scope of protection of the present invention is defined by the claims and is not limited to the above-described specific implementations. All implementation schemes within the scope of the claims are bound by the present invention.

Claims

1. A heterogeneous graph embedding generation graph structure optimization method based on semantic aggregated meta-path for a heterogeneous graph embedding generation graph structure optimization system, characterized in that, Comprise: Step 1, define the problem scenario and optimization target, Step 2, after linear transformation, intra-class meta-path aggregation and inter-class meta-path aggregation by the semantic information extraction module, the node predicted semantic features are obtained by the semantic information extraction module, specifically including: Step 2.1: Project the feature vectors corresponding to authors, papers, conferences, and keywords into a vector space of the same dimension using a linear transformation matrix, specifically: ,in: For a node of one of the four types The initial feature vector, This represents the feature vector after projection transformation, i.e., the node transformation feature. For a specific node type The projection transformation matrix, The operator is the vector multiplication operator; Step 2.2, intra-class aggregation of meta-paths: obtain semantic information of authors and structural information by aggregating features of all nodes on the meta-path, i.e. predefined meta-path Connect target author node and neighbor nodes based on the meta-path instance of this specific type of meta-path ​ Step 2.

3. Consider the difference of multi-type relations between nodes by introducing a relation vector between each two nodes on a meta-path: based on Embedding of a meta-path instance of a type where: , is the feature vector of the th node on the meta-path instance, is the element-wise multiplication of vectors, is the relation vector between nodes, which depends on the node type and the relation type; Step 2.4: For specific types of metapaths Multiple author nodes Start and The weighted sum of the ending metapaths generates a metapath of a specific type. author node The full embedding features, namely the author node Meta-path based eigenvectors , where: metapath The importance of a specific instance to the target node For metapath specific The transpose of the attention vector. This is the cascading operation operator. and There are two activation functions. For author nodes Based on metapath nodes Neighbors Metapath The importance of a specific instance to the target node For nodes Meta-path based eigenvectors; Step 2.

5. Inter-class aggregation of meta-paths: In the heterogeneous graph, there are multiple types of predefined meta-paths where: is the number of meta-path types, for nodes of type author, there exists a set of feature vectors for different types of meta-paths, where: represents the number of meta-path types associated with the author type and for all nodes belonging to the author type , each meta-path is summarized by averaging over all meta-paths of all nodes After that, a self-attention mechanism is applied to obtain the heterogeneous node embedding features where: is a learnable parameter, is the importance of a certain meta-path to the target node , and is the set of meta-paths for node types in the heterogeneous graph;​ Step 2.6, obtaining node predicted semantic features with different labels through a full connection layer in the semantic information extraction module, specifically: mapping the node embedding to a vector with the same horizontal dimension as the semantic information matrix obtained by preprocessing, i.e. the extracted semantic information vector belonging to the type , , , is a heterogeneous node embedding; Step 3, obtain the initial semantic feature vector of the node, that is, the semantic feature vector of the node belonging to the type Wherein: is the node type is an output function, is the number of training nodes, is the dimension of the semantic vector, and the information matrix of the initial semantic feature in the completely unbalanced training data set refers to: the dimensional feature vector of the node ;​​​ Step 4, real-time graph structure optimization processing in the linear stage, model optimization is carried out in accordance with the semi-supervised learning method; The heterogeneous graph embedding generation graph structure optimization system comprises a heterogeneous graph node embedding module and a semantic information extraction module, wherein: the heterogeneous graph node embedding module defines corresponding type meta-paths according to different features of different data sets, and applies twice 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 a node corresponding extracted semantic feature vector from the features obtained from the heterogeneous graph node embedding module through a fully connected layer, and uses the MSE between the vector and the initial semantic feature information corresponding to the vector of the node as a loss function to realize optimization, so as to realize classification of different types of nodes under completely unbalanced data sets and improve the performance of the model under the zero sample scenario.

2. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, The heterogeneous graph node embedding module comprises a linear transformation unit, an intra-class meta-path aggregation unit, an inter-class meta-path aggregation unit and a semantic extraction unit, wherein: the linear transformation unit multiplies the initial features of different categories of nodes by a linear transformation matrix associated with the node category according to the initial feature information of the node, to obtain node transformation features of a unified dimension, the intra-class meta-path aggregation unit encodes the meta-path instance according to the node transformation feature information and the node relationship feature information, to obtain structure and semantic feature information of the node based on a certain type of meta-path, the inter-class meta-path aggregation unit obtains heterogeneous node embedding features according to the importance of different types of meta-paths to the node according to the intra-class meta-path aggregation information of the node, and the semantic extraction unit extracts semantic information by introducing a fully connected layer according to the heterogeneous node embedding features, to obtain node predicted semantic features.

3. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, The step 1 specifically comprises: Step 1.

1. Define a heterogeneous graph corresponding to a DBLP citation network representing the citation relationship of papers as a triple set wherein: is a node set containing paper nodes, conference nodes, author nodes and paper keyword nodes associated with the node type mapping function is an edge set associated with the edge type mapping function and are respectively the set of predefined node types and edge types and satisfy is the cardinality of the set of node feature matrix sets ;​​ Step 1.2: Define metapath In the heterogeneous graph corresponding to the DBLP citation network, predefined relationships are defined as: author and paper and author, author and paper and conference, paper and author, and author and paper and keyword and paper and author, describing the composite relationships between objects. ,in: For the composition operators of relations, starting from the author node Start with the author node The ending node sequence is the metapath. One example is the path excluding the node. Nodes other than those are nodes Meta-path based Neighbors; Step 1.3, defining in zero-sample scenarios, for a label set containing all node labels belonging to the author type, for a label set that is completely unbalanced, i.e. where one or more node classes have no labels at all, i.e. any one or more of the above multiple label types are removed; Step 1.4, the target of optimization is to learn the low-dimensional embedding of the author node, so that the low-dimensional embedding of the nodes connected to each other and the nodes of the same category are as close as possible in the latent low-dimensional vector space.

4. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, The step 3 is specifically: in the data preprocessing stage, setting is the feature matrix of the nodes in the training data set, is the feature matrix of the nodes in the training data set, is the dimensional feature vector of the node; for the node with a label , the common semantic information, i.e. the initial semantic feature vector, is obtained by applying an output function on the feature matrix.

5. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, Step 4 specifically involves using the accuracy of semantic feature extraction, i.e., the difference between the initial semantic features of a node and the predicted semantic features of a node, as the loss function. ,in: and They belong to the type in the training set respectively nodes The corresponding predicted semantic feature vector and initial semantic feature vector, function The sample-by-sample loss function calculates the squared average of the differences between the actual feature vector and the predicted feature vector.

6. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, The aggregation contains information embedded in a fixed-dimensional vector in the meta-path instance.

7. The heterogeneous graph embedding generation graph structure optimization method of claim 1, wherein, To extend the ability of the model to focus on different parts, a multi-head attention mechanism is used to further refine the attention layer: , an independent attention mechanism is applied, and vectors are connected to obtain representing the structural and semantic feature information of the node based on 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