Graph-structured data classification methods, devices, computer equipment, and storage media

By constructing a graph compression mechanism driven by structural entropy and category-aware clustering, combined with information gain-guided Monte Carlo tree search, the shortcomings of graph neural networks in interpretability and predictive performance are addressed, achieving a unity of interpretability and discriminativeness in the model.

CN121302082BActive Publication Date: 2026-03-06SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511873709.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-03-06
Estimated Expiration
2045-12-12

AI Technical Summary

Technical Problem

Existing graph neural networks suffer from inaccurate or inconsistent interpretations, making it difficult to simultaneously balance the model's predictive performance with the graph's structure and semantic representation.

Method used

By constructing a graph compression mechanism driven by structural entropy, the structural complexity is optimized, the core subgraph regions are highlighted, and category-aware clustering is introduced in the compressed graph embedding space to improve semantic discriminativeness and intra-class consistency. An information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to balance the classification performance and structural similarity of subgraphs in the search space.

Benefits of technology

It achieves a balance between model prediction performance and interpretability, improves the interpretability and discriminative ability of graph neural networks, avoids the reuse of redundant information, and enhances the discriminative ability and interpretability of prototypes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121302082B_ABST
    Figure CN121302082B_ABST
Patent Text Reader

Abstract

This invention relates to the field of artificial intelligence technology and discloses a method, apparatus, computer device, and computer-readable storage medium for classifying graph structure data. The method includes: acquiring input data to be classified; converting the data to be classified into target graph structure data; inputting the target graph structure data into a graph neural network to obtain a classification result for the data to be classified; wherein the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate node weights corresponding to each node, and compress the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. Through the above method, this invention improves the predictive performance of the model and provides a more causal explanatory ability for the structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, specifically to a graph structure data classification method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] Graph Neural Networks (GNNs) have demonstrated powerful representation learning capabilities and achieved significant performance breakthroughs in numerous fields, including social network analysis, molecular attribute prediction, and knowledge graph modeling. However, the high complexity and "black box" nature of GNNs make their decision-making processes difficult for humans to understand and trust, especially in tasks with high interpretability requirements, such as medical diagnosis and financial risk control. Therefore, improving the interpretability of GNNs has become an important research direction in the field of graph machine learning. To this end, a large number of Explainable Artificial Intelligence (XAI) methods have been proposed in recent years, aiming to provide transparent and intuitive explanations for the prediction results of graph models.

[0003] In recent years, significant progress has been made in the interpretability research of graph neural networks (GNNs), with numerous methods proposed to explain the predictive basis of models in node classification or graph classification tasks. Most existing methods belong to the post-hoc strategy, meaning that an additional interpretive model is introduced for analysis after model training. For example, GNNExplainer and PGExplainer interpret by selecting subgraph structures that maximize mutual information with the prediction results; PGM-Explainer constructs local datasets using feature perturbations and employs Bayesian networks for fitting and interpretation; XGNN provides class-level interpretation by generating graph patterns with high prediction probabilities. While these methods improve model interpretability to some extent, their reliance on external interpretive models often leads to inaccurate or inconsistent interpretations, making it difficult to truly reflect the internal reasoning process of the original model. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention provide a graph structure data classification method, apparatus, computer device and computer-readable storage medium to solve the problem in the prior art that it is impossible to simultaneously take into account the predictive performance of the model and the structure and semantic representation of the graph.

[0005] According to one aspect of the present invention, a graph-structured data classification method is provided, the method comprising:

[0006] Obtain the input data to be classified;

[0007] The data to be classified is converted into target graph structure data;

[0008] The target graph structure data is input into a graph neural network to obtain the classification result of the data to be classified. The graph neural network includes an input module, a structure entropy-based information compression module, and a prediction module. The structure entropy-based information compression module calculates the structure entropy of each node and generates node weights corresponding to each node, compressing the target graph structure data based on the node weights. The structure entropy is calculated based on the normalized connection probability between the node and its neighboring nodes.

[0009] Output the classification results.

[0010] In one alternative approach, before inputting the target graph structure data into the graph neural network to obtain the classification result of the data to be classified, the method further includes training the graph neural network, the training process being as follows:

[0011] Obtain graph structure sample data;

[0012] The graph structure sample data is input into the graph neural network to obtain the training classification results;

[0013] The total loss function is calculated based on the training classification results and category labels. The parameters of the graph neural network are adjusted according to the total loss function, and iterative training continues until a well-trained graph neural network is obtained.

[0014] In one alternative approach, inputting the graph structure sample data into a graph neural network to obtain training classification results includes:

[0015] Each node in the graph structure sample data is compressed using an information compression module based on structural entropy to obtain compressed graph structure sample data.

[0016] Cluster the compressed graph structure sample data, and based on the clustering results and the initial prototype vector, obtain k prototype embedding representations for each category of the compressed graph structure sample data.

[0017] Based on the prototype embedding representation, a Monte Carlo tree search based on information gain is performed to obtain the corresponding prototype subgraph embedding representation.

[0018] In one optional approach, the compression of each node in the graph structure sample data using a structure entropy-based information compression module to obtain compressed graph structure sample data includes:

[0019] The structural entropy of each node is calculated based on the normalized connection probability from each node to its neighboring nodes in the graph structure sample data.

[0020] The structural entropy is globally normalized to obtain the normalized entropy of each node;

[0021] Based on the normalized entropy and the preset gating function, each node in the graph structure sample data is compressed to obtain compressed graph structure sample data.

[0022] In one optional approach, calculating the structural entropy of each node based on the normalized connection probabilities from each node to its neighboring nodes in the graph structure sample data includes:

[0023] Calculate the structural entropy using the following formula:

[0024] ;

[0025] , ;

[0026] in, Represents a node to neighboring nodes Normalized connection probability; Represents a node and neighboring nodes Edge weights between them; Indicates no boundary. This indicates that a connection exists;

[0027] The structural entropy is globally normalized to obtain the normalized entropy, which includes:

[0028] ;

[0029] in, For normalized entropy, To prevent small constants from being divided by zero, These represent the minimum and maximum structural entropy values ​​of all nodes in the graph structure data, respectively.

[0030] The step of compressing each node in the graph structure sample data according to the normalized entropy and a preset gating function to obtain compressed graph structure sample data includes:

[0031] The following gating function is used to compress each node in the graph structure sample data:

[0032] ;

[0033] ;

[0034] in, , To control the hyperparameters of entropy sensitivity and overall compressibility strength, These represent the information of the i-th graph node of the i-th single graph sample before and after compression, respectively.

[0035] In one alternative approach, the compressed graph structure sample data is clustered.

[0036] Based on the clustering results and the initial prototype vectors, k prototype embeddings for each category of the compressed graph structure sample data are obtained, including:

[0037] For each category of the compressed graph structure sample data, k prototype vectors are randomly initialized to obtain k initialized prototype vectors for each category;

[0038] Based on the category labels corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain the clustering results.

[0039] Based on the clustering results and the k initial prototype vectors for each category, determine the k prototype embedding representations for each category.

[0040] In one alternative approach, the step of performing a Monte Carlo tree search based on information gain to obtain the corresponding prototype subgraph embedding representation, includes:

[0041] For each random sample in the compressed graph structure sample data, calculate the information gain contribution of the candidate subgraph to the category discrimination, and the similarity between the random sample and the candidate subgraph;

[0042] Based on the information gain contribution and the similarity between the random sample and the candidate subgraph, a Monte Carlo tree search is performed until k target subgraphs corresponding to each category are obtained.

[0043] According to another aspect of the present invention, a graph-structured data classification apparatus is provided, comprising:

[0044] The acquisition module is used to acquire the input data to be classified;

[0045] The conversion module is used to convert the data to be classified into target graph structure data;

[0046] A classification module is used to input the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a classification submodule; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compress the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes;

[0047] The output module is used to output the classification results.

[0048] According to another aspect of the present invention, a computer device is provided, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;

[0049] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the graph structure data classification method.

[0050] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing at least one executable instruction, which, when executed on a computer device, causes the computer device to perform the operation of the graph structure data classification method.

[0051] This invention embodiment acquires input data to be classified; converts the data to be classified into target graph structure data; inputs the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compresses the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. This invention embodiment first constructs a graph compression mechanism driven by structural entropy to compress redundant information from the entire graph, optimize structural complexity, and highlight core subgraph regions; secondly, in the compressed graph embedding space, category-aware clustering is introduced to extract representative prototypes, improving semantic discriminativeness and intra-class consistency; finally, an information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to simultaneously weigh the impact of subgraphs on classification performance and their structural similarity to prototypes in the search space, thereby selecting key subgraphs that are both accurate and structurally consistent. Ultimately, the model achieves a balance between performance and interpretability by making predictions based on its similarity to the prototype.

[0052] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0053] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0054] Figure 1 A schematic diagram comparing the prior art with the graph neural network in this application is shown;

[0055] Figure 2 A flowchart illustrating the graph structure data classification method provided in an embodiment of the present invention is shown.

[0056] Figure 3 This diagram illustrates the process of searching a Monte Carlo tree based on information gain in a graph structure data classification method provided by another embodiment of the present invention.

[0057] Figure 4 This diagram illustrates the structure of the graph-structured data classification device provided in an embodiment of the present invention.

[0058] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation

[0059] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0060] First, the problems in existing technologies are further described. As mentioned earlier, to overcome the limitation of "inaccurate or inconsistent interpretations, making it difficult to truly reflect the internal reasoning process of the original model," researchers have gradually turned to built-in interpretable methods, aiming to integrate interpretability into the model's structure and training process. Prototype learning is a typical built-in interpretability mechanism. A "prototype" refers to a typical subgraph representing a certain type of graph structure, used to explain the key patterns on which the model's predictions are based. Prototype interpretable methods achieve the unity of prediction and interpretation by learning representative prototype subgraphs and performing similarity matching with the input graph during inference. Works represented by ProtGNN utilize the concept of prototype learning to construct GNNs with built-in interpretability (i.e., self-interpreting GNNs), comparing the embeddings of the input graph with various prototypes, selecting the closest training graph instance as the prototype mapping, and thus providing a visual and intuitive structural explanation. This type of method not only improves the credibility of the explanation but also enhances the transparency of the model in the decision-making process.

[0061] However, because ProtoGNN only compares the graph-level embedding similarity between the input graph and the prototype graph during prototype learning, the model often ignores key substructures in the input graph and potentially includes a large number of redundant substructures irrelevant to classification. This coarse-grained representation not only leads to a degradation in interpretability but also limits the model's discriminative performance in downstream tasks. Figure 1 As shown, PGIB is a graph neural network based on the prototype graph information bottleneck method, ProtoGNN is a prototype-based graph neural network, and Gusb is a subgraph. In the MUTAG dataset, the prototype graphs selected by ProtoGNN often omit, such as NO2 and C5H. 10 Important functional groups, on the contrary, retain a large number of non-informational ring structures, revealing its lack of structural sensitivity.

[0062] At a deeper level, the embedding generation of graph neural networks relies on an iterative information aggregation mechanism of adjacency structures. During multi-layer propagation, structurally homogeneous and non-discriminatory regions in the graph tend to generate highly similar embedding representations, leading to information redundancy and generalization. The lack of modeling for the saliency of structural redundancy ultimately leads to these regions being mistakenly identified as high-frequency features and included in prototype matching, causing interpretative bias and decreased discriminative ability. This is the main problem with all current prototype learning methods.

[0063] While existing prototype interpretable methods based on the Information Bottleneck (PGIB) framework can reduce redundant information in the input graph by compressing information in the embedding space, thereby improving the model's focus on discriminative features and achieving a certain degree of redundancy removal, their compression process mainly relies on the statistical properties of global embeddings. PGIB, by optimizing the mutual information between the encoder and decoder, weakens label-independent redundant information, effectively reducing the redundancy of the input data from an information theory perspective, resulting in a more compact and discriminative final graph embedding. However, it still primarily optimizes in the graph-level representation space and lacks a mechanism to model the importance of the graph structure itself. This makes it prone to ignoring key functional groups in the structure during compression, resulting in insufficient structural and semantic representation of the generated prototype subgraph.

[0064] Based on this, this application provides a method for classifying graph-structured data. Figure 2 A flowchart of a graph-structured data classification method provided in an embodiment of the present invention is shown. This method is executed by a computer device. The computer device can be a laptop computer, tablet computer, terminal device, smart wearable device, etc., and the embodiments of the present invention do not impose specific limitations. Figure 2 As shown, the method includes the following steps:

[0065] Step 110: Obtain the input data to be classified.

[0066] The data to be classified can be data from various fields such as molecular data, biological data, text data, and synthetic graph data.

[0067] Step 120: Convert the data to be classified into target graph structure data.

[0068] The process of converting the raw data to be classified into target graph structure data (i.e., graph data format containing a set of nodes V, a set of edges E, an adjacency matrix A, and a node feature matrix X) involves three core steps: abstracting data entities into nodes, abstracting entity associations into edges, and encoding node / edge attributes into features. The specific process can be adapted to the original data type (such as molecules, text, images, tables, etc.).

[0069] Step 130: Input the target graph structure data into the graph neural network to obtain the classification result of the data to be classified.

[0070] The graph neural network includes an input module, a structure entropy-based information compression module, and a prediction module. The structure entropy-based information compression module is used to calculate the structure entropy of each node and generate the node weights corresponding to each node, and compress the target graph structure data according to the node weights. The structure entropy is calculated based on the normalized connection probability between the node and its neighboring nodes.

[0071] In this embodiment of the invention, before inputting the target graph structure data into the graph neural network to obtain the classification result of the data to be classified, the graph neural network is first trained. The training process is as follows:

[0072] Step 001: Obtain graph structure sample data.

[0073] This invention primarily selects several datasets, which are briefly introduced below:

[0074] MUTAG: Contains 188 molecular diagrams used to predict whether compounds are mutagenic. Each diagram represents an aromatic compound, with labels derived from experimental results of Salmonella typhimurium.

[0075] BBBP (Blood-Brain Barrier Penetration): Contains 2039 drug molecule maps to predict whether a molecule can cross the blood-brain barrier. It is a binary classification task commonly used in pharmacokinetic studies.

[0076] NCI1: A large-scale molecular graph dataset containing 4110 molecular graphs for screening compounds with activity against non-small cell lung cancer.

[0077] Graph-SST2: A graph classification dataset based on sentiment analysis. Each sentence is parsed as a dependency syntactic graph, where nodes represent words and edges represent dependencies between words. The task is to determine whether a sentence is positive or negative in sentiment.

[0078] BA-2Motifs: A synthetic dataset used to validate the interpretability of graph models. Each graph is generated based on the Barabási–Albert (BA) model and embeds a structural motif (such as a "house" or a five-node cycle). The category of the graph is determined by the type of the embedded motif.

[0079] Step 002: Input the graph structure sample data into the graph neural network to obtain the training classification results.

[0080] Specifically, the process includes:

[0081] Step 020: Compress each node in the graph structure sample data using the information compression module based on structural entropy to obtain the compressed graph structure sample data.

[0082] The graph structure sample data is compressed by an information compression module based on structural entropy for each node, resulting in compressed graph structure sample data, including:

[0083] First, the structural entropy of each node is calculated based on the normalized connection probability from each node to its neighboring nodes in the graph structure sample data.

[0084] The structural entropy is calculated using the following formula:

[0085] ;

[0086] , ;

[0087] in, Represents a node to neighboring nodes Normalized connection probability; Represents a node and neighboring nodes Edge weights between them; Indicates no boundary. This indicates that a connection exists.

[0088] Then, the structural entropy is globally normalized to obtain the normalized entropy of each node.

[0089] The structural entropy is globally normalized using the following formula:

[0090] ;

[0091] in, For normalized entropy, To prevent small constants from being divided by zero, These represent the minimum and maximum structural entropy values ​​of all nodes in the graph structure data, respectively.

[0092] Finally, based on the normalized entropy and the preset gating function, each node in the graph structure sample data is compressed to obtain the compressed graph structure sample data.

[0093] Specifically, the following gating function is used to compress each node in the graph structure sample data:

[0094] ;

[0095] ;

[0096] in, , To control the hyperparameters of entropy sensitivity and overall compressibility strength, These represent the information of the i-th graph node of a single graph sample before and after compression, respectively.

[0097] The gating mechanism not only compresses information from nodes with high structural entropy but also applies a certain degree of compression to nodes with low structural entropy. Assume the node characteristics are... Category label is The normalized structural entropy of the nodes is The gated compression weight is Mutual information between nodes and labels The information is negatively correlated with structural entropy, and the mutual information between nodes and labels is usually difficult to calculate directly. Therefore, the above method can be used to obtain compressed graph structure sample data. Suppose there are two nodes with equal structural entropy and high information content; these nodes are not in the lowest entropy interval. Without compression, these two highly redundant nodes may be simultaneously prioritized during subgraph search, leading to excessive concentration of search resources on these two redundant nodes, thus ignoring other equally low-entropy but more information-rich and complementary nodes. By compressing these nodes, their gating weights can be appropriately weakened, thereby highlighting other potential, more discriminative low-entropy nodes. During the subgraph search phase, after finding one redundant node, the model will be more inclined to explore nodes with higher information content and complementary structures, rather than repeatedly searching for another redundant node. This strategy effectively avoids the reuse of redundant information, improving the efficiency of subgraph search and the discriminative power and interpretability of the final prototype.

[0098] Step 021: Cluster the compressed graph structure sample data, and based on the clustering results and the initial prototype vector, obtain the k prototype embedding representations of each category corresponding to the compressed graph structure sample data.

[0099] In the prototype selection phase, existing baseline methods typically initialize category prototypes in a near-random manner. While simple to implement, this approach struggles to guarantee the representativeness and diversity of the prototypes. Therefore, this invention proposes a clustering-driven prototype selection mechanism to systematically mine more representative and discriminative substructures within each category, thereby improving the quality and interpretability of the prototypes.

[0100] Specifically, after obtaining the compressed graph structure sample data, the compressed graph structure sample data is clustered, and based on the clustering results and the initial prototype vector, k prototype embedding representations for each category of the compressed graph structure sample data are obtained, including the following steps:

[0101] First, for each category of the compressed graph structure sample data, k prototype vectors are randomly initialized to obtain k initialized prototype vectors for each category.

[0102] For each category Assign k prototypes and randomly initialize the prototype vectors. :

[0103] ;

[0104] in, Representing an interval A uniform distribution on the surface.

[0105] Then, based on the category labels corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain the clustering results.

