Time sequence diagram neural network prediction interpretation method based on graph generation

Through the sub-graph generation model combining graph node sequence and recurrent neural network, the generality and accuracy of timing graph neural network interpretation is solved, and the simultaneous interpretation and efficient interpretation of timing graph neural network are realized, which is suitable for large-scale graph prediction .

CN119089934APending Publication Date: 2024-12-06XIDIAN UNIV HANGZHOU RES INST +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411228598.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The prior art cannot explain the prediction results of the snapshot-based and event-based timing graph neural networks, and cannot effectively capture the time evolution and dependencies of events in the dynamic graph, resulting in low interpretation accuracy, high time complexity, and users need to have the first Test knowledge.

Method used

A subgraph generation model using graph node sequences as input is used, and a recurrent neural network is used to capture dynamic changes in the timing graph neural network, and combined with a breadth-first search algorithm to generate an interpretive subgraph to reduce the time complexity, which is suitable for large-scale graph prediction.

Benefits of technology

The simultaneous interpretation ability of timing graph neural network is realized, the interpretation accuracy is improved, the time complexity is reduced, and the dependence on user prior knowledge is reduced, and the application scope and practicality of the method are expanded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119089934A_ABST
    Figure CN119089934A_ABST
Patent Text Reader

Abstract

The invention discloses a time sequence diagram neural network prediction interpretation method based on graph generation, which is an interpretation method taking a graph node sequence as input, does not depend on a data form input in specific time sequence diagram neural network prediction, and can interpret time sequence diagram neural network prediction based on snapshots and events at the same time. According to the method, the recurrent neural network (RNN) is utilized to construct the generative model, dynamic changes of nodes and edges in the time sequence diagram neural network are captured, and the method can adapt to input sequences of different lengths. According to the method, the pre-training interpretation generator model is adopted, the input graph node sequence is obtained through breadth-first search, the model convergence speed can be increased through the pre-training interpretation generator model, and meanwhile the interpretation accuracy is improved. The method has the advantages that the universality and practicability of the interpretation method are enhanced, and the calculation time of the interpretation generation model is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer science and artificial intelligence, and further relates to a method for predicting and interpreting a time-series graph neural network based on graph generation in the technical field of machine learning and deep learning. The present invention can be used to interpret the prediction results of a dynamic graph neural network that processes time-series graph data. Background Art

[0002] Temporal Graph Neural Networks (TGNNs) are a class of advanced technologies specifically designed to process graph-structured data that changes over time. By capturing the dynamic changes of nodes and edges in the time dimension, TGNNs can effectively handle graph-related tasks with time-varying characteristics. In recent years, TGNNs have been significantly applied in many fields. In the field of traffic prediction, TGNNs effectively predict traffic flow by capturing spatiotemporal dependencies, providing important support for urban traffic management and route planning. In the field of social network analysis, TGNNs handle dynamic interactions and information dissemination, improving the accuracy of community discovery and influence analysis. In the field of human trajectory prediction, TGNNs predict the future movement trajectory of humans, which is of great value to urban planning and public health management. Existing temporal graph neural networks can be divided into snapshot-based temporal graph neural networks and event-based temporal graph neural networks. Snapshot-based temporal graph neural networks (STGNNs) are a class of models for processing dynamic graph data, in which the dynamic graph is represented as a sequence of static graph snapshots at a series of discrete time points. Each snapshot represents the graph structure within a specific time period. The properties of nodes and edges may change over time. This method simplifies processing in the time dimension by dividing the time period. In each snapshot, the features of the nodes are aggregated using the graph convolutional network GCN (Graph Convolutional Network). After applying GCN to each snapshot in the sequence, the time series of these snapshots is processed using the recurrent neural network RNN ​​(Recurrent Neural Network). This step captures the changes in node embeddings over time, thereby aggregating information in the time dimension. The event-based temporal graph neural network regards the input as a series of event sequences S = {e1, e2, ...}. Each event Representation Node and At timestamp t i There is an interaction (edge) with edge attribute att i . Attribute att i It can be an interactive feature, or it can represent e iis an indicator of edge addition / removal. In addition, the event e i It can also involve only one node Represents node-level events (node ​​addition / deletion or node attribute change). These events S form a time-series graph G = (N, S), where S can be seen as a set of edges with timestamps and N is the set of nodes participating in S. Different time-series graph models are unified into an encoder-decoder framework. The encoder is used to learn the dynamic embedding of each node over time, and the decoder uses the node embedding for downstream prediction tasks. Specifically, let G i is the timestamp t i The graph constructed previously, that is, the graph containing the events {e1,…e i-1} but not including e i The encoder is in G i as input and obtain the node embedding Z i ,in Represents the timestamp t i Time Node n * The decoder constructs a loss function by predicting whether an interaction occurs between two nodes at a given timestamp (positive samples are Negative samples are the remaining node pairs). Therefore, the decoder uses Z i Predict the logarithm / probability of new events between any pair of nodes, compute the loss to backpropagate gradients, and update the model parameters.

