A self-supervised dynamic network link prediction method fusing spatio-temporal features
Patent Information
- Application Number
- CN202411217636.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2044-09-02
AI Technical Summary
[0019] To address the issues of existing graph generative self-supervised learning masking strategies often neglecting temporal evolution information and existing decoders causing temporal information loss, this invention proposes a self-supervised spatiotemporal feature fusion dynamic network modeling technique. First, a time-aware masking strategy is introduced to acquire the temporal information of the unbiased perturbation graph, ensuring the integrity of evolutionary information in the dynamic network. Second, a globally enhanced decoder based on graph neural networks is proposed to capture temporal information in the dynamic network, preventing its loss and ensuring that the model's encoder can learn richer evolutionary and topological information. Simultaneously, a graph recurrent neural network is deployed to capture spatial and temporal patterns in the dynamic network. Finally, based on our decoding strategy, a loss function that combines global and local information is designed to further optimize the entire model, enabling accurate dynamic network link prediction.
Smart Images

Figure CN119204180B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of graph machine learning, specifically relating to a dynamic network link prediction method based on generative self-supervised learning. Background Technology
[0002] Dynamic networks are ubiquitous in the real world, and their graphs evolve over time. Social networks, referencing 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 achieved good results on dynamic networks, but their success largely depends on complex data augmentation techniques and training strategies. Furthermore, negative sampling is indispensable for the contrastive loss function, and generating negative samples from the graph typically requires significant effort. Generative self-supervised learning inherently avoids these problems of contrastive self-supervised learning. Moreover, due to the simplicity of autoencoders, they do not require complex optimization strategies. Therefore, graph mask autoencoders have been extensively explored. However, research on mask autoencoders for dynamic networks is currently lacking, mainly because dynamic networks evolve over time, making the random masking strategies commonly used on static graphs unsuitable for dynamic networks; secondly, due to the inherent characteristics of dynamic networks, the edges of the mask also imply the corresponding temporal information. In the decoding process, simply reconstructing the mask graph structure is insufficient. Existing technologies mainly have the following drawbacks:
[0004] Existing masking strategies typically ignore the temporal information of evolution, and most current graph masking autoencoders rely on uniform random sampling for masking. In static graphs, such masking strategies ensure that a node's neighbors are neither all deleted nor all retained, thus effectively avoiding potential masking biases. However, dynamic networks consist of a series of static graphs that evolve over time. While using uniform random sampling for masking at each snapshot is reasonable, considering the entire dynamic network, it can lead to potential global masking biases. These biases corrupt the temporal information of the dynamic network, which is crucial for enhancing model performance.
[0005] Existing decoders lead to the loss of temporal information. Traditional masked autoencoder methods often reconstruct the masked portion to guide model optimization. Due to the inherent temporal characteristics of dynamic networks, the edges on the mask graph also mean that the corresponding temporal information of that edge will be masked. Therefore, the input temporal information itself is incomplete. Thus, simply reconstructing the mask graph structure is insufficient, as 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 this invention is to address the challenges of generative self-supervised modeling on dynamic networks. This invention proposes a self-supervised dynamic network modeling technique that fuses spatiotemporal features, thereby improving the modeling capability of dynamic networks and providing technical support for related applications.
[0007] This invention includes 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 snapshot G t The mask values of each edge are dynamically updated to obtain a mask map composed of masked edges and a perturbation map composed of perturbation edges.
[0010] Step 3: Construct an encoder. Based on the perturbation graph, obtain a graph snapshot G through the encoder. t The node embedding Z t .
[0011] Step 4: Update the hidden state of the dynamic network using a graph recurrent neural network that combines a gated recurrent unit network and a graph neural network.
[0012] Step 5: Construct a globally enhanced decoder, perform decoding operations based on the mask image, and output the dynamic network link prediction results.
[0013] Step 6: Construct a loss function for training and validate the performance of dynamic network link prediction.
[0014] Furthermore, in step 1, after obtaining the social data, a dynamic network dataset can be constructed based on the time scale: for user interaction relationships at time t, a corresponding graph snapshot is constructed as follows. Where N t ε represents all social users at that moment. t Represents the edges between social users. The attribute matrix representing all users, using Represents its adjacency matrix; a dynamic network consists of T graph snapshots G = (G1, G2, ..., G...). T ).
[0015] Furthermore, in step 2, for the snapshot G... t Construct a random mask matrix, multiply the mask matrix by the adjacency matrix to obtain the mask result, and calculate the graph snapshot G. tThe mask value is dynamically updated by determining the number of times each edge was masked in the previous snapshot of the graph. Then, the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edges to be masked are obtained through multinomial sampling. Finally, dynamically update the mask value p of each edge. i This is used for calculating the mask edges of subsequent snapshots.
[0016] Furthermore, in step 5, the node embedding Z obtained by the encoder is used. t As input to the decoder, the mask image is first recovered through GNN. Spatiotemporal information and original image snapshot G t The spatiotemporal information is obtained, and then the inner product function is used to calculate the reconstructed adjacency matrix of the masked graph and the adjacency matrix of the original graph.
[0017] Furthermore, the loss function includes: reconstruction of the mask graph structure and reconstruction of the graph snapshot.
[0018] Beneficial effects of this invention:
[0019] To address the issues of existing graph generative self-supervised learning masking strategies often neglecting temporal evolution information and existing decoders causing temporal information loss, this invention proposes a self-supervised spatiotemporal feature fusion dynamic network modeling technique. First, a time-aware masking strategy is introduced to acquire the temporal information of the unbiased perturbation graph, ensuring the integrity of evolutionary information in the dynamic network. Second, a globally enhanced decoder based on graph neural networks is proposed to capture temporal information in the dynamic network, preventing its loss and ensuring that the model's encoder can learn richer evolutionary and topological information. Simultaneously, a graph recurrent neural network is deployed to capture spatial and temporal patterns in the dynamic network. Finally, based on our decoding strategy, a loss function that combines global and local information is designed to further optimize the entire model, enabling accurate dynamic network link prediction. Attached Figure Description
[0020] Figure 1 This is a flowchart of the present invention;
[0021] Figure 2 This is a network structure diagram of the dynamic network modeling technique of the present invention;
[0022] Figure 3 This is a schematic diagram of the time-aware masking strategy in this invention. Detailed Implementation
[0023] A self-supervised method for predicting dynamic network links by fusing spatiotemporal features, such as... Figure 1 As shown, it includes the following steps:
[0024] 1. Obtain various social data from various social platforms, including the identity identifiers and attribute values of all users, as well as the friend relationships and comment relationships between users.
[0025] After acquiring the social data, a dynamic network dataset can be constructed based on the time scale: for user interaction relationships at time t, a corresponding graph snapshot can be constructed as follows. Where N t ε represents all social users at that moment. t Represents the edges between social users. The attribute matrix representing all users, using Represents its adjacency matrix; a dynamic network consists of T graph snapshots G = (G1, G2, ..., 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 the number of snapshots used for testing, respectively. The Adam strategy was used to optimize the objective function, with weight decay set to 0.001, learning rate set to 0.01, and the network trained for 1000 epochs, or early stopping was implemented by comparing the performance on the validation and training sets.
[0026] Table 1
[0027] 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. For example Figure 3 As shown, existing masking strategies typically ignore the temporal information of evolution. Most current graph masking autoencoders rely on uniform random sampling. In static graphs, such masking strategies effectively avoid potential mask bias problems, ensuring that a node's neighbors are neither all deleted nor all retained. Dynamic networks consist of a series of static graphs that evolve over time. While using uniform random sampling for masking in each snapshot is reasonable, considering the entire dynamic network, it may lead to a global potential mask bias. This bias corrupts the temporal information of the dynamic network, which is crucial for enhancing model performance. Therefore, this invention designs a time-aware masking strategy to avoid potential mask bias. This mechanism prevents continuous masking or the retention of certain edges in the dynamic network, fully guaranteeing the integrity of the temporal information of the perturbed dynamic network, thereby ensuring unbiased extraction of temporal information from the perturbed dynamic network. The specific scheme is as follows:
[0029] For snapshot G t Construct a random mask matrix, multiply the mask matrix by the adjacency matrix to obtain the mask result, and calculate the graph snapshot G. tThe mask value is dynamically updated by determining the number of times each edge was masked in the previous snapshot of the graph. Then, the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edges to be masked are obtained through multinomial sampling. Finally, dynamically update the mask value p of each edge. i This is used for calculating the mask edges in subsequent snapshots, and the formula is as follows:
[0030]
[0031]
[0032] p i+1 =(1-∈1)p i
[0033] in Indicates in snapshot G t The upper mask value is p i The number of edges, Indicates snapshot G t The mask probability corresponding to the edge is given above, where id() represents the edge index, ∈1 is the dynamic factor for updating the mask value, and sample() represents probabilistic multinomial sampling; the snapshot G is obtained through the above process. t The mask is missing the edge In G t An edge without a mask is defined as a perturbed edge. The image formed by the mask edges is a mask image. A graph consisting of perturbation edges is called a perturbation graph.
[0034] 3. To enhance the model's expressive power and capture the uncertainties of dynamic networks, thereby learning more effective information, a variational inference-based architecture is adopted to learn the node embedding representations of dynamic networks. Specific methods:
[0035] In snapshot G t The node embedding Z t Through Z t The approximate posterior distribution is obtained. Note that the input graph is a perturbation graph with perturbation structure and temporal information. That is, in this encoding process, such as... Figure 2 As shown, using a perturbation plot As input to the encoder, inference Z t The approximate posterior distribution is described as follows:
[0036]
[0037]
[0038] in These are the perturbation diagrams. The characteristic matrix and adjacency matrix, H t-1 It is the hidden state passed over from the previous time step; For node embedding representation Z t The approximate posterior distribution, It is Z t The value of the i-th row, and Representing Z respectively t mean μ t and variance (σ) t ) 2 The value in the i-th row, diag() means to take the value on its diagonal. Indicates that it follows the mean. variance is The distribution of the variables is determined; the above inference process is implemented using a GNN as the encoder function; firstly, a shared single-layer GNN is used to extract latent variables; then, two single-layer GNNs are used to encode the latent variables to obtain the mean vector μ. t and variance vector (σ t ) 2 After obtaining the mean and variance of the approximate posterior distribution, the node embedding representation Z is obtained through reparameterization. t :
[0039] Z t =(σ t ) 2 *∈2+μ t
[0040] Where ∈2 represents a random variable that follows a standard Gaussian distribution.
[0041] 4. Since the snapshots in a dynamic network are time-dependent, meaning the information of the current snapshot is determined by the co-evolution of past snapshots, we utilize a graph recurrent neural network to dynamically update the hidden state at the current time step to fully capture this time dependency information. This hidden state contains the time dependency information of the current moment and will be passed to the next moment as input to the encoder. Specific method:
[0042] The hidden state of the dynamic network is updated using a graph recurrent neural network equipped with a gated recurrent unit network and a graph neural network. The input of the graph recurrent neural network is the node embedding representation Z. t Attribute matrix Adjacency matrix of perturbation graph And the hidden state H from the previous step t-1 The details are as follows:
[0043]
[0044] in, It's a reset door that decides which information should be forgotten. It determines how much of the hidden state information from the previous time step should be retained in the update gate. g stands for GNN, and Both are single-layer multilayer perceptrons, where δ1 and δ2 represent the sigmoid and tanh activation functions, respectively. ⊙ represents the Hadamard product. By controlling the reset and update gates, the graph recurrent neural network selectively retains or discards historical information and updates the hidden state based on the current input.
[0045] 5. Capturing global dependencies in dynamic networks is crucial for effective embedding learning. Therefore, to preserve the temporal dependencies of perturbed dynamic networks, we reconstruct the original graph structure while reconstructing the mask graph structure. This design allows the model to further capture the temporal dependencies of dynamic networks 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, not just the nodes themselves, thus helping the encoder learn richer information. Such a decoder is more powerful than multilayer perceptrons and inner products. Specific solution:
[0046] The node embedding Z obtained using the encoder t As input to the decoder, the mask image is first recovered through GNN. Spatiotemporal information and original image snapshot G t The spatiotemporal information is obtained, and then the inner product function is used to calculate the reconstructed adjacency matrix of the masked graph and the adjacency matrix of the original graph. The process is formalized as follows:
[0047]
[0048]
[0049]
[0050]
[0051] Where f1 and f2 are used to recover the adjacency matrix of the mask map. Adjacency matrix of the original graph The spatiotemporal information GNN decoder, This represents the probability value of the reconstructed adjacency matrix. Then, the spatiotemporal information obtained through the GNN decoder is input into the inner product to obtain the final reconstructed graph structure. and Distribution Representative and The link prediction results for the i-th row and j-th column.
[0052] It is important to note that, in order to accelerate model training, the parameters of the two GNN decoders are shared.
[0053] 6. Based on the decoding strategy, the loss function consists of two parts: one for reconstructing the mask image structure and the other for reconstructing the original image. Furthermore, since the model of this invention is based on a variational architecture, Z... t The distribution needs further constraints. The reconstruction loss function of the mask image at time t is as follows:
[0054]
[0055] Where g(v,u) is the predicted link probability between nodes β and u, and exp() represents the fetch operation.
[0056] For each graph snapshot G t The reconstruction loss function corresponds to the variational lower bound for each snapshot. Specifically:
[0057]
[0058] Where r(Z) t ) represents the prior distribution of the node embedding representation, which conforms to a standard normal Gaussian distribution; KL represents the KL divergence. The final loss function is the joint of the above two loss functions, using λ as the balance parameter between the two loss functions, as follows:
[0059]
[0060] This embodiment performs link prediction on six datasets (Enron, DBLP, FB, Email, and Socwiki) to verify the effectiveness of the method and compares it with various current state-of-the-art methods. The experimental results are shown in Table 2. The invention is named DVGMAE. As can be seen from the table, DCGMAE significantly outperforms current dynamic network link prediction methods on all datasets. Specifically, on the small social network datasets Enron and DBLP, DVGMAE improved the AUC by 1.39% and 7.17%, and the AP by 0.86% and 4.2% compared to the best link prediction method. On the medium-sized social network datasets FB and Email, DVGMAE improved the AUC by 2.87% and 2.23%, and the AP by 1.28% and 2.01% compared to the best method. On the large social network datasets Socwiki and Iadublin, DVGMAE improved the AUC by 3.86% and 5.39%, and the AP by 10.05% and 12.92% compared to the best method. In summary, the effectiveness of DVGMAE was fully validated through link prediction experiments on dynamic social network datasets of different sizes.
[0061] Table 2
[0062]
Claims
1. A dynamic network link prediction method of self-supervised spatio-temporal feature fusion, characterized in that, Includes the following steps: Step 1: Obtain social data from various social platforms, construct corresponding graph snapshots, and build a dynamic network dataset based on the time scale; Step 2, for the snapshot of the graph The mask values of the edges are dynamically updated to obtain a mask graph composed of mask edges and a perturbation graph composed of perturbation edges, and the implementation process is as follows: For image snapshots Construct a random mask matrix, multiply the mask matrix by the adjacency matrix to obtain the mask result, and calculate the graph snapshot. The mask value is dynamically updated by determining the number of times each edge was masked in the previous snapshot of the graph. Then, the mask probability of each edge is calculated based on the current mask value. After obtaining the probability, the edges to be masked are obtained through multinomial sampling. Finally, the mask values of each edge are dynamically updated. This is used for calculating the mask edges in subsequent snapshots, and the formula is as follows: in Indicates in snapshot The upper mask value is The number of edges, Indicates snapshot The mask probability of the corresponding edge above, Represents the index of the edge. It is a dynamic factor that updates the mask value. This represents probabilistic multinomial sampling; a snapshot is obtained through the above process. The mask is missing the edge ,exist An edge without a mask is defined as a perturbed edge. The image formed by the mask edges is called a mask image. The graph formed by the perturbation edges is called the perturbation graph. ; Step 3: Construct an encoder and obtain a graph snapshot based on the perturbation graph. Node embedding on ; Step 4: Update the hidden state of the dynamic network using a graph recurrent neural network that combines a gated recurrent unit network and a graph neural network. Step 5: Construct a globally enhanced decoder, perform decoding operations based on the mask image, and output the dynamic network link prediction results; Step 6: Construct a loss function for training and validate the performance of dynamic network link prediction.
2. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 1, characterized in that, The social data includes all users' identity identifiers and attribute values, as well as friend relationships and comment relationships between users.
3. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 2, characterized in that, The specific implementation process of step 1 is as follows: After acquiring the social data, a dynamic network dataset is constructed based on the time scale: for... The user interaction relationships at each moment are used to construct the corresponding graph snapshot. ,in Representing all social media users at that moment, Represents the edges between social users. The attribute matrix representing all users, using Represents its adjacency matrix; a dynamic network consists of T graph snapshots. .
4. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 3, characterized in that, The specific implementation process of step 3 is as follows: Using perturbation plots As input to the encoder, reasoning The approximate posterior distribution is described as follows: in These are the perturbation diagrams. The characteristic matrix and adjacency matrix, It is the hidden state passed over from the previous time step; For node embedding representation The approximate posterior distribution, yes The value of the i-th row, and Represent mean and variance The value of the i-th row, This means taking the value on its diagonal. Indicates that it follows the mean. The variance is Distribution; The above inference process is implemented using a GNN as the encoder function; firstly, a shared single-layer GNN is used to extract latent variables; then, two single-layer GNNs are used to encode the latent variables to obtain the mean vector. Sum of variance vectors After obtaining the mean and variance of the approximate posterior distribution, the node embedding representation is obtained through reparameterization. : in Let represent a random variable that follows a standard Gaussian distribution.
5. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 4, characterized in that, The specific implementation process of step 4 is as follows: The input to the graph recurrent neural network is the node embedding representation. Attribute matrix Adjacency matrix of perturbation graph And the hidden state in the previous step The details are as follows: in, It's a reset door that decides which information should be forgotten. It determines how much of the hidden state information from the previous time step should be retained in the update gate; stands for GNN, and They are all single-layer multilayer perceptrons. and These represent the sigmoid activation function and the tanh activation function, respectively. The Hadamard product is represented by the graph recurrent neural network. By controlling the reset and update gates, the graph recurrent neural network selectively retains or discards historical information and updates the hidden state based on the current input.
6. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 5, characterized in that, The specific implementation process of step 5 is as follows: Node embeddings obtained using the encoder As input to the decoder, the mask image is first recovered through GNN. Spatiotemporal information and original image snapshot The spatiotemporal information is obtained, and then the inner product function is used to calculate the reconstructed adjacency matrix of the masked graph and the adjacency matrix of the original graph. The process is formalized as follows: in, and It is used to recover the adjacency matrix of the mask map. Adjacency matrix of the original graph The spatiotemporal information GNN decoder, This represents the probability value of the reconstructed adjacency matrix. Then, the spatiotemporal information obtained through the GNN decoder is input into the inner product to obtain the final reconstructed graph structure. and Distribution Representative and The link prediction results for the i-th row and j-th column.
7. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 6, characterized in that, The two GNN decoders in the decoder share parameters.
8. The self-supervised spatiotemporal feature fusion dynamic network link prediction method according to claim 7, characterized in that, The loss function described in step 6 is constructed as follows: timestamp The reconstruction loss function of the mask image at time step is as follows: in, It is a predicted node. and The link probability, where exp() represents the fetch operation; For each graph snapshot The reconstruction loss function corresponds to the variational lower bound for each snapshot; specifically as follows: in, The prior distribution representing the node embeddings conforms to a standard normal Gaussian distribution; express Divergence; the final loss function is the joint of the two loss functions mentioned above, using... The balancing parameters for these two loss functions are 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