A trusted subgraph mining method based on subgraph generation
By using a reliable subgraph mining method based on subgraph generation, and leveraging GraphSAGE and GNN classification models, reliable subgraphs are generated. This addresses the issue of strong randomness in existing drug molecule generation methods, thereby improving the accuracy of drug molecule structure analysis and the efficiency of drug development.
Patent Information
- Application Number
- CN202310585599.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-05-23
AI Technical Summary
Existing technologies struggle to effectively generate drug molecule substructures with specific properties, and the compounds generated by existing methods are too random to reflect the typical characteristics of drug molecules, making them unsuitable for drug discovery tasks.
A reliable subgraph mining method based on subgraph generation is adopted. By acquiring a dataset of drug molecule graph structures, graph embedding and training are performed using graph neural network GraphSAGE to generate reliable subgraphs, which are then combined with a GNN classification model for drug molecule structure analysis.
It improves the accuracy and efficiency of drug molecular structure analysis, helps to understand model prediction results, optimizes the drug development process, and increases the success rate of drug discovery.
Smart Images

Figure CN116631538B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of computer technology, and particularly relates to a trusted subgraph mining method based on subgraph generation. BACKGROUND
[0002] In the field of drug molecules, drug molecules are composed of various chemical atoms and chemical bonds, and different molecular structures often have different functions. The main reason for realizing the functions is due to the types of atoms and the chemical bond connection between atoms. For example, for the Mutagenicity data set, it is known that the molecular structure "NO2" and "NH2" contained in the carbon ring indicate that it has mutagenicity and can cause DNA mutations, which may lead to abnormal functions of cells or health problems such as cancer. Since mutagenicity testing is crucial for the toxicological evaluation of newly developed compounds, it has become an urgent problem to construct a generation model on the drug molecule data set to help screen and evaluate potential compounds with certain properties.
[0003] Due to the large number of atoms in drug molecules, the topological structure composed of chemical bonds between atoms is complex. It is difficult for people to directly analyze and discover compounds; in addition, there is little known compound substructure information that can make compounds have certain properties. In the existing technology, the method of reinforcement learning is mainly used to generate compound substructures with certain properties, which needs to design a complex reward function according to the data set. The resulting compounds are too random and cannot reflect the typical characteristics of drug molecules, which cannot be used for drug discovery and other tasks.
[0004] Therefore, it is necessary to design a feasible and effective drug molecule generation method to realize the mining of compounds with certain properties. SUMMARY
[0005] In order to solve the problems in the background art, the application provides a trusted subgraph mining method based on subgraph generation, which specifically comprises the following steps:
[0006] S1: Obtain a drug molecule graph structure data set, and the topological structure of the drug molecule graph structure data is represented as G i =(V i ,E i ,X i ,A i ), wherein G i represents the i-th drug molecule graph structure, V i represents the set of atomic nodes in G i , E i represents the edge set in G i , that is, the set of chemical bonds between atoms in the molecule, X i represents the set of atom types in G iThe characteristic matrix of the middle atom, A i G represents i The adjacency matrix;
[0007] S2: Randomly select I nodes as anchor nodes in the drug molecule graph structure; with each anchor node as the starting node, use breadth-first search to sample the d-hop neighbor nodes of the anchor node to obtain I first molecular relation subgraphs;
[0008] S2: Take I first molecular relation subgraphs as positive example graphs, and generate B corresponding negative example graphs for each positive example graph;
[0009] S3: Input I positive example images and B negative example images corresponding to each positive example image into the graph neural network GraphSAGE to perform graph embedding, thereby obtaining the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image; design the loss function of the graph neural network GraphSAGE based on the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image, and train the graph neural network GraphSAGE through backpropagation with the minimum loss function as the optimization objective. After convergence, the graph embedding generation model is obtained.
[0010] S5: Input the drug molecule graph structure in the drug molecule graph structure dataset into the trained GNN classification model to obtain the K target molecule relationship graphs predicted by the GNN classification model as target class c;
[0011] S6: In the target molecular relationship diagram Randomly select a node v k,1 As the starting node; initialize the target subgraph g. k,1 ={v k,1}, will g k,1 Input graph embedding generative model to obtain graph embedding z k,1 Step t, sequentially from g k,t-1 neighbor node set Mid-sampled candidate node v k,t This yields M candidate subgraphs, m∈{1,2,...,m,...,M}, where M represents g. k,t-1 The number of neighboring nodes; sequentially select M candidate subgraphs g m k,t The graph embedding Z is obtained for each candidate subgraph in the input graph embedding generative model. m k,t According to each candidate subgraph g m k,t Image embedding Z m k,t Calculate candidate subgraphs g using a scoring function. m k,tthe candidate subgraph g with the minimum score value is selected as the target subgraph g m k,t the target subgraph g k,t , until t = T steps, K target subgraphs g k,T are obtained.
[0012] S7: inputting the K target subgraphs g k,T into the GNN classification model respectively, and selecting the target subgraph with the highest probability of being classified as the target class c as the credible subgraph corresponding to the target class c.
[0013] Further, the generating of the B negative example subgraphs corresponding to each positive example subgraph includes: generating the B negative example subgraphs by deleting edges, adding edges, deleting nodes or modifying nodes in the positive example subgraph.
[0014] Further, the graph embedding performed by the graph neural network GraphSAGE includes:
[0015]
[0016]
[0017] wherein aggregate represents an aggregation function, represents the embedding vector of node u in the k-1 layer of the graph neural network GraphSAGE, and N(v) represents the neighbor node set of node v, represents the aggregation of the neighbor node embedding vectors of node v in the k layer of the graph neural network GraphSAGE; sigma represents an activation function, and W k represents the weight parameter of the k layer of the graph neural network GraphSAGE.
[0018] Further, the loss function of the graph neural network GraphSAGE includes:
[0019]
[0020]
[0021] wherein z q represents the graph embedding of graph q, z u represents the graph embedding of graph u, P represents the graph embedding set of the positive example subgraph, N represents the graph embedding set of the negative example subgraph, and alpha represents a hyperparameter.
[0022] Further, the GNN classification model includes: the GNN classification model is trained based on the GNN neural network on the drug molecule graph structure data set, and the GNN classification model is obtained after the training is completed, and the classification process of the GNN classification model is as follows:
[0023]
[0024]
[0025] y = softmax(zW) (L+1) )
[0026] Where σ represents the activation function, Let A denote the adjacency matrix and I denote the identity matrix. express The degree matrix, H (l) H represents the node features of the l-th layer of the GNN neural network. When l = 0, H (0) =X is the original feature of the node, W (l) The weights of the l-th layer of the GNN neural network are represented by: L represents the last layer of the GNN neural network; N is the number of nodes; W (L+1) is the weight matrix from the Lth layer to the output layer of the GNN neural network, and softmax is the activation function used for multi-class classification tasks.
[0027] Furthermore, the scoring function includes:
[0028]
[0029]
[0030] Where Score(z) represents the score of the candidate subgraph, z represents the graph embedding of the candidate subgraph, and z′∈Z cand Z cand Let z' represent the set of graph embeddings of the sampled subgraphs, where z' represents the graph embedding of the sampled subgraphs sampled from the drug molecule graph structure dataset.
[0031] Furthermore, the sampled sub-graphs sampled from the drug molecule graph structure dataset include:
[0032] Drug molecule graph structures are selected from the drug molecule graph structure dataset using a uniform distribution function. A node is randomly selected as the initial node in this graph, and a breadth-first search is performed to sample neighbor nodes. Sampling ends when the number of nodes equals a preset number, generating a sampled subgraph. This process is repeated 1000 times to obtain 1000 sampled subgraphs. All sampled subgraphs are then input into a graph embedding generation model to generate corresponding graph embeddings, forming a graph embedding set Z. cand .
[0033] The present invention has at least the following beneficial effects
[0034] The application can help people intuitively understand the decision basis of the GNN graph classification model for making classification prediction, greatly reducing the use restrictions of GNN in fields such as risk sensitivity and high safety requirements. In drug research and development, GNN can be used to analyze the relationship between the structure and activity of compounds, predict the activity of new compounds, and thus accelerate the process of drug research and development. The application can find the molecular structure of a drug with certain medicinal properties, allowing researchers to better understand the prediction results of the model and make adjustments and optimizations based on the results, improving the efficiency and success rate of drug research and development. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 is a method flowchart of the application;
[0036] Figure 2 is an implementation framework flowchart of the application. DETAILED DESCRIPTION
[0037] The embodiments of the application are described below through specific examples. Those skilled in the art can easily understand other advantages and effects of the application from the disclosure. The application can also be implemented or applied in different specific embodiments, and various modifications or changes can be made to the details based on different views and applications without departing from the spirit of the application. It should be noted that the diagrams provided in the following examples only illustrate the basic concept of the application in a schematic manner, and the following examples and features in the examples can be combined with each other without conflict.
[0038] The accompanying drawings are only used for illustrative purposes, and the representations are only schematic diagrams, not physical diagrams, and cannot be understood as limitations of the application; in order to better illustrate the embodiments of the application, some components in the drawings may be omitted, enlarged or reduced, and do not represent the actual size of the product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0039] The same or similar reference numerals in the drawings of the embodiments of the application correspond to the same or similar components; in the description of the application, it should be understood that the orientations or positional relationships indicated by terms such as "upper", "lower", "left", "right", "front", "back" and the like are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only used for illustrative purposes, and cannot be understood as limitations of the application, for those skilled in the art, the specific meanings of the above terms can be understood according to the specific circumstances.
[0040] Please refer to Figure 1 and Figure 2This invention proposes a reliable subgraph mining method based on subgraph generation, comprising:
[0041] S1: Obtain the drug molecule graph structure dataset, the topological structure of which is represented by G. i =(V i E i ,X i A i ), where G i V represents the structure of the i-th drug molecule. i G represents i The set of atomic nodes in E i G represents i The edge set in a molecule is the set of chemical bonds between atoms, X. i G represents i The characteristic matrix of the middle atom, A i G represents i The adjacency matrix;
[0042] S2: Randomly select I nodes as anchor nodes in the drug molecule graph structure; with each anchor node as the starting node, use breadth-first search to sample the d-hop neighbor nodes of the anchor node to obtain I first molecular relation subgraphs;
[0043] S2: Take I first molecular relation subgraphs as positive example graphs, and generate B corresponding negative example graphs for each positive example graph;
[0044] S3: Input I positive example images and B negative example images corresponding to each positive example image into the graph neural network GraphSAGE to perform graph embedding, thereby obtaining the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image; design the loss function of the graph neural network GraphSAGE based on the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image, and train the graph neural network GraphSAGE through backpropagation with the minimum loss function as the optimization objective. After convergence, the graph embedding generation model is obtained.
[0045] S5: Input the drug molecule graph structure in the drug molecule graph structure dataset into the trained GNN classification model to obtain the K target molecule relationship graphs predicted by the GNN classification model as target class c;
[0046] S6: In the target molecular relationship diagram Randomly select a node v k,1 As the starting node; initialize the target subgraph g. k,1 ={v k,1}, will g k,1 Input graph embedding generative model to obtain graph embedding z k,1 Step t, sequentially from gk,t-1 neighbor node set of g sampling candidate node v k,t , obtaining M candidate subgraphs g k,t-1 , m∈{1, 2, …, m, …, M}, M represents the number of neighbor nodes of g m k,t inputting each candidate subgraph into the graph embedding generation model to obtain the graph embedding Z m k,t of each candidate subgraph g m k,t m k,t calculating the score value of each candidate subgraph g m k,t using the scoring function, selecting the candidate subgraph g m k,t with the minimum score value as the target subgraph g k,t , until t=T steps, obtaining K target subgraphs g k,T ;
[0047] S7: inputting the K target subgraphs g k,T into the GNN classification model respectively, and selecting the target subgraph with the highest probability of being classified as the target class c as the trusted subgraph corresponding to the target class c.
[0048] Further, the generating B negative example subgraphs corresponding to each positive example subgraph comprises: generating B negative example subgraphs by deleting edges, adding edges, deleting nodes or modifying nodes in the positive example subgraph.
[0049] Further, the graph embedding performed by the graph neural network GraphSAGE comprises:
[0050]
[0051]
[0052] wherein, aggregate represents an aggregation function, represents the embedding vector of node u in the k-1 layer of the graph neural network GraphSAGE, and N(v) represents the neighbor node set of node v, represents the aggregation of the neighbor node embedding vectors of node v in the k layer of the graph neural network GraphSAGE; σ represents an activation function, W k represents the weight parameter of the k layer of the graph neural network GraphSAGE.
[0053] Further, the loss function of the graph neural network GraphSAGE comprises:
[0054]
[0055]
[0056] where z q represents the graph embedding of graph q, z u represents the graph embedding of graph u, P represents the set of graph embeddings of positive example graphs, N represents the set of graph embeddings of negative example graphs, and a represents a hyperparameter.
[0057] Further, the GNN classification model comprises: the GNN classification model is trained based on the GNN neural network on the drug molecule graph structure data set, and the GNN classification model is obtained after the training is completed, and the classification process is as follows:
[0058]
[0059]
[0060] y = softmax(zW (L+1) )
[0061] wherein σ represents an activation function, A represents an adjacency matrix, and I represents a unit matrix, represents the degree matrix of H (l) represents the node feature of the lth layer of the GNN neural network, when l = 0, H (0) = X is the original feature of the node, W (l) represents the weight parameter of the lth layer of the GNN neural network; L represents the last layer of the GNN neural network, and N is the number of nodes; W (L+1) is the weight matrix of the Lth layer to the output layer of the GNN neural network, and softmax is an activation function used for multi-classification tasks.
[0062] Further, the scoring function comprises:
[0063]
[0064]
[0065] wherein Score(z) represents the score value of the candidate subgraph, z represents the graph embedding of the candidate subgraph, z' ∈ Z cand , Z cand represents the set of graph embeddings of the sampled subgraph, and z' represents the graph embedding of the sampled subgraph sampled on the drug molecule graph structure data set.
[0066] Further, the sampled subgraph on the drug molecule graph structure data set comprises:
[0067] Select a drug molecule graph structure from the drug molecule graph structure dataset by a uniform distribution function, randomly select a node in the graph as an initial node, sample neighbor nodes by breadth-first search, and end the sampling to generate a sampling subgraph when the number of nodes is equal to the preset number of nodes, repeat the execution 1000 times to obtain 1000 sampling subgraphs, input all the sampling subgraphs into the graph embedding generation model to generate corresponding graph embeddings to form a graph embedding set Z cand .
[0068] In Example 1, the drug molecule graph structure dataset used by the present application is the open source medical field dataset Mutagenicity, which contains 4337 compound samples, each sample has a binary label indicating whether it is a mutagenic compound. The Mutagenicity dataset is divided into a training set, a validation set and a test set according to a ratio of 7:2:1, and the dataset is trained by GNN. The method of the present application generates a batch of new drug molecules with fewer nodes than the original drug molecule nodes on the GNN classified mutagenic compound dataset. The new drug molecules are spliced to obtain new drug molecules, which are input into the trained GNN to verify that the probability value of being classified as a mutagenic class is very high. This greatly helps us understand the molecular structure of the mutagenic compound class in the Mutagenicity dataset, and provides a reference for us to design new mutagenic compound class molecular compounds.
[0069] In Example 2, the drug molecule graph structure dataset used by the present application is the dataset PROTEINS used for protein classification tasks, which contains the amino acid sequences and secondary structure information of 1113 protein molecules. Each sample has a binary label indicating whether the protein belongs to the enzyme class. The PROTEINS dataset is divided into a training set, a validation set and a test set according to a ratio of 7:2:1, and the dataset is trained by GNN. The method of the present application generates a batch of new and more compact protein molecules on the GNN classified enzyme class dataset, which can help scientists understand what typical structural features the enzyme class protein has, and at the same time, the generated protein molecules can be connected to a certain protein molecule, which can make the connected protein molecule be classified as an enzyme class by GNN, helping to design new proteins with enzyme class characteristics.
[0070] Finally, it should be pointed out that the above examples are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and all should be covered in the scope of the claims of the present application.
Claims
1. A reliable subgraph mining method based on subgraph generation, characterized in that, Specifically, it includes: S1: Obtain the drug molecule graph structure dataset, the topological structure of which is represented by G. i =(V i E i ,X i A i ), where G i V represents the structure of the i-th drug molecule. i G represents i The set of atomic nodes in E i G represents i The edge set in a molecule is the set of chemical bonds between atoms, X. i G represents i The characteristic matrix of the middle atom, A i G represents i The adjacency matrix; S2: Randomly select I nodes as anchor nodes in the drug molecule graph structure; with each anchor node as the starting node, use breadth-first search to sample the d-hop neighbor nodes of the anchor node to obtain I first molecular relation subgraphs; S2: Take I first molecular relation subgraphs as positive example graphs, and generate B corresponding negative example graphs for each positive example graph; S3: Input I positive example images and B negative example images corresponding to each positive example image into the graph neural network GraphSAGE to perform graph embedding, thereby obtaining the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image; design the loss function of the graph neural network GraphSAGE based on the graph embeddings of the I positive example images and the graph embeddings of the B negative example images corresponding to each positive example image, and train the graph neural network GraphSAGE through backpropagation with the minimum loss function as the optimization objective. After convergence, the graph embedding generation model is obtained. S5: Input the drug molecule graph structure in the drug molecule graph structure dataset into the trained GNN classification model to obtain the K target molecule relationship graphs predicted by the GNN classification model as target class c; S6: In the target molecular relationship diagram Randomly select a node v k,1 As the starting node; initialize the target subgraph g. k,1 ={v k,1 }, will g k,1 Input graph embedding generative model to obtain graph embedding z k,1 Step t, sequentially from g k,t-1 neighbor node set Mid-sampled candidate node v k,t This yields M candidate subgraphs, m∈{1,2,...,m,...,M}, where M represents g. k,t-1 The number of neighboring nodes; sequentially select M candidate subgraphs g m k,t The graph embedding Z is obtained for each candidate subgraph in the input graph embedding generative model. m k,t According to each candidate subgraph g m k,t Image embedding Z m k,t Calculate candidate subgraphs g using a scoring function. m k,t Based on the score, select the candidate subgraph g with the smallest score. m k,t As the target subgraph g k,t Until step t = T, K target subgraphs g are obtained. k,T ; S7: Transform K target subgraphs g k,T Input the GNN classification model into each model, and select the target subgraph with the highest probability of being classified as target class c as the reliable subgraph corresponding to target class c.
2. The reliable subgraph mining method based on subgraph generation according to claim 1, characterized in that, The step of generating B corresponding negative example graphs for each positive example graph includes generating B negative example graphs by deleting edges, adding edges, deleting nodes, or modifying nodes in the positive example graph.
3. The reliable subgraph mining method based on subgraph generation according to claim 1, characterized in that, The graph embedding performed by the graph neural network GraphSAGE includes: Where aggregate represents an aggregate function. Let N(v) represent the embedding vector of node u in the (k-1)th layer of the graph neural network GraphSAGE, and let N(v) represent the set of neighboring nodes of node v. This represents the aggregation of the embedding vectors of the neighboring nodes of node v in the k-th layer of the graph neural network GraphSAGE; σ represents the activation function, W k This represents the weight parameters of the k-th layer of the GraphSAGE neural network.
4. The reliable subgraph mining method based on subgraph generation according to claim 1, characterized in that, The loss function of the graph neural network GraphSAGE includes: Among them, z q Let z represent the graph embedding of graph q. u Let P represent the graph embedding of graph u, P represent the set of graph embeddings of positive example graphs, N represent the set of graph embeddings of negative example graphs, and α represent the hyperparameter.
5. The reliable subgraph mining method based on subgraph generation according to claim 1, characterized in that, GNN classification models include: y=softmax(zW (L+1) ) Where σ represents the activation function, Let A denote the adjacency matrix and I denote the identity matrix. express The degree matrix, H (l) H represents the node features of the l-th layer of the GNN neural network. When l = 0, H (0) =X is the original feature of the node, W (l) The weights of the l-th layer of the GNN neural network are represented by: L represents the last layer of the GNN neural network; N is the number of nodes; W (L+1) is the weight matrix from the Lth layer to the output layer of the GNN neural network, and softmax is the activation function used for multi-class classification tasks.
6. The reliable subgraph mining method based on subgraph generation according to claim 1, characterized in that, The scoring function includes: Where Score(z) represents the score of the candidate subgraph, z represents the graph embedding of the candidate subgraph, and z′∈Z cand Z cand Let z' represent the set of graph embeddings of the sampled subgraphs, where z' represents the graph embedding of the sampled subgraphs sampled from the drug molecule graph structure dataset.
7. A reliable subgraph mining method based on subgraph generation according to claim 6, characterized in that, The sampled subgraphs sampled from the drug molecule graph structure dataset include: Drug molecule graph structures are selected from the drug molecule graph structure dataset using a uniform distribution function. A node is randomly selected as the initial node in this graph, and a breadth-first search is performed to sample neighbor nodes. Sampling ends when the number of nodes equals a preset number, generating a sampled subgraph. This process is repeated 1000 times to obtain 1000 sampled subgraphs. All sampled subgraphs are then input into a graph embedding generation model to generate corresponding graph embeddings, forming a graph embedding set Z. cand .
Citation Information
Patent Citations
Molecular activity prediction method based on multi-sample substructure feature fusion
CN111916143A
Molecular generation method based on subgraph-variational self-encoding structure
CN112397157A