[0106] To alleviate the problems of high randomness and weak representativeness in existing methods, this embodiment of the invention employs a prototype selection strategy based on K-Means clustering. Specifically, for each category y, its corresponding sample set is first extracted:

[0107] ;

[0108] in, Indicates the first i One sample, Indicates the first i The category label associated with each sample.

[0109] In this embodiment of the invention, a graph neural network (GNN) is used to obtain the embedding representation of each sample. All samples are then embedded and clustered into n clusters, corresponding to n categories:

[0110] ;

[0111] For each cluster Assume the embedded sample is represented as d 3D vector. To identify the representative prototype of each cluster, the embedding of each sample is computed. With cluster center The similarity between them is determined using the following Euclidean distance:

[0112] ;

[0113] Subsequently, based on the clustering results and the k initial prototype vectors of each category, the k prototype embedding representations of each category are determined.

[0114] In this process, the k samples closest to the center of each cluster are selected as representative prototypes, resulting in k prototypes for category y, denoted as . This strategy avoids directly using cluster centers that may lack real-world sample support, thereby enhancing the diversity and representativeness of the selected prototypes.

[0115] Step 022: Based on the prototype embedding representation, perform a Monte Carlo tree search based on information gain to obtain the corresponding prototype subgraph embedding representation. For each random sample in the compressed graph structure sample data, calculate the information gain contribution of the candidate subgraph to the category discrimination, as well as the similarity between the random sample and the candidate subgraph; based on the information gain contribution and the similarity between the random sample and the candidate subgraph, perform a Monte Carlo tree search until k target subgraphs corresponding to each category are obtained.

[0116] In traditional Monte Carlo tree subgraph search methods, rewards are typically based solely on the embedding similarity between the subgraph and the original graph. While this method ensures that the generated subgraph is close to the original graph in the feature space, the lack of modeling of category information often results in subgraphs containing features shared by multiple categories, lacking discriminative power. Furthermore, these subgraphs may contain a large number of redundant nodes, leading to complex structures and poor interpretability.

[0117] To address these issues, category information is incorporated into the reward function. By introducing information gain (IG) as part of the reward, the discriminative and goal-oriented nature of the search process is enhanced. Information gain, derived from information theory, measures the contribution of features to reducing category uncertainty. In the classification task of this invention embodiment, it quantifies the subgraph. The degree to which the uncertainty of the target category Y is reduced. Figure 3 The complete workflow of the IG-MCTS algorithm is demonstrated.

[0118] ;

[0119] in, The prior entropy of the category label represents the category uncertainty before observing any graph structure; Given a subgraph The conditional entropy after observation reflects the remaining uncertainty after observing the subgraph.

[0120] ;

[0121] In practical applications, Through classifier The predicted class probability distribution estimate of the output above:

[0122] ;

[0123] ;

[0124] Where C represents the total number of categories. For category The prior probability, Given a subgraph Time Category The predicted conditional probability.

[0125] Clearly, subgraphs that better reflect categorical features have lower conditional entropy. Thus, higher information gain can be obtained. This indicates that it has greater value in class discrimination.

[0126] During MCTS, each action selection (i.e., adding a new node) is determined by the updated reward function. Guided by the updated Tree Confidence Upper Bound (UCT) criterion, child node selection and expansion are performed as follows:

[0127] ;

[0128] in, For nodes Select Action The average reward, taking into account similarity and information gain; For nodes All sub-actions Total number of visits; For the node Select Action Number of visits; To explore coefficients.

[0129] Despite the initial prototype vector in the prototype selection phase Embedding based on complete sample graphs However, the final prototype used for inference is not a direct copy of these original embeddings. Instead, a subgraph search mechanism, IG-MCTS, is used for each training sample. Generate a set of candidate subgraphs and extract its embedding .

[0130] Subsequently, based on the reward function Select candidate subgraphs that satisfy the following formula And update the corresponding prototype vector using its embedding. :

[0131] ;

[0132] in, To maximize the candidate subgraph index of the reward function, The number of candidate subgraphs generated for each sample Candidate subgraph The reward value, For category The One prototype vector, This represents the mapping function of the GNN encoder.

[0133] Through iterative optimization, this embodiment of the invention constructs a refined prototype subgraph embedding for each category, effectively enhancing the discriminativeness and interpretability of the prototype while preserving the semantic expressiveness of the complete graph. In summary, IG-MCTS achieves a balance between interpretability and discriminativeness in subgraph search by integrating structural similarity and category discrimination signals, avoiding redundant common substructures, and significantly improving the performance and stability of interpretable graph representation learning models.

[0134] Step 003: Calculate the total loss function based on the training classification results and category labels, adjust the parameters of the graph neural network based on the total loss function, and continue iterative training until a well-trained graph neural network is obtained.

[0135] To maintain the model's classification performance, prototype representation ability, and training stability, a total loss function is calculated during training. This total loss function jointly optimizes the model parameters through three loss terms: classification loss, prototype clustering loss, and prototype separation loss.

[0136] ;

[0137] The classification loss LClsEnt uses the standard cross-entropy loss function to supervise the true class labels of the samples, and is defined as follows:

[0138] ;

[0139] The prototype clustering loss LCls encourages sample embeddings to have high similarity to the prototypes of their corresponding categories, and is defined as follows:

[0140] ;

[0141] The prototype separation loss LScp promotes high separation between different prototypes and is defined as follows. The overall prototype training loss is summarized as follows:

[0142] ;

[0143] in, Indicates sample The embedding is defined by CrsEnt, which is the cross-entropy loss function, and cogp, which represents the prototype-aware classification head. For the sample The true category label, Indicates the first generation generated from the corresponding subgraph embedding Embedding vectors of prototypes, For category The associated set of prototypes. The balance coefficient for each loss term, where C is the total number of categories. The cosine similarity between two prototypes is represented by... A threshold is set to limit the maximum allowed similarity between prototypes of the same type in order to reduce redundancy.

[0144] It is worth noting that the structural entropy gating module proposed in this embodiment of the invention is a parameterless information compression strategy that does not require additional loss terms or auxiliary training signals, and therefore has strong transferability and generalization ability.

