A method, device and electronic equipment for link prediction of a heterogeneous information network

By using the Motif-Transformer model with adversarial motifs in heterogeneous information networks, multivariate relationships are extracted and trained for optimization, solving the problem of low link prediction accuracy in existing technologies and achieving higher accuracy and node representation capabilities.

CN115834383BActive Publication Date: 2026-02-10中国农业银行股份有限公司青岛市分行
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211458909.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-17
Publication Date
2026-02-10
Estimated Expiration
2042-11-17

AI Technical Summary

Technical Problem

In heterogeneous information networks, existing technologies assume that the relationships between object entities are paired, which leads to low accuracy in link prediction and makes it impossible to effectively handle complex one-to-many or many-to-many multi-dimensional association relationships.

Method used

We employ a Motif-Transformer model based on adversarial motifs. By extracting multivariate relationships and using them as motif nodes, we combine generative, discriminative, and link prediction modules, perform vector addition operations and training optimization, and generate more accurate link prediction results.

Benefits of technology

It improves the accuracy of link prediction in heterogeneous information networks, effectively handles complex multi-dimensional relationships, and enhances node representation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834383B_ABST
    Figure CN115834383B_ABST
Patent Text Reader

Abstract

The application provides a heterogeneous information network link prediction method and device and electronic equipment, in the application, a target heterogeneous information network to be subjected to link prediction is acquired, multi-element relationship extraction is performed on the target heterogeneous information network, a multi-element group of the target heterogeneous information network is obtained, the multi-element group is taken as a motif node, an embedding vector and a position coding vector of the motif node are determined, vector addition operation is performed on the embedding vector and the position coding vector, a motif node vector of the motif node is obtained, a link prediction model based on an adversarial motif is called to process the motif node vector, and a link prediction result of the target heterogeneous information network is obtained. That is, in the application, the real multi-element relationship of the target heterogeneous information network is used for link prediction, compared with the processing mode that assumes that the relationship between object entities is paired, the accuracy of link prediction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of link prediction, and more specifically, to a method, apparatus, and electronic device for predicting links in heterogeneous information networks. Background Technology

[0002] Compared to homogeneous information networks, heterogeneous information networks can integrate more complex network structures and external information. Their advantages are mainly reflected in their ability to integrate multimodal data and to mine potential pattern information through various combination methods.

[0003] When predicting links in heterogeneous information networks, it is often assumed that the relationships between entities are paired, meaning each edge connects only two nodes. However, the relationships between entities are often complex, involving one-to-many or many-to-many relationships. Therefore, assuming that the relationships between entities are paired will result in lower accuracy in link prediction. Summary of the Invention

[0004] In view of this, the present invention provides a link prediction method, apparatus and electronic device for heterogeneous information networks to solve the problem of low accuracy in link prediction.