[0003] Interpretability methods for graph neural networks (GNNs) can be roughly divided into two categories: non-generative methods and generative methods. Given an input instance and its prediction, non-generative methods usually use methods such as gradient, decomposition, proxy models, mask optimization, causality, greedy strategies, reinforcement learning strategies, and clustering to search for explanatory subgraphs. These methods optimize explanations one by one in the explanation phase, resulting in long inference time. In contrast, generative methods learn the distribution of potential explanatory subgraphs by pre-training a generative model on the entire dataset, thereby quickly generating explanatory subgraphs in the explanation phase and significantly reducing inference time. Existing static graph interpretation methods face significant challenges when extending to dynamic graphs, which mainly come from the dynamic changes of dynamic graphs, the complex dependencies of time series, and the nonlinear interactions of high-dimensional features. These factors together increase the difficulty of effectively and intuitively interpreting dynamic graph models.

[0004] Chen J et al. proposed a temporal motif-based interpreter in their paper “Tempme: Towards the explainability of temporal graph neural networks via motif discovery” (Neural Information Processing Systems, 2024, 36.). This method first uses a generative approach to interpret event-based temporal graph neural networks. The steps of this method are: (1) extracting temporal patterns with temporal causality and correlation; (2) combining structural features and temporal information to generate feature vectors of events; (3) obtaining embedded representations of temporal patterns through local message passing and pooling; (4) In the interpretation process, TempME assigns importance scores to each temporal pattern by finding a balance between interpretation accuracy and information compression, thereby extracting explanatory subgraphs. However, the method still has the disadvantage that it does not consider the temporal order of events when extracting temporal patterns, and it also needs to specify the number of events in the subgraph and requires users to have certain prior knowledge. Due to the need to calculate and extract temporal patterns, the time complexity of this method is high in large-scale graphs.

[0005] Xie J et al. proposed an instance-level explanation method in their paper "Explaining dynamic graph neural networks via relevance back-propagation" (arXiv preprint arXiv:2207.11175,2022.) to explain the snapshot-based temporal graph neural network method. The steps of this method are: (1) Use the selected graph snapshot dataset to train the corresponding temporal graph neural network and record the parameters and features of the hidden layer; (2) Based on the prediction results of the temporal graph neural network, use the recorded hidden layer parameters and features to calculate the score of the previous layer neurons, and iterate until the score of the input neuron is obtained, which is the relevance score of each input graph node with the prediction; (3) Select nodes with high scores to form an explanation subgraph. The disadvantage of this method is that it is based on a decomposition strategy and does not consider the interaction between nodes, so its explanation accuracy is low. This method requires knowing the internal parameters of the model and the number of nodes in the explanation, and requires a high level of knowledge. The time complexity of this method depends on the computational graph of the graph neural network, so it is not suitable for large-scale graph interpretation. Summary of the invention

[0006] The purpose of the present invention is to address the deficiencies in the above-mentioned prior art and propose a time series graph neural network prediction and interpretation method based on graph generation to solve the problems that the prior art is not versatile enough and cannot simultaneously interpret snapshot-based and event-based time series graph neural networks; does not consider the dynamic changes of the graph structure, resulting in low interpretation accuracy and inability to capture the temporal evolution and dependencies of events in dynamic graphs; requires users to have certain prior knowledge, which limits the scope of use of the method; and has high time complexity when providing explanations for large-scale graph predictions.