[0145] In this embodiment of the invention, the end-to-end training process begins with model initialization, followed by iterative optimization of the total loss function. In each epoch, the structural entropy module first compresses the input graph. After a warm-up period, the algorithm periodically performs K-Means clustering to update the prototype representation and uses IG-MCTS (the aforementioned Monte Carlo tree search based on information gain) to search and identify the most discriminative subgraph for prototype projection. This cyclical process of compression, clustering, and search continues until convergence, resulting in a well-trained model and interpretable prototype visualizations. During training, each dataset is divided into training, validation, and test sets in an 80%:10%:10% ratio. All experiments use Graph Isomorphic Networks (GINs) as feature extractors, employing a uniform three-layer network architecture. The primary evaluation metric is classification accuracy. To ensure fairness, the hyperparameters related to loss weights and subgraph search are consistent with those of ProtGNN. Specifically, in the loss function, the weights... The values ​​are set to 0.10, 0.05, and 0.01 respectively. In the information compression module, the structural entropy-gated compression threshold parameter... The values ​​are set to 0.5 and 0.1 respectively. During the subgraph search phase, the similarity and information gain weights of the reward function are... and To balance structure matching and class discriminativeness, the number of pre-training epochs and the initial epochs of prototype learning were aligned with ProtGNN to ensure consistency. All experiments were conducted in a computing environment equipped with a single NVIDIA RTX 3090 GPU.

[0146] The proposed method is evaluated on widely used graph classification benchmark datasets in this invention, covering multiple fields such as molecular biology, text, and synthetic graphs, to demonstrate the robustness of our method. A brief description of the datasets is as follows:

[0147] MUTAG: Contains 188 molecular diagrams for predicting mutagenicity. Each diagram represents an aromatic compound, with labels derived from Salmonella Typhimurium experiments.

[0148] BBBP: Composed of 2039 drug molecules, it is designed to predict whether a molecule can cross the blood-brain barrier. This is a commonly used binary classification task in pharmacokinetics.

[0149] NCI1: A large molecular graph dataset containing 4,110 compounds used to screen for activity against non-small cell lung cancer.

[0150] Graph-SST2: A graph classification dataset for sentiment analysis. Sentences are parsed into dependency syntactic graphs, nodes represent words, and edges capture dependency relationships. The task is binary sentiment classification (positive or negative).

[0151] BA-2Motifs: A synthetic dataset used to test model interpretability. Each graph is generated using a Barabási-Albert (BA) model and embeds one of two motifs (e.g., "house" or five-node cycle). Graph labels correspond to the type of embedded motif.

[0152] PROTEINS: Contains 1113 protein structures, used to classify proteins as enzymes or non-enzymes. Each node represents an amino acid in a protein molecule; if the distance between amino acids is less than 6 angstroms, an edge connects the corresponding node.

[0153] For comparison, three representative prototype-based interpretable graph classification models were selected:

[0154] ProtGNN: Constructs category prototype graphs and classifies data by measuring the similarity between the input graph and the prototype. Each category has multiple prototype subgraphs.

[0155] PGIB: Based on the information bottleneck principle, it learns hard masks to select key nodes or edges, thereby compressing redundant information while retaining the structure that is strongly related to the classification task, thus enhancing information filtering and interpretability.

[0156] PAGE: Generates a prototype subgraph with consistent structure at the sample level and optimizes it using edge importance to improve the structural expressiveness and interpretability of the prototype.

[0157] The trained graph neural network can be obtained through the above method. The target graph structure data is input into the graph neural network, which compresses the target graph structure data based on structural entropy, and then matches it with subgraphs to obtain the matched subgraphs. The classification submodule calculates the classification probability of the matched subgraphs, thus obtaining the classification result.

[0158] Step 140: Output the classification result.

[0159] After obtaining the classification results, the classification results are output to the user.

[0160] This invention embodiment acquires input data to be classified; converts the data to be classified into target graph structure data; inputs the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compresses the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. This invention embodiment first constructs a graph compression mechanism driven by structural entropy to compress redundant information from the entire graph, optimize structural complexity, and highlight core subgraph regions; secondly, in the compressed graph embedding space, category-aware clustering is introduced to extract representative prototypes, improving semantic discriminativeness and intra-class consistency; finally, an information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to simultaneously weigh the impact of subgraphs on classification performance and their structural similarity to prototypes in the search space, thereby selecting key subgraphs that are both accurate and structurally consistent. Ultimately, the model achieves a balance between performance and interpretability by making predictions based on its similarity to the prototype.

[0161] Figure 4 A schematic diagram of the graph-structured data classification device provided in an embodiment of the present invention is shown. Figure 4 As shown, the device 300 includes:

[0162] The acquisition module 310 is used to acquire the input data to be classified;

[0163] The conversion module 320 is used to convert the data to be classified into target graph structure data;

[0164] The classification module 330 is used to input the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a classification submodule; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compress the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes;

[0165] Output module 340 is used to output the classification result.

[0166] In one alternative approach, before inputting the target graph structure data into the graph neural network to obtain the classification result of the data to be classified, the method further includes training the graph neural network, the training process being as follows:

[0167] Obtain graph structure sample data;

[0168] The graph structure sample data is input into the graph neural network to obtain the training classification results;

[0169] The total loss function is calculated based on the training classification results and category labels. The parameters of the graph neural network are adjusted according to the total loss function, and iterative training continues until a well-trained graph neural network is obtained.

[0170] In one alternative approach, inputting the graph structure sample data into a graph neural network to obtain training classification results includes:

[0171] Each node in the graph structure sample data is compressed using an information compression module based on structural entropy to obtain compressed graph structure sample data.

[0172] Cluster the compressed graph structure sample data, and based on the clustering results and the initial prototype vector, obtain k prototype embedding representations for each category of the compressed graph structure sample data.

[0173] Based on the prototype embedding representation, a Monte Carlo tree search based on information gain is performed to obtain the corresponding prototype subgraph embedding representation.

[0174] In one optional approach, the compression of each node in the graph structure sample data using a structure entropy-based information compression module to obtain compressed graph structure sample data includes:

[0175] The structural entropy of each node is calculated based on the normalized connection probability from each node to its neighboring nodes in the graph structure sample data.

[0176] The structural entropy is globally normalized to obtain the normalized entropy of each node;

[0177] Based on the normalized entropy and the preset gating function, each node in the graph structure sample data is compressed to obtain compressed graph structure sample data.

[0178] In one optional approach, calculating the structural entropy of each node based on the normalized connection probabilities from each node to its neighboring nodes in the graph structure sample data includes:

[0179] Calculate the structural entropy using the following formula:

[0180] ;

[0181] ;

[0182] in, Represents a node to neighboring nodes Normalized connection probability; Represents a node and neighboring nodes Edge weights between them; Indicates no boundary. This indicates that a connection exists;

[0183] The structural entropy is globally normalized to obtain the normalized entropy, which includes:

[0184] ;

[0185] in, For normalized entropy, To prevent small constants from being divided by zero, These represent the minimum and maximum structural entropy values ​​of all nodes in the graph structure data, respectively.

[0186] The step of compressing each node in the graph structure sample data according to the normalized entropy and a preset gating function to obtain compressed graph structure sample data includes:

[0187] The following gating function is used to compress each node in the graph structure sample data:

[0188] ;

[0189] ;

[0190] in, , To control the hyperparameters of entropy sensitivity and overall compressibility strength, These represent the information of the i-th graph node of a single graph sample before and after compression, respectively.

[0191] In one optional approach, the step of clustering the compressed graph structure sample data and obtaining k prototype embeddings for each category of the compressed graph structure sample data based on the clustering results and the initial prototype vectors includes:

[0192] For each category of the compressed graph structure sample data, k prototype vectors are randomly initialized to obtain k initialized prototype vectors for each category;

[0193] Based on the category labels corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain the clustering results.

[0194] Based on the clustering results and the k initial prototype vectors for each category, determine the k prototype embedding representations for each category.

[0195] In one alternative approach, the step of performing a Monte Carlo tree search based on information gain to obtain the corresponding prototype subgraph embedding representation, includes:

[0196] For each random sample in the compressed graph structure sample data, calculate the information gain contribution of the candidate subgraph to the category discrimination, and the similarity between the random sample and the candidate subgraph;

[0197] Based on the information gain contribution and the similarity between the random sample and the candidate subgraph, a Monte Carlo tree search is performed until k target subgraphs corresponding to each category are obtained.

[0198] This invention embodiment acquires input data to be classified; converts the data to be classified into target graph structure data; inputs the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compresses the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. This invention embodiment first constructs a graph compression mechanism driven by structural entropy to compress redundant information from the entire graph, optimize structural complexity, and highlight core subgraph regions; secondly, in the compressed graph embedding space, category-aware clustering is introduced to extract representative prototypes, improving semantic discriminativeness and intra-class consistency; finally, an information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to simultaneously weigh the impact of subgraphs on classification performance and their structural similarity to prototypes in the search space, thereby selecting key subgraphs that are both accurate and structurally consistent. Ultimately, the model achieves a balance between performance and interpretability by making predictions based on its similarity to the prototype.

[0199] Figure 5 The diagram shows a structural schematic of a computer device provided in an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the computer device.

[0200] like Figure 5 As shown, the computer device may include: a processor 402, a communications interface 404, a memory 406, and a communications bus 408.

[0201] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408. Communication interface 404 is used to communicate with other network elements, such as clients or other servers. The processor 402 executes program 410, specifically performing the relevant steps described above in the embodiment of the graph-structured data classification method.

[0202] Specifically, program 410 may include program code, which includes computer-executable instructions.

[0203] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The computer device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0204] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0205] Specifically, program 410 can be called by processor 402 to cause the computer device to perform the following operations:

[0206] Obtain the input data to be classified;

[0207] The data to be classified is converted into target graph structure data;

[0208] The target graph structure data is input into a graph neural network to obtain the classification result of the data to be classified. The graph neural network includes an input module, a structure entropy-based information compression module, and a prediction module. The structure entropy-based information compression module calculates the structure entropy of each node and generates node weights corresponding to each node, compressing the target graph structure data based on the node weights. The structure entropy is calculated based on the normalized connection probability between the node and its neighboring nodes.

[0209] Output the classification results.

[0210] In one alternative approach, before inputting the target graph structure data into the graph neural network to obtain the classification result of the data to be classified, the method further includes training the graph neural network, the training process being as follows:

[0211] Obtain graph structure sample data;

[0212] The graph structure sample data is input into the graph neural network to obtain the training classification results;

[0213] The total loss function is calculated based on the training classification results and category labels. The parameters of the graph neural network are adjusted according to the total loss function, and iterative training continues until a well-trained graph neural network is obtained.

[0214] In one alternative approach, inputting the graph structure sample data into a graph neural network to obtain training classification results includes:

[0215] Each node in the graph structure sample data is compressed using an information compression module based on structural entropy to obtain compressed graph structure sample data.

[0216] Cluster the compressed graph structure sample data, and based on the clustering results and the initial prototype vector, obtain k prototype embedding representations for each category of the compressed graph structure sample data.

[0217] Based on the prototype embedding representation, a Monte Carlo tree search based on information gain is performed to obtain the corresponding prototype subgraph embedding representation.

[0218] In one optional approach, the compression of each node in the graph structure sample data using a structure entropy-based information compression module to obtain compressed graph structure sample data includes:

[0219] The structural entropy of each node is calculated based on the normalized connection probability from each node to its neighboring nodes in the graph structure sample data.

[0220] The structural entropy is globally normalized to obtain the normalized entropy of each node;

[0221] Based on the normalized entropy and the preset gating function, each node in the graph structure sample data is compressed to obtain compressed graph structure sample data.

[0222] In one optional approach, calculating the structural entropy of each node based on the normalized connection probabilities from each node to its neighboring nodes in the graph structure sample data includes:

[0223] Calculate the structural entropy using the following formula:

[0224] ;

[0225] ;

[0226] in, Represents a node to neighboring nodes Normalized connection probability; Represents a node and neighboring nodes Edge weights between them; Indicates no boundary. This indicates that a connection exists;

[0227] The structural entropy is globally normalized to obtain the normalized entropy, which includes:

[0228] ;

[0229] in, For normalized entropy, To prevent small constants from being divided by zero, These represent the minimum and maximum structural entropy values ​​of all nodes in the graph structure data, respectively.

[0230] The step of compressing each node in the graph structure sample data according to the normalized entropy and a preset gating function to obtain compressed graph structure sample data includes:

[0231] The following gating function is used to compress each node in the graph structure sample data:

[0232] ;

[0233] ;

[0234] in, , To control the hyperparameters of entropy sensitivity and overall compressibility strength, These represent the information of the i-th graph structure sample before and after compression, respectively.

