Heterogeneous graph embedding method and system based on relationship mining

By learning the similarity and relationship strength of nodes in heterogeneous graphs, generating relationship adjacency matrices and attention weights, and combining with the multi-head attention mechanism, it solves the problem of existing models relying on specific knowledge and complete graph structures, and achieves a more comprehensive heterogeneous Composition embedding and performance improvements.

CN117807275BActive Publication Date: 2024-09-27JIANGNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311856289.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-09-27
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

Existing heterogeneous graph embedding models require specific domain knowledge to design meta-paths, rely on complete graph structures, and ignore the semantic information of intermediate nodes when aggregating meta-path node data, resulting in incomplete message delivery.

Method used

By extracting the feature vectors of all nodes in the heterogeneous graph, learn the similarity between nodes, generate a relationship adjacency matrix, calculate the attention weight of neighbor nodes, aggregate the updated neighbor node information, and generate the final node embedding value based on the relationship strength , using a relationship graph generator and a multi-head attention mechanism to comprehensively capture relationship information in heterogeneous graphs.

Benefits of technology

It effectively captures the relationships between different types of nodes in heterogeneous graphs, uses topological information to generate richer node representations, improves the performance of heterogeneous graph embedding, and overcomes the limitations of existing models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117807275B
    Figure CN117807275B
Patent Text Reader

Abstract

The present invention relates to the technical field of graph data mining, and specifically to a heterogeneous graph embedding method and system based on relationship mining, including: extracting feature vectors of all nodes in a heterogeneous graph; based on the feature vectors of all nodes, learning the similarity between nodes, completing the hidden relationships in the heterogeneous graph, and generating a relationship adjacency matrix; based on the relationship adjacency matrix, calculating the attention weights of neighbor nodes to a target node, aggregating the weighted neighbor node information into the neighbor node, and obtaining an updated neighbor node feature vector; calculating the relationship strength between nodes, and aggregating the information contained in the updated neighbor node feature vector into the corresponding target node according to the relationship strength, and obtaining the final node embedding value. The present invention solves the problem that the existing method is too dependent on the prior knowledge of the meta-path and does not consider the information of the intermediate nodes of the meta-path when the node relationship semantic aggregation is performed, effectively utilizes the topological information of the heterogeneous graph, and enhances the connection between nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graph data mining, and in particular to a heterogeneous graph embedding method and system based on relationship mining. Background Art

[0002] In computer science, graph structure is a basic data structure that is more flexible than other structures. Graphs not only contain the attributes of individuals, but also capture the relationships between individuals. Therefore, they are often used to describe and model more complex systems. By analyzing graph structures at multiple levels, users can gain a deeper understanding of the information hidden behind the data, thereby providing support for subsequent tasks in various business scenarios (such as node classification, link prediction, node recommendation, etc.).

[0003] Graph embedding is an effective method to solve graph analysis problems. It converts the original graph data into a low-dimensional space and retains important data, which helps to understand the correlation between nodes and improve the performance of downstream tasks.

[0004] In order to address these challenges, some scholars introduced the concept of meta-path to parse the semantic relationship between different types of nodes. For example, when a paper involves two authors, it can be represented by the meta-path P=APA. Subsequently, researchers proposed a variety of methods. Metapath2vec performs random walks based on user-defined meta-paths and uses the heterogeneous Skip-Gram method to learn node embeddings. MAGNN manually samples meta-path instances and fuses the semantic features of other nodes on the meta-path where the node is located, aggregating the latent vectors of multiple meta-paths into the target node embedding. The HAN model solves the heterogeneity by converting heterogeneous graphs into multiple sub-graphs, and proposes a hierarchical attention mechanism to learn node embedding. The HHNE ​​model first studies the HIN embedding problem in hyperbolic space, using meta-paths to guide random walks to preserve the HIN structure and semantic relevance. MHGCN performs representation learning for attribute reuse heterogeneous networks, automatically learns meta-paths of different lengths in HIN through multi-layer convolution aggregation, and integrates multi-relational structures and attribute semantics into the learned node embeddings. Considering the dependencies between meta-path instances, MIGTNet samples all meta-paths within a predefined maximum meta-path length starting from the embedded target node, builds a hierarchical graph attention network, and learns node embeddings.

[0005] These models have made some progress in the field of heterogeneous graph embedding, but there are still some limitations:

[0006] First, most models require domain-specific knowledge to design meta-paths in heterogeneous graphs;

[0007] Second, many methods rely on a basic assumption that the original heterogeneous graph structure is complete. However, during the dataset preprocessing, the data is usually processed according to certain rules, resulting in the graph structure of the input model being suboptimal. Therefore, the impact of dataset preprocessing on the graph is ignored.

[0008] Third, when aggregating meta-path node data, some models only focus on the first and last nodes, ignoring the semantic information carried by the intermediate nodes, resulting in incomplete message delivery. Summary of the invention