[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:

[0006] A link prediction method for heterogeneous information networks includes:

[0007] Obtain the target heterogeneous network for link prediction;

[0008] Multivariate relation extraction is performed on the target heterogeneous information network to obtain the multivariate group of the target heterogeneous information network, and the multivariate group is used as the module node;

[0009] The embedding vector and position encoding vector of the phantom node are determined, and the embedding vector and the position encoding vector are added together to obtain the phantom node vector of the phantom node.

[0010] The link prediction model based on adversarial modalities is invoked to process the modal node vectors to obtain the link prediction results of the target heterogeneous information network.

[0011] The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to train and optimize the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

[0012] Optionally, after using the tuple as a module node, the method further includes:

[0013] The classification type of the child nodes in the phantom node is determined to obtain the classification result of the child node, which includes the main phantom node or the secondary phantom node;

[0014] Based on the classification results of the child nodes, node connection operations are performed on the primary and secondary phantom nodes in all the phantom nodes to obtain a node connection graph.

[0015] Optionally, the generation process of the link prediction model based on adversarial motifs includes:

[0016] Obtain training samples; the training samples include node vector samples;

[0017] Obtain a link prediction model based on adversarial motifs, wherein the link prediction model based on adversarial motifs includes a generative model, a discrimination model, and a link prediction module;

[0018] The link prediction model based on the adversarial motif is trained using the training samples until the area fraction and mean precision fraction under the ROC curve of the link prediction model based on the adversarial motif meet the preset conditions, at which point training stops.

[0019] Optionally, training the link prediction model based on the adversarial motif using the training samples includes:

[0020] The generative model is invoked to process the node vector samples to obtain the hidden layer representation vectors of the node vector samples;

[0021] The discrimination model is used to match the posterior distribution of the hidden layer representation vector with the prior distribution of the node vector samples, and the parameters in the generation model are adjusted based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector.

[0022] The link prediction module is used to verify the optimal representation vector in order to determine the link prediction result corresponding to the optimal representation vector.

[0023] Optionally, the generative model is invoked to process the node vector samples to obtain the hidden layer representation vectors of the node vector samples, including:

[0024] The generative model is invoked so that it calculates the attention coefficients between phantom nodes with connectivity based on the node vector samples, and calculates the hidden layer representation vectors of the phantom nodes based on the attention coefficients; the parameters in the generative model are updated based on the node connectivity graph.

[0025] A link prediction device for heterogeneous information networks includes:

[0026] The network acquisition module is used to acquire the target heterogeneous information network to be predicted for link prediction.

[0027] The node determination module is used to extract multivariate relationships from the target heterogeneous information network, obtain multivariate groups of the target heterogeneous information network, and use the multivariate groups as module nodes;

[0028] The vector determination module is used to determine the embedding vector and the position encoding vector of the phantom node, and to perform a vector addition operation on the embedding vector and the position encoding vector to obtain the phantom node vector of the phantom node;

[0029] The result determination module is used to call the link prediction model based on the adversarial motif to process the motif node vector to obtain the link prediction result of the target heterogeneous information network.

[0030] The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to train and optimize the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

[0031] Optionally, it also includes:

[0032] A classification module is used to determine the classification type of the child nodes in the phantom node and obtain the classification result of the child node, wherein the classification result includes the main phantom node or the secondary phantom node;

[0033] The node connection module is used to perform node connection operations on the primary and secondary phantom nodes among all the phantom nodes based on the classification results of the child nodes, so as to obtain a node connection diagram.

[0034] Optionally, it also includes a model generation module, the model generation module comprising:

[0035] The sample acquisition submodule is used to acquire training samples; the training samples include node vector samples.

[0036] The model acquisition submodule is used to acquire a link prediction model based on adversarial motifs. The link prediction model based on adversarial motifs includes a generative model, a discriminative model, and a link prediction module.

[0037] The training submodule is used to train the adversarial motif-based link prediction model using the training samples until the area fraction and mean precision fraction under the ROC curve of the adversarial motif-based link prediction model meet preset conditions, at which point training stops.

[0038] Optionally, the training submodule includes:

[0039] The first training unit is used to call the generative model to process the node vector samples and obtain the hidden layer representation vector of the node vector samples.

[0040] The second training unit is used to match the posterior distribution of the hidden layer representation vector and the prior distribution of the node vector samples using the discrimination model, and adjust the parameters in the generation model based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector.

[0041] The third training unit is used to verify the optimal representation vector using the link prediction module to determine the link prediction result corresponding to the optimal representation vector.

[0042] An electronic device includes: a memory and a processor;

[0043] The memory is used to store programs;

[0044] The processor calls the program and executes the link prediction method described above.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] This invention provides a method, apparatus, and electronic device for link prediction in heterogeneous information networks. In this invention, a target heterogeneous information network to be predicted is acquired; multivariate relations are extracted from the target heterogeneous information network to obtain tuples; these tuples are used as motif nodes; the embedding vector and position encoding vector of each motif node are determined; and the embedding vector and position encoding vector are added together to obtain the motif node vector. A link prediction model based on adversarial motifs is then called to process the motif node vector to obtain the link prediction result for the target heterogeneous information network. That is, this invention uses the actual multivariate relations of the target heterogeneous information network for link prediction, which improves the accuracy of link prediction compared to the approach that assumes the relationships between object entities are paired. Furthermore, during link prediction, the adversarial motif-based link prediction model is trained using training samples. This model includes a generative model, a discriminative model, and a link prediction module. The generative model generates representation vectors for motif nodes. The discriminative model performs training and optimization operations on the representation vectors generated by the generative model. The link prediction module determines the link prediction result corresponding to the trained and optimized representation vectors, and uses this result as the link prediction result for the target heterogeneous information network. In other words, this invention configures a discriminative model to improve the link prediction capability of the generative model, further enhancing the accuracy of link prediction. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0048] Figure 1 A flowchart illustrating a link prediction method for heterogeneous information networks provided in an embodiment of the present invention;

[0049] Figure 2 A flowchart illustrating the generation process of a link prediction model provided in an embodiment of the present invention;

[0050] Figure 3 A model training flowchart provided for an embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram of the structure of a link prediction device for a heterogeneous information network provided in an embodiment of the present invention. Detailed Implementation

[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] Networks are an important form of representing relationships between entities, and real-world data is often organized into graph structures. Graph data analysis plays a crucial role in data mining tasks, such as link prediction. Link prediction, as a key problem in network analysis, aims to predict missing edges or potential edges in a network. These tasks are applicable to various graph data, including protein-protein interaction networks, social media networks, and citation networks. However, due to the high computational cost and low parallelism of graph data analysis, processing graph data is a challenging task.

[0054] Compared to traditional homogeneous information network representation methods, heterogeneous information networks can integrate more complex network structures and external information. Their advantages are mainly reflected in two aspects:

[0055] (1) It can integrate multimodal data. In the real world, network data is massive and complex, with various interaction information implicit between different types of objects, forming complex links. Secondly, complex networks have high-dimensional sparsity, and there is a large amount of attribute information between different types of objects, making it difficult to model using homogeneous graphs. Using heterogeneous graphs for modeling can better preserve the original structural and attribute information of network data, thereby learning a more comprehensive representation.

