Chemical molecular structure interpretable method based on graph neural network

By converting chemical molecules into molecular graphs and splitting them into isomorphic functional groups, combining domain knowledge and attribution functions to generate visual interpretation sub-graphs, the explanatory problem of graph neural networks in chemical molecular structure analysis is solved, achieving higher semantics and reducing interpretation complexity.

CN120297325APending Publication Date: 2025-07-11CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510363195.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The existing graph neural network interpretation methods have limitations in semantic understanding, computational complexity and interaction capture of sub-graph extraction, and are difficult to meet the high transparency and interpretability requirements in practical applications, especially in chemical molecular structure analysis.

Method used

By obtaining the chemical molecular smiles expression, converting it into a molecular graph and splitting it into isomorphic functional group subgraphs, node and edge features are extracted, functional group influence is simulated using masking strategies, and subgraph contribution degree is calculated based on domain knowledge and attribution functions to generate a visual interpretation subgraph.

Benefits of technology

The semanticity of chemical molecular structure interpretation and reduce the complexity of interpretation, the generated interpretation subgraph is more intuitive and valuable, and can better understand the model decision process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297325A_ABST
    Figure CN120297325A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of graph neural networks, and relates to a graph neural network-based chemical molecular structure interpretable method, which comprises the following steps: acquiring a chemical molecule smiles expression, and converting the chemical molecule smiles expression into a molecular graph; splitting the molecular diagram to obtain isomorphic functional group sub-diagrams; node features and edge features are extracted from the molecular graph; masking the isomorphic functional group sub-graph according to the node features and the edge features; inputting the molecular graph into the trained graph neural network for molecular structure performance prediction to obtain a prediction result; processing the masked isomorphic functional group sub-graph by adopting an interpretation sub-graph extraction function according to a prediction result to obtain a molecular performance interpretation sub-graph; carrying out visualization on the molecular performance interpretation subgraph; according to the method, the prediction contribution degree of the sub-graph to the neural network is calculated through the attribution function to explain input, and the semantic property of an explanation result is improved and the explanation complexity is reduced based on the constraint of domain knowledge in the explanation process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of graph neural networks, and particularly relates to an interpretable method for chemical molecular structures based on graph neural networks. Background Art

[0002] Graph neural networks (GNNs) have demonstrated excellent performance in multiple fields in recent years, especially in computer vision, natural language processing, and graph data analysis, achieving remarkable results. As an important technology in the field of graph machine learning, GNNs have shown great advantages in processing unstructured data, especially playing an excellent role in tasks such as node classification, graph classification, and link prediction. To improve the performance of graph models, GNNs have proposed various innovative methods, such as graph convolution, graph attention, and graph pooling technologies, which continuously promote the research and application of graph neural networks.

[0003] Despite the significant breakthroughs in performance, the "black box" nature of GNNs remains a major obstacle to their widespread application. Especially in some practical application scenarios with high requirements for interpretability (such as the medical and financial fields), due to the lack of transparency in the decision-making process of GNNs, many practical problems are difficult to directly solve through the model's output. Therefore, the post hoc interpretation of graph neural networks has become an urgent challenge, aiming to make the model's prediction process clearer and verifiable, so as to meet the needs of practical applications.

[0004] Different from traditional image or text data, graph-structured data has unique characteristics, especially the complex relationships and non-linear structures between nodes and edges. Therefore, traditional image and text interpretation methods often cannot be directly applied to the interpretation process of graph neural networks. This difference has prompted researchers to propose specialized interpretation methods for GNNs, such as GNNExplainer, PGExplainer, etc. These methods help researchers more intuitively understand the model's decision-making process by generating local subgraphs and analyzing their impact on the model's output, thereby improving the transparency and credibility of the model.

[0005] In addition to local subgraph methods, in recent years, perturbation-based interpretable methods have also received extensive attention. Perturbation-based methods artificially modify some elements in the graph (such as nodes or edges), observe the impact of these modifications on the model prediction results, and thereby reveal which graph elements (nodes, edges, features, etc.) play a decisive role in the prediction results. Specifically, this method generally includes three steps: First, change the local or global structure of the graph through perturbation operations (such as deleting nodes, deleting edges, or adding noisy nodes); then, based on the modified graph, use the GNN model for prediction and compare it with the prediction results of the original graph; finally, evaluate which graph elements have a greater impact on the model's prediction according to the degree of prediction change. Perturbation-based graph neural interpretation frameworks are as Figure 1 shown.

[0006] Perturbation-based interpretable methods effectively evaluate the contributions of each element in the graph structure, but there are also certain limitations. Although many methods have successfully revealed important structural elements in the decision-making process of GNNs to some extent, these methods still face many challenges. For example, GNNExplainer and PGExplainer generate subgraph-level explanations by post-processing combinations of nodes or edges, but the generated subgraphs do not always form a connected whole, which limits the comprehensibility and operability of the interpretation results.