[0009] In order to solve the above technical problems, the present invention provides a heterogeneous graph embedding method based on relationship mining, and the specific steps of the method include:

[0010] Step S1: extract the feature vectors of all nodes in the heterogeneous graph;

[0011] Step S2: Based on the feature vectors of all nodes, learn the similarity between nodes, complete the hidden relationships in the heterogeneous graph, and generate a relationship adjacency matrix;

[0012] Step S3: Based on the relational adjacency matrix, the attention weight of the neighbor node to the target node is calculated, and the weighted neighbor node information is aggregated into the neighbor node to obtain an updated neighbor node feature vector;

[0013] Step S4: Calculate the relationship strength between nodes, and aggregate the information contained in the updated neighbor node feature vector into the corresponding target node according to the relationship strength to obtain the final node embedding value.

[0014] In one embodiment of the present invention, in step S2, the method for constructing the relational adjacency matrix includes:

[0015] Step S21: The feature vectors f of all nodes in the heterogeneous graph are v Mapped to a unified shared semantic space f' v :

[0016] f' v =σ(f v ·W φ(v) +b φ(v) )

[0017] Where v represents a node, φ(v) represents the type of node v, represents the projection matrix corresponding to the φ(v) type node, b τ represents the bias parameter, b τ ∈R 1×d , σ(·) is a nonlinear activation function;

[0018] Step S22: For a relationship in the heterogeneous graph Through metric learning, we learn the first-order feature similarity between different types of node features.

[0019] Step S23: Based on first-order feature similarity Get the similarity graph

[0020]

[0021] Among them, ε F Represents the control similarity graph The sparsity parameter of ;

[0022] Similarly, calculate the feature similarity graph between nodes of the same type:

[0023]

[0024]

[0025] in, is the source node s i and j The feature similarity graph between is the tail node t m and t n Feature similarity graph between ; Represents the source node s i and j The first-order feature similarity between Represents the tail node t m and t n The first-order feature similarity between i 、f' j Represents the source node s i and j The eigenvector of m 、f' n Respectively represent the tail node t m and t n The eigenvector of FS , ε FT Represent the control feature similarity graph respectively The sparsity parameter, ε F ∈[0,1];

[0026] Step S24: propagate the similarity between source nodes and the similarity between tail nodes through the topological structure of the initial relationship graph matrix to generate a propagation graph:

[0027]

[0028]

[0029] Step S25: Using channel attention Feature similarity graph and propagation diagram Fusion to generate a relationship adjacency graph

[0030]

[0031] in, Assign different weights to each relation r;

[0032] Step S26: Connect the relationship adjacency graph and the same type of relationship vector A r Perform aggregation to obtain the relationship adjacency matrix A' r :

[0033]

[0034] Among them, softmax(·) means that the weight w ψ,r Normalize.

[0035] In one embodiment of the present invention, the first-order feature similarity between the node features is The methods for obtaining include:

[0036] Through metric learning, the relationship between nodes is used to learn the first-order feature similarity between node features.

[0037]

[0038] Among them, f' i 、f' j Both represent the node v after feature mapping i and v j The eigenvector of Represents Hadamard; is a learnable weight matrix used to weight node features; r represents the type of relationship between nodes, e represents the relationship edge between nodes vi and vj, represents the mapping function, Indicates the type of the relationship edge e.

[0039] In one embodiment of the present invention, in step S3, the method for obtaining the updated neighbor node feature vector is: designing a row normalization matrix, and calculating the updated node neighbor feature vector F according to the row normalization matrix. Γ :

[0040]

[0041] in, represents the row normalized matrix; f' Γ Represents the node neighbors N in the same type of relationship r Γ The feature vector of .

[0042] In one embodiment of the present invention, the row normalization matrix The expression is:

[0043]

[0044] Among them, D r It's A' r The degree matrix of

[0045] In one embodiment of the present invention, the step of obtaining the final node embedding value includes:

[0046] Step S41: Using the meta-relation triple Calculate the relationship strength of the nodes and get the attention value of the relationship:

[0047] K(s)=K-Linear φ(s) (F[s])

[0048] Q(t)=Q-Linear φ(t) (F[t])

[0049]

[0050] Among them, φ(s) represents the type of node s, φ(t) represents the type of node t, Indicates the type of connection relationship between node s and node t; K(s) indicates the strength of the relationship between source node s; Q(t) indicates the strength of the relationship between tail node t; F(s) indicates the feature representation of source node s; F(t) indicates the feature representation of tail node t; Linear projection φ(v) Used to adjust the dimension of node s or t, changing the node dimension from R d become h is the number of attention heads, is the vector dimension of each head; Represents the parameter for adjusting the attention value;

[0051] Step S42: Connect h attention heads together to obtain the attention vector Attention(s,e,t) of each node pair:

[0052]

[0053] Among them, the softmax function is used to normalize the attention distribution of neighbor node s;

[0054] Step S43: Combine the attention vector of each node pair with the message vectors from neighboring nodes to obtain the contextual representation of each target node t