[0056] (2) Heterogeneous networks contain various types of objects and interactions, and their potential pattern information can be mined through multiple combinations, providing a basis for interpretability research. Taking e-commerce networks as an example, their node types are no longer limited to users and products, but may also include information such as reviews and stores. Their interaction information is not limited to simple purchase relationships, but may include more granular interactions such as ratings, clicks, browsing, and sharing. Based on this knowledge, more granular representations can be learned through methods such as motif mining.

[0057] In heterogeneous networks, more diverse node information can be utilized to learn richer vector representations, which can then be used to predict the existence of links between nodes. Currently, link prediction in heterogeneous networks presupposes that relationships between entities are paired, meaning each edge connects only two nodes. However, relationships between entities are often complex, involving one-to-many or many-to-many relationships. Therefore, assuming paired relationships leads to lower accuracy in link prediction.

[0058] For example, in social networks, users rate movies. Users, movies, and tags are considered nodes, and user ratings are seen as events, forming edges in a graph. Each edge can connect two or more nodes. In this case, the relationships are no longer binary (pairwise), but ternary, quaternary, or even more complex. When solving this type of problem, simply forcibly converting multi-way relationships into binary associations will result in the loss of much useful information, insufficient node representation capabilities, and low accuracy in link prediction.

[0059] For example, social networks such as Facebook and Sina Weibo have complex and diverse relationships between users, which may involve multiple entities. If they are only modeled as links between pairs of nodes, a lot of information about complex relationships will be ignored, resulting in low accuracy of link prediction.

[0060] To address the aforementioned issue of low link prediction accuracy, this invention employs a link prediction approach based on the Motif-Transformer model of adversarial motifs. By defining relationships between three or more entities to form a motif, the link relationships between nodes are predicted based on the Motif-Transformer model, thus resolving the problem of low link prediction accuracy caused by insufficient node representation capabilities.

[0061] Specifically, this invention provides a method, apparatus, and electronic device for link prediction in heterogeneous information networks. In this invention, a target heterogeneous information network to be predicted is acquired; multivariate relations are extracted from the target heterogeneous information network to obtain a set of multivariates; these multivariates are used as motif nodes; the embedding vector and position encoding vector of each motif node are determined; and the embedding vector and position encoding vector are added together to obtain the motif node vector. A link prediction model based on adversarial motifs is then called to process the motif node vector to obtain the link prediction result for the target heterogeneous information network. That is, this invention uses the actual multivariate relations of the target heterogeneous information network for link prediction, which improves the accuracy of link prediction compared to the approach that assumes the relationships between object entities are paired. Furthermore, during link prediction, the adversarial motif-based link prediction model is trained using training samples. This model includes a generative model, a discriminative model, and a link prediction module. The generative model generates representation vectors for motif nodes. The discriminative model performs training and optimization operations on the representation vectors generated by the generative model. The link prediction module determines the link prediction result corresponding to the trained and optimized representation vectors, and uses this result as the link prediction result for the target heterogeneous information network. In other words, this invention configures a discriminative model to improve the link prediction capability of the generative model, further enhancing the accuracy of link prediction.

[0062] The link prediction model based on adversarial motifs in this embodiment can be the Motif-Transformer model based on adversarial motifs described above.

[0063] Specifically, based on the above, embodiments of the present invention provide a link prediction method for heterogeneous information networks, referring to... Figure 1 It can include:

[0064] S11. Obtain the target heterogeneous information network for link prediction.

[0065] In this embodiment, the structure of the target heterogeneous information network is not limited; any heterogeneous information network is acceptable.

[0066] S12. Extract multivariate relationships from the target heterogeneous information network to obtain multivariate groups of the target heterogeneous information network, and use the multivariate groups as module nodes.

[0067] Specifically, a motif extraction method can be used to match multi-dimensional relationships in heterogeneous information networks using motif methods.

[0068] In detail, for a given target heterogeneous information network, extract the multivariate relationships of the target heterogeneous information network, such as ternary relationships, quaternary relationships, quinary relationships, etc. The specific multivariate relationships are set according to the actual scenario.

[0069] Taking ternary relations as an example, ternary relations are extracted from the target heterogeneous information network to obtain triples, and the ternary relations are modeled as motif nodes through the triples.

[0070] Taking the MovieLens dataset as an example, it includes three types of child nodes: user, movie, and tag.<user,movie,tag> Let's consider a triple, where `user` represents a user, `movie` represents a movie, and `tag` represents a label a user assigns to a movie at a specific time. In real-world networks, users frequently tag movies, and clearly, this relationship is inseparable. However, network representation learning models studying pairwise relationships often fail to fully learn these underlying higher-order associations when dealing with this type of problem. Therefore, this embodiment fully considers this inseparable multi-dimensional association, using a motif representation and modeling it as a triple representation. Each triple is a motif node, thus allowing the extraction of multiple motif nodes from the target heterogeneous information network.

[0071] In practical applications, after using the tuple as a module node, the following is also included:

[0072] 1) Determine the classification type of the child nodes in the phantom node, and obtain the classification result of the child nodes.

[0073] The classification type is either a primary phantom node or a secondary phantom node. The classification result includes either a primary phantom node or a secondary phantom node, meaning that the child nodes in the phantom node are either primary phantom nodes or secondary phantom nodes.

