CN-122023547-A - Self-adaptive graph compression method oriented to graph neural network
Abstract
The invention provides a self-adaptive graph compression method for a graph neural network, which relates to the field of graph data processing and specifically comprises the following steps of establishing original graph data for non-uniform initialization to generate an initial synthetic graph, executing intra-class multi-sample gradient matching on the synthetic graph, calculating gradient contribution of synthetic nodes, calculating structural scores of the synthetic nodes through a structural evaluation module based on k-core decomposition, inputting the gradient contribution of the synthetic nodes and the structural scores of the synthetic nodes into a double-branch gating network, adaptively cutting according to accumulated contribution criteria, executing class guarantee and reviving strategies, and outputting a final synthetic graph for downstream GNN training. The technical scheme of the invention solves the problem that the optimal compression ratio cannot be dynamically determined according to the characteristics of different data sets in the prior art.
Inventors
- ZHOU HUI
- REN BOYANG
- ZHAO ZHONGYING
- LI CHAO
- LIANG YONGQUAN
Assignees
- 山东科技大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260413
Claims (9)
- 1. The adaptive graph compression method for the graph neural network is characterized by comprising the following steps of: S1, establishing original graph data for non-uniform initialization to generate an initial synthetic graph; S2, performing intra-class multi-sample gradient matching on the synthetic graph, and calculating gradient contribution of synthetic nodes; s3, calculating the structure score of the synthesized node through a structure evaluation module based on k-core decomposition; s4, inputting the gradient contribution of the synthetic nodes and the structure score of the synthetic nodes into a double-branch gating network, adaptively cutting and executing class assurance and reviving strategies according to accumulated contribution criteria, and outputting a final synthetic graph for downstream GNN training.
- 2. The adaptive graph compression method for a graph neural network according to claim 1, wherein the step S1 specifically includes the following steps: S1.1, obtaining an original image Coarse clustering is carried out according to the category, wherein, Is that An adjacency matrix of the individual nodes, Is a characteristic matrix of the nodes and, Is the first of (2) Row of lines Is a node A kind of electronic device The dimension of the feature vector is determined, Is a label vector; s1.2, performing intra-class fine clustering by adopting an improved Dirichlet process Gaussian mixture model DP-GMM to generate an initial synthetic node.
- 3. The adaptive graph compression method for a graph neural network according to claim 2, wherein the step S1.1 specifically includes the following steps: S1.1.1 for each category Using training set categories As class prototypes: , ; Wherein, the Represent the first The prototype vector of the class is used to determine, Representing all belonging categories in the training set Is defined by a set of node indices, Representing nodes Is used for the feature vector of (a), Representing nodes Category labels of (c); s1.1.2 for each prototype Doing the following steps Normalizing; S1.1.3 for each node in the full graph Prototype with each class Cosine similarity scoring, if node And class prototypes The node is then set if the similarity of the two is up to the set value As a prototype of class Is to sample the high confidence pseudo tag of (1) and to node Adding class prototypes The sample pool of (2) is used for subsequent intra-class fine clustering; opposite node And class prototypes Cosine similarity of (2) The definition is as follows: ; Wherein, the The vector inner product is represented by the vector, Is that A norm; s1.1.4, get the highest scoring class With the corresponding maximum similarity If the similarity is the largest Setting a threshold value The node corresponding to the maximum similarity is regarded as a high confidence pseudo-label and added into the class Is a sample cell of (a).
- 4. The adaptive graph compression method for a graph neural network according to claim 2, wherein the step S1.2 specifically includes the following steps: S1.2.1, fitting the intra-class samples by using the DP-GMM to obtain component weight vectors Corresponding mean value set ; S1.2.2 sorting the component weights from large to small, and recording the sorted component weights as Corresponding mean value ; S1.2.3 given a cumulative weight threshold The smallest positive integer is chosen such that: ; Wherein, the Is of the category Number of synthetic nodes in the compressed graph; s1.2.4, adding all the categories to obtain the total number of initial synthetic nodes : ; Wherein, the Is the total category number.
- 5. The adaptive graph compression method for a graph neural network according to claim 1, wherein the step S2 specifically includes the following steps: S2.1, obtaining a composite graph adjacency matrix through a parameterized adjacency generator, and regarding the composite adjacency as a micro-functional of a composite feature: , ; Wherein, the Is a trainable synthetic node feature, the first Row of lines Is a synthetic node A kind of electronic device The dimension of the feature vector is determined, For the current mask to be the current mask, Representing features actually used to generate synthetic adjacencies and participate in model forward direction under the current training or inference step; representing a parameterized adjacency generator, the parameters being ; S2.2, gradient matching of multiple sampling is carried out according to the category; S2.3, obtaining gradient contribution scores through matching targets First, class-level gradient matching terms are calculated Subsequently, synthetic features are synthesized Gradient determination to obtain node contribution : ; Wherein, the Feature matrix representing synthetic nodes Obtaining a gradient; First, the Gradient vector of individual synthetic nodes A kind of electronic device Gradient contribution raw score with norm as node : ; And obtaining normalized contribution value through min-max protocol As a gradient channel input to GateNet.
- 6. The adaptive graph compression method for a graph neural network according to claim 5, wherein the step S2.2 specifically includes the steps of: s2.2.1 for the real graph on each category Sub-independent sub-picture sampling, record the first Subsampling on real graph The loss is Corresponding parameter gradient is : ; Wherein, the Is the GNN parameter used for training, i.e. the learnable weight of the model, Representation of parameters Obtaining a gradient; s2.2.2 in the synthesis of the graph On the first pair Class calculation synthesis loss And obtain a synthetic gradient : ; S2.2.3 pair of The distance between the true gradient obtained by sub-independent sampling and the synthesized gradient is averaged to define class-level gradient matching loss The method comprises the following steps: ; Wherein, the Is a gradient gap measure; Multiplying class loss by class weight : ; Wherein, the Is the first The number of synthetic nodes currently reserved is classified, The maximum number of synthetic nodes in all categories; s2.2.4, obtaining an overall gradient matching item : ; Wherein, the Is a structural regularization term.
- 7. The adaptive graph compression method for a graph neural network according to claim 1, wherein the step S3 specifically includes the following steps: s3.1 pair Copy of (a) Binarization of a fixed threshold value is carried out once to obtain a discrete form of a synthetic image: ; Wherein, the Is a preset edge threshold value, and the edge threshold value is set, Representing the first of the composite graph The individual node The adjacency value between the individual nodes, Is binarized ; S3.2 for synthetic nodes Can obtain non-negative integer representing node importance Section normalization is carried out on k-core, and Mapping to [0,1]: ; Wherein, the Is obtained by preventing the denominator from being a small constant of 0 Is the structure score actually input to GateNet.
- 8. The adaptive graph compression method for a graph neural network according to claim 1, wherein the step S4 specifically includes the following steps: s4.1, a lightweight dual-branch gating network GateNet is introduced as a slave Score of importance to node Is a learning map of (1); GateNet include two sub-maps: ; Wherein, the Is responsible for embedding scalar gradient contributions into a low-dimensional representation space, Responsible for embedding scalar structural scores into the same representation space, then concatenating and inputting the two into a fusion map In (c), the output is finally compressed to the following by Sigmoid : ; Wherein, the Is the first The soft importance scores learned by the individual synthetic nodes, Is a Sigmoid function; S4.2, introduced Structure alignment loss : ; Introducing entropy or sparsity canonical losses : ; Wherein, the Is a small constant which is a small constant, As a logarithmic function; Combining the structure alignment loss with entropy or sparsity canonical loss to obtain GateNet loss function : ; Wherein, the And Is a weight super parameter; Overall loss of The method comprises the following steps: ; ; Wherein, the In order for the gradient to match the loss, For the enabling coefficient of the gating loss, Is the length of the preheating period; s4.3, obtaining node retention probability And then, performing dynamic threshold pruning to realize self-adaptive compression.
- 9. The adaptive graph compression method for a graph neural network according to claim 8, wherein the step S4.3 specifically includes the following steps: S4.3.1 calculating a global threshold based on the cumulative contribution to be used Ordering from big to small And defines: ; Wherein, the And Respectively show the front Cumulative contributions of individual nodes and all nodes; S4.3.2 given a target cumulative ratio Defining a minimum prefix length : ; Wherein, the Is the target ratio; And by combining The corresponding quantiles give a dynamic threshold : ; Final binary mask The method comprises the following steps: ; S4.3.3, in order to combine the robustness in the early stage of training with the effective compression in the later stage, Scheduling with linear decrementing: ; Wherein, the Is the initial coverage ratio of the substrate to be covered, Is the minimum coverage ratio of the two-dimensional object, Is that From the slave Decay to Is set up by the number of epochs So that when it is proper Time of day After that, fix 。
Description
Self-adaptive graph compression method oriented to graph neural network Technical Field The invention relates to the field of graph data processing, in particular to a graph neural network-oriented self-adaptive graph compression method. Background The Graph Neural Network (GNNs) is a popular research direction in recent years, and has been successfully applied to a plurality of application scenarios such as social network analysis, knowledge graph reasoning and computational biology. However, graph data from the real world often has the characteristics of complex associated structure, macro graph scale and the like, so that huge calculation and memory overhead are generated in the GNN training process. The graph compression technique has been developed to synthesize a graph that is smaller than the original graph but as much information as possible, so that the graph can achieve test performance comparable to the original graph when training the same GNN model. In the prior art, the gradient matching based graph compression method GCond introduces the gradient matching from the data set compression to the graph for the first time, optimizes the characteristics of the synthesized nodes, and enables the GNN trained on the synthesized graph to undergo parameter updating similar to the original graph. The graph compression method SGDD based on frequency spectrum constraint adopts a frequency spectrum view angle, and a Laplace Energy Distribution (LED) regularizer is added in a condensation target, so that the frequency spectrum difference between a synthesized graph and an original graph is punished, and low-frequency and high-frequency components are reserved. Graph compression method EXGC based on saliency score the method further incorporates interpretability into the flow, identifies redundant synthetic nodes using saliency-based scores, dynamically decides which synthetic nodes should remain active or freeze during training, thereby accelerating optimization and enhancing the coacervation effect. However, these graph compression methods suffer from simple initialization strategies such as fixed compression ratios and random sampling, resulting in their inadequate adaptability to different data sets. Therefore, an adaptive compression strategy is urgently needed, and the optimal compression ratio can be dynamically determined according to the characteristics of different data sets while the initial compression diagram is obtained in a basis, so that the aim of efficient compression is fulfilled on the premise of retaining key information. Disclosure of Invention The invention mainly aims to provide a self-adaptive graph compression method oriented to a graph neural network, which aims to solve the problem that the optimal compression ratio cannot be dynamically determined according to the characteristics of different data sets in the prior art. In order to achieve the above purpose, the present invention provides a graph neural network-oriented adaptive graph compression method, which specifically includes the following steps: s1, establishing original graph data for non-uniform initialization to generate an initial synthetic graph. S2, performing intra-class multi-sample gradient matching on the synthetic graph, and calculating gradient contribution of synthetic nodes. S3, calculating the structure score of the synthesized node through a structure evaluation module based on k-core decomposition. S4, inputting the gradient contribution of the synthetic nodes and the structure score of the synthetic nodes into a double-branch gating network, adaptively cutting and executing class assurance and reviving strategies according to accumulated contribution criteria, and outputting a final synthetic graph for downstream GNN training. Further, the step S1 specifically includes the following steps: S1.1, obtaining an original image Coarse clustering is carried out according to the category, wherein,Is thatAn adjacency matrix of the individual nodes,Is a characteristic matrix of the nodes and,Is the first of (2)Row of linesIs a nodeA kind of electronic deviceThe dimension of the feature vector is determined,Is a label vector. S1.2, performing intra-class fine clustering by adopting an improved Dirichlet process Gaussian mixture model DP-GMM to generate an initial synthetic node. Further, the step S1.1 specifically includes the following steps: S1.1.1 for each category Using training set categoriesAs class prototypes: ,; Wherein, the Represent the firstThe prototype vector of the class is used to determine,Representing all belonging categories in the training setIs defined by a set of node indices,Representing nodesIs used for the feature vector of (a),Representing nodesCategory labels of (c). S1.1.2 for each prototypeDoing the following stepsNormalization. S1.1.3 for each node in the full graphPrototype with each classCosine similarity scoring, if nodeAnd class prototypesThe node is then set if the similarity of the