[0055] Step S44: Based on the context representation of each target node t Map the target node t back to the distribution of its node type and perform residual connection to obtain the updated context representation H of the target node (l) [t], the final node embedding value.

[0056] In one embodiment of the present invention, the context representation of each target node t is

[0057]

[0058] in, represents the connection symbol, and Message(s,e,t) represents the message vector from the adjacent node.

[0059] In one embodiment of the present invention, the message vector Message(s,e,t) from the adjacent node is:

[0060]

[0061] Where h represents the number of attention heads,

[0062] In one embodiment of the present invention, the updated context representation H of the target node (l) [t] is:

[0063]

[0064] Among them, l represents the number of layers of relationship stacking; A-Linear φ(t) represents linear projection, and t represents the target node.

[0065] Based on the same inventive concept, the present invention also provides a heterogeneous graph embedding system based on relationship mining, comprising the following modules:

[0066] Node feature vector extraction module, used to extract feature vectors of all nodes in the heterogeneous graph;

[0067] A relational graph generator is used to learn the similarity between nodes based on the feature vectors of all nodes, complete the hidden edges in the heterogeneous graph, and generate a relational adjacency matrix;

[0068] An object-level aggregator, used to calculate the attention weight of the neighbor node to the target node based on the relational adjacency matrix, aggregate the weighted neighbor node information into the neighbor node, and obtain an updated neighbor node feature vector;

[0069] The relationship-level aggregator is used to calculate the relationship strength between nodes, and aggregate the information contained in the updated node neighbor feature vector into the corresponding target node according to the relationship strength to obtain the final node embedding value.

[0070] The above technical solution of the present invention has the following advantages compared with the prior art:

[0071] The present invention can effectively capture the relationship between different types of nodes in heterogeneous graphs, introduces a relationship graph generator, effectively utilizes the topological information of heterogeneous graphs, and combines object-level aggregation and multi-head attention mechanism to generate richer node representations. The proposed heterogeneous graph embedding method has better performance than the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein

[0073] Figure 1 is a flow chart of a heterogeneous graph embedding method based on relationship mining in an embodiment of the present invention;

[0074] Figure 2 is a schematic diagram of a process for generating a relational adjacency matrix in an embodiment of the present invention;

[0075] Figure 3 is a schematic diagram of a process for generating context representation vectors of all nodes in an embodiment of the present invention;

[0076] Figure 4 It is a framework flow chart of a heterogeneous graph embedding method (HRMNN model) based on relationship mining in an embodiment of the present invention;

[0077] Figure 5 is a link prediction result graph in an embodiment of the present invention;

[0078] Figure 6 1 is a graph of ablation experiment results in an embodiment of the present invention, wherein (a) represents a comparison of experimental results on an ACM dataset, (b) represents a comparison of experimental results on an IMDB dataset, and (c) represents a comparison of experimental results on a DBLP dataset. DETAILED DESCRIPTION

[0079] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0080] Embodiment 1

[0081] Reference Figures 1 to 3 As shown, the present invention provides a heterogeneous graph embedding method based on relationship mining, and the specific steps of the method include:

[0082] Step S1: extract the feature vectors of all nodes in the heterogeneous graph;

[0083] Step S2: Based on the feature vectors of all nodes, learn the similarity between nodes, complete the hidden relationships in the heterogeneous graph, and generate a relationship adjacency matrix;

[0084] Step S3: Based on the relational adjacency matrix, the attention weight of the neighbor node to the target node is calculated, and the weighted neighbor node information is aggregated into the neighbor node to obtain an updated neighbor node feature vector;

[0085] Step S4: Calculate the relationship strength between nodes, and aggregate the information contained in the updated neighbor node feature vector into the corresponding target node according to the relationship strength to obtain the final node embedding value.

[0086] Different types of nodes usually have their own characteristic attributes and are located in different semantic spaces. Directly comparing the features of these different types of nodes may lead to misleading results and fail to reflect the true relationship between the nodes. Therefore, the feature vector f of node v is v Mapped into a shared semantic space:

[0087] f' v =σ(f v ·W φ(v) +b φ(v) )

[0088] Where v represents a node, φ(v) represents the type of node v, represents the projection matrix corresponding to the φ(v) type node, b τ represents the bias parameter, b τ ∈R 1×d , σ(·) is a nonlinear activation function; r represents the type of relationship between nodes, The feature mapping operation uses a learnable parameter matrix to process the features of different types of nodes to ensure that various types of nodes have consistent representations. This helps in the analysis and generation of node relationship graphs.

[0089] In a heterogeneous graph, the more similar the features of two nodes are in the feature vector space, the closer the nodes are to each other in the embedding space, the higher the probability that they belong to the same type, and the higher the probability that there is an edge between the two similar nodes. Based on the topological structure of the heterogeneous graph, a relationship graph generator is introduced to learn the similarity between node features by using the relationship between nodes. The principle is as follows Figure 2 As shown. Figure 2 Contains only one relationship This relation covers the following three relation triples: i ,e 1 ,t m >,<s j ,e 2 ,t m >,<s j ,e 3 ,t n >.