[0007] In summary, although existing interpretation methods have improved the interpretability of graph neural networks to some extent, they still face many challenges in practical applications, especially in aspects such as semantic understanding of subgraph extraction, computational complexity, and comprehensive capture of interactions. Future research needs to continue to deeply explore how to solve these problems through more effective structural constraints and algorithm optimizations, improve the transparency and interpretability of GNNs in processing complex graph structure data, and ultimately enable graph neural networks to be more widely applied in multiple practical application fields. Summary of the Invention

[0008] To solve the problems existing in the above prior art, the present invention proposes an interpretable method for chemical molecular structures based on graph neural networks, which includes: obtaining the smiles expression of a chemical molecule, converting the smiles expression of the chemical molecule into a molecular graph; splitting the molecular graph to obtain isomorphic functional group subgraphs; extracting node features and edge features from the molecular graph; masking the isomorphic functional group subgraphs according to the node features and edge features; inputting the molecular graph into a trained graph neural network for predicting the performance of the molecular structure to obtain a prediction result; processing the masked isomorphic functional group subgraphs using an explanation subgraph extraction function according to the prediction result to obtain a molecular performance explanation subgraph; visualizing the molecular performance explanation subgraph.

[0009] Advantages of the present invention:

[0010] The present invention calculates the prediction contribution degree of sub - graphs to the neural network through an attribution function to explain the input. During the explanation process, based on the constraints of domain knowledge, the semantic property of the explanation result is improved and the complexity of the explanation is reduced. Brief Description of the Drawings

[0011] Figure 1 It is a framework structure diagram of a perturbation - based GNN explanation method;

[0012] Figure 2 It is a model framework structure diagram of the present invention;

[0013] Figure 3 It is an overall flowchart of the present invention;

[0014] Figure 4 It is a visualization diagram of the explanation result of the present invention. Detailed Embodiment

[0015] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts belong to the scope of protection of the present invention.

[0016] An interpretable method for chemical molecular structures based on graph neural networks, as Figure 3 shown, the method includes: obtaining a chemical molecule smiles expression, converting the chemical molecule smiles expression into a molecular graph; splitting the molecular graph to obtain isomorphic functional group sub - graphs; extracting node features and edge features from the molecular graph; masking the isomorphic functional group sub - graphs according to the node features and edge features; inputting the molecular graph into a trained graph neural network for predicting the performance of the molecular structure to obtain a prediction result; processing the masked isomorphic functional group sub - graphs using an explanation sub - graph extraction function according to the prediction result to obtain molecular property explanation sub - graphs; visualizing the molecular property explanation sub - graphs.

[0017] Graph - structured data contains rich structural information, and this information largely determines the attributes and functions of graph data. For example, for a molecular data set, some functional groups contained therein are considered to be its important sub - structures and play a decisive role in its molecular properties. However, the existing GCN models based on node masking fail to reveal these key functional groups. To overcome this problem and expand the practical application scope of GCN, functional groups are used to extract important sub - graphs node by node instead of nodes.

[0018] Utilize domain knowledge to extract key substructures from molecular datasets. Subgraph extraction based on domain knowledge is not only more intuitive but also more valuable. Different datasets correspond to different domain knowledge. For molecular datasets, domain knowledge can be regarded as the functional groups therein, which carry rich semantic information and play an important role in molecular classification or prediction tasks. Based on this, a new method is proposed to extract key substructures, including intrinsic properties and topological structures, by applying domain knowledge in molecular datasets. The toxicity of the molecule "NC1CCC(N(O)O)CC(O)C1" is mainly determined by the nitro group 'N(O)O', which is a subgraph of the original graph and also a functional group. Therefore, the main task of the substructure extraction of the present invention is to extract the nitro group and other functional groups.

[0019] In this embodiment, masking the isomorphic functional group subgraphs includes: selecting specific functional group subgraphs and assigning masking weights to control their contribution degrees in the model; simulating the influence of functional groups on the overall molecular properties through a masking mechanism and adopting a 01 masking strategy. Among them, simulating the influence of functional groups on the overall molecular properties by adopting the 01 masking strategy includes: eliminating the node information of the functional group by multiplying the 01 mask with the node features. Judging the influence of the functional group on the model prediction through model prediction.

[0020] Extract functional groups from molecules through graph isomorphism and subgraph isomorphism, and obtain a set of substructures with clear semantics. Then, explore key subgraphs based on these substructures. The model framework is as Figure 2 shown. Finally, the performance of the method of the present invention was tested on six public datasets and compared with five of the most classic GCN interpretable methods.

