Self-supervised spatial-temporal feature fusion dynamic network link prediction method
The self-supervised spatiotemporal feature fusion method addresses the issue of temporal information loss in dynamic networks by using time-aware masking and enhanced decoders, improving dynamic network link prediction accuracy.
Patent Information
- Application Number
- CN202411217636.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Existing masking strategies for generative self-supervised learning on dynamic networks ignore temporal information, leading to potential masking bias and loss of temporal information, which affects model performance in dynamic network link prediction.
A self-supervised spatiotemporal feature fusion approach is introduced, using time-aware masking, graph recurrent neural networks, and globally enhanced decoders to capture and preserve temporal information, incorporating graph neural networks for dynamic network modeling.
The approach enhances model performance by accurately predicting dynamic network links, capturing richer evolutionary and topological structure information, and optimizing the model with a combined loss function.
Smart Images

Figure CN119204180A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of graph machine learning, and specifically relates to a dynamic network link prediction method based on generative self-supervised learning. Background Art
[0002] Dynamic networks are ubiquitous in the real world, where graphs evolve over time. Social networks, citation networks, and transportation systems can all be described using dynamic networks. Dynamic network link prediction describes how real-world networks evolve and interact over time, helping to understand their internal behavior and predict future behavior.
[0003] Contrastive self-supervised learning methods have also achieved good results on dynamic networks, but their success depends largely on complex data augmentation techniques and training strategies. In addition, negative sampling is indispensable for contrastive loss functions, and it usually takes a lot of effort to generate negative samples from graphs. Generative self-supervised learning essentially circumvents the above problems of contrastive self-supervised learning. In addition, due to the simplicity of autoencoders, they do not require complex optimization strategies. Therefore, graph mask autoencoders have been widely explored. However, there is currently a lack of research on masked autoencoders in dynamic networks, mainly because dynamic networks evolve over time, so the random masking strategy commonly used on static graphs is not suitable for dynamic networks; secondly, due to the inherent characteristics of dynamic networks, masking its edges also means masking the corresponding time information. In the decoding process, the traditional reconstruction of the masked graph structure is insufficient. The existing technology mainly includes the following disadvantages:
[0004] Existing masking strategies usually ignore the evolving temporal information. The masking strategies in most current graph masked autoencoders are based on uniform random sampling. In static graphs, such masking strategies ensure that the neighbors of a node are neither completely deleted nor completely retained, so these methods can effectively avoid potential masking bias. However, a dynamic network is composed of a series of static graphs that evolve over time. Although it is reasonable to use uniform random sampling for masking in each snapshot, it may lead to a global potential masking bias when considering the entire dynamic network globally. This bias destroys the temporal information of the dynamic network, and capturing temporal information is the key to enhancing model performance.
[0005] Existing decoders will lead to the loss of temporal information. For traditional masked autoencoder methods, they often reconstruct the masked part to guide model optimization learning. Due to the inherent temporal characteristics of dynamic networks, the edges on the mask graph also mean that the temporal information corresponding to this edge will be masked. Therefore, the input temporal information itself is incomplete. Therefore, it is not enough to only reconstruct the mask graph structure, because this will lead to the loss of global temporal information in the dynamic network. Summary of the invention
[0006] The technical problem to be solved by the present invention is that, in response to the challenge of generative self-supervised modeling on the above-mentioned dynamic network, the present invention proposes a dynamic network modeling technology with self-supervised spatiotemporal feature fusion, which improves the modeling ability of dynamic networks and provides technical support for related applications.
[0007] The present invention comprises the following steps:
[0008] Step 1: Obtain social data from various social platforms, construct corresponding graph snapshots, and build a dynamic network dataset based on the time scale.
[0009] Step 2: For the graph snapshot G t , dynamically update the mask value of each edge, and obtain a mask graph composed of mask edges and a perturbation graph composed of perturbation edges.
[0010] Step 3: Build an encoder and obtain a snapshot G of the graph through the encoder based on the perturbation graph. t The node embedding Z t .
[0011] Step 4: Use a graph recurrent neural network that combines a gated recurrent unit network and a graph neural network to update the hidden state of the dynamic network.
[0012] Step 5: Build a globally enhanced decoder, perform decoding operations based on the mask map, and output dynamic network link prediction results.
[0013] Step 6: Construct a loss function for training and verify the dynamic network link prediction performance.
[0014] Furthermore, in step 1, after obtaining the social data, a dynamic network dataset can be constructed based on the time scale: for the user interaction relationship at time t, the corresponding graph snapshot is constructed as Where N t represents all social users at that moment, ε t Represents the edges between social users, Represents the attribute matrix of all users, with Represents its adjacency matrix; a dynamic network is composed of T graph snapshots G = (G 1 ,G 2 ,…,G T ).
[0015] Furthermore, in step 2, for the graph snapshot G t , construct a random mask matrix, obtain the mask result by multiplying the mask matrix with the adjacency matrix, and calculate the graph snapshot G tThe number of times each edge was masked in the graph snapshot at the previous moment, the mask value at the current moment is dynamically updated, and then the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edge to be masked is obtained according to polynomial sampling Finally, dynamically update the mask value p of each edge i , used for the calculation of mask edges of subsequent snapshots.
[0016] Furthermore, in step 5, the node embedding Z obtained by the encoder is used t As the input of the decoder, the mask map is first restored through GNN The spatiotemporal information and the original graph snapshot G t The spatial-temporal information of the mask graph is then extracted and the inner product function is used to calculate the reconstructed adjacency matrix of the mask graph and the adjacency matrix of the original graph.
[0017] Furthermore, the loss function includes: reconstruction of the mask image structure and reconstruction of the image snapshot.
[0018] Beneficial effects of the present invention:
[0019] In view of the fact that the existing masking strategies of graph-generated self-supervised learning usually ignore the temporal information of evolution, and the problem that the existing decoders cause the loss of temporal information, the present invention proposes a dynamic network modeling technology with self-supervised spatiotemporal feature fusion. First, a time-aware masking strategy is introduced to obtain the temporal information of unbiased perturbation graphs to ensure the integrity of the evolutionary information on the dynamic network. Secondly, we propose a globally enhanced decoder based on graph neural networks to capture the temporal information on dynamic networks, prevent the loss of temporal information, and ensure that the encoder of the model can learn richer evolutionary and topological structure information. At the same time, we deploy graph recurrent neural networks to capture spatial and temporal patterns in dynamic networks. Finally, based on our decoding strategy, we design a loss function that combines global and local information to further optimize the entire model and perform accurate dynamic network link prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of the present invention;
[0021] Figure 2 A network structure diagram of the dynamic network modeling technology of the present invention;
[0022] Figure 3 Schematic diagram of the time-aware masking strategy in the present invention. DETAILED DESCRIPTION
[0023] A dynamic network link prediction method based on self-supervised spatiotemporal feature fusion, such as Figure 1 As shown, the following steps are included:
[0024] 1. Obtain various social data from various social platforms. Social data includes the identity identification and attribute values of all users, as well as the friendship and comment relationships between users.
[0025] After obtaining social data, we can construct a dynamic network dataset based on the time scale: for the user interaction relationship at time t, we construct the corresponding graph snapshot: Where N t represents all social users at that moment, ε t Represents the edges between social users, Represents the attribute matrix of all users, with Represents its adjacency matrix; a dynamic network is composed of T graph snapshots G = (G 1 ,G 2 ,…,G T ). Table 1 summarizes the statistical characteristics of all the dynamic social networks used. N, E, T, K, and L represent the number of users, edges, snapshots, user categories, and snapshots used for testing in the dynamic social network, respectively. The Adam strategy is used to optimize the objective function, with the weight decay set to 0.001 and the learning rate set to 0.01. The network is trained for 1000 rounds or early stopping is implemented by comparing the performance of the validation set with the training set.
[0026] Table 1
[0027] Dataset N E T L Enron 184 4,784 11 3 DBLP 315 5,104 10 3 FB 663 23,394 9 3 Email 2,029 39,264 29 3 Socwiki 8,298 106,043 12 3
[0028] 2. If Figure 3 As shown, existing masking strategies usually ignore the evolving temporal information. The masking strategies in most current graph mask autoencoders are based on uniform random sampling. In static graphs, such a masking strategy can effectively avoid potential mask bias problems, that is, to ensure that the neighbors of a node are neither completely deleted nor completely retained. A dynamic network is composed of a series of static graphs that evolve over time. Although it is reasonable to use uniform random sampling for masking in each snapshot, it may lead to global potential mask bias from the perspective of the entire dynamic network. This bias destroys the temporal information of the dynamic network, and capturing temporal information is the key to enhancing model performance. Therefore, the present invention designs a time-aware masking strategy to avoid potential mask bias. This mechanism can prevent continuous masking or retention of a certain edge in a dynamic network, fully ensuring the integrity of the temporal information of the perturbed dynamic network, and thus ensuring unbiased extraction of temporal information from the perturbed dynamic network. The specific scheme is as follows:
[0029] For a graph snapshot G t , construct a random mask matrix, obtain the mask result by multiplying the mask matrix with the adjacency matrix, and calculate the graph snapshot Gt The number of times each edge was masked in the graph snapshot at the previous moment, the mask value at the current moment is dynamically updated, and then the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edge to be masked is obtained according to polynomial sampling Finally, dynamically update the mask value p of each edge i , used to calculate the mask edge of subsequent snapshots, the formula is as follows:
[0030]
[0031]
[0032] p i+1 =(1-∈1)p i
[0033] in Indicates that in snapshot G t The upper mask value is p i The number of edges, Represents snapshot G t The mask probability of the corresponding edge, id() represents the index of the edge, ∈1 is the dynamic factor for updating the mask value, and sample() represents the polynomial sampling according to probability; the snapshot G is obtained through the above process t The masked edge In G t Edges without masks are defined as perturbed edges. The graph consisting of mask edges is called a mask graph. A graph consisting of perturbed edges is a perturbed graph.
[0034] 3. In order to enhance the expressiveness of the model and capture the uncertainty of the dynamic network, and then learn more effective information, a variational inference-based architecture is used to learn the node embedding representation of the dynamic network. Specific methods:
[0035] In snapshot G t The node embedding Z t Can be done through Z t The approximate posterior distribution of is obtained. Please note that the input graph is a perturbation graph with perturbation structure and time information. That is, in this encoding process, Figure 2 As shown, using the perturbation diagram As the input of the encoder, the inference Z t The approximate posterior distribution of , the process is described as follows:
[0036]
[0037]
[0038] in are the perturbation plots The feature matrix and adjacency matrix, H t-1 is the hidden state passed from the previous time step; Embedding representation Z for the node t The approximate posterior distribution of It's Z t The i-th row value of and Represents Z t The mean μ t and variance (σ t ) 2 The value of the i-th row, diag() means taking the value on its diagonal. It means that the mean is The variance is distribution; GNN is used as the encoder function to implement the above inference process; first, a shared single-layer GNN is used to extract the latent variables; then two single-layer GNNs are used to encode the latent variables to obtain the mean vector μ t and the variance vector (σ t ) 2 After obtaining the mean and variance of the approximate posterior distribution, the node embedding representation Z is obtained by reparameterization t :
[0039] Z t =(σ t ) 2 *∈2+μ t
[0040] Where ∈2 represents a random variable that satisfies the standard Gaussian distribution.
[0041] 4. Since the snapshots of the dynamic network are time-dependent, that is, the information of the current snapshot is determined by the co-evolution of past snapshots, in order to fully capture the time-dependent information in the dynamic network, we use the graph recurrent neural network to dynamically update the hidden state of the current time step, which contains the time-dependent information of the current moment and will be passed to the next moment as the input of the encoder of the next moment. Specific method:
[0042] A graph recurrent neural network equipped with a gated recurrent unit network and a graph neural network is used to update the hidden state of the dynamic network. The input of the graph recurrent neural network is the node embedding representation Z t , attribute matrix Adjacency Matrix of Perturbed Graph and the hidden state H of the previous step t-1 , as follows:
[0043]
[0044] in, is the reset gate that determines which information should be forgotten, is the update gate that determines how much hidden state information from the previous time step should be retained. g stands for GNN, and They are all single-layer multilayer perceptrons, δ 1 and δ 2 Represent the sigmoid activation function and the tanh activation function respectively. ⊙ represents the Hadamard product. By controlling the reset gate and the update gate, the graph recurrent neural network selectively retains or discards historical information and updates the hidden state according to the current input.
[0045] 5. Capturing global dependencies in dynamic networks is crucial for effective embedding learning. Therefore, in order to preserve the temporal dependencies of the perturbed dynamic network, we will reconstruct the original graph structure while reconstructing the mask graph structure. This design enables the model to further capture the temporal dependencies of the dynamic network by focusing on global information reconstruction. In terms of decoder design, we used a GNN-based decoder, which performs well on various graph mask autoencoder architectures. The GNN-based decoder can recover spatiotemporal information based on nodes and their neighbors rather than just the nodes themselves, thereby helping the encoder learn richer information. Such a decoder is more powerful than multi-layer perceptrons and inner products. Specific solution:
[0046] The node embedding Z obtained using the encoder t As the input of the decoder, the mask map is first restored through GNN The spatiotemporal information and the original graph snapshot G t The spatial and temporal information of the mask graph is then used to calculate the reconstructed adjacency matrix of the mask graph and the adjacency matrix of the original graph. The process is formalized as follows:
[0047]
[0048]
[0049]
[0050]
[0051] Among them, f 1 and f 2 is used to recover the adjacency matrix of the mask graph and the original graph adjacency matrix GNN decoder of spatiotemporal information, Represents the probability value of the reconstructed adjacency matrix, and then the spatiotemporal information obtained by the GNN decoder is input into the inner product to obtain the final reconstructed graph structure. and Distribution Representative and The link prediction result of the i-th row and j-th column.
[0052] It should be noted that in order to speed up the training of the model, the parameters of the two GNN decoders are shared.
[0053] 6. Based on the decoding strategy, the loss function is: one is the reconstruction of the mask image structure, and the other is the reconstruction of the original image. In addition, since the model of the present invention is based on the variational architecture, Z t The distribution of needs further constraints. The reconstruction loss function of the mask image at timestamp t is as follows:
[0054]
[0055] Among them, g(v,u) is the predicted link probability between nodes β and u, and exp() represents the instruction fetch operation.
[0056] For each graph snapshot G t The reconstruction loss function corresponds to the variational lower bound of each snapshot. It is as follows:
[0057]
[0058] Among them, r(Z t ) represents the prior distribution of node embedding representation, which conforms to the standard normal Gaussian distribution; KL represents KL divergence. The final loss function is the union of the above two loss functions, using λ as the balance parameter of the two loss functions, as follows:
[0059]
[0060] This embodiment performs link prediction of dynamic social networks on 6 data sets (Enron, DBLP, FB, Email, Socwiki) to verify the effectiveness of the method and compares it with various current advanced methods. The experimental results are shown in Table 2. The name of the present invention is DVGMAE. It can be found from the table that DCGMAE is much better than the current dynamic network link prediction method on all data sets. Specifically, compared with the best link prediction method on two small social network datasets, Enron and DBLP, DVGMAE improves the AUC index by 1.39% and 7.17%, and the AP index by 0.86% and 4.2%; compared with the best method on two medium-sized social network datasets, FB and Email, DVGMAE improves the AUC index by 2.87% and 2.23%, and the AP index by 1.28% and 2.01%; compared with the best method on two large social network datasets, Socwiki and Iadublin, DVGMAE improves the AUC index by 3.86% and 5.39%, and the AP index by 10.05% and 12.92%; In short, through link prediction experiments on dynamic social network datasets of different sizes, the effectiveness of DVGMAE is fully verified.
[0061] Table 2
[0062]
Claims
1. A dynamic network link prediction method based on self-supervised spatiotemporal feature fusion, characterized in that: The following steps are involved: Step 1: Obtain social data from various social platforms, construct corresponding graph snapshots, and construct a dynamic network dataset based on the time scale; Step 2: For the graph snapshot G t , dynamically update the mask value of each edge, and obtain a mask graph composed of mask edges and a perturbation graph composed of perturbation edges; Step 3: Build an encoder and obtain a snapshot G of the graph through the encoder based on the perturbation graph. t The node embedding Z t ; Step 4: Use a graph recurrent neural network that combines a gated recurrent unit network and a graph neural network to update the hidden state of the dynamic network. Step 5: Build a globally enhanced decoder, perform decoding operations based on the mask map, and output dynamic network link prediction results; Step 6: Construct a loss function for training and verify the dynamic network link prediction performance.
2. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 1, characterized in that: The social data includes the identities and attribute values of all users, as well as the friendship and comment relationships between users.
3. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 2, characterized in that: The specific implementation process of step 1 is as follows: After obtaining the social data, a dynamic network dataset is constructed according to the time scale: for the user interaction relationship at time t, the corresponding graph snapshot is constructed as Where N t represents all social users at that moment, ε t Represents the edges between social users, Represents the attribute matrix of all users, with Represents its adjacency matrix; a dynamic network is composed of T graph snapshots G = (G1, G2, ..., G T ).
4. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 3, characterized in that: The specific implementation process of step 2 is as follows: For a graph snapshot G t , construct a random mask matrix, obtain the mask result by multiplying the mask matrix with the adjacency matrix, and calculate the graph snapshot G t The number of times each edge was masked in the graph snapshot at the previous moment, the mask value at the current moment is dynamically updated, and then the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edge to be masked is obtained according to polynomial sampling Finally, dynamically update the mask value p of each edge i , used to calculate the mask edge of subsequent snapshots, the formula is as follows: p i+1 =(1-∈1)p i in Indicates that in snapshot G t The upper mask value is p i The number of edges, Represents snapshot G t The mask probability of the corresponding edge, id() represents the index of the edge, ∈1 is the dynamic factor for updating the mask value, and sample() represents the polynomial sampling according to probability; the snapshot G is obtained through the above process t The masked edge In G t Edges without masks are defined as perturbed edges The graph consisting of mask edges is called a mask graph. A graph consisting of perturbed edges is a perturbed graph.
5. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 4, characterized in that: The specific implementation process of step 3 is as follows: Using perturbation plots As the input of the encoder, the inference Z t The approximate posterior distribution of , the process is described as follows: in are the perturbation plots The feature matrix and adjacency matrix, H t-1 is the hidden state passed from the previous time step; Embedding representation Z for the node t The approximate posterior distribution of It's Z t The i-th row value of and Represents Z t The mean μ t and variance (σ t ) 2 The value of the i-th row, diag() means taking the value on its diagonal. It means that the mean is The variance is Distribution of GNN is used as the encoder function to implement the above inference process; first, a shared single-layer GNN is used to extract the latent variables; then two single-layer GNNs are used to encode the latent variables to obtain the mean vector μ t and the variance vector (σ t ) 2 After obtaining the mean and variance of the approximate posterior distribution, the node embedding representation Z is obtained by reparameterization t : Z t =(s t ) 2 *∈2+μ t Where ∈2 represents a random variable that satisfies the standard Gaussian distribution.
6. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 5, characterized in that: The specific implementation process of step 4 is as follows: The input of the graph recurrent neural network is the node embedding representation Z t , attribute matrix Adjacency Matrix of Perturbed Graph and the hidden state H of the previous step t-1 , as follows: in, is the reset gate that determines which information should be forgotten, is the update gate that determines how much hidden state information of the previous time step should be retained; f g stands for GNN, and They are all single-layer multilayer perceptrons, ε1 and δ2 represent the sigmoid activation function and tanh activation function respectively; ⊙ represents the Hadamard product; through the control of the reset gate and the update gate, the graph recurrent neural network selectively retains or discards historical information and updates the hidden state according to the current input.
7. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 6, characterized in that: The specific implementation process of step 5 is as follows: The node embedding Z obtained using the encoder t As the input of the decoder, the mask map is first restored through GNN The spatiotemporal information and the original graph snapshot G t The spatial and temporal information of the mask graph is then used to calculate the reconstructed adjacency matrix of the mask graph and the adjacency matrix of the original graph. The process is formalized as follows: Among them, f1 and f2 are used to restore the mask graph adjacency matrix and the original graph adjacency matrix GNN decoder of spatiotemporal information, Represents the probability value of the reconstructed adjacency matrix, and then the spatiotemporal information obtained by the GNN decoder is input into the inner product to obtain the final reconstructed graph structure. and Distribution Representative and The link prediction result of the i-th row and j-th column.
8. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 7, characterized in that: The parameters of the two GNN decoders in the decoder are shared.
9. The method for dynamic network link prediction based on self-supervised spatiotemporal feature fusion according to claim 8, characterized in that: The loss function described in step 6 is specifically constructed as follows: The reconstruction loss function of the mask image at timestamp t is as follows: Among them, g(v,u) is the predicted link probability of nodes v and u, and exp() represents the instruction fetch operation; For each graph snapshot G t The reconstruction loss function of corresponds to the variational lower bound for each snapshot; it is as follows: Among them, r(Z t ) represents the prior distribution of node embedding representation, which conforms to the standard normal Gaussian distribution; KL represents KL divergence; the final loss function is the union of the above two loss functions, using λ as the balance parameter of the two loss functions, as follows:
Citation Information
Patent Citations
Dynamic network community discovery method and device, equipment and storage medium
CN117113240A
Graph masking self-coding learning method and system based on community awareness, and storage medium
CN117973445A
Capturing network dynamics using dynamic graph representation learning
US20200074246A1