[0090] For relation r, we learn the first-order feature similarity between different types of node features through metric learning.

[0091]

[0092] Among them, f' i 、f' j Both represent the node v after feature mapping i and v j The eigenvector of Representing Hadamard, is a learnable weight matrix used to weight node features; r represents the type of relationship between nodes, e represents node v i and v j The relationship side, represents the mapping function, Indicates the type of the relationship edge e.

[0093] Through this process, we get the similarity graph

[0094]

[0095] Among them, ε F ∈[0,1] controls the sparsity of the graph. The closer the value is to 1, the sparser the graph is, meaning that very similar nodes are retained. If ε F If is smaller, the graph will contain more non-zero elements, reflecting more similar nodes.

[0096] Two nodes with similar characteristics are likely to have similar neighbors. Therefore, for the same type of relationship A r, using a meta-relation triple to represent relation A r ,Right now Study its high-order similarity, that is, find the neighbors of nodes with similar characteristics through the structure of the graph.

[0097] Therefore, in step S2, the method for constructing the relationship adjacency matrix includes:

[0098] Step S21: Calculate the similarity between nodes of the same type (source nodes or tail nodes) and generate a feature similarity graph:

[0099]

[0100]

[0101] in, is the source node s i and j The feature similarity graph between is the tail node t m and t n Feature similarity graph between ; represents the first-order feature similarity between node features, Represents the source node s i and j The first-order feature similarity between Represents the tail node t m and t n The first-order feature similarity between i 、f' j Represents the source node s i and j The eigenvector of m 、f' n Respectively represent the tail node t m and t n The eigenvector of FS , ε FT Both represent parameters that control the sparsity of the graph, ε F ∈[0,1];

[0102] Step S22: propagate the feature similarity graph between source nodes and the feature similarity graph between tail nodes through the topological structure of the initial relationship graph matrix to generate a potential propagation graph:

[0103]

[0104]

[0105] Step S23: Using channel attention Feature similarity graph and propagation diagram Fusion to generate a relationship adjacency graph

[0106]

[0107] in, Assign different weights to each relation r;

[0108] Step S24: In order to more comprehensively consider the impact of relations on the graph and further improve the model performance, the relation adjacency graph and the same type of relationship vector A r Perform aggregation to obtain the relationship adjacency matrix A' r :

[0109]

[0110] Among them, softmax(·) means that the weight w ψ,r Normalize. The relationship graph generator learns a new relationship adjacency matrix by analyzing the connection information between nodes, mining feature similarity, and applying the channel attention mechanism. The complete graph structure information helps to more fully understand the relationship between nodes, including complex information between different node types.

[0111] Different types of neighbor nodes have unique features and semantics, which have a certain impact on the representation of the target node. For example, in an academic heterogeneous graph, the association between an author's published papers and the corresponding conferences can reveal the author's academic interests and predict which conferences he is more inclined to submit his papers to. Therefore, in order to ensure the integrity of the target node (author node) information and provide strong support for downstream tasks, an object-level aggregation module is used to process the information of the target node's neighbor nodes.

[0112] In step S3, the method for obtaining the updated neighbor node feature vector is: designing a row normalization matrix to weight the importance of the target node according to different neighbor node types, and the row normalization matrix The expression is:

[0113]

[0114] Among them, D r It's A' r The degree matrix of

[0115] Normalize the matrix according to the rows For node neighbors N in the same relation r Γ , its feature vector f' ΓMultiply it with the corresponding adaptive weight matrix, perform aggregation, and calculate the updated node neighbor feature vector F Γ :

[0116]

[0117] in, represents the row normalized matrix; f' Γ Represents the node neighbors N in the same type of relationship r Γ For symbol consistency, update the characteristics of the target node, let F τ =f' τ , which helps ensure that all features are processed in the same way.

[0118] Through the row normalization matrix method, the object-level aggregation module comprehensively considers the impact of different neighbor nodes on the target object, which provides a basis for the subsequent relationship-level aggregation module to learn the information of different types of high-order neighbor nodes and update the target node representation.

[0119] exist Figure 3 There are two different relationships, namely Relation triple <s,e 1 ,t>,<h,e 2 ,t> respectively. For the target object t, information from different types of neighbor objects may have different effects. Therefore, in order to effectively utilize different relationships, such as Figure 3 As shown in Figure 1, the importance weights of different types of neighbor objects are learned, and the attention mechanism is used to aggregate the information from the source node to obtain the contextual representation of the target node t.

[0120] Therefore, the steps to obtain the final heterogeneous graph include:

[0121] Step S41: Using the meta-relation triple Calculate the relationship strength of the nodes and get the attention value of the relationship:

[0122] K(s)=K-Linear φ(s) (F[s])