[0007] The technical solution to achieve the purpose of the present invention is: the present invention introduces a subgraph generation model that uses a sequence of nodes in a graph as input, so that an explanatory subgraph can be generated. This method does not rely on static snapshots or specific events, and can simultaneously interpret snapshot-based and event-based sequential graph neural networks, thereby solving the problem that the existing interpretation method cannot simultaneously provide explanations for snapshot-based and event-based sequential graph neural network predictions. The present invention uses recurrent neural networks (RNNs) to generate explanatory subgraphs to capture the dynamic changes of nodes and edges in sequential graph neural networks. RNNs capture key information in time changes through their state propagation mechanism, and due to their structural flexibility, they can adapt to input sequences of different lengths, thereby solving the problem that existing interpretation methods cannot capture the time evolution and dependencies of events in dynamic graphs and cannot be applied to large-scale graph prediction interpretation. The method of the present invention does not require users to have any prior knowledge, thereby reducing the threshold for users to use, thereby solving the problem that the existing interpretation method limits the scope of use. The graph generation process proposed by the method of the present invention only depends on the number of nodes in the graph, and the number of nodes in the graph is much smaller than the number of edges in the graph, which significantly reduces the time complexity of the interpretation. In addition, this method uses a pre-trained subgraph generation model and breadth-first search BFS (Breadth First Search) to generate a node sequence as input. In a breadth-first search tree, the connection status of a new node with an existing node only needs to consider the current node and the nodes at the same level and its parent node. These two methods effectively reduce the time complexity, thereby solving the problem of high time complexity in existing interpretation methods.

[0008] The specific implementation steps of the present invention are as follows:

[0009] Step 1: Build an explanation generation model;

[0010] Step 2, extracting a time series graph of a time period related to the prediction object from the network where the prediction object of the time series graph neural network model is located;

[0011] Step 3, using a breadth-first search algorithm, generate a sequence set consisting of a node sequence of the time series graph for each time period; the sequence sets formed by all time periods of the time series graph form a training set for pre-training;

[0012] Step 4, inputting the pre-trained training set into the explanation generation model, pre-training the model, and obtaining the pre-trained explanation generation model;

[0013] Step 5, extracting the time series graph of the time period corresponding to the predicted object in the network where the predicted object is located, and generating a subgraph of each time series graph;

[0014] Step 6, using the same breadth-first search algorithm as step 3 to obtain the training set for the second training;

[0015] Step 7, input the training set of the second training into the pre-trained explanation generation model, and further train the model to obtain a trained explanation generation model;

[0016] Step 8, using the breadth-first search algorithm to obtain the sequence set data corresponding to the subgraph of the prediction object to be explained, and inputting these data into the trained explanation generation model. The graph generated by the model is the explanation graph of the prediction object to be explained.

[0017] Compared with the prior art, the present invention has the following advantages:

[0018] First, the present invention proposes an interpretation method that uses a graph node sequence as input. The method does not rely on the data format of the input in a specific time-series graph neural network prediction, and can simultaneously interpret snapshot-based and event-based time-series graph neural network predictions. In addition, a static graph can be viewed as a graph snapshot at a certain moment, so the method is also applicable to interpreting static graph neural network predictions. This overcomes the problem that existing interpretation methods are only aimed at interpreting snapshot-based time-series graph neural network predictions or event-based time-series graph neural network predictions, and lack a general method that can simultaneously interpret these two types, which limits the scope of application of the interpretation method in practical applications, so that the present invention has the advantage of expanding the scope of application of the interpretation method.

[0019] Second, the present invention uses a recurrent neural network (RNN) to construct a generative model to capture the dynamic changes of nodes and edges in a time-series graph neural network. RNN captures key information in time changes through its state propagation mechanism, and due to its structural flexibility, it can adapt to input sequences of different lengths. This overcomes the defect that the existing methods do not consider the dynamic changes of the graph structure during the interpretation process, cannot effectively capture the time evolution and dependencies of events in the dynamic graph, and result in low interpretation accuracy, so that the present invention has the advantage of improving interpretation accuracy.

