A graph neural network method based on graph structure enhancement
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SITENG HELI TIANJIN TECH CO LTD
- Filing Date
- 2023-02-20
- Publication Date
- 2026-08-07
AI Technical Summary
然而目前大多数研究都只考虑到增强后的图结构,忽略了原始图结构的合理性
[0024]因此,本发明采用上述一种基于图结构增强的图神经网络方法,与现有技术相比:本发明考虑了在图结构增强的过程中融入了原始的图邻接矩阵,既可以保留真实的链接关系,又可以提高图数据的同质性,使其更加适应现有的图神经网络,具有更高的泛化性。本发明可用于图数据分析、图表示学习等场景,能够辅助人们更好地分析并使用图数据。
Smart Images

Figure CN116010855B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of graph data analysis and graph representation learning, and in particular to a graph neural network method based on graph structure enhancement. Background Technology
[0002] Graph data has been widely applied in fields such as knowledge graphs, e-commerce, social networks, and chemical molecular structures, demonstrating its broad application value. With the increasingly widespread use of graph data, learning excellent node representations is becoming increasingly important. Graph representation learning requires reducing the dimensionality of high-dimensional graph data to a lower-dimensional space to remove feature redundancy and obtain expressive node representations for the aforementioned tasks. However, because existing graph neural networks rely on information propagation among nodes, the class of their neighbors directly affects the message representation received by the node. Therefore, when a node and its neighbors do not belong to the same class, it will receive relatively incorrect information. Furthermore, most existing graph neural networks assume that graphs are highly homogeneous, resulting in poor generalization performance.
[0003] Currently, improving the homogeneity of graph data has become a feasible approach, and many related studies have yielded promising results. However, most current research only considers the enhanced graph structure, neglecting the rationality of the original graph structure. Summary of the Invention
[0004] The purpose of this invention is to provide a graph neural network method based on graph structure enhancement, which transforms low homogeneity graphs into high homogeneity graphs, thereby enabling graph data to be better adapted to existing graph neural networks, thus allowing for better node classification tasks.
[0005] To achieve the above objectives, this invention provides a graph neural network method based on graph structure enhancement.
[0006] Step S1: Collect the original graph structure data and label the collected original graph structure data;
[0007] Step S2: Encode the labeled graph structure data using an encoder to obtain a preliminary node representation. Then, reduce the dimensionality of the preliminary node representation using a graph neural network to obtain a low-dimensional node representation.
[0008] Step S3: Calculate the similarity between the low-dimensional node representations and generate an enhanced graph adjacency matrix based on the similarity.
[0009] Step S4: Repeat steps S2 and S3 until a highly homogeneous graph adjacency matrix is obtained;
[0010] Step S5: Input the highly homogeneous graph adjacency matrix, the original graph adjacency matrix, and the low-dimensional node representation into the encoder of the graph neural network to perform the node classification task.
[0011] Preferably, in step S1, the raw graph structure data collected from the network is labeled with tags according to the data type.
[0012] Preferably, in step S2, the feature matrix and normalized adjacency matrix of the node representation are used as input to the graph neural network. The graph neural network propagates and aggregates information from the nodes to obtain a low-dimensional node representation. The formula for the low-dimensional node representation is as follows:
[0013]
[0014] in, This represents the node representation matrix obtained through graph neural network encoding, where N represents the number of nodes, and d l Let the number of nodes represent the dimension of the matrix; W is the normalized adjacency matrix; X is the node feature matrix; W GCN Let be the network weight parameters of the graph neural network, and σ(.) be the non-linear activation function.
[0015] Preferably, in step S3,
[0016] Step S31: Calculate the similarity measure between each node. The calculation formula is as follows:
[0017] s i,j =h i ·h j T
[0018] Among them, s i,j Let h be the node representation i and node representation h j The similarity measure between them, h i and h j All belong to H0;
[0019] The similarity matrix of nodes is obtained by measuring the similarity between their representations, and the formula is as follows:
[0020] S0=H0·H0 T ;
[0021] Step S32: Obtain the normalized similarity matrix, i.e., the enhanced graph adjacency matrix, based on the similarity matrix, as follows:
[0022]
[0023] Preferably, in step S5, the original graph adjacency matrix, the generated similarity matrix, and the low-dimensional node representation are input into the encoder of the graph neural network to reconstruct the graph structure. The reconstructed graph structure is then passed through the last encoder layer of the graph neural network to obtain the high-level node representation H. s High-level nodes represent H s The softmax function is used for node classification tasks.
[0024] Therefore, this invention employs a graph neural network method based on graph structure enhancement, which, compared to existing technologies, incorporates the original graph adjacency matrix during the graph structure enhancement process. This preserves the true link relationships and improves the homogeneity of graph data, making it more adaptable to existing graph neural networks and exhibiting higher generalization ability. This invention can be used in scenarios such as graph data analysis and graph representation learning, assisting people in better analyzing and using graph data.
[0025] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0026] Figure 1 This is a flowchart of a graph neural network method based on graph structure enhancement according to the present invention;
[0027] Figure 2 This is a schematic diagram illustrating the principle of generating an enhanced graph adjacency matrix for this invention. Detailed Implementation
[0028] Example
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0030] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0031] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0032] refer to Figure 1 A graph neural network method based on graph structure enhancement, the specific steps of which are as follows:
[0033] Step S1: Collect raw graph structure data and label the collected raw graph structure data. The raw graph structure data collected from the network is labeled with tags according to data type.
[0034] This embodiment uses two highly homogeneous graphs and four low-homogeneity graphs for experiments. The highly homogeneous datasets Cora and Citeseer are citation networks, where each node represents a scientific paper. All papers are categorized into different types, including genetic algorithms, neural networks, reinforcement learning, etc. Each paper is represented by a d0-dimensional word vector, so each sample point has d0 features. Each element of the word vector corresponds to a word, and this element has only two values: 0 or 1. A value of 0 indicates that the corresponding word is not in the paper, and a value of 1 indicates that it is in the paper. All words come from a dictionary with d0 words. Each paper cites at least one other paper or is cited by another paper, meaning that there are connections between sample points; no sample point is completely unrelated to other sample points. If we consider the sample points as points in a graph, then this is a connected graph, and there are no isolated points.
[0035] The low-homogeneity Chameleon and Squirrel datasets, sourced from English Wikipedia, represent a network of pages on specific topics (Chameleon and Squirrel). Nodes represent articles, and edges are the links between them. Node features represent informative terms from the Wikipedia pages. These nodes are categorized into five classes based on their average traffic. Subnetworks from the WebKB network, including Actor and Wisconsin, are derived from computer science departments at various universities. In these datasets, nodes correspond to web pages, and edges represent hyperlinks between pages. Node features represent word representations of the web pages.
[0036] hnode and hedge are two metrics that measure graph homogeneity. The maximum value is 1, which represents high homogeneity, and the minimum value is 0, which represents low homogeneity.
[0037] The data statistics table is as follows:
[0038]
[0039] Step S2: Encode the labeled graph structure data using an encoder to obtain a preliminary node representation. Then, reduce the dimensionality of the preliminary node representation using a graph neural network to obtain a low-dimensional node representation.
[0040] The method of this invention defines a graph dataset: In this section, an undirected graph is defined as G = (V, E), and its node set is denoted by V = {v1, v2, ... v...}. N} indicates that v iRepresenting node i; the node feature matrix is represented by X = {x1, x2, ..., x...} N} represents, where x i Represents node v i The feature vector of A = ∈ R, where N represents the number of nodes and d0 represents the feature dimension of the node. N×d The adjacency matrix of the graph represents the edge e. i,j =(v i ,v j )∈E means node v i and v j There are links, and |E| represents the number of edges.
[0041] This invention employs Graph Convolutional Neural Networks (GCNs) to learn the latent representation of graph data. GCNs are a powerful graph data analysis method that primarily follows a message-passing mechanism. Each node obtains attribute and structural information from its neighbors through this mechanism, thereby updating its own node representation. The feature matrix of the node representation and the normalized adjacency matrix are used as inputs to the GCN. The GCN then propagates and aggregates information from the nodes to obtain a low-dimensional node representation. The formula for the low-dimensional node representation is as follows:
[0042]
[0043] in, This represents the node representation matrix obtained through graph neural network encoding, where N represents the number of nodes, and d l Let the number of nodes represent the dimension of the matrix; W is the normalized adjacency matrix; X is the node feature matrix; W GCN Let be the network weight parameters of the graph neural network, and σ(.) be the non-linear activation function.
[0044] Step S3: Calculate the similarity between the low-dimensional node representations and generate an enhanced graph adjacency matrix based on the similarity. The specific steps are as follows:
[0045] Step S31: Calculate the similarity measure between each node. In this embodiment, the inner product of vectors is used as the similarity measure between nodes. The calculation formula is as follows:
[0046] s i,j =h i ·h j T
[0047] Among them, s i,j Let h be the node representation i and node representation h j The similarity measure between them, h i and h jAll belong to H0. The similarity matrix of nodes is obtained based on the similarity metric between their representations. The formula for the similarity metric between nodes in the entire graph is as follows:
[0048] S0=H0·H0 T , where S0 is the similarity matrix of the nodes.
[0049] Step S32: Obtain the normalized similarity matrix, i.e., the enhanced graph adjacency matrix, based on the similarity matrix. Link the top_k similar nodes of each node, removing links with low similarity. This is the k-NN strategy, which increases the homogeneity of the graph structure. The normalized similarity matrix is then represented as follows:
[0050]
[0051] Step S4: Repeat steps S2 and S3 until a highly homogeneous graph adjacency matrix is obtained.
[0052] Step S5: Input the highly homogeneous graph adjacency matrix, the original graph adjacency matrix, and the low-dimensional node representation into the encoder of the graph neural network for node classification. The original adjacency matrix represents the real links in the graph data and can represent the real relationships between nodes, but these relationships may not be the highly homogeneous links expected by the network. Therefore, the original graph adjacency matrix, the generated similarity matrix, and the low-dimensional node representation are input into the encoder of the graph neural network to reconstruct the graph structure. The reconstructed graph structure is then passed through the last layer of the encoder of the graph neural network to obtain the high-level node representation H. s High-level nodes represent H s It is expressed as follows:
[0053]
[0054] High-level node representation H s The softmax function is used for node classification tasks. The formula for class prediction using softmax is: Z = softmax(H). s )
[0055] For semi-supervised multi-class classification, this embodiment evaluates the cross-entropy loss of all labeled sample nodes, calculated using the following formula:
[0056] Where L is the cross-entropy loss, Y i,j Let Y be the set of node indices with label Y, and C be the number of categories. Backpropagation is used to optimize the parameters of the neural network, thus achieving better results.
[0057] This embodiment was compared with existing methods in the following comparison experiments:
[0058] GCN: GCN is a semi-supervised graph convolutional network framework that aggregates inputs from neighbors to learn node representations. GAT: GAT is a semi-supervised graph neural network framework that uses an attention mechanism to aggregate node features. GraphSAGE: GraphSAGE is an inductive learning framework that generates representations of unknown nodes using node feature information; it can be divided into semi-supervised and unsupervised frameworks.
[0059] The experimental results are shown in the table below: Accuracy (ACC) and Macro F1-score (F1) were used as evaluation metrics.
[0060]
[0061] The table above shows the performance of the proposed method on six downstream task datasets, including two high-homogeneity graph datasets and four low-homogeneity graph datasets, thus verifying the generalization ability of the proposed method. Observing the table, it can be seen that Ours (the method proposed in this invention) has the best classification performance, outperforming all other baseline models. Particularly on the four low-homogeneity graph datasets, the overall performance index exceeds the comparison methods by an average of 5%. The proposed method demonstrates strong capabilities on both high-homogeneity and low-homogeneity graph data, reflecting its good generalization ability.
[0062] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It should be understood that the present invention is not limited to the implementations described herein. These implementations are described to help those skilled in the art practice the present invention. Any person skilled in the art can easily make further improvements and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention is only limited by the content and scope of the claims, and is intended to cover all alternatives and equivalents included within the spirit and scope of the present invention as defined by the appended claims.
Claims
1. A graph neural network method based on graph structure enhancement, characterized in that, The specific steps are as follows: Step S1: Collect the original graph structure data and label the collected original graph structure data; the original graph structure data includes two highly homogeneous graphs and four low homogeneous graphs. The highly homogeneous graphs Cora and Citeseer are citation networks, where each node represents a scientific paper, and all papers are divided into different categories; the low homogeneous graphs Chameleon and Squirrel datasets are from English Wikipedia, representing a network of pages on a specific topic, where nodes represent articles, edges are the links between them, and node features represent some informative terms in the Wikipedia pages; the low homogeneous graphs Actor and Wisconsin are subnetworks from the WebKB network, where nodes correspond to web pages, edges represent hyperlinks between web pages; node features represent the word representations of the web pages; Step S2: Encode the labeled graph structure data using an encoder to obtain a preliminary node representation. Then, reduce the dimensionality of the preliminary node representation using a graph neural network to obtain a low-dimensional node representation. Step S3: Calculate the similarity between the low-dimensional node representations and generate an enhanced graph adjacency matrix based on the similarity. Step S4: Repeat steps S2 and S3 until a highly homogeneous graph adjacency matrix is obtained; Step S5: Input the highly homogeneous graph adjacency matrix, the original graph adjacency matrix, and the low-dimensional node representation into the encoder of the graph neural network to perform the node classification task.
2. The graph neural network method based on graph structure enhancement according to claim 1, characterized in that: In step S1, the raw graph structure data collected from the network is labeled with tags according to the data type.
3. The graph neural network method based on graph structure enhancement according to claim 1, characterized in that: In step S2, the feature matrix and normalized adjacency matrix of the node representation are used as input to the graph neural network. The graph neural network propagates and aggregates information from the nodes to obtain a low-dimensional node representation. The formula for the low-dimensional node representation is as follows: in, This represents the node representation matrix obtained through graph neural network encoding. Represents the number of nodes. Let the number of nodes represent the dimension of the matrix; The normalized adjacency matrix; The node feature matrix; These are the network weight parameters of a graph neural network. It is a non-linear activation function.
4. The graph neural network method based on graph structure enhancement according to claim 3, characterized in that: In step S3, Step S31: Calculate the similarity measure between each node. The calculation formula is as follows: in, Node representation and node representation Similarity measure between and All belong to ; The similarity matrix of nodes is obtained by measuring the similarity between their representations, and the formula is as follows: ; Step S32: Obtain the normalized similarity matrix, i.e., the enhanced graph adjacency matrix, based on the similarity matrix, as follows: 。 5. The graph neural network method based on graph structure enhancement according to claim 4, characterized in that: In step S5, the original graph adjacency matrix, the generated similarity matrix, and the low-dimensional node representation are input into the encoder of the graph neural network to reconstruct the graph structure. The reconstructed graph structure is then passed through the last encoder layer of the graph neural network to obtain the high-level node representation. High-level node representation The softmax function is used for node classification tasks.
Citation Information
Patent Citations
Social network node classification method and system based on multi-channel graph convolutional network
CN114757271A
Method and apparatus for classifying nodes of a graph
WO2023000165A1