A Graph Neural Network Weighted Convolution Method Based on Node Importance
By constructing the node importance matrix and using this matrix in graph convolution operations, the problem of inability to distinguish the importance of different neighbor nodes in graph data in the prior art is solved, and a more efficient graph convolution learning effect is achieved.
Patent Information
- Application Number
- CN202210267509.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-03-17
AI Technical Summary
When processing graph data, existing graph convolutional neural networks cannot effectively distinguish the importance of different neighbor nodes, resulting in the inability to pay attention to the feature information of important neighbor nodes during the learning process.
By constructing a node importance matrix, the node's degree and efficiency are used to distinguish the importance of neighboring nodes, and the matrix is used in convolution operations to adjust the calculation of the convolution formula.
Different allocation of neighbor node weights in graph convolution operations is realized, so that the graph convolution network can pay more effectively to the feature information of important neighbor nodes, thereby improving prediction accuracy.
Smart Images

Figure CN114781584B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of deep learning, and particularly relates to a graph neural network weighted convolution method based on node importance. Background Art
[0002] In recent years, convolutional neural networks have developed rapidly and attracted wide attention due to their powerful modeling capabilities. Compared with traditional methods, the advent of convolutional neural networks has brought new solutions to fields such as image processing and natural language processing, such as machine translation, image recognition, and speech recognition.
[0003] Traditional convolutional neural networks can only process Euclidean space data, such as images, texts, and speeches, and these Euclidean data all have translational invariance. For example, image data, a picture can be represented as a set of regularly scattered pixel points in Euclidean space, and translational invariance means that taking any pixel point as the center, the same-sized local structure can be obtained. Based on this, convolutional neural networks model local connections by learning convolutional kernels shared at each pixel point, and then learn rich hidden layer representations for pictures.
[0004] However, a type of non-Euclidean space data: graph data, has gradually attracted attention due to its widespread existence. Graph data can naturally represent data structures in real life, such as traffic networks, the World Wide Web, and social networks. Different from image and text data, the local structures of each node in graph data are different, which makes translational invariance no longer satisfied. Therefore, defining a convolutional neural network on graph data has become a challenging problem. Since this problem was proposed, it has received extensive attention from researchers. At present, although good progress has been made in the research on graph convolution, the problem of the importance degree of neighbor nodes has not been considered from the network structure. Summary of the Invention
[0005] Aiming at the problem of translational invariance caused by the different local structures of each node in current graph data, the present invention provides a graph neural network weighted convolution method based on node importance.
[0006] The present invention constructs a weighted graph convolution neural network model based on the GCN network, constructs a node importance matrix by using the degree of nodes and the efficiency of nodes in the network, so as to distinguish the importance degree of neighbor nodes, and enables the graph network to pay attention to the feature information of these important neighbor nodes during the learning process.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A graph neural network weighted convolution method based on node importance, comprising the following steps:
[0009] Step 1, construct an undirected graph without self-loops;
[0010] Step 2: Calculate each node v through the adjacency matrix i Degree D i ; The degree of a node in a network refers to the number of nodes directly connected to the node. The larger the degree, the greater the importance contribution of the node to its neighboring nodes.
[0011] Step 3: Construct the node importance contribution matrix H IC ;
[0012] Step 4: Calculate node efficiency I s ;
[0013] Step 5: Construct the node importance evaluation matrix H E ;
[0014] Step 6, normalize the node importance matrix;
[0015] Step 7: Calculate the convolution formula according to the node importance matrix to complete the weighted convolution of the graph neural network.
[0016] Furthermore, the specific method of constructing an undirected graph G without self-loops in step 1 is as follows: G = {V, E, A} represents an undirected graph without self-loops, where v = {v1, v2, ..., v n} represents the set of all nodes, E = {e1, e2, ..., e m} represents the set of edges between nodes in an undirected graph, and A represents the adjacency matrix, which has a value of 1 only when there is an edge between two nodes in an undirected graph.
[0017] Furthermore, the step 3 constructs the node importance contribution matrix H IC The specific method is:
[0018] The number of nodes is n, and for node v i The contribution value of its own importance is a neighboring node. The importance contribution ratio of all nodes to their neighboring nodes is expressed in a matrix to form the node importance contribution matrix H IC :
[0019]
[0020] Among them, D i Represents node v i degree, i = 1, 2, ... n, D i / k 2 Represents node v i The contribution value of its own importance, k represents the average value, δ ij represents the contribution allocation parameter;
[0021] Node importance contribution matrix H IC It has the same structure as the adjacency matrix and is a mapping of the network adjacency matrix. The mapping rule is as follows:
[0022]
[0023] When v i and v j are directly connected, the value is 1; otherwise, the value is 0. The elements on the diagonal of the matrix are 1, indicating that the proportion of the node's importance contribution to itself is 1.
[0024] Furthermore, the specific method for calculating the node efficiency I s in step 4 is as follows: The efficiency I s of a node,
[0025] where N represents the number of nodes, and d si represents the distance between node v s and node v i . The node distance refers to the number of edges on the shortest path between two nodes. If there is no path between node v s and node v i , then d si →∞. The efficiency of a node expresses the average difficulty of the node reaching other nodes in the network. The larger the node efficiency value, the more important the position of the node in the network information transmission process.
[0026] Furthermore, the specific method for constructing the node importance evaluation matrix H E in step 5 is as follows:
[0027] Fuse the efficiency values of the nodes and use the importance contribution value of the node to replace the importance contribution proportion value in H IC to obtain the node importance evaluation matrix H E : The node importance matrix H E : Use the degree to construct the importance association between nodes and use the efficiency I s of the node to characterize the position information of the node;
[0028]
[0029] In the formula, D i represents the degree of node v i , the element in the i-th row and j-th column of H E , and H Eij represents the importance contribution value of node v j to node v i .
[0030] The importance contribution value of a node to its neighbor nodes is related to its own efficiency and degree value. The greater the efficiency value and the higher the degree value of the node, the greater its importance contribution to the adjacent nodes.
[0031] Furthermore, the specific method for normalizing the node importance matrix in step 6 is as follows:
[0032] For the node importance matrix H E perform softmax normalization, denoted as matrix P,
[0033]
[0034] where e represents the natural constant, H Eij represents the element in the i-th row and j-th column of H E , N i represents the set of neighbor nodes of node i, and N i ∪{i} represents the set of neighbor nodes of node i plus the node itself.
[0035] The constructed matrix P has the same form as the adjacency matrix. For two nodes without an edge connection, P ij is 0. For two nodes with an edge connection,
[0036] Furthermore, the specific method for calculating the convolution formula according to the node importance matrix in step 7 is as follows:
[0037] The convolution formula is expressed as:
[0038] Z = f(X, P) = soft maX(PReLU(PXW (0) )W (1) )
[0039] where Z represents the final output layer, P represents the matrix obtained by performing softmax normalization on the node importance matrix H E , X represents the node features on the graph G, where X ∈ R n×D , X i ∈R D is the feature of the i-th node. The weight is the weight matrix from the input layer to the hidden layer. Similarly, is the weight matrix from the hidden layer to the output layer; represents the real number field;
[0040] Set the number of convolutional layers to be the same as the GCN network, with a total of two layers, one convolutional layer and one softmax layer.
[0041] Compared with the prior art, the present invention has the following advantages:
[0042] In current graph convolutional neural networks, when aggregating messages from surrounding neighbor nodes, the importance of different neighbor nodes is not distinguished from the perspective of the network topology. Therefore, this paper proposes a graph neural network weighted convolution method based on node importance. In this work, to distinguish the importance of nodes, a node importance matrix is constructed from the degree of nodes and the efficiency of nodes in the network, replacing the adjacency matrix after Laplacian symmetric normalization in the graph convolutional network. Thus, during the graph convolution operation, different weights can be assigned to neighbor nodes, enabling the graph convolutional network to focus on the feature information of these important neighbor nodes during the learning process. Secondly, based on this model, due to the different contribution degrees of different neighbor nodes, the proportion of the degree of a neighbor node in the sum of the degrees of all neighbors of the central node is used to distinguish the importance of neighbor nodes, and an adaptive coefficient is introduced to better learn the attribute information of the neighbor nodes received by the target node. By using the benchmark dataset of graph neural networks, the proposed method is compared with the graph convolutional network method. The experimental results show that the proposed graph convolutional model based on topology and its improvement are superior to the graph convolutional network model in prediction accuracy, achieving better results. Brief Description of the Drawings
[0043] Figure 1 This is the flowchart of the method of the present invention. Detailed Embodiments
[0044] Embodiment 1
[0045] Step 1: Preprocess the data
[0046] In this example, the benchmark datasets of graph neural networks, namely the three datasets Cora, Citeseer, and Pumbed of the citation network, are selected and adjusted to the undirected version.
[0047] Let G = {V, E, A} represent an undirected graph without self-loops, where V = {v1, v2,..., v n} represents the set of all nodes, E = {e1, e2,..., e m} represents the set of edges between nodes in the undirected graph, and A represents the adjacency matrix, which has a value only when there is an edge between two nodes in the undirected graph, and the value is 1.
[0048] Among them, the Cora dataset has 2708 nodes and 5429 edges, and the obtained adjacency matrix is a 2708 * 2708-dimensional matrix.
[0049] The Citeseer dataset has 3327 nodes and 4732 edges, and the obtained adjacency matrix is a 3327 * 3327-dimensional matrix.
[0050] The Pumbed dataset has 19,717 nodes and 44,338 edges, and the obtained adjacency matrix is a 19,717 * 19,717 - dimensional matrix.
[0051] Step 2: Calculate the degree D of each node v i of i
[0052] Calculate the number of nodes directly connected to each node v i , that is, the degree D of v i of i .
[0053] Step 3: Construct the node importance contribution matrix
[0054] Give each node v i a contribution value of D i / k 2 to one of its adjacent nodes, and represent the proportion of the importance contribution of all nodes to their adjacent nodes in a matrix to obtain the node importance contribution matrix, denoted as H IC .
[0055]
[0056] Among them, D i represents the degree of node v i , D i / k 2 represents the contribution value of the importance of node v i itself, k represents the average degree value, and δ ij represents the contribution distribution parameter;
[0057] The node importance contribution matrix H IC has the same structure as the adjacency matrix and is a mapping of the network adjacency matrix. The mapping rule is:
[0058]
[0059] When v i and v j are directly connected, the value is 1; otherwise, the value is 0. The elements on the diagonal of the matrix are 1, indicating that the proportion of the importance contribution of the node to itself is 1.
[0060] Step 4: Calculate the efficiency I of the node s
[0061] Calculate the efficiency I of the node s as
[0062] Among them, N represents the number of nodes, and d si represents the node v s and the node vi The distance between nodes. The node distance refers to the number of edges on the shortest path between two nodes. If there is no path between node v s and node v i , then d si →∞.
[0063] Step 5: Construct the node importance evaluation matrix H E
[0064] Use the efficiency I s of the node to characterize the position information of the node. Integrate the efficiency values of the nodes, and use the importance contribution value of the node to replace the importance contribution ratio value in H IC to obtain the node importance evaluation matrix H E .
[0065]
[0066] In the formula, D i represents the degree of node v i . The element H E in the i-th row and j-th column of H Eij represents the importance contribution value of node v j to node v i .
[0067] Step 6: Normalize the node importance matrix
[0068] Perform softmax normalization on the node importance matrix H E , denoted as matrix P,
[0069]
[0070] where e represents the natural constant, H Eij represents the element in the i-th row and j-th column of H E , N i represents the set of neighbor nodes of node i, and N i ∪{i} represents the set of neighbor nodes of node i plus the node itself.
[0071] The constructed matrix P has the same form as the adjacency matrix. For two nodes without an edge connection, P ij is 0. For two nodes with an edge connection,
[0072] Step 7: Calculate the convolution formula according to the node importance matrix
[0073] The convolution formula is:
[0074] Z = f(X, P) = softmax(PReLU(PXW(0) )W (1) )
[0075] Among them, Z represents the final output layer, and P represents the matrix for softmax normalization of the node importance matrix H E The matrix for softmax normalization of the node importance matrix H, X represents the node features on graph G, where X ∈ R n×D , Xi ∈ R D is the feature of the i-th node. The weight is the weight matrix from the input layer to the hidden layer. Similarly, is the weight matrix from the hidden layer to the output layer, represents the real number field.
[0076] The graph convolution layer of this model is set the same as the GCN network, with one convolution layer and one softmax layer. The learning rate is 0.005, the number of hidden layers is 32, and the dropout is set to 0.5.
[0077] Step 8: Compare the results of this method with those of GCN
[0078] The data is fixedly segmented, with 20 labeled nodes for each class, 500 nodes for validation, 1000 nodes for testing, and the remaining nodes as unlabeled data.
[0079] The comparison accuracy results between this method and GCN are shown in Table 1.
[0080] Table 1 Comparison of Results between W-GCN (This Method) and GCN
[0081]
[0082]
[0083] The results show that based on GCN, different weight distributions for nodes are adopted using the method proposed in this study. The accuracy on the Cora dataset is improved by 1.6% compared to GCN, the accuracy on the Citeseer dataset is improved by 1.7% compared to GCN, and the accuracy on the Pubmed dataset is improved by 0.9% compared to GCN.
[0084] The content not described in detail in the specification of the present invention belongs to the prior art well-known to those skilled in the art. Although the illustrative specific embodiments of the present invention have been described above for the understanding of those skilled in the art of the present technology, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art of the present technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concept of the present invention are within the scope of protection.
Claims
1. A graph neural network weighted convolution method based on node importance, characterized in that: Including the following steps: Step 1, construct an undirected graph without self-loops; Step 2, calculate the degree D of each node v i through the adjacency matrix i ; Step 3, construct the node importance contribution matrix H IC ; Step 4, calculate the node efficiency I s ; Step 5, construct the node importance evaluation matrix H E ; Step 6, normalize the node importance matrix; Step 7, calculate the convolution formula according to the node importance matrix to complete the graph neural network weighted convolution for image processing and natural language processing; The specific method for constructing an undirected graph without self-loops in step 1 is as follows: Represent an undirected graph without self-loops using G = {V, E, A}, where V = {v1, v2, …, v n} represents the set of all nodes, E = {e1, e2, …, e m} represents the set of edges between nodes in the undirected graph, and A represents the adjacency matrix, which has a value of 1 only when there is an edge between two nodes in the undirected graph; The specific method for constructing the node importance contribution matrix H in step 3 is as follows: IC : The number of nodes is n. For node v i The contribution value of its own importance to an adjacent node. The importance contribution ratio values of all nodes to their adjacent nodes are represented by a matrix to form a node importance contribution matrix H IC : Among them, D i represents the degree of node v i , δ ij represents the contribution distribution parameter, i = 1, 2, … n, j = 1, 2, …, n, D i / k 2 represents the contribution value of the importance of node v i itself, and k represents the average degree value; Node importance contribution matrix H IC It has the same structure as the adjacency matrix and is a mapping of the network adjacency matrix. The mapping rule is as follows: When v i and v j are directly connected, the value is 1; otherwise, the value is 0. The elements on the diagonal of the matrix are 1, indicating that the contribution ratio value of the node to itself is 1. The specific method for calculating the node efficiency I in step 4 s is as follows: The efficiency I of the node s , Among them, N represents the number of nodes, and d si represents the distance between node v s and node v i . The node distance refers to the number of edges on the shortest path between two nodes. If there is no path between node v s and node v i , then d si →∞; The specific method for constructing the node importance evaluation matrix H in step 5 is as follows: E is: The efficiency value of the fusion node is used, and the importance contribution value of the node is used to replace the importance contribution ratio value in IC to obtain the node importance evaluation matrix H E : where D i represents the degree of node v i , and the element H E in the i-th row and j-th column of H Eij represents the contribution value of node v j to the importance of node v i ; The specific method for normalizing the node importance matrix in Step 6 is: For the node importance matrix H E perform softmax normalization, denoted as matrix P where e represents the natural constant, H Eij represents the element in the i-th row and j-th column of H E , N i represents the set of neighbor nodes of node i, N i ∪{i} represents the set of neighbor nodes of node i plus the node itself; The constructed matrix P has the same form as the adjacency matrix. For two nodes without an edge connection, P ij is 0. For two nodes with an edge connection, The specific method for calculating the convolution formula according to the node importance matrix in Step 7 is: The convolution formula is expressed as: Z = f(X, P) = softmax(PReLU(PXW (0) )W (1) ) Among them, Z represents the final output layer, and P represents the matrix for softmax normalization of the node importance matrix H E The matrix for softmax normalization, X represents the node features on graph G, where X ∈ R n×D , X i ∈ R D is the feature of the i-th node; the weight is the weight matrix from the input layer to the hidden layer. Similarly, is the weight matrix from the hidden layer to the output layer, represents the real number field; Set the number of convolutional layers to be the same as that of the GCN network, with a total of two layers, one convolutional layer and one softmax layer; Select the benchmark datasets of the graph neural network, namely the three datasets Cora, Citeseer, and Pubmed of the citation network, and adjust them to the undirected version.
Citation Information
Patent Citations
Grouping attention-based width graph convolutional network model and training method thereof
CN112668700A