[0020] Third, the present invention uses a recurrent neural network (RNN) to construct a generative model to capture the dynamic changes of nodes and edges in a time-series graph neural network. RNN captures key information in time changes through its state propagation mechanism, and due to its structural flexibility, it can adapt to input sequences of different lengths. This method does not require the user to understand or provide any internal parameters of the model to be interpreted or the specific structure of the explanatory subgraph, such as the number of nodes and edges. The generative model can autonomously learn the distribution and patterns in the training data, which is completely data-driven rather than relying on the understanding of a specific model structure. Its powerful generalization ability reduces the reliance on user prior knowledge, greatly lowers the technical threshold, and enables non-expert users to use it effectively, so that the present invention has the advantage of enhancing the universality and practicality of the interpretation method.

[0021] Fourth, the present invention adopts a pre-trained explanation generator model and uses a breadth-first search to obtain an input graph node sequence. The pre-trained explanation generator model can speed up the model convergence speed while improving the accuracy of the explanation. In the breadth-first search tree, the connection status of the newly added node and the existing node only needs to consider the connection status of the current node with the same layer and the parent node, thereby further reducing the time complexity. It overcomes the defects of the existing explanation methods that the time complexity is high, which is not conducive to the explanation of large-scale graph predictions and limits their efficiency and practicality when processing large-scale dynamic graphs, so that the present invention has the advantage of reducing the calculation time of the explanation generation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of an embodiment of the present invention;

[0023] Figure 2 It is a structural diagram of the pre-trained explanation generation model of the present invention;

[0024] Figure 3 It is a schematic diagram of extracting a timing diagram of the current moment and the previous G moments of a prediction object according to the present invention;

[0025] Figure 4 is a schematic diagram of a timing diagram for extracting a time period related to a prediction object according to the present invention;

[0026] Figure 5 It is an example schematic diagram of using the breadth-first search algorithm of the present invention to generate a node sequence of a time sequence diagram for each time period;

[0027] FIG6( a ) is a pre-trained explanation generation model of the present invention; FIG6( b ) is a flow chart of further training the explanation generation model of the present invention;

[0028] Figure 7 is a structural diagram of the explanation generation model to be further trained in the present invention;

[0029] Figure 8 It is a schematic diagram of extracting a time sequence diagram of a time period corresponding to the prediction object in the network where the prediction object is located, and generating a sub-graph of each time sequence diagram;

[0030] Fig. 9 It is a schematic diagram of the present invention using the training set data of the second training as the input of the model to generate a complete graph. DETAILED DESCRIPTION

[0031] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0032] Reference Figure 2 , the explanation generation model of the present invention is further described in detail.

[0033] The structure of the explanation generation model is composed of a first linear layer, a first ReLU activation layer, a first GRU layer, a second GRU layer, a third GRU layer, a fourth GRU layer, a second linear layer, a second ReLU activation layer, a third linear layer, a fifth GRU layer, a sixth GRU layer, a seventh GRU layer, an eighth GRU layer, a third ReLU activation layer, and a fourth linear layer connected in series.

[0034] The parameters of the explanation generation model are set as follows: the first and second activation layers are implemented using the ReLU activation function; the input size of the first to fourth GRU layers is set to 64 dimensions, the hidden layer size is set to 128 dimensions, and the output layer size is set to 16 dimensions; the input size of the fifth to eighth GRU layers is set to 1 dimension, and the hidden layer size is set to 16 dimensions. The dimension of the input layer is the same as the dimension of the output layer, and its value is a hyperparameter. In the explanation generation model, the output of the linear layer 3 is used as the hidden layer parameter of the GRU layer 5, in order to provide encoded graph information to improve the accuracy of predicting the corresponding connection relationship between the newly added nodes and the existing nodes in the graph.

[0035] Reference Figure 3 and Figure 4 , a further detailed description is given of extracting the timing diagram of the current moment and the previous G moments of the prediction object and extracting the timing diagram of the time period related to the prediction object.

