Graph neural network simplified interpretation method based on proxy model
Through the simplified interpretation method of graph neural network based on proxy model, the aggregation segmentation and loss function optimization, the problem of graph neural network interpretation on large-scale graph datasets is solved, the transparency and trust of the model are improved, and the efficient interpretation process is achieved. .
Patent Information
- Application Number
- CN202410989285.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
AI Technical Summary
When faced with large-scale graph datasets, it is difficult for the existing technology to train an interpreted model, which makes the black box characteristics of graph neural networks difficult to understand the model decision process and lacks transparency and trust.
Using the simplified interpretation method of graph neural network based on proxy model, preprocessing and critical evaluation of large images through the aggregation and segmentation model to form small images, and training the graph neural network model and interpretation model on small images, and using loss function optimization The category prediction and the consistency of the large image indirectly explain the large image.
The training time of the interpretation model on large-scale graph datasets is significantly reduced, and the efficiency and interpretability of interpretation is improved, ensuring the reliability and quality of interpretation.
Smart Images

Figure CN118940815A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of graph neural network interpretation and segmentation aggregation, and specifically relates to a simplified interpretation method of graph neural network based on an agent model. Background Art
[0002] Graph Neural Networks (GNNs) are a type of deep learning model specifically designed for processing graph-structured data. In many fields, such as social network analysis, bioinformatics, recommendation systems, and knowledge graphs, data often exists in the form of graphs, where nodes represent entities and edges represent relationships between entities. A social network is a collection of individuals or organizations that are interconnected through various social relationships, where nodes usually represent individuals and edges represent relationships. Social network analysis (SNA) studies network structure and dynamics, including centrality, community detection, network evolution, etc. It is widely used in social media, business networks, biological networks, and other fields, facing challenges such as large-scale data processing and privacy protection. Traditional neural network models such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) are not directly applicable to social network graph data because they mainly process regular Euclidean data structures such as image grids and time series.
[0003] GNN can capture the complex dependencies between nodes by performing convolution operations on the social network graph structure. Such models usually include message passing or aggregation strategies, and nodes can update their feature representations based on the characteristics of neighboring nodes and the characteristics of edges. Although GNN models have shown excellent performance on multiple tasks, their black box characteristics make the decision-making process of the model difficult to understand. Explanatory models can reveal the working mechanism of the model, such as the importance of node level and the influence of edges, thereby improving the transparency and trust of the model.
[0004] However, when faced with large-scale graph datasets, it is difficult to train an explanation model due to the high complexity of large-scale graph datasets. Summary of the invention
[0005] In order to solve the above problems in the prior art, the present invention adopts a simplified interpretation method of a graph neural network based on a proxy model, comprising:
[0006] Acquire large-scale graph structure data of social networks, input the large-scale graph structure data of social networks into a trained simplified interpretation model of graph neural network, and obtain an interpretation subgraph; the simplified interpretation model of graph neural network includes: an aggregation segmentation model, a graph neural network model, and an interpretation model;
[0007] The training process of the simplified explanatory model of the graph neural network includes: obtaining a large graph structure dataset of a social network, i.e., a large graph; inputting the large graph into a trained aggregation and segmentation model to obtain a small graph; inputting the small graph into a trained graph neural network model to obtain a predicted value; and using the trained graph neural network model, the small graph, and the predicted value of the small graph on the trained graph neural network model to train the explanatory model to obtain a trained explanatory model.
[0008] The aggregation and segmentation model processes the large graph by: preprocessing the large graph, performing key evaluation on the preprocessed large graph to obtain centrality indicators of nodes and edges, and aggregating and segmenting the preprocessed large graph according to the centrality indicators of nodes and edges to obtain a small graph.
[0009] Preprocessing of large graphs includes removing noise, irrelevant data, isolated nodes, and inconsistent edges in the large graphs.
[0010] Aggregating and segmenting the preprocessed large graph includes: setting a learnable node threshold and an edge threshold, removing nodes whose centrality index in the preprocessed large graph is less than the node threshold, and removing edges whose centrality index in the preprocessed large graph is less than the edge threshold, to obtain a small graph.
[0011] The key evaluation of the preprocessed large graph includes: calculating the degree centrality of the node Betweenness Centrality and closeness centrality use and Comprehensively evaluate the criticality of node v and obtain the centrality index of node v; calculate the betweenness centrality of the edge and use the betweenness centrality of the edge as the centrality index of the edge.
[0012] The training process of the aggregation and segmentation model and the graph neural network model includes: inputting the large image into the aggregation and segmentation model to obtain a small image; inputting the small image and the large image into the graph neural network model respectively to obtain the prediction values of the small image and the large image; calculating the loss function value according to the prediction values of the small image and the large image, and updating the parameters of the aggregation and segmentation model and the graph neural network model according to the loss function value. When the loss function value is minimized, the model training is completed to obtain the trained aggregation and segmentation model and graph neural network model.
[0013] The total loss function is:
[0014]
[0015] Among them, M is the total number of nodes in the small graph, C is the total number of categories, and y ij is the true label, indicating whether the i-th sample belongs to the j-th category. is the predicted value of the small image, indicating the probability that the i-th sample belongs to the j-th category. Represents the prediction vector of the large image, represents the probability that the i-th sample belongs to the j-th category, Represents the prediction vector of the small image.
[0016] The graph neural network model is a graph convolutional network model, which includes four graph convolutional layers and one fully connected layer.
[0017] Each graph convolutional layer is followed by a Dropout layer.
[0018] The explanation model is GNNExplainer; GNNExplainer is a graph neural network interpreter.
[0019] Beneficial effects:
[0020] 1. The present invention forms a small graph by applying a segmentation and aggregation algorithm to a large graph, uses the small graph to fit the large graph when training the graph neural network, and further uses an explanatory model on the small graph to indirectly explain the large graph, which greatly reduces the training time of the existing explanatory model applied to large-scale graph data sets while ensuring the quality of the explanation, and improves the efficiency and interpretability of the explanation; 2. The present invention performs a criticality assessment on the edges and points in the large graph, and segments the large graph according to the criticality assessment results of the edges and points, thereby enhancing the representativeness of the small graph, thereby better applying the interpretable model on the small graph; 3. The present invention combines the loss of classification and large graph prediction consistency, and the loss function can simultaneously optimize the performance of the small graph in category prediction and consistency with the large graph prediction results, so that the small graph can more comprehensively fit the behavior of the large graph, thereby ensuring the reliability of the explanation. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a simplified interpretation method of a graph neural network based on an agent model provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] like Figure 1 As shown, the present invention adopts a simplified interpretation method of a graph neural network based on a proxy model, comprising:
[0024] Acquire large-scale graph structure data of social networks, input the large-scale graph structure data of social networks into a trained simplified interpretation model of graph neural network, and obtain an interpretation subgraph; the simplified interpretation model of graph neural network includes: an aggregation segmentation model, a graph neural network model, and an interpretation model;
[0025] The training process of the graph neural network simplified explanation model includes: obtaining a large graph structure dataset of social networks, i.e., a large graph The big picture Input the trained aggregation and segmentation model to obtain a small image; input the small image into the trained graph neural network model to obtain a predicted value; use the trained graph neural network model, the small image, and the predicted value of the small image on the trained graph neural network model to train the explanation model to obtain a trained explanation model.
[0026] A social network is a collection of individuals or organizations that are connected to each other through various social relationships. The nodes represent individuals, and the edges represent the relationships between individuals.
[0027] In one embodiment, the individual is a user, and the data of the user individual includes the user's personal information, behavior records, social relationships, etc.
[0028] The aggregation and segmentation model processes the large graph by: preprocessing the large graph, performing key evaluation on the preprocessed large graph to obtain centrality indicators of nodes and edges, and aggregating and segmenting the preprocessed large graph according to the centrality indicators of nodes and edges to obtain a small graph.
[0029] Preprocessing of large images includes: first Perform data cleaning to remove noise and irrelevant data in the graph to improve the accuracy and efficiency of subsequent aggregation and segmentation steps; remove isolated nodes. An isolated node v refers to a node that has no edges connected to it. Mathematically, for a node v, when the node degree deg(v) = 0, it is considered an isolated node; clear inconsistent edges. Inconsistent edges refer to duplicate edges, self-loops, or edges with abnormal weights in the graph. If the two nodes connected by edge e are the same node (e = (v, v)), then it is a self-loop and should be removed.
[0030] The key evaluation of the preprocessed large graph includes: calculating the degree centrality of the node Betweenness Centrality and closeness centrality use and Comprehensively evaluate the criticality of node v and obtain the centrality index of node v; calculate the betweenness centrality of the edge and use the betweenness centrality of the edge as the centrality index of the edge.
[0031] Degree centrality reflects the number of direct connections between a node and other nodes; for node v, degree centrality is expressed as: Where N represents the number of nodes in the preprocessed large graph. Betweenness centrality refers to the ratio of the number of paths passing through node v among all shortest paths, which reflects the "bridge" role of the node in the network; for node v, betweenness centrality is expressed as: Among them, σ st is the number of all shortest paths from node s to node t, σ st (v) is the number of shortest paths passing through node v. Closeness centrality reflects the average distance from a node to all other nodes in the graph; for node v, closeness centrality is expressed as: d(v,u) represents the distance between node v and node u;
[0032] After normalization and comprehensive processing, for node v, the centrality index C is obtained combined (v):
[0033]
[0034] Among them, γ, δ, and ε are weights.
[0035] For edge criticality evaluation, if the preprocessed large graph is a weighted graph, each edge e can be evaluated by w(e). If it is not a weighted graph, it is evaluated by edge betweenness centrality. For edge e, its edge betweenness centrality is expressed as: σ st (e) represents the number of shortest paths passing through edge e.
[0036] Aggregating and segmenting the preprocessed large graph includes: setting a learnable node threshold and an edge threshold, removing nodes whose centrality index in the preprocessed large graph is less than the node threshold, and removing edges whose centrality index in the preprocessed large graph is less than the edge threshold, to obtain a small graph.
[0037] The training process of the aggregation and segmentation model and the graph neural network model includes: inputting the large image into the aggregation and segmentation model to obtain a small image; inputting the small image and the large image into the graph neural network model respectively to obtain the prediction values of the small image and the large image; calculating the loss function value according to the prediction values of the small image and the large image, and updating the parameters of the aggregation and segmentation model and the graph neural network model according to the loss function value. When the loss function value is minimized, the model training is completed to obtain the trained aggregation and segmentation model and graph neural network model.
[0038] The graph neural network model is a model based on the graph convolutional network (GCN), which is specially designed to process graph structure data. The model contains four graph convolutional layers GCNConv and one fully connected layer for classification tasks. The operation of each GCNConv layer can be expressed as: in is the adjacency matrix with self-connection added, I is the identity matrix, yes The degree matrix, W (l) is the weight matrix of layer l, H (l) is the feature representation of layer l, ReLU is the activation function, which is expressed as ReLU(x)=max(0,x), where x is the input of the activation function.
[0039] There is a Dropout layer after each ReLU activation function, and the Dropout rate is set to 0.5. Dropout can reduce the risk of overfitting of the model. The Dropout operation can be expressed by this mathematical formula: In practice, in order to keep the expected activation value unchanged, the activation value after the Dropout operation is usually scaled. Therefore, the Dropout operation can be further expressed as: in, is the output of neuron i, is the output of the Dropout layer, d i is a random variable with a probability of 1-p. In the model of the present invention, the Dropout rate is set to 0.5, which can enhance the generalization ability. Discarding half of the activation units forces the network to not rely on any single feature, because any feature may be randomly discarded during the training process. This forces the network to learn more feature expressions, thereby improving the performance of the model on new data that has not been seen.
[0040] The total loss function is:
[0041]
[0042] Among them, M is the total number of nodes in the small graph, C is the total number of categories, and the categories of user interests include: sports, music, technology, etc., y ij is the true label, indicating whether the i-th sample belongs to the j-th category. is the predicted value of the small image, indicating the probability that the i-th sample belongs to the j-th category. Represents the prediction vector of the large image, represents the probability that the i-th sample belongs to the j-th category, represents the prediction vector of the small image, It represents the probability that the i-th sample belongs to the j-th category.
[0043] The explanation model can be GNNExplainer (graph neural network interpreter) and PGExplainer. The generation process of the explanation subgraph of GNNexplainer is realized by optimizing an objective function, which aims to maximize the mutual information between the prediction value of GNN and the subgraph structure distribution; PGExplainer uses a generative probability model to generate the explanation subgraph, and the final optimization goal of PGExplainer is to maximize the mutual information between the explanation subgraph and the GNN prediction, while minimizing the complexity of the explanation subgraph.
[0044] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A simplified interpretation method of graph neural network based on agent model, characterized in that: include: Obtain large-scale graph structure data of social networks, input the large-scale graph structure data of social networks into the trained graph neural network simplified interpretation model, and obtain the interpretation subgraph; The simplified interpretation model of the graph neural network includes: an aggregation segmentation model, a graph neural network model and an interpretation model; The training process of the simplified explanatory model of the graph neural network includes: obtaining a large graph structure dataset of a social network, i.e., a large graph; inputting the large graph into a trained aggregation and segmentation model to obtain a small graph; inputting the small graph into a trained graph neural network model to obtain a predicted value; and using the trained graph neural network model, the small graph, and the predicted value of the small graph on the trained graph neural network model to train the explanatory model to obtain a trained explanatory model.
2. According to the simplified interpretation method of graph neural network based on proxy model in claim 1, it is characterized in that: The aggregation and segmentation model processes the large graph by: preprocessing the large graph, performing key evaluation on the preprocessed large graph to obtain centrality indicators of nodes and edges, and aggregating and segmenting the preprocessed large graph according to the centrality indicators of nodes and edges to obtain a small graph.
3. The simplified interpretation method of graph neural network based on proxy model according to claim 2 is characterized in that: Preprocessing of large graphs includes removing noise, irrelevant data, isolated nodes, and inconsistent edges in the large graphs.
4. The simplified interpretation method of graph neural network based on proxy model according to claim 2, characterized in that: Aggregating and segmenting the preprocessed large graph includes: setting a learnable node threshold and an edge threshold, removing nodes whose centrality index in the preprocessed large graph is less than the node threshold, and removing edges whose centrality index in the preprocessed large graph is less than the edge threshold, to obtain a small graph.
5. The simplified interpretation method of graph neural network based on proxy model according to claim 2, characterized in that: The key evaluation of the preprocessed large graph includes: calculating the degree centrality of the node Betweenness Centrality and closeness centrality use and Comprehensively evaluate the criticality of node v and obtain the centrality index of node v; calculate the betweenness centrality of the edge and use the betweenness centrality of the edge as the centrality index of the edge.
6. The simplified interpretation method of graph neural network based on proxy model according to claim 1, characterized in that: The training process of the aggregation and segmentation model and the graph neural network model includes: inputting the large image into the aggregation and segmentation model to obtain a small image; inputting the small image and the large image into the graph neural network model respectively to obtain the prediction values of the small image and the large image; calculating the loss function value according to the prediction values of the small image and the large image, and updating the parameters of the aggregation and segmentation model and the graph neural network model according to the loss function value. When the loss function value is minimized, the model training is completed to obtain the trained aggregation and segmentation model and graph neural network model.
7. The simplified interpretation method of graph neural network based on proxy model according to claim 6 is characterized in that: The loss function totalloss is: Among them, M is the total number of nodes in the small graph, C is the total number of categories, and y ij is the true label, indicating whether the i-th sample belongs to the j-th category. is the predicted value of the small image, indicating the probability that the i-th sample belongs to the j-th category. Represents the prediction vector of the large image, represents the probability that the i-th sample belongs to the j-th category, Represents the prediction vector of the small image.
8. The simplified interpretation method of graph neural network based on proxy model according to claim 1, characterized in that: The graph neural network model is a graph convolutional network model, which includes four graph convolutional layers and one fully connected layer.
9. The simplified interpretation method of graph neural network based on proxy model according to claim 8, characterized in that: Each graph convolutional layer is followed by a Dropout layer.
10. The simplified interpretation method of graph neural network based on proxy model according to claim 1, characterized in that: The explanation model is GNNExplainer; GNNExplainer is a graph neural network interpreter.
Citation Information
Cited By
Software supply chain risk monitoring and early warning method and device
CN119939607A