[0235] In one optional approach, the step of clustering the compressed graph structure sample data and obtaining k prototype embeddings for each category of the compressed graph structure sample data based on the clustering results and the initial prototype vectors includes:

[0236] For each category of the compressed graph structure sample data, k prototype vectors are randomly initialized to obtain k initialized prototype vectors for each category;

[0237] Based on the category labels corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain the clustering results.

[0238] Based on the clustering results and the k initial prototype vectors for each category, determine the k prototype embedding representations for each category.

[0239] In one alternative approach, the step of performing a Monte Carlo tree search based on information gain to obtain the corresponding prototype subgraph embedding representation, includes:

[0240] For each random sample in the compressed graph structure sample data, calculate the information gain contribution of the candidate subgraph to the category discrimination, and the similarity between the random sample and the candidate subgraph;

[0241] Based on the information gain contribution and the similarity between the random sample and the candidate subgraph, a Monte Carlo tree search is performed until k target subgraphs corresponding to each category are obtained.

[0242] This invention embodiment acquires input data to be classified; converts the data to be classified into target graph structure data; inputs the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compresses the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. This invention embodiment first constructs a graph compression mechanism driven by structural entropy to compress redundant information from the entire graph, optimize structural complexity, and highlight core subgraph regions; secondly, in the compressed graph embedding space, category-aware clustering is introduced to extract representative prototypes, improving semantic discriminativeness and intra-class consistency; finally, an information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to simultaneously weigh the impact of subgraphs on classification performance and their structural similarity to prototypes in the search space, thereby selecting key subgraphs that are both accurate and structurally consistent. Ultimately, the model achieves a balance between performance and interpretability by making predictions based on its similarity to the prototype.

[0243] This invention provides a computer-readable storage medium storing at least one executable instruction that, when executed on a computer device, causes the computer device to perform the graph structure data classification method in any of the above method embodiments.

[0244] Executable instructions can be used to cause computer devices to perform the following operations:

[0245] Obtain the input data to be classified;

[0246] The data to be classified is converted into target graph structure data;

[0247] The target graph structure data is input into a graph neural network to obtain the classification result of the data to be classified. The graph neural network includes an input module, a structure entropy-based information compression module, and a prediction module. The structure entropy-based information compression module calculates the structure entropy of each node and generates node weights corresponding to each node, compressing the target graph structure data based on the node weights. The structure entropy is calculated based on the normalized connection probability between the node and its neighboring nodes.

[0248] Output the classification results.

[0249] In one alternative approach, before inputting the target graph structure data into the graph neural network to obtain the classification result of the data to be classified, the method further includes training the graph neural network, the training process being as follows:

[0250] Obtain graph structure sample data;

[0251] The graph structure sample data is input into the graph neural network to obtain the training classification results;

[0252] The total loss function is calculated based on the training classification results and category labels. The parameters of the graph neural network are adjusted according to the total loss function, and iterative training continues until a well-trained graph neural network is obtained.

[0253] In one alternative approach, inputting the graph structure sample data into a graph neural network to obtain training classification results includes:

[0254] Each node in the graph structure sample data is compressed using an information compression module based on structural entropy to obtain compressed graph structure sample data.

[0255] Cluster the compressed graph structure sample data, and based on the clustering results and the initial prototype vector, obtain k prototype embedding representations for each category of the compressed graph structure sample data.

[0256] Based on the prototype embedding representation, a Monte Carlo tree search based on information gain is performed to obtain the corresponding prototype subgraph embedding representation.

[0257] In one optional approach, the compression of each node in the graph structure sample data using a structure entropy-based information compression module to obtain compressed graph structure sample data includes:

[0258] The structural entropy of each node is calculated based on the normalized connection probability from each node to its neighboring nodes in the graph structure sample data.

[0259] The structural entropy is globally normalized to obtain the normalized entropy of each node;

[0260] Based on the normalized entropy and the preset gating function, each node in the graph structure sample data is compressed to obtain compressed graph structure sample data.

[0261] In one optional approach, calculating the structural entropy of each node based on the normalized connection probabilities from each node to its neighboring nodes in the graph structure sample data includes:

[0262] Calculate the structural entropy using the following formula:

[0263] ;

[0264] , ;

[0265] in, Represents a node to neighboring nodes Normalized connection probability; Represents a node and neighboring nodes Edge weights between them; Indicates no boundary. This indicates that a connection exists;

[0266] The structural entropy is globally normalized to obtain the normalized entropy, which includes:

[0267] ;

[0268] in, For normalized entropy, To prevent small constants from being divided by zero, These represent the minimum and maximum structural entropy values ​​of all nodes in the graph structure data, respectively.

[0269] The step of compressing each node in the graph structure sample data according to the normalized entropy and a preset gating function to obtain compressed graph structure sample data includes:

[0270] The following gating function is used to compress each node in the graph structure sample data:

[0271] ;

[0272] ;

[0273] in, , To control the hyperparameters of entropy sensitivity and overall compressibility strength, These represent the information of the i-th graph structure sample before and after compression, respectively.

[0274] In one optional approach, the step of clustering the compressed graph structure sample data and obtaining k prototype embeddings for each category of the compressed graph structure sample data based on the clustering results and the initial prototype vectors includes:

[0275] For each category of the compressed graph structure sample data, k prototype vectors are randomly initialized to obtain k initialized prototype vectors for each category;

[0276] Based on the category labels corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain the clustering results.

[0277] Based on the clustering results and the k initial prototype vectors for each category, determine the k prototype embedding representations for each category.

[0278] In one alternative approach, the step of performing a Monte Carlo tree search based on information gain to obtain the corresponding prototype subgraph embedding representation, includes:

[0279] For each random sample in the compressed graph structure sample data, calculate the information gain contribution of the candidate subgraph to the category discrimination, and the similarity between the random sample and the candidate subgraph;

[0280] Based on the information gain contribution and the similarity between the random sample and the candidate subgraph, a Monte Carlo tree search is performed until k target subgraphs corresponding to each category are obtained.