[0036] Step 2: extract the time series graph of the time period related to the prediction object from the network where the prediction object of the time series graph neural network model is located.

[0037] For the prediction explanation of the snapshot-based time series graph neural network model, extract the time series graph of G moments before the current moment of the prediction object, such as Figure 3As shown, G is limited by available computing resources. The process of extracting the timing graph is as follows: obtain the time information T1 of the current prediction object, retain the edges and related nodes in the graph that exist at time T1, that is, obtain the timing graph of G moments before the current moment of the prediction object, repeat the above process to obtain the previous G-1, G-2, ..., 1 moments until the G moment, obtain G graphs, that is, obtain the timing graph of G moments before the current moment of the prediction object.

[0038] For the prediction explanation of the event-based time series graph neural network model, the time series graph of the prediction object at the current moment is extracted, such as Figure 4 The process of extracting the timing diagram is as follows: obtaining the time information T1 of the current prediction object, retaining the edges and related nodes existing at time T1 in the diagram, and obtaining the timing diagram of the prediction object at the current time.

[0039] Step 3, using a breadth-first search algorithm, generate a sequence set consisting of a node sequence of the time series graph for each time period; the sequence sets formed by all time periods of the time series graph form a training set for pre-training.

[0040] Reference Figure 5 , a further detailed description is given of the sequence set consisting of a node sequence that generates the timing graph for each time period using the breadth-first search algorithm.

[0041] The breadth-first search algorithm refers to performing the following operations on each time period in the timing diagram:

[0042] In the first step, a node is randomly selected as the starting point of the search.

[0043] The second step is to add the starting point node to the queue and mark it as visited.

[0044] The third step is to select nodes from the time periods in the searched time series graph in turn, check all unvisited neighbor nodes of the selected node, and add these neighbor nodes to the queue in turn, and mark them as visited; repeat this process until the queue is empty, complete the breadth-first search process of all nodes in the entire graph, and finally obtain a sequence of node access order. The breadth-first search algorithm is used because, in the sequence obtained by the breadth-first search, the connection status of the newly added node and the existing node only needs to consider the connection relationship between the newly added node and the node at the same layer and its parent node in the breadth-first search number, avoiding the need to consider the connection relationship between the newly added node and all previous nodes, thereby reducing the time complexity of the calculation.

[0045] The fourth step is to start from the first node 1 of the sequence and process each node in the sequence one by one. For each node, record its connection relationship with the previous 10 nodes. If there is a connection relationship with the previous node, the corresponding position is marked as 1, otherwise it is marked as 0. The connection relationship of each node is formed into a separate sequence. The position with the corresponding value of 1 in the sequence is replaced with the weight of the corresponding connection relationship. The sequences of all nodes are combined to form a sequence set. Here, the hyperparameter value of controlling the input layer dimension is 10.

[0046] Step 4: Input the pre-trained training set into the explanation generation model, pre-train the model, and obtain the pre-trained explanation generation model.

[0047] Referring to Figure 6(a) and Figure 7 , the pre-trained explanation generation model of the present invention is further described in detail.

[0048] The steps for pre-training the model are as follows:

[0049] In the first step, unlike the constructed explanation generation model, the input dimension of the fifth to eighth GRU layers of the pre-trained explanation generation model is 64 dimensions. The many-to-many mode GRU layer is used to input the pre-trained training set into the explanation generation model. The model outputs a set of sequences, each sequence represents the connection relationship between a node and its previous node, and a complete graph is generated based on each node and its corresponding connection relationship.

[0050] In the second step, the loss between the graph generated in the first step and the time series graph extracted from the network where the prediction object of the time series graph neural network model is located is calculated; through the back propagation algorithm, the recurrent layer parameters of the two recurrent neural network models are iteratively updated until the loss function of the explanation generation model converges, and the pre-trained explanation generation model is obtained, so that the explanation generation model can generate a graph with a topological structure similar to the extracted time series graph. The purpose of training is to enable the pre-trained explanation generation model to capture the structure of the input graph.

[0051] The model loss function is as follows:

[0052]