[0074] In this context, the primary modifier node is the central node in the modifier relationship, connecting secondary modifier nodes and collectively identifying a semantic path. For example, in the above example, "movie" is the primary modifier node.

[0075] Secondary modifier nodes are nodes connected to primary modifier nodes. For example, user and tag mentioned above are secondary modifier nodes.

[0076] 2) Based on the classification results of the sub-nodes, perform node connection operations on the primary and secondary phantom nodes in all the phantom nodes to obtain a node connection diagram.

[0077] Specifically, the Motif-transformer model includes two types of links:

[0078] 1) Motif Connections: Motifs connect primary and secondary motif nodes, enabling interconnection of any non-neighboring nodes.

[0079] 2) Ring Connections: All master module nodes are connected, and the first master module node is connected to the last master module node, forming a ring subgraph network.

[0080] The node connection diagram in this embodiment includes both phantom links and ring links.

[0081] S13. Determine the embedding vector and position encoding vector of the phantom node, and perform vector addition on the embedding vector and the position encoding vector to obtain the phantom node vector of the phantom node.

[0082] The embedding vector of a modal node can be determined using conventional methods.

[0083] Position encoding can be implemented based on motifs. For example, a semantic event where a user tags a movie as a comedy can be seen as a motif. For the movie node, it can be linearly represented by user and tag nodes.

[0084] After obtaining the embedding vector and the position encoding vector, the two are added together to obtain the motif node vector, which is the input vector of the Motif-transformer model.

[0085] S14. The link prediction model based on adversarial modalities is invoked to process the modal node vectors to obtain the link prediction results of the target heterogeneous information network.

[0086] The link prediction model based on adversarial motifs in this embodiment can be the Motif-Transformer model based on adversarial motifs described above.

[0087] The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to perform training and optimization operations on the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

[0088] The generative model described in this embodiment is used to generate representation vectors for the phantom nodes. The generative model can consist of 6 encoders:

[0089] Each encoder consists of two sub-layers: a Self-Attention layer and a Position-wise Feed Forward Network (FFN). For each input vector H of the encoder (i.e., the motif node vector of each motif node), three vectors are created: a query vector (Q), a key vector (K), and a value vector (V). These are obtained by multiplying all the motif node vectors H into a matrix X and then multiplying each of the three matrices, which are obtained through training. Each encoder has the same structure, but they use different weight parameters.

[0090] The input to the encoder first flows into the Self-Attention layer, then the output of the Self-Attention layer flows into the feedforward network, and finally the output is passed to the next encoder.

[0091] First is the Self-Attention layer, for a given input vector H∈Rn×d sequence

[0092]

[0093] Where Attention represents the attention function, Q, K, and V are the query vector, key vector, and value vector, respectively, and softmax is the normalization function; Rn is the number of rows in the vector, and d is the dimension of the vector. k Let K be the dimension of the vector.

[0094] To gather more useful information from H, multi-head attention with m heads is used:

[0095]

[0096] α i =Att(qW i Q HW i K HW i V ), i∈[1,m]

[0097] Where m represents m head attention functions, MultiAtt is the multi-head attention function, q is the query vector, q∈R1×d, R1 is the first row of the vector, d is the dimension of the vector, H is the input vector, and α i Let W represent the attention coefficient of node i, where i∈[1,m], Att is an abbreviation for the Attention function, and W is the attention coefficient of node i. 0 Let W be the initial weight matrix, where Q, K, and V are the query vector, key vector, and value vector, respectively.i Q W is the weight matrix of the query vector for node i; i K W is the weight matrix of the key vector of node i. i V Let i be the weight matrix of the value vector of node i.

[0098] Since similar inputs can sometimes produce very different encodings, this problem can be effectively addressed by introducing adversarial training. Therefore, this embodiment introduces a discriminative model to train and optimize the representation vectors generated by the generative model.

[0099] Furthermore, after the discrimination model performs training and optimization operations on the representation vectors generated by the generative model, the link prediction module is used to determine the link prediction results corresponding to the trained and optimized representation vectors, and these results are used as the link prediction results of the target heterogeneous information network.

[0100] Specifically, link prediction, as an important task in graph data mining, has been widely applied to various real-world scenarios. Its main purpose is to predict missing or undiscovered links in a network, thereby uncovering richer potential information. Link prediction plays an indispensable role in different fields. Therefore, both models proposed in this embodiment use link prediction as their downstream task to verify the robustness of the learned low-dimensional vector representation in specific mining tasks. First, the latent representations of nodes are used to represent combined edges, and then these are used to build a classifier to predict whether there is an edge between vertices. For a given pair of vertices (u, v) connected by an edge, we use an element-wise operator, Hadamard, to combine the trained and optimized representation vectors Z of the vertices. u and Z v Its formula is defined as follows:

[0101]

[0102] Z uv For Z u and Z v The link prediction results are used as the link prediction results of the target heterogeneous information network.