[0021] An interpretable method for graph neural networks under domain knowledge constraints, which includes the following steps:

[0022] Step 1: Data input: For a molecular dataset, input the molecular smiles expressions therein.

[0023] Step 2: Data splitting: Split the molecular data obtained in Step 1. Specifically, extract functional groups from molecules through graph isomorphism and subgraph isomorphism, and obtain a set of substructures with clear semantics. Use some common functional groups as domain knowledge to extract the functional groups in the input data.

[0024] Step 3: Aggregate subgraphs. This step is to use an aggregation function to extract the explanatory subgraph. Specifically, calculate the contribution of the explanatory subgraph to the prediction result at each step, add the newly unselected substructures to the explanatory subgraph in the next step, select the substructure with the largest increase in contribution and add it to the explanatory subgraph in the previous step to generate a new explanatory subgraph. Repeat this step, and the higher the contribution degree under the condition that the sparsity of the explanatory subgraph is not lower than the given sparsity, the better.

[0025] Step 4: Input the interpretation result, which is the interpretation sub-graph generated in Step 3, as the interpretation result of the current input.

[0026] In this embodiment, as Figure 2 shown, the fragmentation of the graph involves using the graph isomorphism method to split the input molecular graph. First, collect the currently known functional groups, and use the definition of sub-graph isomorphism to split the input graph into n sub-structures, that is where represents a functional group or a fragment.

[0027] Let be a graph, be the set of all isomorphic sub-graphs of and the remaining set of non-connected sub-graphs is which is the fragment set of

[0028] Let be a graph, be the n sub-graphs of and be the set of isomorphic sub-graphs and the fragment set of respectively. For each if it always satisfies then is called a partition of

[0029] If is a part of then some members of belong to the fragment set while some others belong to the set of isomorphic sub-graphs that is:

[0030]

[0031] After obtaining the partition of each sub-structure in

[0032]

[0033] In this embodiment, the interpretable subgraph extraction includes: a graph can be divided into a combination of isomorphic functional group subgraphs and the remaining unconnected subgraphs. Based on this fact, measuring the contribution of these subgraphs to the output is very important for searching for important subgraphs. The degree of influence of a masked substructure on the overall prediction is called attribution. Next, an importance measurement function is given to calculate the contribution of these subgraphs to the output, and then the interpretable subgraphs of a given graph are extracted.

[0034] Let be a sample set containing m graphs, be the label set, be a graph in X, be part of. f: be a trained GCN model. For any subset and y ∈ Y, the importance of can be measured based on f.

[0035] Processing the masked isomorphic functional group subgraphs using the interpretable subgraph extraction function includes: calculating the contribution degree of each subgraph and evaluating its impact on the overall molecular performance; using the attribution method to quantify the importance of the subgraph to the prediction result, that is, quantifying the and probability difference between; screening out the most critical functional groups for the prediction result through the extraction function; combining visualization tools to intuitively display the key subgraphs and their contribution degrees, and generating the final molecular performance interpretable subgraphs.

[0036] The expression for the contribution degree of each subgraph is:

[0037]

[0038] where in f is the trained model, f(G|y) represents the prediction probability of the model classifying graph G into class y, represents the remaining subgraph after removing the node features of subgraph from graph G. μ f function is to measure the importance of the subgraph within the function.

[0039] The extraction function is: each time a subgraph is selected and added to the subgraph obtained by the extraction function in the previous step; finally, the subgraph that makes μ f the largest is added to the interpretation result.

[0040] According to the above content, the importance of subgraphs for model prediction can be calculated. The importance calculation in this step can use the final probability difference of model prediction or mutual information to measure, both of which are a way to measure the importance of subgraphs for model prediction. In the first step of explaining the subgraph extraction, from the obtained set of substructures, select the substructure with the highest importance for model prediction as the explanation result generated in the first step of the subgraph extraction process. Then, according to the given sparsity, generate the final explanation subgraph step by step.

[0041] Let be a sample set containing m graphs, Y be the label set,

[0042] be a part of, be the interpretable subgraph of extracted in the i-th iteration. For a given sparsity ∈ > 0, and the objective function for the interpretable subgraph extraction in the (i + 1)-th iteration is:

[0043]

[0044] The pseudo-code for subgraph extraction is as follows:

[0045]

[0046] In this embodiment, as Figure 4 shown, the method of the present invention is compared with other existing explanation methods, and the explanation results are highlighted in bold. Figure 3 Shows the visualization effects of gnexplorer, SubgraphX and the method of this application on the Mutagenicity dataset. On the mutagenicity dataset, nitro and amino groups are identified as toxic groups, while carboxyl groups are identified as detoxifying groups.