[0123] Q(t)=Q-Linear φ(t) (F[t])

[0124]

[0125] Among them, φ(s) represents the type of node s, φ(t) represents the type of node t, Indicates the type of connection relationship between node s and node t; K(s) indicates the strength of the relationship between source node s; Q(t) indicates the strength of the relationship between tail node t; F(s) indicates the feature representation of source node s; F(t) indicates the feature representation of tail node t; Linear projection φ(v) Used to adjust the dimension of node s or t, changing the node dimension from R d become h is the number of attention heads, is the vector dimension of each head; since there are multiple relationships between node pairs in heterogeneous graphs, we use As a learnable weight matrix, it adapts to different edges. Represents the parameters for adjusting the attention value to adapt to different relationships;

[0126] Step S42: In order to more comprehensively capture the information of different types of neighbor nodes, a multi-head attention mechanism is introduced to connect h attention heads together to obtain the attention vector Attention(s,e,t) of each node pair:

[0127]

[0128] Among them, the softmax function is used to normalize the attention distribution of neighbor node s to ensure that the attention distribution of neighbor node s satisfies the normalization, which is convenient for effectively performing weighted averaging on different neighbor nodes; ATT-head i (s,e,t) represents the i-th attention head;

[0129] Step S43: Combine the attention vector of each node pair with the message vectors from neighboring nodes to obtain the contextual representation of each target node t

[0130]

[0131] in, represents a connection symbol, Attention(s,e,t) represents the attention vector of each node pair, and Message(s,e,t) represents the message vector from the adjacent node; the attention vector weights and averages the information of different types of neighboring nodes to ensure that more attention is paid to the neighboring nodes that have the greatest impact on the target node. The message vector Message(s,e,t) from the adjacent node is:

[0132]

[0133] Where h represents the number of attention heads,

[0134] Step S44: Based on the context representation of each target node t Map the target node t back to the distribution of its node type and perform residual connection to obtain the updated context representation H of the target node (l) [t], the final node embedding value:

[0135]

[0136] Among them, l represents the number of layers of relationship stacking; A-Linear φ(t) represents linear projection, and t represents the target node.