[0103] In this embodiment, a target heterogeneous information network to be predicted for link prediction is obtained. Multivariate relations are extracted from the target heterogeneous information network to obtain tuples. These tuples are used as motif nodes. The embedding vector and position encoding vector of each motif node are determined, and the embedding vector and position encoding vector are added together to obtain the motif node vector. A link prediction model based on adversarial motifs is then called to process the motif node vector to obtain the link prediction result for the target heterogeneous information network. That is, in this invention, using the actual multivariate relations of the target heterogeneous information network for link prediction improves the accuracy of link prediction compared to the approach that assumes the relationships between object entities are paired. Furthermore, during link prediction, the adversarial motif-based link prediction model is trained using training samples. This model includes a generative model, a discriminative model, and a link prediction module. The generative model generates representation vectors for motif nodes. The discriminative model performs training and optimization operations on the representation vectors generated by the generative model. The link prediction module determines the link prediction result corresponding to the trained and optimized representation vectors, and uses this result as the link prediction result for the target heterogeneous information network. In other words, this invention configures a discriminative model to improve the link prediction capability of the generative model, further enhancing the accuracy of link prediction.

[0104] The above embodiments mentioned a link prediction model based on adversarial modalities. The generation process of the link prediction model based on adversarial modalities will now be introduced.

[0105] Reference Figure 2 The generation process of the link prediction model may include:

[0106] S21. Obtain training samples.

[0107] The training samples include node vector samples, which can refer to the above-mentioned phantom node vectors, and the generation process of the node vector samples can refer to the above-mentioned phantom node vector generation process.

[0108] S22. Obtain a link prediction model based on adversarial modalities.

[0109] The link prediction model based on adversarial modalities includes a generative model, a discrimination model, and a link prediction module. The generative model can be described in the corresponding explanation above.

[0110] In addition, the parameter update strategy of the generated model was adjusted in this embodiment.

[0111] Specifically, the traditional Transformer model updates parameters through a fully connected topology, resulting in a heavy and complex structure. The Motif-transformer structure in this embodiment introduces a Motif structure, namely the node connection graph described above, to guide the parameter update process.

[0112] Let M t ∈R1×d,H t ∈R n ×d represents the state of the principal module node and n secondary module nodes at time t. R1 is the first row of the vector, d is the dimension of the vector, and Rn is the number of rows of the vector.

[0113] Parameter updates are divided into two phases:

[0114] (1) Update of the secondary module node.

[0115] In the first phase, the status code h of the sub-module node i It will be updated from neighboring nodes, including neighboring hi-1, h i+1 .

[0116] Specifically, each input to the Motif-transformer is a token, and each token is updated sequentially through the Attention mechanism:

[0117]

[0118]

[0119] in, This represents the context information of the i-th sub-motif node at time t. After information exchange, a normalization operation is performed using a layer. This represents the state of node i at time t; Let i be the state of the left neighbor of node i at time t-1; Let e ​​be the state of the right neighbor of node i at time t+1. i For the link information of node i, c t-1 The state information of the main module node at time t-1 is denoted by MultiAtt, which is the multi-head attention function.

[0120] (2) Update the main module node.

[0121] In the second stage, the state information C of the main module node t The parameter update was completed by summarizing the information of all sub-module nodes and their previous states. The parameter update formula is:

[0122] C t =MultiAtt(C t-1,[C t-1 H t ])

[0123] C t =LayerNorm(ReLU(C t ))

[0124] Among them, C t This represents the information of all secondary phantom nodes aggregated by the primary phantom node at time t, along with their state information from previous times. MultiAtt is the multi-head attention function, C. t-1 H contains information about all secondary phantom nodes aggregated by the primary phantom node at time t-1, as well as their state information from previous times. t Let be the input vector at time t, LayerNorm be the normalization operation, and ReLU be the corrected linear unit.

[0125] By alternately updating the primary and secondary phantom nodes, all local and non-local information of the input vector is finally captured, thus completing the update.

[0126] In this embodiment, the discriminator (D) is used to train and optimize the representation vectors generated by the generator (G). Specifically, it matches the aggregated posterior distribution q(z) of the representation vectors output by the generator with the prior distribution p(z) of the real samples. This is achieved by attaching an adversarial network to the hidden layer representation vectors of the generator.

[0127] The aggregated posterior distribution of the generative model can deceive the discriminative model, making it believe that the aggregated posterior distribution q(z) comes from the true prior distribution p(z). This discriminative method introduces a probability distribution to obtain the hidden vector of the node through sampling, which can refine the representation of the node.

