Graph embedded link prediction method based on motif perception feature propagation
The graph embedding link prediction method based on motif-aware feature propagation, combined with motif recognition and weighted propagation mechanism, solves the problem of insufficient high-order structure perception in existing link prediction methods, realizes the deep fusion of node features and structural features, and improves the accuracy of link prediction and the generalization ability of the model.
Patent Information
- Application Number
- CN202510673042.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-05
AI Technical Summary
Existing link prediction methods mainly rely on local structural similarity or low-dimensional representation between nodes, which makes it difficult to characterize high-order semantic structures and lacks the ability to perceive high-order structures such as motifs, affecting the accuracy and interpretability of link prediction.
A graph embedding link prediction method based on motif-aware feature propagation is adopted. Through motif recognition and weighted propagation mechanism, a node attribute matrix is constructed. Combined with node centrality and similarity measurement, an edge feature matrix is generated, and a machine learning classifier is used for link prediction.
The accuracy of link prediction and the generalization ability of the model have been significantly improved, especially showing stronger robustness and interpretability in complex topologies or heterogeneous networks.
Smart Images

Figure CN120597930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of complex network analysis, and in particular to a graph embedding link prediction method based on motif-aware feature propagation. Background Art
[0002] Link prediction, a fundamental task in graph mining, aims to predict potential edges based on existing network structure information. It is widely used in scenarios such as social recommendations, protein interaction prediction, and knowledge graph completion. Traditional link prediction methods typically rely on local structural similarities between nodes or use network embedding techniques to create low-dimensional representations of nodes.
[0003] However, existing methods suffer from the following major shortcomings: they only consider first- or second-order neighbor information, making it difficult to capture higher-order semantic structures; they lack the ability to perceive higher-order structures such as motifs, failing to reflect the semantic context of nodes in the network; and they crudely fuse node attributes with structural information, affecting the accuracy and interpretability of link predictions. In recent years, motif structures, as high-order patterns that can reflect local functional units in a network, have demonstrated promising results in tasks such as community detection and node representation learning. Therefore, a link prediction method that combines motif information, node characteristics, and propagation mechanisms is urgently needed to improve prediction performance and model expressiveness.
[0004] Previous research has attempted to incorporate motif information into graph representation learning tasks. For example, Zhao et al. proposed a motif-driven graph neural network approach in their paper "Motif-Driven Graph Neural Networks" (DOI: 10.1109 / TNNLS.2023.3281716). This approach constructs motif-induced subgraphs and guides the update of node representations. However, this approach primarily relies on a motif-weighted adjacency matrix for information aggregation, but lacks specialized propagation rules based on motif awareness, failing to deeply model the role of motifs in the information diffusion process. Summary of the Invention
[0005] In order to overcome the above technical problems, the purpose of the present invention is to provide a graph embedding link prediction method based on motif-aware feature propagation, so as to achieve effective prediction of potential connection relationships between node pairs and improve the model's adaptability and generalization performance to complex network structures.
[0006] The technical solution adopted in the present invention is:
[0007] A graph embedding link prediction method based on motif-aware feature propagation includes the following steps:
[0008] Step 1: Graph structure initialization and motif identification. Preprocess the network graph to be predicted G = (V, E, C), extract the node set V, edge set E and node attribute matrix C, and construct the motif matrix A. M , used to represent high-order structures in the network;
[0009] Step 2: Construct a node attribute matrix based on motif-aware feature propagation. First, obtain high-order network structure information through motif recognition, and then use the motif matrix A M Perform weighted propagation on the initial node attribute matrix C of the network, iteratively update the node feature vector to integrate the local and high-order topological information of the node, and finally form a node feature matrix C' that can effectively reflect the node attributes and structural characteristics;
[0010] Step 3: Construct edge features of node pairs. Based on the extracted predicted network graph G = (V, E, C), calculate the centrality index and structural similarity measure of the node pairs. Fuse multiple edge attribute information to generate an edge feature matrix U that expresses the node pair relationship and potential connection features.
[0011] Step 4: Fuse the node embedding vector (i.e., the feature vector of the corresponding node pair in C') with the edge feature vector (i.e., the feature vector of the corresponding node edge in U) and input it into the machine learning classifier to predict whether there is a potential edge between the node pairs;
[0012] Step 5: Link prediction score calculation, based on the prediction results of the classifier output, obtain the connection probability score of the node pair and form the similarity matrix S.
[0013] In step 1, the motif matrix A is constructed M The process steps include:
[0014] Step 1.1: Identify the subgraphs (such as triangles and four-membered rings) in the graph G = (V, E, C) that meet the specific structure as motifs, where the node set V represents the set of entity nodes in the network, including user nodes, item nodes or other types of nodes, and the edge set Indicates the existing interaction relationship or connection between nodes, node attribute matrix Represents the attribute characteristics of each node, where d is the attribute dimension;
[0015] Step 1.2: Construct the motif matrix A M , where each element represents the number of times a node pair (u, v) co-occurs in the motif M; its calculation formula is:
[0016]
[0017] in, Indicates the number of instances in which nodes u and v participate in the motif M;
[0018] In step 2, the process of generating the node feature matrix C' includes:
[0019] Step 2.1: Construct the initial feature vector of the node. Construct the initial embedding vector for each node in the graph. If the node has existing attributes, use the attribute directly as the initial feature. Otherwise, randomly initialize a vector of dimension d for each node to obtain the initial node attribute matrix. Where N is the number of nodes;
[0020] Step 2.2: Construct the motif weight matrix and calculate the motif matrix A based on the high-order structural information of the graph M , and smoothed by the logarithmic function ψ(x) = log(x+1), the low-order adjacency matrix A is weightedly combined with the motif matrix to obtain the reconstructed weighted adjacency matrix:
[0021] W=A+ψ(A M )
[0022] Step 2.3: Define influence propagation and calculate the weighted degree of each node Based on the smooth function ψ(x), the influence propagation matrix Y=(y u←v ) N×N ,in
[0023]
[0024] Indicates the influence strength of node v on node u;
[0025] Step 2.4: Iteratively update the feature vector. Use the iterative aggregation mechanism to iteratively update the node features based on the influence propagation matrix:
[0026] C (l) =Y·C (l-1) +C (l-1)
[0027] And normalize the updated vector to ensure numerical stability:
[0028]
[0029] After L iterations, the final node feature matrix C' is output.
[0030] In step 3, the process of generating the node edge feature matrix U includes the following steps:
[0031] Step 3.1: Node centrality: Calculate the centrality characteristics of each node based on the importance of each node in the network to be predicted. The centrality includes but is not limited to degree centrality, betweenness centrality, or eigenvector centrality, where:
[0032] Node v i The degree centrality C D (v i ) is defined as the number of edges connected to it, that is,
[0033]
[0034] Node v i The betweenness centrality C B (v i ) represents the intermediate degree of the node in all shortest paths, and its calculation formula is:
[0035]
[0036] where σ st represents the number of shortest paths from node s to node t, σ st (v i ) means passing through v i The number of shortest paths;
[0037] Step 3.2: Similarity measurement: Calculate the similarity characteristics between node pairs based on the structural adjacency relationship between nodes to characterize their potential connection possibilities. The similarity measurement includes but is not limited to the number of common neighbors, Jaccard coefficient, Adamic-Adar index, etc., where:
[0038] Node pair (v i ,v j ) is defined as:
[0039] CN(i,j)=|Γ(v i )∩Γ(v j )|
[0040] Among them, Γ(v i ) is the node v i The set of neighbor nodes of
[0041] Step 3.3: Node edge feature information fusion, based on the above centrality features and similarity measurement results, the node pair (v i ,v j ) Construct its corresponding edge eigenvector U ij , the multi-source features are fused by feature splicing to form the final node-edge feature matrix U, which is specifically:
[0042] U=α·centrality+(1-α)·similarity
[0043] Where centrality is the centrality feature vector representing the node, similarity is the similarity feature vector representing the node pair, and the parameter α is a user-defined weight ranging from 0 to 2, which is used to adjust the contribution ratio of centrality and similarity to the score.
[0044] In step 4, the fusion process of the node features and edge features includes:
[0045] Step 4.1: Construct the fusion feature vector. For each pair of predicted nodes, extract the embedding vector C' of the two nodes from the final node feature matrix C' i , C' j , and extract the corresponding edge feature vector u from the node edge feature matrix U ij , the three are concatenated to form a fusion feature vector Z ij , specifically expressed as follows:
[0046] Z ij =[c' i ||c' j ||u ij ]
[0047] Among them, [·||·] represents the vector splicing operation, The concatenated fusion feature vector
[0048] Step 4.2: Link prediction classification, the fused feature vector Z ij Input to the preset machine learning classifier f(·) to predict whether there is a link; the classifier may include models such as Logistic Regression, Support Vector Machine (SVM), Random Forest, etc., and the prediction output is the link probability value Its expression is:
[0049]
[0050] in, Indicates the probability that there is a potential connection between a pair of nodes.
[0051] In step 5, the link prediction score calculation process includes:
[0052] Step 5.1: Use the trained machine learning model to perform forward inference on the input features and output the connection probability score between each pair of nodes;
[0053] Step 5.2: Construct the similarity matrix S and estimate the connection probability of potential edges using the following formula:
[0054] S uv= <Z u ,Z v >
[0055] Step 5.3: Sort the unconnected node pairs according to their corresponding scores in S from high to low, and select the pairs with the highest scores as the predicted edge outputs.
[0056] Beneficial effects of the present invention:
[0057] Compared with existing link prediction technologies based only on low-order adjacency relationships or traditional graph embedding methods, the present invention proposes a graph embedding link prediction method based on motif-aware feature propagation. By introducing motif recognition and motif weighted propagation mechanisms, it can explicitly model high-order structural information in the network, that is, mining specific subgraph structures (such as triangles, four-membered rings, etc.) formed by multi-node interactions between nodes, and combining node centrality and similarity metrics to construct edge features, thereby achieving a deep fusion of node features (i.e., node attributes themselves, such as user interest vectors and product category labels) and structural features (i.e., the topological position of the node in the graph, centrality indicators, and its structural relationship with other nodes), thereby improving the accuracy of link prediction and the generalization ability of the model, especially in complex topological structures or heterogeneous networks, showing stronger robustness and interpretability. This method can not only be used for network link prediction, but also for product recommendation, friend recommendation, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is an example of the present invention in product recommendation. DETAILED DESCRIPTION
[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0060] The following is a specific embodiment of the application of the present invention in a product recommendation system.
[0061] There are several pieces of interaction data between users and products (<a1,a2> ,…, m ,a n >), each piece of interaction data represents a certain behavior between the user and the product (such as purchase, browsing, rating, etc.). The present invention models each user and each product as a node in the graph, and models the interaction data as the edges between the nodes, thereby constructing a user-product network graph G = (V, E, C) where V represents the node set (including users and products), E represents the interaction edge set, and C represents the attribute information of the node, such as the user's age, gender, interest preferences, and the product category, brand, price range, etc. After constructing this product-user network, a graph embedding link prediction method based on motif-aware feature propagation is used to recommend products to users as follows:
[0062] Step 1: Aims to mine high-order structural information in the network. By modeling the interaction between users and products as a user-product network graph G = (V, E, C), and performing motif recognition (such as identifying closed structures of "user-product-user" or "user-product-product"), a motif matrix A is constructed. M These motifs reflect frequently occurring local patterns and help identify potential common preferences or semantic associations between products. This process enhances the network structure's ability to express complex semantic relationships and provides a structural foundation for subsequent feature propagation.
[0063] Step 1.1: Identify the subgraphs in the graph that meet the specific structure (identify "user-item-user") as motifs;
[0064] Step 1.2: Construct the motif matrix A M , where each element represents the number of times the user relationship (u, v) co-occurs in the motif M. The calculation formula is:
[0065]
[0066] in, Indicates the number of instances in which users u and v purchased the same product.
[0067] Step 2: Construct a node attribute matrix based on motif-aware feature propagation. The purpose of this step is to fuse the attribute features of the node with its motif context in the network. Specifically, first initialize the feature vectors of users and products (such as user interests and product categories), and then use the motif adjacency matrix to perform weighted propagation of features so that nodes can absorb information from their motif neighbors. The node attribute matrix formed by iterative updates can more fully capture the implicit semantic connection between users and products and enhance the expressive power of nodes.
[0068] Step 2.1: Constructing the initial feature vector of the node. Construct the initial embedding vector for each node in the user-product network graph. If the user has a purchase record attribute for a certain type of product, use this attribute directly as the initial feature; otherwise, randomly initialize a vector of dimension d for each user to obtain the initial node attribute matrix Where N is the number of nodes;
[0069] Step 2.2: Construct the motif weight matrix and calculate the motif matrix A based on the high-order structural information of the graph M , and smoothed by logarithmic function ψ(x) = log(x+1), the low-order adjacency matrix A and the motif matrix A M Weighted combination to obtain the reconstructed weighted adjacency matrix:
[0070] W=A+ψ(A M )
[0071] Step 2.3: Define influence propagation and calculate the weighted degree of each user Based on the smooth function ψ(x), the influence propagation matrix Y=(y u←v ) N×N ,in
[0072]
[0073] Indicates the influence strength of user v on u;
[0074] Step 2.4: Iteratively update the feature vector. Use the iterative aggregation mechanism to iteratively update the node features based on the influence propagation matrix:
[0075] C (l) =Y·C (l-1) +C (l-1)
[0076] And normalize the updated vector to ensure numerical stability:
[0077]
[0078] After L iterations, the final node feature matrix C' is output;
[0079] Step 3: Construct edge features for node pairs. This step aims to characterize the potential connections between users and products. By calculating centrality metrics (such as user activity and product popularity) and structural similarity (such as co-occurrence counts and Jaccard coefficients) for node pairs, an edge feature matrix reflecting user preferences and product characteristics is constructed. These edge features compensate for interaction patterns that are difficult to capture in node representations, allowing the model to more accurately characterize user behavior.
[0080] Step 3.1: Node centrality. Calculate the centrality characteristics of each user based on the importance of each node in the user-item network. The centrality includes but is not limited to degree centrality, betweenness centrality, or eigenvector centrality, where:
[0081] User v i The degree centrality C D (v i ) is defined as the number of commodity nodes directly connected to it, that is,
[0082]
[0083] User v i The betweenness centrality C B (v i ) is used to measure its "bridge" role in the user-product path, and its calculation formula is:
[0084]
[0085] where σ st represents the number of shortest paths from user s to user t, σ st (v i ) means passing through v i The number of shortest paths;
[0086] Step 3.2: Similarity measurement: Calculate similarity features between users based on their structural adjacency relationships to characterize their potential connection possibilities. The similarity measurement includes but is not limited to the number of common neighbors, Jaccard coefficient, Adamic-Adar index, etc., where:
[0087] For any two users i and j, the number of their common neighbors is defined as the size of the set of items they have interacted with:
[0088] CN(i,j)=|Γ(v i )∩Γ(v j )|
[0089] Among them, Γ(v i ) represents user v i The collection of connected products;
[0090] Step 3.3: Fusion of user-item feature information: Based on the above centrality features and similarity measurement results, the user-item relationship (v i ,v j ) Construct its corresponding edge eigenvector U ij , the multi-source features are fused by feature splicing to form the final node-edge feature matrix U, which is specifically:
[0091] U=α·centrality+(1-α)·similarity
[0092] Where centrality is the centrality feature vector representing the user, similarity is the similarity feature vector representing the purchase relationship between the user and the product, and the parameter α is a user-defined weight ranging from 0 to 2, which is used to adjust the contribution ratio of centrality and similarity to the score;
[0093] Step 4: This step combines the user embedding vector from Step 2 with the user-item edge features constructed in Step 3 and feeds them into a machine learning classifier (such as XGBoost, Random Forest, or MLP) to predict whether a new connection (i.e., recommendation) is likely to be generated between the user and the item. This process achieves unified modeling of structural information, node attributes, and interaction features, helping to improve the predictive accuracy of the recommendation system.
[0094] Step 4.1: Construct the fusion feature vector. For each pair of predicted user-item relationships, extract the embedding vectors C' of the two users from the final user feature matrix C' i , C' j , and extract the corresponding edge feature vector u from the user node edge feature matrix U ij , the three are concatenated to form a fusion feature vector Z ij , specifically expressed as follows:
[0095] Z ij =[c' i ||c' j ||u ij ]
[0096] Among them, [·||·] represents the vector splicing operation, c' i represents the embedding vector of user i, u ij is the user-item edge feature vector, then the concatenated fusion feature vector
[0097] Step 4.2: Link prediction classification, the fused feature vector Z ij The input is fed into the preset machine learning classifier f(·) to perform a binary classification prediction on whether there is a potential connection between the user and the product. The classifier may include models such as Logistic Regression, Support Vector Machine (SVM), and Random Forest. The prediction output is the link probability value. Its expression is:
[0098]
[0099] in, Represents the predicted probability of interaction or purchase between users and products.
[0100] Step 5: Link prediction score calculation. Based on the classifier model trained in Step 4, forward inference is performed on each candidate user-item relationship pair, and the probability score of their potential connection is calculated. This score is used to perform recommendation sorting, and the output result is the connection probability score for each user-item pair. A higher score indicates greater potential user interest in the item. The final recommendation result is the top-N item list sorted by the score.
[0101] Step 5.1: Use the trained machine learning model f(·) to perform forward inference on the input features and output the connection probability score for each pair of user-item relationships;
[0102] Step 5.2: Construct all user-item relationship prediction scores into a user-item similarity matrix S, where each item represents the user's potential interest in the item. The calculation expression is:
[0103] S uv = <Z u ,Z v >
[0104] Step 5.3: Sort the unpurchased user-item relationships according to their corresponding scores in S from high to low, and select the pairs with the highest scores as the predicted edge outputs.
Claims
1. A graph embedding link prediction method based on motif-aware feature propagation, characterized by: The following steps are included: Step 1: Graph structure initialization and motif identification. Preprocess the predicted network graph G = (V, E, C), extract the node set V, edge set E and node attribute matrix C, and construct the motif matrix A. M , used to represent high-order structures in the network; Step 2: Construct a node attribute matrix based on motif-aware feature propagation. First, obtain high-order network structure information through motif recognition, and then use the motif matrix A M Perform weighted propagation on the initial node attribute matrix C of the network, iteratively update the node feature vector to integrate the local and high-order topological information of the node, and finally form a node feature matrix C' that can effectively reflect the node attributes and structural characteristics; Step 3: Construct edge features of node pairs. Based on the extracted predicted network graph G = (V, E, C), calculate the centrality index and structural similarity measure of the node pairs. Fuse multiple edge attribute information to generate an edge feature matrix U that expresses the node pair relationship and potential connection features. Step 4: Fuse the node embedding vector and edge feature vector and input them into the machine learning classifier to predict whether there is a potential edge between the node pairs; Step 5: Link prediction score calculation, based on the prediction results of the classifier output, obtain the connection probability score of the node pair and form the similarity matrix S.
2. The graph embedding link prediction method based on motif-aware feature propagation according to claim 1, characterized in that: In step 1, the motif matrix A is constructed M The process steps include: Step 1.1: Identify the subgraphs (such as triangles and four-membered rings) in the graph G = (V, E, C) that meet the specific structure as motifs, where the node set V represents the set of entity nodes in the network, including user nodes, item nodes or other types of nodes, and the edge set Indicates the existing interaction relationship or connection between nodes, node attribute matrix Represents the attribute characteristics of each node, where d is the attribute dimension; Step 1.2: Construct the motif matrix A M , where each element represents the number of times a node pair (u, v) co-occurs in the motif M; its calculation formula is: in, Indicates the number of instances in which nodes u and v participate in the motif M.
3. The graph embedding link prediction method based on motif-aware feature propagation according to claim 1, characterized in that: In step 2, the process of generating the node feature matrix C' includes: Step 2.1: Construct the initial feature vector of the node. Construct the initial embedding vector for each node in the graph. If the node has existing attributes, use the attribute directly as the initial feature. Otherwise, randomly initialize a vector of dimension d for each node to obtain the initial node attribute matrix. Where N is the number of nodes; Step 2.2: Construct the motif weight matrix and calculate the motif matrix A based on the high-order structural information of the graph M , and smoothed by the logarithmic function ψ(x) = log(x+1), the low-order adjacency matrix A is weightedly combined with the motif matrix to obtain the reconstructed weighted adjacency matrix: W=A+ψ(A M ) Step 2.3: Define influence propagation and calculate the weighted degree of each node Based on the smooth function ψ(x), the influence propagation matrix Y=(y u←v ) N×N ,in Indicates the influence strength of node v on node u; Step 2.4: Iteratively update the feature vector. Use the iterative aggregation mechanism to iteratively update the node features based on the influence propagation matrix: C (l) =Y·C (l-1) +C (l-1) And normalize the updated vector to ensure numerical stability: After L iterations, the final node feature matrix C' is output.
4. The graph embedding link prediction method based on motif-aware feature propagation according to claim 1, characterized in that: In step 3, the process of generating the node edge feature matrix U includes the following steps: Step 3.1: Node centrality: Calculate the centrality characteristics of each node based on the importance of each node in the network to be predicted. The centrality includes but is not limited to degree centrality, betweenness centrality, or eigenvector centrality, where: Node v i The degree centrality C D (v i ) is defined as the number of edges connected to it, that is, Node v i The betweenness centrality C B (v i ) represents the intermediate degree of the node in all shortest paths, and its calculation formula is: where σ st represents the number of shortest paths from node s to node t, σ st (v i ) means passing through v i The number of shortest paths; Step 3.2: Similarity measurement: Calculate the similarity characteristics between node pairs based on the structural adjacency relationship between nodes to characterize their potential connection possibilities. The similarity measurement includes but is not limited to the number of common neighbors, Jaccard coefficient, Adamic-Adar index, etc., where: Node pair (v i ,v j ) is defined as: CN(i,j)=|Γ(v i )∩Γ(v j )| Among them, Γ(v i ) is the node v i The set of neighbor nodes of Step 3.3: Node edge feature information fusion, based on the above centrality features and similarity measurement results, the node pair (v i ,v j ) Construct its corresponding edge eigenvector U ij , the multi-source features are fused by feature splicing to form the final node-edge feature matrix U, which is specifically: U=α·centrality+(1-α)·similarity Where centrality is the centrality feature vector representing the node, similarity is the similarity feature vector representing the node pair, and the parameter α is a user-defined weight ranging from 0 to 2, which is used to adjust the contribution ratio of centrality and similarity to the score.
5. The graph embedding link prediction method based on motif-aware feature propagation according to claim 1, characterized in that: In step 4, the fusion process of the node features and edge features includes: Step 4.1: Construct the fusion feature vector. For each pair of predicted nodes, extract the embedding vector C' of the two nodes from the final node feature matrix C' i , C' j , and extract the corresponding edge feature vector u from the node edge feature matrix U ij , the three are concatenated to form a fusion feature vector Z ij , specifically expressed as follows: Z ij =[c' i ||c' j ||u ij ] Among them, [·||·] represents the vector splicing operation, The concatenated fusion feature vector Step 4.2: Link prediction classification, the fused feature vector Z ij Input to the preset machine learning classifier f(·) to predict whether there is a link; the classifier may include models such as Logistic Regression, Support Vector Machine (SVM), Random Forest, etc., and the prediction output is the link probability value Its expression is: in, Indicates the probability that there is a potential connection between a pair of nodes.
6. The graph embedding link prediction method based on motif-aware feature propagation according to claim 1, characterized in that: In step 5, the link prediction score calculation process includes: Step 5.1: Use the trained machine learning model to perform forward inference on the input features and output the connection probability score between each pair of nodes; Step 5.2: Construct the similarity matrix S and estimate the connection probability of potential edges using the following formula: S uv =<Z u ,Z v > Step 5.3: Sort the unconnected node pairs according to their corresponding scores in S from high to low, and select the pairs with the highest scores as the predicted edge outputs.