[0137] The following experiments are designed for three typical heterogeneous information network datasets and compared with multiple baseline models in detail to demonstrate the proposed method (e.g. Figure 4 The HRMNN model shown in Figure 3 shows the superior performance of the proposed approach.

[0138] Table 1

[0139]

[0140] The experiments were conducted using the datasets ACM, IMDB, and DBLP. Table 1 summarizes the specific data of the three datasets. The ACM dataset comes from citation network data and contains three types of objects: author (A), paper (P), and topic (S). Papers (P) are divided into three research fields: database, data mining, and wireless communication, and are used as labels for papers. The features of a paper are represented by a bag of words consisting of its keywords, while the feature vector of an author is the average of the features of its connected papers. The features of the topic are encoded using one-hot encoding.

[0141] The IMDB dataset is preprocessed and contains three types of objects: movies (M), actors (A), and directors (D). Movies (M) include three types of tags: action movies, comedies, and dramas. The features of movies are represented by bags of words consisting of keywords of their movie plots, while the features of actors and directors are the averages of the corresponding movie features.

[0142] The DBLP dataset contains four types of objects: papers (P), authors (A), conferences (C), and terms (T). Authors (A) are divided into four categories according to their research fields: databases, data mining, artificial intelligence, and information retrieval. The paper feature is a bag-of-words representation of the paper title, the author feature is a bag-of-words representation of keywords extracted from their published papers, the term feature is represented by a pre-trained word vector, and the conference feature is represented by a one-hot vector.

[0143] Experiment 1: Node Classification

[0144] We focus on the paper node of the ACM dataset, the author node of the DBLP dataset, and the movie node of the IMDB dataset to evaluate the performance of the HRMNN model in the node classification task. In this experiment, different training ratios were used, specifically 20%, 40%, 60%, and 80%, and the target nodes were divided according to these ratios, while the remaining nodes were used as validation sets and test sets. Macro-F1 and Micro-F1 were used as evaluation indicators, and the experimental results are shown in Table 2.

[0145] Table 2

[0146]

[0147]

[0148] The experimental results in Table 2 show that the HRMNN model achieves good performance. This proves that by fully exploring the influence of different relations on the target node, the node representation can be learned more effectively. At the same time, we also observed that the performance of the Metapath2vec model on the ACM and IMDB datasets is relatively poor. This emphasizes that there is still room for improvement in the heterogeneous network embedding method with manually set meta-paths.

[0149] Experiment 2: Node Clustering

[0150] K-Means algorithm is used for clustering. For the ACM dataset, we divide the paper nodes into training set (808), validation set (401), and test set (2816); for the DBLP dataset, the author nodes are divided into training set (400), validation set (400), and test set (3257); for the IMDB dataset, the movie nodes are divided into training set (400), validation set (400), and test set (3478). The two evaluation indicators, normalized mutual information (NMI) and adjusted Rand index (ARI), are used to evaluate the performance of different algorithms on the node clustering task. The experimental results are shown in Table 3.

[0151] Table 3

[0152]

[0153]

[0154] From the results in Table 3, we can see that the HRMNN model performs well, especially on the ACM dataset, where its NMI and ARI scores are significantly higher than those of other algorithms. In contrast, ie-HGCN performs relatively poorly, which suggests that the model may not be very suitable for the downstream task of node clustering. It should be noted that due to the incompleteness of node labels in the dataset, the performance of all algorithms on the IMDB dataset is relatively low. It is worth mentioning that HRMNN performs better than the HGT algorithm on the ACM dataset. This shows that discovering hidden edges in the graph through similarity gives the HRMNN method a significant advantage in the node clustering task.

[0155] Experiment 3: Link Prediction

[0156] When conducting link prediction experiments, the edge between the paper node and the author node in the DBLP dataset is used to demonstrate the performance of the HRMNN model. We regard the connected paper-author pairs as positive node pairs and all unconnected paper-author pairs as negative node pairs. The training set contains 13,751 positive node pairs and adds the same number of randomly sampled negative node pairs. The number of positive node pairs and negative node pairs in the validation set and the test set are also consistent. In this experiment, two evaluation indicators are used, namely the area under the curve (AUC) and the average precision (AP). The specific results are shown in Figure 2. Figure 5 shown.

[0157] from Figure 4 According to the experimental results, HRMNN significantly outperforms all baseline models in various performance indicators. In particular, compared with ie-HCGN and HAN models, the HRMNN model shows better performance, which shows that HRMNN has the ability to automatically mine hidden relationships. Metapath2Vec performs well in heterogeneous graph scenarios, which suggests that the meta-path sampling method has certain advantages in link prediction applications. HGT, HAN, and HRMNN models all perform well, which may be because these models can utilize the rich information of neighbor nodes around the target node to optimize the representation of the node.

[0158] Experiment 4: Ablation experiment

[0159] In order to comprehensively evaluate the effectiveness of the HRMNN model, a series of node classification ablation experiments were conducted to deeply explore the impact of each component on performance. Therefore, multiple variants of the HRMNN model were created, including the HRMNN-O model, HRMNN-S model, HRMNN-L model, HRMNN-R model, and HRMNN-M model, to explore their performance in different aspects. Specifically:

[0160] The HRMNN-O model directly uses the original adjacency matrix for modeling and does not rely on the relationship graph generator.

[0161] The HRMNN-S model does not consider the differences between nodes when generating a new adjacency graph and sets all weights to 1.

[0162] The HRMNN-L model adopts a simple strategy that does not take any action in object-level aggregation and directly performs relation aggregation.

[0163] The HRMNN-R model replaces the relationship mapping matrix weights with unified weights during relationship aggregation.

[0164] The HRMNN-M model does not use a relation-level aggregator to generate node representations.

[0165] The experimental results are as follows Figure 6 As shown. Figure 6 As can be seen from (a) to (c), the HRMNN-O model performs poorly on the ACM dataset, which may be because the ACM dataset has a single author node after preprocessing, and the relationship graph generator completes the ACM heterogeneous network, highlighting the importance of this module in capturing hidden node relationships. The performance of the HRMNN-S model is worse than that of the HRMNN, emphasizing that more attention should be paid to the differences between nodes when generating new relationship graphs. In addition, the results of HRMNN-L show that it is necessary to use the relationship matrix to aggregate information of neighbor nodes. The HRMNN-R model performs the worst, which shows that when using the multi-head attention mechanism to aggregate source node information, the heterogeneity of edges still needs to be considered. The performance of HRMNN-M is improved compared to HRMNN-R, but it is still inferior to other models, which shows that the relationship-level aggregator is effective in improving model performance.

[0166] Embodiment 2

[0167] Based on the same inventive concept as the heterogeneous graph embedding method described in Example 1, the present invention also provides a heterogeneous graph embedding system based on relationship mining, and the system includes the following modules:

[0168] Node feature vector extraction module, used to extract feature vectors of all nodes in the heterogeneous graph;

[0169] A relational graph generator is used to learn the similarity between nodes based on the feature vectors of all nodes, complete the hidden edges in the heterogeneous graph, and generate a relational adjacency matrix;

[0170] An object-level aggregator, used to calculate the attention weight of the neighbor node to the target node based on the relational adjacency matrix, aggregate the weighted neighbor node information into the neighbor node, and obtain an updated neighbor node feature vector;

[0171] The relationship-level aggregator is used to calculate the relationship strength between nodes, and aggregate the information contained in the updated node neighbor feature vector into the corresponding target node according to the relationship strength to obtain the final node embedding value.

[0172] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0173] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0174] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0175] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0176] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A heterogeneous graph embedding method based on relationship mining, characterized in that: include: Step S1: Add authors, papers, and topics as different types of nodes to the heterogeneous graph, add edges between paper nodes and author nodes, and between paper nodes and topic nodes, and extract feature vectors of all nodes in the heterogeneous graph; Step S2: Based on the feature vectors of all nodes, learn the similarity between nodes, complete the hidden relationships in the heterogeneous graph, and generate a relationship adjacency matrix; wherein the method for constructing the relationship adjacency matrix includes: Step S21: The feature vectors f of all nodes in the heterogeneous graph are v Mapped to a unified shared semantic space f v ': f v ′=σ(f v ·W φ(v) +b φ(v) ) Where v represents a node, φ(v) represents the type of node v, represents the projection matrix corresponding to the φ(v) type node, b φ(v) represents the bias parameter, b φ(v) ∈R 1×d , σ(·) is a nonlinear activation function; Step S22: For a relationship in the heterogeneous graph Through metric learning, we learn the first-order feature similarity between different types of node features. Step S23: Based on first-order feature similarity Get the similarity graph Among them, ε F Represents the control similarity graph The sparsity parameter of ; Similarly, calculate the feature similarity graph between nodes of the same type: in, is the source node s i and j The feature similarity graph between is the tail node t m and t n Feature similarity graph between ; Represents the source node s i and j The first-order feature similarity between Represents the tail node t m and t n The first-order feature similarity between i ', f′ j Represents the source node s i and j The characteristic vector of m , f′ n Respectively represent the tail node t m and t n The eigenvector of FS , ε FT Represent the control feature similarity graph The sparsity parameter, ε F ∈[0,1]; Step S24: The similarity between the source nodes and the similarity between the tail nodes are propagated through the topological structure of the initial relationship graph matrix to generate a propagation graph: Step S25: Using channel attention Feature similarity graph and propagation diagram Fusion to generate a relationship adjacency graph in, Assign different weights to each relation r; Step S26: Connect the relationship adjacency graph and the same type of relationship vector A r Perform aggregation to obtain the relationship adjacency matrix A' r : Among them, softmax(·) means that the weight w ψ,r Perform normalization; Step S3: Based on the relational adjacency matrix, the attention weight of the neighbor node to the target node is calculated, and the weighted neighbor node information is aggregated into the neighbor node to obtain an updated neighbor node feature vector; Step S4: Calculate the relationship strength between nodes, aggregate the information contained in the updated neighbor node feature vector into the corresponding target node according to the relationship strength, obtain the final node feature representation, i.e., node embedding value, and use the node embedding value to perform node classification or link prediction; The method for obtaining the node embedding value includes: Step S41: Using the triplet of meta-relationships Calculate the relationship strength of the nodes and get the attention value ATT-head(s,e,t) of the relationship: K(s)=K-Linear φ(s) (F[s]) Q(t)=Q-Linear φ(t) (F[t]) Among them, φ(s) represents the type of node s, φ(t) represents the type of node t, represents the type of connection relationship between node s and node t; K(s) represents the relationship strength between source nodes s; Q(t) represents the relationship strength between tail nodes t; F(s) represents the feature representation of source node s, K-Linear φ(s) (F[s]) represents the linear projection of F(s); F(t) represents the feature representation of the tail node t, Q-Linear φ(t) (F[t]) represents the linear projection of F(t); Linear projection φ(v) Used to adjust the dimension of node s or t, changing the node dimension from R d become h is the number of attention heads, is the vector dimension of each head; Represents the parameter for adjusting the attention value; Step S42: Connect h attention heads together to obtain the attention vector Attention(s,e,t) of each node pair: Among them, the softmax function is used to normalize the attention distribution of neighbor node s; Step S43: Combine the attention vector of each node pair with the message vectors from neighboring nodes to obtain the contextual representation of each target node t Step S44: Based on the context representation of each target node t Map the target node t back to the distribution of its node type and perform residual connection to obtain the updated context representation H of the target node (l) [t], the final node embedding value.