[0047] In drug research and development, the interpretability of graph neural networks plays a crucial role, especially in aspects such as molecular structure prediction, drug screening, and optimization. By representing molecules as graphs, GNNs can deeply learn the chemical features of molecules and predict their biological activities or other key properties. During the drug screening process, GNNs can not only help identify potential candidate drug molecules but also, through interpretability techniques, reveal which specific atoms or chemical bonds have a key impact on drug activity, thereby optimizing drug design. At the same time, GNNs can also be used for the analysis of the interaction between drugs and targets, helping to predict the binding affinity of drugs to target molecules. By focusing on important chemical features and interactions, the targeting and effectiveness of drugs can be further optimized. In toxicity prediction and side effect analysis, GNNs can identify structural features that may cause adverse reactions by analyzing molecular graphs, avoiding potential risks during the research and development process. In drug repositioning, GNNs provide new application directions for drugs by analyzing the relationships between approved drugs and genes or pathways related to different diseases. Generally speaking, the interpretability of GNNs provides a transparent and scientific basis for drug research and development, helping researchers develop new drugs more accurately and improving the efficiency and safety of drug research and development.

[0048] The above-mentioned embodiments have further elaborated on the purpose, technical solutions, and advantages of the present invention. It should be understood that the above-mentioned embodiments are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made to the present invention within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. An interpretable method for chemical molecular structures based on graph neural networks, characterized in that, Including: Obtain the SMILES expression of a chemical molecule, convert the SMILES expression of the chemical molecule into a molecular graph; split the molecular graph to obtain isomorphic functional group subgraphs; Extract node features and edge features from the molecular graph; mask the isomorphic functional group subgraphs according to the node features and edge features; input the molecular graph into a trained graph neural network for molecular structure performance prediction to obtain a prediction result; use an explanation subgraph extraction function to process the masked isomorphic functional group subgraphs according to the prediction result to obtain a molecular performance explanation subgraph; Visualize the molecular performance explanation subgraph.

2. An interpretable method for the chemical molecular structure based on graph neural network according to claim 1, wherein Converting the SMILES expression of a chemical molecule into a molecular graph includes: parsing the SMILES expression to determine the atoms and bond connection relationships in the molecule; constructing a molecular graph according to the parsing result, where the nodes in the molecular graph represent atoms and the edges represent chemical bonds.

3. An interpretable method for chemical molecular structures based on graph neural networks according to claim 1, characterized in that, Splitting the molecular graph includes: identifying the functional groups and substructures in the molecular graph; using a subgraph matching algorithm based on graph isomorphism detection to determine isomorphic functional group subgraphs, and generating a functional group subset according to the isomorphic functional group subgraphs.

4. An interpretable method for chemical molecular structures based on graph neural networks according to claim 3, characterized in that, Using a subgraph matching algorithm based on graph isomorphism detection to determine isomorphic functional group subgraphs includes: converting the SMILES expression of the molecule and the SMILES expression of the functional group into graph structures; calculating whether the subgraphs in the molecule are isomorphic to the graph structure of the functional group. If they are isomorphic, save the position information of the subgraphs in the molecule, otherwise they are not isomorphic functional group subgraphs; output the matching subgraph structures and the non-matching subgraph structures.

5. An interpretable method for chemical molecular structures based on graph neural networks according to claim 1, characterized in that, Extracting node features and edge features from the molecular graph includes: node features include atomic number, number of valence electrons, electronegativity, hybridization orbital type, and aromaticity; edge features include bond type, polarity, and conjugation; normalize the node features and edge features.

6. An interpretable method for chemical molecular structure based on graph neural network according to claim 1, characterized in that, Masking the isomorphic functional group subgraphs includes: selecting specific functional group subgraphs, assigning mask weights to control their contribution degrees in the model; simulating the influence of functional groups on the overall molecular properties through a masking mechanism and using a 01 masking strategy.

7. An interpretable method for chemical molecular structure based on graph neural network according to claim 1, characterized in that The graph neural network processes the molecular graph by: using multiple convolutional layers in the graph neural network to encode the node features in the molecular graph, so that each node gradually aggregates the information of multi-hop neighbor nodes; inputting the encoded node features into a fully connected layer to obtain the predicted properties of the molecular graph.

8. An interpretable method for chemical molecular structures based on graph neural networks according to claim 1, characterized in that, Using an explanation subgraph extraction function to process the masked isomorphic functional group subgraphs includes: calculating the contribution degree of each subgraph and evaluating its influence on the overall molecular performance; using an attribution method to quantify the importance of the subgraphs to the prediction result; screening out the functional groups that are most critical to the prediction result through an extraction function; combining visualization tools to intuitively display the key subgraphs and their contribution degrees to generate the final molecular performance explanation subgraph.