[0053] Among them, MMD 2 (·) represents the difference between two probability distributions p and q, p and q represent the probability distributions of the degrees of two different nodes in the graph, E represents the expected value operation, x1 and y1 represent samples independently randomly drawn from probability distribution p, x2 and y2 represent samples independently randomly drawn from probability distribution q, x3 and y3 represent samples independently randomly drawn from distributions p and q, respectively, k(·) represents the kernel function, and the values ​​of x1, y1, x2, y2, x3, and y3 are different.

[0054] Step 5: extract the time series graph of the time period corresponding to the prediction object in the network where the prediction object is located, and generate a subgraph of each time series graph.

[0055] Reference Figure 8 , the present invention extracts the time sequence diagram of the time period corresponding to the prediction object in the network where the prediction object is located, and generates a sub-graph of each time sequence diagram, which is further described in detail.

[0056] The steps of generating each subgraph of the timing diagram are as follows:

[0057] The first step is to extract the neighboring nodes directly connected to the two nodes related to the predicted object.

[0058] The second step is to obtain the direct neighbor nodes of each node from all neighbor nodes, and form a subgraph of the time-series graph with all nodes and their corresponding connection relationships. Here, only the two-hop neighbor nodes of the node are taken. The range of the obtained neighbor nodes is determined by the number of layers of the time-series graph neural network model. This is because the contextual information that each layer of the model can capture is limited to the node relationships within the range of this layer, so the number of obtained neighbor nodes corresponds to the number of layers of the model.

[0059] Step 6: Use the same breadth-first search algorithm as step 3 to obtain the training set for the second training.

[0060] The breadth-first search algorithm refers to performing the following operations on each time period in the timing diagram:

[0061] In the first step, a node is randomly selected as the starting point of the search.

[0062] The second step is to add the starting point node to the queue and mark it as visited.

[0063] The third step is to select nodes from the time periods in the searched timing graph in turn, check all unvisited neighbor nodes of the selected node, and add these neighbor nodes to the queue in turn, and mark them as visited; repeat this process until the queue is empty, completing the breadth-first search process of all nodes in the entire graph, and finally obtaining a sequence of node access order.

[0064] The fourth step is to start from the first node of the sequence and process each node in the sequence one by one. For each node, record its connection relationship with all previous nodes, form the connection relationship of each node into a separate sequence, and combine the sequences of all nodes together to form a sequence set.

[0065] Step 7: The parameters of the further trained explanation generation model are completely consistent with the parameters of the pre-trained explanation generation model. The parameters of the pre-trained explanation generation model are used to initialize the parameters of the further trained explanation generation model to accelerate the convergence of the model. The training set of the second training is input into the explanation generation model to be further trained, and the model is further trained to obtain a trained explanation generation model.

[0066] Referring to Figure 6(b) and Fig. 9 , the further training explanation generation model of the present invention is further described in detail.

[0067] The steps for further training the model are as follows:

[0068] In the first step, the training set data of the second training is used as the input of the model. In this example, each sequence of the input only retains the connection relationship between the newly added nodes and the previously existing nodes, and deletes the connection relationship with the nodes that have not yet appeared. The output of the upper layer is the output of the fourth GRU layer, which is used to initialize the hidden layer parameters of the fifth GRU layer. A value between 0 and 1 is randomly initialized as the input of the fifth to eighth GRU layers of the model. The output of the lower layer is the final output of the explanation generation model, which is a set of sequences. Each sequence represents the connection relationship between a node and its previous node. According to each node and its corresponding connection relationship, a complete graph is generated, and a point multiplication operation is performed with the time series graph subgraph obtained in step five to ensure that the edges that do not appear in the original time series graph subgraph do not appear in the generated graph.

[0069] The second step is to calculate the loss between the prediction results of the temporal graph neural network model for the temporal graph subgraph and the prediction results of the graph output by the explanation generation model, and iteratively update the parameters of the explanation generation model until the model loss function converges to obtain the trained explanation generation model; this training model is to adjust the model. In this process, the model will gradually discard unimportant nodes in the subgraph and only retain the nodes most relevant to the prediction results.