[0281] This invention embodiment acquires input data to be classified; converts the data to be classified into target graph structure data; inputs the target graph structure data into a graph neural network to obtain the classification result of the data to be classified; wherein, the graph neural network includes an input module, an information compression module based on structural entropy, and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weights corresponding to each node, and compresses the target graph structure data according to the node weights; the structural entropy is calculated based on the normalized connection probability between the node and its neighboring nodes; and the classification result is output. This invention embodiment first constructs a graph compression mechanism driven by structural entropy to compress redundant information from the entire graph, optimize structural complexity, and highlight core subgraph regions; secondly, in the compressed graph embedding space, category-aware clustering is introduced to extract representative prototypes, improving semantic discriminativeness and intra-class consistency; finally, an information gain-guided Monte Carlo Tree Search (IG-MCTS) algorithm is designed to simultaneously weigh the impact of subgraphs on classification performance and their structural similarity to prototypes in the search space, thereby selecting key subgraphs that are both accurate and structurally consistent. Ultimately, the model achieves a balance between performance and interpretability by making predictions based on its similarity to the prototype.

[0282] This invention provides a graph structure data classification device for performing the above-described graph structure data classification method.

[0283] This invention provides a computer program that can be called by a processor to cause a computer device to execute the graph structure data classification method in any of the above method embodiments.

[0284] This invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed on a computer, cause the computer to perform the graph structure data classification method in any of the above method embodiments.

[0285] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0286] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0287] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.

[0288] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0289] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.

Claims

1. A graph structure data classification method, characterized by, The method comprises: acquiring input data to be classified; the data to be classified comprises molecular data, text data or synthetic graph data; converting the data to be classified into target graph structure data; inputting the target graph structure data into a graph neural network to obtain a classification result of the data to be classified; wherein the graph neural network comprises an input module, an information compression module based on structural entropy and a prediction module; the information compression module based on structural entropy is used to calculate the structural entropy of each node and generate the node weight corresponding to each node, and the target graph structure data is compressed according to the node weight; the structural entropy is calculated according to the normalized connection probability of the node and the neighbor node of the node; wherein the structural entropy is calculated by the following formula: ; ; wherein, denotes a node to a neighbor node with normalized connection probability; denotes an edge weight between a node and a neighbor node denotes no edge, denotes an existing connection;​ outputting the classification result.

2. The method of claim 1, wherein, Before the target graph structure data is inputted into the graph neural network to obtain the classification result of the data to be classified, the method further comprises training the graph neural network, and the training process is as follows: acquiring graph structure sample data; inputting the graph structure sample data into the graph neural network to obtain a training classification result; calculating a total loss function according to the training classification result and a class label, adjusting the parameters of the graph neural network according to the total loss function, and continuing to perform iterative training until a trained graph neural network is obtained.

3. The method of claim 2, wherein, The inputting of the graph structure sample data into the graph neural network to obtain the training classification result comprises: compressing each node in the graph structure sample data by the information compression module based on structural entropy to obtain compressed graph structure sample data; clustering the compressed graph structure sample data, and obtaining k prototype embedding representations of each category corresponding to the compressed graph structure sample data according to the clustering result and an initial prototype vector; performing Monte Carlo tree search based on information gain according to the prototype embedding representations to obtain corresponding prototype subgraph embedding representations.

4. The method of claim 3, wherein, The compression of each node in the graph structure sample data by the information compression module based on structural entropy to obtain the compressed graph structure sample data comprises: calculating the structural entropy of each node according to the normalized connection probability of each node to its neighbor node; globally normalizing the structural entropy to obtain normalized entropy of each node; compressing each node in the graph structure sample data according to the normalized entropy and a preset gating function to obtain the compressed graph structure sample data.

5. The method of claim 4, wherein: the global normalization of the structural entropy to obtain the normalized entropy comprises: ; wherein, is the normalized entropy, is a small constant to prevent division by zero, and min and max structural entropy values of all nodes in the graph structure data, respectively. the compression of each node in the graph structure sample data according to the normalized entropy and the preset gating function to obtain the compressed graph structure sample data comprises: each node in the graph structure sample data is compressed by the following gating function: ; ; wherein, ; , is a hyperparameter that controls the sensitivity to entropy and the overall compression strength, respectively represent the information of the i-th graph node of a single graph sample before and after compression.

6. The method of claim 3, wherein, the clustering of the compressed graph structure sample data, and the obtaining of k prototype embedding representations of each category corresponding to the compressed graph structure sample data according to the clustering result and an initial prototype vector comprises: For each category of the compressed graph structure sample data, k prototype vectors are randomly initialized respectively to obtain k initialized prototype vectors of each category; According to the category label corresponding to the compressed graph structure sample data, the compressed graph structure sample data is clustered to obtain a clustering result; According to the clustering result and the k initialized prototype vectors of each category, k prototype embedding representations of each category are determined.

7. The method of claim 3, wherein, According to the prototype embedding representation, the search of the Monte Carlo tree based on information gain is performed to obtain a corresponding prototype subgraph embedding representation, including: For each random sample in the compressed graph structure sample data, the information gain contribution of the candidate subgraph to the category discrimination and the similarity between the random sample and the candidate subgraph are calculated; According to the information gain contribution and the similarity between the random sample and the candidate subgraph, the search of the Monte Carlo tree is performed until k target subgraphs corresponding to each category are obtained.

8. A graph structure data classification apparatus characterized by comprising: The device comprises: An acquisition module configured to acquire inputted data to be classified; the data to be classified comprises molecular data, text data or synthetic graph data; A conversion module configured to convert the data to be classified into target graph structure data; A classification module configured to input the target graph structure data into a graph neural network to obtain a classification result of the data to be classified; wherein the graph neural network comprises an input module, an information compression module based on structural entropy and a classification submodule; the information compression module based on structural entropy is configured to calculate the structural entropy of each node and generate the node weight corresponding to each node, and compress the target graph structure data according to the node weight; the structural entropy is calculated according to the normalized connection probability of the node and the neighbor node of the node; wherein the structural entropy is calculated by the following formula: ; , ; wherein, denotes a node to a neighbor node with normalized connection probability; denotes an edge weight between a node and a neighbor node denotes no edge, denotes an existing connection;​ An output module configured to output the classification result.

9. A computer device, comprising: Comprise: A processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete the communication among each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction makes the processor execute the operation of the graph structure data classification method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction, and the executable instruction runs on the computer device to make the computer device execute the operation of the graph structure data classification method in any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for training graph neural network based on privacy protection

    CN112464292A

  • Iterative knowledge distillation-based heterogeneous graph neural network model construction method

    CN113723608A