2. The heterogeneous graph embedding method based on relationship mining according to claim 1, characterized in that: The first-order feature similarity between the node features The methods for obtaining include: Through metric learning, the relationship between nodes is used to learn the first-order feature similarity between node features. Among them, f i ', f′ j Both represent the node v after feature mapping i and v j The eigenvector of Represents Hadamard; is a learnable weight matrix used to weight node features; r represents the type of relationship between nodes, e represents node v i and v j The relationship side, represents the mapping function, Indicates the type of the relationship edge e.

3. The heterogeneous graph embedding method based on relationship mining according to claim 1, characterized in that: In step S3, the method for obtaining the updated neighbor node feature vector is: designing a row normalization matrix, and calculating the updated node neighbor feature vector F according to the row normalization matrix Γ : in, represents the row normalized matrix; f Γ 'Represents the node neighbors N in the same type of relationship r Γ The feature vector of .

4. The heterogeneous graph embedding method based on relationship mining according to claim 3 is characterized in that: The row normalization matrix The expression is: Among them, A' r is the relation adjacency matrix, D r It's A' r The degree matrix of 5. The heterogeneous graph embedding method based on relationship mining according to claim 1, characterized in that: The context representation of each target node t in, represents the connection symbol, and Message(s,e,t) represents the message vector from the adjacent node.