[0070] The model loss function is as follows:

[0071]

[0072] Wherein, L(·) represents the loss function, M represents the adjacency matrix of the second step generated graph in claim 8, X represents the matrix composed of the features of the nodes in the generated graph, Y represents the prediction result of the time series graph subgraph, CrossEntropy represents the cross entropy loss function, Indicates that M and X are input into the time series graph neural network model The prediction result, |M| represents the square root of the sum of the squares of all elements in the adjacency matrix M, and λ represents the weight of the regularization term ∑|M|.

[0073] Step 8, using the breadth-first search algorithm to obtain the sequence set data corresponding to the subgraph of the prediction object to be explained, and inputting these data into the trained explanation generation model. The graph generated by the model is the explanation graph of the prediction object to be explained.

[0074] The breadth-first search algorithm refers to performing the following operations on each time period in the timing diagram:

[0075] In the first step, a node is randomly selected as the starting point of the search.

[0076] The second step is to add the starting point node to the queue and mark it as visited.

[0077] The third step is to select nodes from the time periods in the searched timing graph in turn, check all unvisited neighbor nodes of the selected node, and add these neighbor nodes to the queue in turn, and mark them as visited; repeat this process until the queue is empty, completing the breadth-first search process of all nodes in the entire graph, and finally obtaining a sequence of node access order.

[0078] The fourth step is to start from the first node of the sequence and process each node in the sequence one by one. For each node, record its connection relationship with all previous nodes, form the connection relationship of each node into a separate sequence, and combine the sequences of all nodes together to form a sequence set.

Claims

1. A prediction and interpretation method for a time series graph neural network model based on graph generation, characterized in that: The breadth-first search algorithm is used to generate training sets for pre-training and secondary training respectively, and the constructed explanation generation model is trained twice; the trained generation model is used to generate an explanation graph; the steps of the prediction and explanation method include the following: Step 1: Build an explanation generation model; Step 2, extracting a time series graph of a time period related to the prediction object from the network where the prediction object of the time series graph neural network model is located; Step 3, using a breadth-first search algorithm, generate a sequence set consisting of a node sequence of the time series graph for each time period; the sequence sets formed by all time periods of the time series graph form a training set for pre-training; Step 4, inputting the pre-trained training set into the explanation generation model, pre-training the model, and obtaining the pre-trained explanation generation model; Step 5, extracting the time series graph of the time period corresponding to the predicted object in the network where the predicted object is located, and generating a subgraph of each time series graph; Step 6, using the same breadth-first search algorithm as step 3 to obtain the training set for the second training; Step 7, input the training set of the second training into the pre-trained explanation generation model, and further train the model to obtain a trained explanation generation model; Step 8, using the breadth-first search algorithm to obtain the sequence set data corresponding to the subgraph of the prediction object to be explained, and inputting these data into the trained explanation generation model. The graph generated by the model is the explanation graph of the prediction object to be explained.

2. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 1, characterized in that: The structure of the explanation generation model described in step 1 is composed of a first linear layer, a first ReLU activation layer, a first GRU layer, a second GRU layer, a third GRU layer, a fourth GRU layer, a second linear layer, a second ReLU activation layer, a third linear layer, a fifth GRU layer, a sixth GRU layer, a seventh GRU layer, an eighth GRU layer, a third ReLU activation layer, and a fourth linear layer connected in series in sequence; the first and second activation layers are implemented using the ReLU activation function; the input size of the first to fourth GRU layers is set to 64 dimensions, the hidden layer size is set to 128 dimensions, and the output layer size is set to 16 dimensions; the input size of the fifth to eighth GRU layers is set to 1 dimension, the hidden layer size is set to 16 dimensions, and the output layer size is a hyperparameter.

3. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 1, characterized in that: The time series diagram of extracting the time period related to the prediction object in step 2 refers to: A. For the prediction explanation of snapshot-based time series graph neural network model, extract the time series graph of the current moment and the previous G moments of the prediction object, where G is limited by the available computing resources; B. For the prediction explanation of the event-based time series graph neural network model, extract the time series graph of the prediction object at the current moment.

4. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 1, characterized in that: The breadth-first search algorithm described in step 3, step 6, and step 8 refers to performing the following operations on each time period in the timing diagram: The first step is to randomly select a node as the starting point of the search; The second step is to add the starting point node to the queue and mark it as visited; The third step is to select nodes from the time period in the searched timing graph in turn, check all unvisited neighbor nodes of the selected node, and add these neighbor nodes to the queue in turn, and mark them as visited; repeat this process until the queue is empty, completing the breadth-first search process of all nodes in the entire graph, and finally obtaining a sequence of node access order; The fourth step is to start from the first node of the sequence and process each node in the sequence one by one. For each node, record its connection relationship with all previous nodes, form the connection relationship of each node into a separate sequence, and combine the sequences of all nodes together to form a sequence set.

5. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 1, characterized in that: The steps for pre-training the model described in step 4 are as follows: In the first step, the input size of the fifth to eighth GRU layers is modified to 64 dimensions. The many-to-many GRU layer is used. The pre-trained training set is input into the explanation generation model. The model outputs a set of sequences, each of which represents the connection relationship between a node and its previous node. A complete graph is generated based on each node and its corresponding connection relationship. In the second step, the loss between the graph generated in the first step and the time series graph extracted from the network where the prediction object of the time series graph neural network model is located is calculated; through the back propagation algorithm, the recurrent layer parameters of the two recurrent neural network models are iteratively updated until the loss function of the explanation generation model converges, and the pre-trained explanation generation model is obtained, so that the explanation generation model can generate a graph with a topological structure similar to the extracted time series graph.

6. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 5, characterized in that: The model loss function is as follows: Among them, MMD 2 (·) represents the difference between two probability distributions p and q, p and q represent the probability distributions of the degrees of two different nodes in the graph, E represents the expected value operation, x1 and y1 represent samples independently randomly drawn from the probability distribution p, x2 and y2 represent samples independently randomly drawn from the probability distribution q, x3 and y3 represent samples independently randomly drawn from the distributions p and q, respectively, and k(·) represents the kernel function.

7. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 1, characterized in that: The steps for generating each subgraph of the timing diagram described in step 5 are as follows: The first step is to extract the neighboring nodes directly connected to each predicted object from each predicted object; In the second step, starting from all neighbor nodes, obtain the direct neighbor nodes of each node, and continue to iterate this process until all neighbor nodes in the layers of the time-series graph neural network model are obtained, and all nodes and their corresponding connection relationships constitute a subgraph of the time-series graph.

8. The method for predicting and explaining a time series graph neural network model based on graph generation according to claim 1, characterized in that: In step 7, the training set of the second training is input into the pre-trained explanation generation model, and the steps for further training the model are as follows: In the first step, the training set data of the second training is used as the input of the model, and a value between 0 and 1 is randomly initialized as the input of the fifth to eighth GRU layers of the model. The model outputs a set of sequences, each of which represents the connection relationship between a node and its previous node. A complete graph is generated based on each node and its corresponding connection relationship. The second step is to calculate the loss between the prediction results of the temporal graph neural network model for the temporal graph subgraph and the prediction results of the graph output by the explanation generation model, and iteratively update the parameters of the explanation generation model until the model loss function converges to obtain the trained explanation generation model; this training model is to adjust the model. In this process, the model will gradually discard unimportant nodes in the subgraph and only retain the nodes most relevant to the prediction results.

9. The method for predicting and interpreting a time series graph neural network model based on graph generation according to claim 8, characterized in that: The model loss function is as follows: Wherein, L(·) represents the loss function, M represents the adjacency matrix of the second step generated graph in claim 8, X represents the matrix composed of the features of the nodes in the generated graph, Y represents the prediction result of the time series graph subgraph, CrossEntropy represents the cross entropy loss function, Indicates that M and X are input into the time series graph neural network model The prediction result, |M| represents the square root of the sum of the squares of all elements in the adjacency matrix M, and λ represents the weight of the regularization term ∑|M|.

Citation Information

Cited By

  • Parallelization motif transfer mode identification method and system in large-scale sequence diagram

    CN120067652A