[0128] The posterior distribution of the generative model can be sampled using a fixed function or a Gaussian posterior distribution. Here, we train q(Z|H) as a general approximator of the posterior distribution. Assuming the discriminative model is a function f(H,η), which accepts an input vector H and a fixed distribution (e.g., Gaussian distribution) of random noise η, sampling from an arbitrary posterior distribution q(Z|H) can be achieved by calculating the values ​​of f(H,η) on different noise η samples. In other words, we can assume q(Z|H) = f(H|η ... t |H t ,η)=ζ(Zf(H t The definitions of the posterior distribution q(Z|H) and the aggregate posterior distribution q(z) are as follows:

[0129] q(Z t |H t )=∫ η q(Zt |H t ,η)p η (η)dη

[0130] q(Z t )=∫ H ∫ η q(Z t |H t ,η)p d (H t )p η (η)dηdH t

[0131] Where q(Z|H) is the posterior distribution, q(Z t |H t Let q(Z) be the posterior distribution at time t. t |H t ,η) represents the sampling of samples with different noise η at time t in the posterior distribution q(Z|H); q(Z t Let be the aggregate posterior distribution at time t, H be the input vector, and Z be the hidden layer representation vector. d (H t Let p be the data distribution at time t. η (η) represents the model distribution with added noise.

[0132] In this case, the randomness in q(z) comes from the data distribution and the random noise η at the encoder input. For a given input vector H, the encoder can learn any posterior distribution. Thus, the posterior distribution q(Z|H) is no longer constrained to a specific Gaussian distribution. Here, an effective method for sampling from the aggregated posterior distribution q(z) is adopted. The adversarial training process can directly backpropagate through the function f(H,η) to match q(z) and p(z).

[0133] By attaching a discriminative model (D) to the generative model, D and G complete the optimization process of generative adversarial interaction with V(D,G) as the value function.

[0134]

[0135] Where V(D,G) is the value function, G is the generative model, D is the discriminative model, and E is the value function. p(Z) E is the expectation of the prior distribution p(z). q(Z) Let q(z) be the expectation of the aggregated posterior distribution, D(Z) be the discrimination process of the discrimination model, min be the minimum function, and max be the maximum function.

[0136] S23. Use the training samples to train the link prediction model based on the adversarial motif until the area fraction and average precision fraction under the ROC curve of the link prediction model based on the adversarial motif meet the preset conditions, and then stop training.

[0137] Specifically, a stop training condition is set when training the link prediction model. In this embodiment, the accuracy of link prediction is mainly reflected in the predicted positive and negative probability values. In this invention, common model evaluation metrics, Area Under Count (AUC) and Average Precision (AP), are used as evaluation metrics for link prediction. AUC is mainly based on the confusion matrix to calculate the true positive rate and false positive rate, and then the accuracy of link prediction is measured by the Area Under Count (ROC).

[0138] The formulas for the AUC score and mean precision (AP) score under the ROC curve of each linked prediction model on the test set are as follows:

[0139]

[0140] Where AUC is the area, E is the set of edges, e is an element in E, and N is the number of edges. E The number of positive samples. The number of negative samples; rank e Let rank the edges by their predicted scores.

[0141]

[0142] Where AP is the average precision, precision represents the number of correctly predicted edges, and N... Total This represents the total number of sides.

[0143] After calculating the area fraction and average precision score, determine whether the area fraction and average precision score meet the corresponding preset conditions. If they do, stop training.

[0144] Based on this embodiment, the link prediction model is trained using the training samples, referring to... Figure 3 It can include:

[0145] S31. Call the generative model to process the node vector sample to obtain the hidden layer representation vector of the node vector sample.

[0146] Specifically, a generative model can be invoked to calculate the attention coefficients between phantom nodes with connectivity based on the node vector samples, and to calculate the hidden layer representation vector of the phantom node based on the attention coefficients.

[0147] The parameters in the generated model are updated based on the node connection graph, and the specific parameter update strategy described above can be referred to.

[0148] S32. The discrimination model is used to match the posterior distribution of the hidden layer representation vector and the prior distribution of the node vector samples, and the parameters in the generation model are adjusted based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector.

[0149] Specifically, the posterior distribution is the aggregated posterior distribution q(z) mentioned above, and the prior distribution of the node vector samples is the prior distribution p(z) of the real samples mentioned above. The process of matching and adjusting the parameters in the generative model to optimize the hidden layer representation vector and obtain the optimal representation vector can be referred to the corresponding description above.

[0150] S33. The link prediction module is used to verify the optimal representation vector to determine the link prediction result corresponding to the optimal representation vector.

[0151] The process of verifying the optimal representation vector using the link prediction module is the same as calculating the area AUC and average precision AP mentioned above. After verification, the link prediction result corresponding to the optimal representation vector can be determined based on the task.

[0152] In this embodiment, the fully connected topology for parameter updates in the Motif-transformer model is changed to a phantom structure, which improves the attention mechanism update strategy. Compared with the traditional self-attention mechanism, which requires calculating the attention between all nodes, this reduces computational complexity.

[0153] Furthermore, this embodiment incorporates adversarial training, using regularization constraints to address the losses caused by network sparsity in reconstruction. Simultaneously, adversarial training is introduced to distinguish between fake samples generated by the generative model and real samples sampled from the real dataset. The parameters of the generative model are then updated based on the discrimination results, thereby optimizing the model. The learned hidden layer representations are then used for downstream link prediction tasks to verify the robustness of the representation results.

[0154] Optionally, based on the above embodiment of a link prediction method for heterogeneous information networks, another embodiment of the present invention provides a link prediction apparatus for heterogeneous information networks, referring to... Figure 4 ,include:

[0155] Network acquisition module 11 is used to acquire the target heterogeneous information network to be predicted for link prediction;

[0156] The node determination module 12 is used to extract multivariate relationships from the target heterogeneous information network, obtain multivariate groups of the target heterogeneous information network, and use the multivariate groups as module nodes;

[0157] The vector determination module 13 is used to determine the embedding vector and the position encoding vector of the phantom node, and to perform a vector addition operation on the embedding vector and the position encoding vector to obtain the phantom node vector of the phantom node.

[0158] The result determination module 14 is used to call the link prediction model based on the adversarial motif to process the motif node vector to obtain the link prediction result of the target heterogeneous information network.

[0159] The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to train and optimize the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

[0160] Furthermore, it also includes:

[0161] A classification module is used to determine the classification type of the child nodes in the phantom node and obtain the classification result of the child node, wherein the classification result includes the main phantom node or the secondary phantom node;

[0162] The node connection module is used to perform node connection operations on the primary and secondary phantom nodes among all the phantom nodes based on the classification results of the child nodes, so as to obtain a node connection diagram.

[0163] Furthermore, it also includes a model generation module, which includes:

[0164] The sample acquisition submodule is used to acquire training samples; the training samples include node vector samples.

[0165] The model acquisition submodule is used to acquire a link prediction model based on adversarial motifs. The link prediction model based on adversarial motifs includes a generative model, a discriminative model, and a link prediction module.

[0166] The training submodule is used to train the adversarial motif-based link prediction model using the training samples until the area fraction and mean precision fraction under the ROC curve of the adversarial motif-based link prediction model meet preset conditions, at which point training stops.

[0167] Furthermore, the training submodule includes:

[0168] The first training unit is used to call the generative model to process the node vector samples and obtain the hidden layer representation vector of the node vector samples.

[0169] The second training unit is used to match the posterior distribution of the hidden layer representation vector and the prior distribution of the node vector samples using the discrimination model, and adjust the parameters in the generation model based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector.

[0170] The third training unit is used to verify the optimal representation vector using the link prediction module to determine the link prediction result corresponding to the optimal representation vector.

[0171] Furthermore, the first training unit is specifically used for:

[0172] The generative model is invoked so that it calculates the attention coefficients between phantom nodes with connectivity based on the node vector samples, and calculates the hidden layer representation vectors of the phantom nodes based on the attention coefficients; the parameters in the generative model are updated based on the node connectivity graph.

[0173] In this embodiment, a target heterogeneous information network to be predicted for link prediction is obtained. Multivariate relations are extracted from the target heterogeneous information network to obtain tuples. These tuples are used as motif nodes. The embedding vector and position encoding vector of each motif node are determined, and the embedding vector and position encoding vector are added together to obtain the motif node vector. A link prediction model based on adversarial motifs is then called to process the motif node vector to obtain the link prediction result for the target heterogeneous information network. That is, in this invention, using the actual multivariate relations of the target heterogeneous information network for link prediction improves the accuracy of link prediction compared to the approach that assumes the relationships between object entities are paired. Furthermore, during link prediction, the adversarial motif-based link prediction model is trained using training samples. This model includes a generative model, a discriminative model, and a link prediction module. The generative model generates representation vectors for motif nodes. The discriminative model performs training and optimization operations on the representation vectors generated by the generative model. The link prediction module determines the link prediction result corresponding to the trained and optimized representation vectors, and uses this result as the link prediction result for the target heterogeneous information network. In other words, this invention configures a discriminative model to improve the link prediction capability of the generative model, further enhancing the accuracy of link prediction.

[0174] It should be noted that the working process of each module, submodule and unit in this embodiment is described in the corresponding description in the above embodiment, and will not be repeated here.

[0175] Optionally, based on the above-described embodiment of a link prediction method and apparatus for heterogeneous information networks, another embodiment of the present invention provides an electronic device, including: a memory and a processor;

[0176] The memory is used to store programs;

[0177] The processor calls the program and executes the link prediction method described above.

[0178] In this embodiment, a target heterogeneous information network to be predicted for link prediction is obtained. Multivariate relations are extracted from the target heterogeneous information network to obtain tuples. These tuples are used as motif nodes. The embedding vector and position encoding vector of each motif node are determined, and the embedding vector and position encoding vector are added together to obtain the motif node vector. A link prediction model based on adversarial motifs is then called to process the motif node vector to obtain the link prediction result for the target heterogeneous information network. That is, in this invention, using the actual multivariate relations of the target heterogeneous information network for link prediction improves the accuracy of link prediction compared to the approach that assumes the relationships between object entities are paired. Furthermore, during link prediction, the adversarial motif-based link prediction model is trained using training samples. This model includes a generative model, a discriminative model, and a link prediction module. The generative model generates representation vectors for motif nodes. The discriminative model performs training and optimization operations on the representation vectors generated by the generative model. The link prediction module determines the link prediction result corresponding to the trained and optimized representation vectors, and uses this result as the link prediction result for the target heterogeneous information network. In other words, this invention configures a discriminative model to improve the link prediction capability of the generative model, further enhancing the accuracy of link prediction.

[0179] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A link prediction method for heterogeneous information networks, characterized in that, include: Obtain the target heterogeneous network for link prediction; Multivariate relation extraction is performed on the target heterogeneous information network to obtain the multivariate group of the target heterogeneous information network, and the multivariate group is used as the module node; The classification type of the child nodes in the phantom node is determined to obtain the classification result of the child node, which includes the main phantom node or the secondary phantom node; Based on the classification results of the sub-nodes, node connection operations are performed on the primary and secondary phantom nodes in all the phantom nodes to obtain a node connection graph. The node connection graph includes phantom links and ring links. The phantom links connect the primary and secondary phantom nodes to achieve interconnection of any non-neighboring nodes. The ring links connect each primary phantom node to form a ring subgraph network. The embedding vector and position encoding vector of the phantom node are determined, and the embedding vector and the position encoding vector are added together to obtain the phantom node vector of the phantom node. The link prediction model based on adversarial modalities is invoked to process the modal node vectors to obtain the link prediction results of the target heterogeneous information network. The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to train and optimize the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

2. The link prediction method according to claim 1, characterized in that, The generation process of the link prediction model based on adversarial motifs includes: Obtain training samples; the training samples include node vector samples; Obtain a link prediction model based on adversarial motifs, wherein the link prediction model based on adversarial motifs includes a generative model, a discrimination model, and a link prediction module; The link prediction model based on the adversarial motif is trained using the training samples until the area fraction and mean precision fraction under the ROC curve of the link prediction model based on the adversarial motif meet the preset conditions, at which point training stops.

3. The link prediction method according to claim 2, characterized in that, Training the link prediction model based on the adversarial motif using the training samples includes: The generative model is invoked to process the node vector samples to obtain the hidden layer representation vectors of the node vector samples; The discrimination model is used to match the posterior distribution of the hidden layer representation vector with the prior distribution of the node vector samples, and the parameters in the generation model are adjusted based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector. The link prediction module is used to verify the optimal representation vector in order to determine the link prediction result corresponding to the optimal representation vector.

4. The link prediction method according to claim 3, characterized in that, The generative model is invoked to process the node vector samples to obtain the hidden layer representation vectors of the node vector samples, including: The generative model is invoked so that it calculates the attention coefficients between phantom nodes with connectivity based on the node vector samples, and calculates the hidden layer representation vectors of the phantom nodes based on the attention coefficients; the parameters in the generative model are updated based on the node connectivity graph.

5. A link prediction device for heterogeneous information networks, characterized in that, include: The network acquisition module is used to acquire the target heterogeneous information network to be predicted for link prediction. The node determination module is used to extract multivariate relationships from the target heterogeneous information network, obtain multivariate groups of the target heterogeneous information network, and use the multivariate groups as module nodes; A classification module is used to determine the classification type of the child nodes in the phantom node and obtain the classification result of the child node, wherein the classification result includes the main phantom node or the secondary phantom node; The node connection module is used to perform node connection operations on the primary and secondary phantom nodes among all the phantom nodes based on the classification results of the sub-nodes, to obtain a node connection graph. The node connection graph includes phantom links and ring links. The phantom links connect the primary and secondary phantom nodes to achieve interconnection of any non-neighboring nodes. The ring links connect each primary phantom node to form a ring subgraph network. The vector determination module is used to determine the embedding vector and the position encoding vector of the phantom node, and to perform a vector addition operation on the embedding vector and the position encoding vector to obtain the phantom node vector of the phantom node; The result determination module is used to call the link prediction model based on the adversarial motif to process the motif node vector to obtain the link prediction result of the target heterogeneous information network. The link prediction model based on adversarial motifs is trained based on training samples. The link prediction model based on adversarial motifs includes a generation model, a discrimination model, and a link prediction module. The generation model is used to generate representation vectors of motif nodes. The discrimination model is used to train and optimize the representation vectors generated by the generation model. The link prediction module is used to determine the link prediction result corresponding to the trained and optimized representation vectors, and use it as the link prediction result of the target heterogeneous information network.

6. The link prediction device according to claim 5, characterized in that, It also includes a model generation module, which includes: The sample acquisition submodule is used to acquire training samples; the training samples include node vector samples. The model acquisition submodule is used to acquire a link prediction model based on adversarial motifs. The link prediction model based on adversarial motifs includes a generative model, a discriminative model, and a link prediction module. The training submodule is used to train the adversarial-based link prediction model using the training samples until the area fraction and mean precision fraction under the ROC curve of the adversarial-based link prediction model meet preset conditions, at which point training stops.

7. The link prediction device according to claim 6, characterized in that, The training submodule includes: The first training unit is used to call the generative model to process the node vector samples and obtain the hidden layer representation vector of the node vector samples. The second training unit is used to match the posterior distribution of the hidden layer representation vector and the prior distribution of the node vector samples using the discrimination model, and adjust the parameters in the generation model based on the matching results to optimize the hidden layer representation vector and obtain the optimal representation vector. The third training unit is used to verify the optimal representation vector using the link prediction module to determine the link prediction result corresponding to the optimal representation vector.

8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor calls the program and performs the link prediction method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Small target detection method and device thereof, equipment, medium and product

    CN114332586A