6. The heterogeneous graph embedding method based on relationship mining according to claim 5, characterized in that: The message vector Message(s,e,t) from the adjacent node: Where h represents the number of attention heads, 7. The heterogeneous graph embedding method based on relationship mining according to claim 1, characterized in that: The updated context representation H of the target node (l) [t] is: Among them, l represents the number of layers of relationship stacking; A-Linear φ(t) represents linear projection, and t represents the target node.

8. A heterogeneous graph embedding system based on relationship mining, characterized in that: The system is used to implement the heterogeneous graph embedding method based on relationship mining according to any one of claims 1 to 7, and the system includes the following modules: The node feature vector extraction module is used to add authors, papers, and topics as different types of nodes to the heterogeneous graph, add edges between paper nodes and author nodes, and between paper nodes and topic nodes, and extract feature vectors of all nodes in the heterogeneous graph; A relationship graph generator is used to learn the similarity between nodes based on the feature vectors of all nodes, complete the hidden edges in the heterogeneous graph, and generate a relationship adjacency matrix; wherein the construction method of the relationship adjacency matrix includes: Step S21: The feature vectors f of all nodes in the heterogeneous graph are v Mapped to a unified shared semantic space f′ v : f′ v =σ(f v ·W φ(v) +b φ(v) ) Where v represents a node, φ(v) represents the type of node v, represents the projection matrix corresponding to the φ(v) type node, b φ(v) represents the bias parameter, b φ(v) ∈R 1×d , σ(·) is a nonlinear activation function; Step S22: For a relationship in the heterogeneous graph Through metric learning, we learn the first-order feature similarity between different types of node features. Step S23: Based on first-order feature similarity Get the similarity graph Among them, ε F Represents the control similarity graph The sparsity parameter of ; Similarly, calculate the feature similarity graph between nodes of the same type: in, is the source node s i and j The feature similarity graph between is the tail node t m and t n Feature similarity graph between ; Represents the source node s i and j The first-order feature similarity between Represents the tail node t m and t n The first-order feature similarity between i ', f′ j Represents the source node s i and j The characteristic vector of m , f′ n Respectively represent the tail node t m and t n The eigenvector of FS , ε FT Represent the control feature similarity graph The sparsity parameter, ε F ∈[0,1]; Step S24: The similarity between the source nodes and the similarity between the tail nodes are propagated through the topological structure of the initial relationship graph matrix to generate a propagation graph: Step S25: Using channel attention Feature similarity graph and propagation diagram Fusion to generate a relationship adjacency graph in, Assign different weights to each relation r; Step S26: Connect the relationship adjacency graph and the same type of relationship vector A r Perform aggregation to obtain the relationship adjacency matrix A' r : Among them, softmax(·) means that the weight w ψ,r Perform normalization; An object-level aggregator, used to calculate the attention weight of the neighbor node to the target node based on the relational adjacency matrix, aggregate the weighted neighbor node information into the neighbor node, and obtain an updated neighbor node feature vector; A relationship-level aggregator is used to calculate the relationship strength between nodes, aggregate the information contained in the updated node neighbor feature vector into the corresponding target node according to the relationship strength, obtain a final node embedding value, and use the node embedding value to perform node classification or link prediction; wherein the method for obtaining the node embedding value includes: Step S41: Using the triplet of meta-relationships Calculate the relationship strength of the nodes and get the attention value ATT-head(s,e,t) of the relationship: K(s)=K-Linear φ(s) (F[s]) Q(t)=Q-Linear φ(t) (F[t]) Among them, φ(s) represents the type of node s, φ(t) represents the type of node t, represents the type of connection relationship between node s and node t; K(s) represents the relationship strength between source nodes s; Q(t) represents the relationship strength between tail nodes t; F(s) represents the feature representation of source node s, K-Linear φ(s) (F[s]) represents the linear projection of F(s); F(t) represents the feature representation of the tail node t, Q-Linear φ(t) (F[t]) represents the linear projection of F(t); Linear projection φ(v) Used to adjust the dimension of node s or t, changing the node dimension from R d become h is the number of attention heads, is the vector dimension of each head; Represents the parameter for adjusting the attention value; Step S42: Connect h attention heads together to obtain the attention vector Attention(s,e,t) of each node pair: Among them, the softmax function is used to normalize the attention distribution of neighbor node s; Step S43: Combine the attention vector of each node pair with the message vectors from neighboring nodes to obtain the contextual representation of each target node t Step S44: Based on the context representation of each target node t Map the target node t back to the distribution of its node type and perform residual connection to obtain the updated context representation H of the target node (l) [t], the final node embedding value.