An interpretable molecular property prediction method and system based on a graph neural network

By employing an interpretable molecular property prediction method based on graph neural networks, functional group trees are extracted and generated, and edge masks are optimized. This addresses the issues of insufficient interpretability and scarce labeled data in existing technologies, thereby improving the accuracy of molecular property prediction and the interpretability of the model.

CN115798629BActive Publication Date: 2026-02-06HARBIN UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211702643.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2026-02-06
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

Existing graph neural networks lack interpretability in predicting molecular properties, making the models difficult to understand and requiring a large amount of labeled data, resulting in low prediction accuracy.

Method used

An interpretable molecular property prediction method based on graph neural networks is proposed. Functional groups are extracted using a trained graph neural network model to generate a functional group tree. The connection mode of functional groups is learned through autoregression, and message passing is performed using a GRU network to optimize the edge mask and generate an interpretable molecular property prediction network.

Benefits of technology

It improves the accuracy of molecular property prediction, enhances the interpretability and generalization ability of the model, and reduces the dependence on labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115798629B_ABST
    Figure CN115798629B_ABST
Patent Text Reader

Abstract

The application relates to a kind of explainability molecular property prediction method and system based on graph neural network, and relates to the field of molecular property prediction.The present application is to solve the problem of low prediction accuracy of the existing molecular property prediction method.The present application comprises: obtaining a small molecule data set to be predicted, inputting the small molecule data set into a molecular property prediction network to obtain molecular properties;The molecular property prediction network is obtained by the following way: obtaining a small molecule data set, obtaining a trained graph neural network model using the small molecule data set;The trained graph neural network model and the small molecule data set are input into the explainable graph neural network model to obtain functional groups;Functional groups are generated using functional group trees, and a pre-trained first graph neural network model is obtained by pre-training the first graph neural network using the functional group tree;The pre-trained first graph neural network model is fine-tuned to obtain a molecular property prediction network.The present application is used for predicting molecular properties.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of molecular property prediction, in particular to an interpretable molecular property prediction method and system based on a graph neural network. BACKGROUND

[0002] In the field of material discovery and drug development, molecular property prediction is considered an important task and is a major research direction in material chemistry, physics and chemistry. In the field of virtual screening, a small number of molecules are screened from a dataset of hundreds of millions of molecules for subsequent synthesis, and molecular property prediction can greatly reduce the time and cost required in these fields, so molecular property prediction is a focus of research in the field.

[0003] Nowadays, graph neural networks are widely used for molecular property prediction. Since graph neural networks aggregate the features of surrounding nodes and the topological structure of the graph for prediction, it is particularly important to identify important subgraphs. However, existing methods for explaining general graph neural networks have insufficient ability to explain graph structures, making it difficult to understand black-box models. In addition, a large amount of labeled data is required for molecular property prediction to achieve high effectiveness, but it is unrealistic to obtain so much labeled data, which is time-consuming and labor-intensive. Therefore, there is still a problem of a lack of labeled data for molecular property prediction, which reduces the generalization ability of the model and leads to low accuracy of molecular property prediction. SUMMARY

[0004] The present application aims to solve the problem of low prediction accuracy in existing molecular property prediction methods, and proposes an interpretable molecular property prediction method and system based on a graph neural network.

[0005] An interpretable molecular property prediction method based on a graph neural network includes the following steps: obtaining a small molecule dataset to be predicted, inputting the small molecule dataset to be predicted into a molecular property prediction network to obtain a molecular property;

[0006] The molecular property prediction network is obtained by the following method:

[0007] Step one, obtain a small molecule dataset and use the small molecule dataset to obtain a training set and a validation set, then use the training set to train a graph neural network model to obtain a trained graph neural network model;

[0008] Step two, input the trained graph neural network model obtained in step one and the small molecule dataset into an interpretable graph neural network model to obtain a functional group;

[0009] Step three, generate a functional group tree using the functional group obtained in step two, and use the functional group tree to learn the connection mode of the functional group for the first graph neural network to obtain a pre-trained first graph neural network model;

[0010] Step four, fine-tuning the pre-trained first graph neural network model obtained in step three to obtain a molecular property prediction network.

[0011] Further, the step one includes the following steps of obtaining a small molecule dataset, and using the small molecule dataset to obtain a training set and a validation set, and then using the training set to train a graph neural network model to obtain a trained graph neural network model.

[0012] Step one, obtaining a small molecule dataset, and converting the small molecule dataset into a molecular graph form, and dividing the small molecule dataset in the form of a molecular graph into a training set and a validation set;

[0013] The molecular graph includes the following features: atomic order number, total number of atomic connections, atomic form charge, atomic hybridization mode, index of the first atom of the bond, index of the end atom of the bond, bond type, and whether it is a conjugated bond;

[0014] Step one, using the training set to train a graph neural network model to obtain a trained graph neural network model:

[0015] The activation function of the graph neural network model is RELU;

[0016] The AdamW optimization algorithm is used for the training graph neural network model optimizer, and the L2 norm regularization is used for the weight decay;

[0017] Step one, using the validation set to verify the trained graph neural network model, if the accuracy of the trained graph neural network is greater than or equal to a first threshold, step two is executed; if the accuracy of the trained graph neural network model is less than the first threshold, the hyperparameters of the trained graph neural network are adjusted to re-execute step one, so that the accuracy of the trained graph neural network is greater than the first threshold, and then step two is executed.

[0018] Further, the step two includes the following steps of inputting the trained graph neural network model obtained in step one and the small molecule dataset into an interpretable graph neural network model to obtain a functional group.

[0019] Step two, clearing the edge mask in the interpretable graph neural network model, setting an initially randomly generated edge mask, using the initially randomly generated edge mask as a trainable parameter, calculating the loss function of the trainable parameter, then backpropagating and updating the gradient to obtain an optimal edge mask;

[0020] Step two, set the edge mask threshold threshold, compare the optimal edge mask mapping value obtained in step two one with threshold, if the optimal edge mask mapping value is less than threshold, remove the edge in the molecular graph, if the optimal edge mask is greater than or equal to threshold, keep the edge, and connect the reserved edges into a subgraph as a functional group.

[0021] Further, the training parameter loss function can be as follows:

[0022] loss=CrossEntropy(f(data,model,edge_mask),label)+Size(edge_mask)+Discrete(edge_mask)

[0023] Wherein, CrossEntropy() is the cross entropy loss function, (f(data,model,edge_mask),label) is the loss of the output of the trained graph neural network model and the target label, Size(edge_mask) is the size of the edge mask, and Discrete(edge_mask) is the discrete degree of the edge mask.

[0024] Further, in step three, the functional group tree is generated by using the functional group obtained in step two, and the pre-trained first graph neural network model is obtained by using the functional group tree to learn the connection mode of the functional group.

[0025] Step three, using the functional group obtained in step two to generate a functional group tree, specifically:

[0026] Using autoregressive method to decompose the probability target, adding one functional group in each iteration to generate a functional group tree

[0027] Wherein, Indicates the node set, and epsilon indicates the edge set, Indicates the functional group;

[0028] The probability target is embodied by modeling the likelihood of the following functional group tree:

[0029]

[0030] Wherein, pi represents the order of adding functional groups, theta represents the functional group, and ptheta represents the probability of generating the functional group tree;

[0031] Wherein, the order of adding functional groups is realized by using depth first search algorithm and breadth first search algorithm;

[0032] The functional groups in the functional group tree adopt a GRU network for message passing;

[0033] Step three two, a first graph neural network is newly established, the connection mode of the functional groups is pre-trained and learned based on the functional group tree, and a pre-trained first graph neural network model is obtained;

[0034] The pre-trained loss function is the sum of the cross-entropy loss of the topology prediction and the functional group prediction.

[0035] The functional group prediction is realized by using a softmax.

[0036] The topology prediction comprises a single hidden layer network and a network realized by using a sigmoid function.

[0037] Further, the pre-trained first graph neural network model obtained in step three is fine-tuned in step four to obtain a molecular property prediction network, comprising the following steps:

[0038] Step four one, a small molecule dataset is obtained in a MoleculeNet dataset, and the small molecule dataset is divided into a training set and a test set.

[0039] Step four two, a linear classifier is added to the pre-trained first graph neural network obtained in step three, the pre-trained first graph neural network with the added classifier is trained by using the training set, and a prediction network is obtained.

[0040] Step four three, the prediction network is tested by using the test set, if the accuracy of the prediction network is greater than or equal to a second threshold, the current network is taken as a molecular property prediction network, if the accuracy of the prediction network is less than the second threshold, the hyperparameters of the prediction network are adjusted, step four two is re-executed, and a prediction model with an accuracy greater than the second threshold is obtained as the molecular property prediction network.

[0041] An interpretable molecular property prediction system based on a graph neural network, comprising: a small molecule dataset acquisition module, a functional group acquisition module, a functional group tree generation module, and a molecular property prediction module.

[0042] The small molecule dataset acquisition module is used to acquire a small molecule dataset.

[0043] The functional group acquisition module is used to obtain a trained graph neural network model by using the small molecule dataset, and obtain functional groups by using the trained graph neural network model.

[0044] The functional group tree generation module is used to generate a functional group tree according to the functional groups.

[0045] The molecular property prediction module is configured to obtain a molecular property prediction network according to the functional group tree, and input a small molecule data set to be predicted into the molecular property prediction network to obtain a molecular property.

[0046] Further, the functional group acquisition module is configured to obtain a trained graph neural network model by using the small molecule data set, and obtain the functional group by using the trained graph neural network model, including the following steps:

[0047] S1, converting data in the small molecule data set into a molecular graph form, and dividing the small molecule data set in the molecular graph form into a training set and a validation set;

[0048] S2, training a graph neural network model by using the training set to obtain a trained graph neural network model;

[0049] S3, verifying the trained graph neural network model by using the validation set, if the accuracy of the trained graph neural network is greater than or equal to a first threshold, performing S4, if the accuracy of the trained graph neural network is less than the first threshold, adjusting the hyperparameters of the trained graph neural network to re-perform step S2, so that the accuracy of the trained graph neural network is greater than the first threshold, and then performing S4;

[0050] S4, inputting the small molecule data set and the trained graph neural network into an interpretable graph neural network model to obtain the functional group:

[0051] S401, clearing an edge mask in the interpretable graph neural network model, setting an initial randomly generated edge mask, taking the initial randomly generated edge mask as a trainable parameter, calculating a trainable parameter loss function, then back propagating, performing gradient update, and obtaining an optimal edge mask;

[0052] The trainable parameter loss function is as follows:

[0053] loss = CrossEntropy (f (data, model, edge_mask), label) + Size (edge_mask) + Discrete (edge_mask)

[0054] Wherein, CrossEntropy() is a cross-entropy loss function, (f(data, model, edge_mask), label) is a loss of the output of the trained graph neural network model and the target label, Size(edge_mask) is the size of the edge mask, and Discrete(edge_mask) is the discrete degree of the edge mask.

[0055] S402. Set the edge mask threshold. Compare the optimal edge mask mapping value obtained in S401 with the threshold. If the optimal edge mask mapping value is less than the threshold, remove the edge in the subgraph. If the optimal edge mask is greater than or equal to the threshold, retain the edge. Connect the retained edges to form a subgraph as a functional group.

[0056] Furthermore, the functional group tree generation module is used to generate a functional group tree based on functional groups, specifically as follows:

[0057] An autoregressive approach is used to decompose the probabilistic objective, and a functional group is added in each iteration to generate a functional group tree.

[0058] in, Let ε represent the set of nodes, and ε represent the set of edges. Indicates a functional group;

[0059] The probabilistic objective is represented by the likelihood model of the following functional group tree:

[0060]

[0061] Where π represents the order in which functional groups are added, θ represents the functional group, and pθ represents the probability of generating a functional group tree.

[0062] The order in which functional groups are added is implemented using both depth-first search and breadth-first search algorithms.

[0063] The functional groups in the functional group tree use a GRU network for message passing.

[0064] Furthermore, the molecular property prediction module is used to obtain a molecular property prediction network based on the functional group tree, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties, including the following steps:

[0065] 1. Create a new first graph neural network. Based on the functional group tree, pre-train the graph neural network to learn the connection mode of functional groups and obtain the pre-trained first graph neural network model.

[0066] 2. Obtain a small molecule dataset from the MoleculeNet dataset and divide the small molecule dataset into a first training set and a test set;

[0067] 3. Add the linear classifier to the pre-trained first graph neural network obtained in one step, and train the pre-trained first graph neural network with the classifier added using the first training set to obtain the prediction network.

[0068] Fourth, test the prediction network using the test set. If the prediction network accuracy is greater than or equal to the second threshold, then use the current network as the molecular property prediction network. If the prediction network accuracy is less than the second threshold, adjust the hyperparameters of the prediction network and repeat step three to obtain a prediction model with an accuracy greater than the second threshold as the molecular property prediction network.

[0069] 5. Obtain the small molecule dataset to be predicted, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties.

[0070] The beneficial effects of this invention are as follows:

[0071] This invention proposes an interpretable molecular property prediction method and system based on graph neural networks. The invention extracts functional groups that have a significant impact on the prediction results through interpretable graph neural networks, and then generates a functional group tree based on the functional groups to learn the data distribution of functional groups. The invention uses the functional group tree for message passing, which enables the molecular property prediction network to be easily generalized to downstream tasks, thereby improving the accuracy of molecular property prediction. Attached Figure Description

[0072] Figure 1 This is a flowchart illustrating the steps of the method of the present invention;

[0073] Figure 2 This is a functional module structure diagram;

[0074] Figure 3 This is an example diagram for explanation. Detailed Implementation

[0075] Specific implementation method one: as follows Figure 1 As shown, this embodiment of an interpretable molecular property prediction method based on graph neural networks specifically involves: obtaining a small molecule dataset to be predicted, and inputting the small molecule dataset into a molecular property prediction network to obtain molecular properties;

[0076] The molecular property prediction network was obtained through the following method:

[0077] Step 1: Obtain a small molecule dataset and use it to obtain a training set and a validation set. Then, use the training set to train a graph neural network model to obtain the trained graph neural network model, including:

[0078] Step 1: Obtain the small molecule dataset, convert it into a molecular graph format, and then divide the small molecule dataset into a training set and a validation set.

[0079] First, get the ZINC small molecule dataset, which has 250k drug molecules, get the SMILES string (Simplified Molecular Input Line Entry System) by row, filter out the empty rows.

[0080] Each SMILES code corresponds to a unique chemical structure, and each chemical structure also has a unique SMILES code. SMILES saves more storage space than other representations.

[0081] Then, use the RDkit toolkit to convert the SMILES string form to the molecular graph form: represent the different substructures of the molecule in the form of one-hot encoding. Traverse the atoms to get a vector containing the atomic number, total number of atomic connections, atomic form charge, atomic hybridization, etc. Traverse the bond to get a vector containing the index of the first atom of the bond, the index of the last atom of the bond, the type of the bond, whether it is a conjugate bond, etc.

[0082] The small molecule dataset in the form of molecular graph is divided into training set and validation set.

[0083] The training set: validation set = 8:2.

[0084] Step one two, use the training set to train the graph neural network model to obtain the trained graph neural network model:

[0085] The graph neural network module is composed of convolutional layers, pooling layers, and fully connected layers, using RELU as the activation function, which can make the neural network better solve more complex problems. The pooling layer is used to compress data and parameter quantity, and then uses the dropout function to remove a certain number of neurons. It can obviously reduce the overfitting phenomenon, and the last fully connected layer outputs the number of neurons equal to the number of classification targets.

[0086] Set the optimizer to AdamW optimization algorithm, which is a kind of adaptive moment estimation algorithm. It uses the first and second moment estimates of the gradient to dynamically adjust the learning rate of each parameter. Set the learning rate to 0.02 to update the parameters, and set the weight decay to 0.01.

[0087] Weight decay is equivalent to L2 norm regularization. Regularization adds a penalty term to the model loss function to make the learned model parameter value smaller, preventing overfitting.

[0088] The training epoch is 200.

[0089] Step one three, the trained graph neural network model is verified by using the verification set, if the accuracy of the trained graph neural network is greater than or equal to the first threshold value, step two is executed; if the accuracy of the trained graph neural network model is less than the first threshold value, the hyperparameters of the trained graph neural network are adjusted to re-execute step one two, so that the accuracy of the trained graph neural network is greater than the first threshold value, and then step two is executed.

[0090] Step two, the trained graph neural network model obtained in step one and the small molecule data set are input into the interpretable graph neural network model to obtain the functional group, including the following steps:

[0091] Step two one, the edge mask in the interpretable graph neural network model is cleared, an initial randomly generated edge mask is set, the initial randomly generated edge mask is taken as a trainable parameter, the loss function of the trainable parameter is calculated, then the back propagation is performed, the gradient is updated, and the optimal edge mask is obtained:

[0092] In the process of obtaining the optimal edge mask, the gradient is set to 0, the loss function is calculated, then the back propagation is performed, and the value of the edge mask is updated by the gradient descent method;

[0093] The loss function is a cross entropy loss function, including: the loss of the output of the trained graph neural network model after adding the edge mask and the target label, the size of the edge mask, and the discrete degree of the edge mask, specifically:

[0094] loss=CrossEntropy(f(data,model,edge_mask),label)+Size(edge_mask)+Discrete(edge_mask)

[0095] Set the number of iterations epochs=50, set the learning rate 0.01, the edge mask of the node will be optimized in the training process, and finally the optimized edge mask is obtained, and the prediction of the graph is visualized.

[0096] Step two two, set the edge mask threshold value threshold=0.5, compare the optimal edge mask mapping value obtained in step two one with threshold, if the optimal edge mask mapping value is less than threshold, remove the edge in the molecular graph, if the optimal edge mask is greater than or equal to threshold, keep the edge, and connect the reserved edges into a subgraph as a functional group.

[0097] Step three, the functional group tree is generated by using the functional group obtained in step two, and the pre trained first graph neural network model is obtained by using the functional group tree to learn the connection mode of the functional group:

[0098] Step three one, the functional group tree is generated by using the functional group obtained in step two:

[0099] The probability objective is decomposed using an autoregressive approach, adding one functional group at a time to generate a functional group tree

[0100] where, denotes the set of nodes, and denotes the set of edges, denotes the functional groups;

[0101] The likelihood of this functional group tree is modeled by a GNN model as It shows how the functional groups are connected, so is the expected likelihood over all possible orderings, which is given by

[0102]

[0103] where denotes the order of functional group addition, denotes the functional groups, and p θ denotes the probability of generating a functional group tree;

[0104] The order of functional group addition is implemented using a depth-first search and a breadth-first search algorithm;

[0105] The breadth-first search algorithm generates functional group nodes layer by layer, and if the nodes in the current layer have all completed the generation of child nodes, it backtracks to the starting node. The depth-first search method judges whether each node has a child node to be generated. If there is a child node to be generated, the above process (judging whether each node has a child node to be generated) is recursively performed on the child node. If there is no child node to be generated, backtracking is performed.

[0106] GRU is a kind of recurrent neural network, and functional group nodes receive information from other generated functional groups for topology prediction and functional group prediction. When building a topic tree step by step, message passing is suitable for functional group trees. At each time step, functional group nodes receive information from other generated functional groups, and information is transmitted through an information vector.

[0107] Step three two, a first graph neural network is newly established, and the first graph neural network is pre-trained based on the functional group tree to learn the connection mode of the functional groups, and a pre-trained first graph neural network model is obtained;

[0108] According to the existing functional groups and the connection mode of the functional groups, topology prediction and functional group prediction are performed:

[0109] where the functional groups are predicted using softmax, and the topology prediction is predicted using a network composed of a single hidden layer network and a sigmoid function. Finally, the functional group generation loss is the sum of the cross-entropy losses of topology prediction and functional group prediction, and the loss function is minimized in the optimization process.

[0110] Step 4: Fine-tune the pre-trained neural network model obtained in Step 3 to obtain the molecular property prediction network:

[0111] Step 41: Obtain the small molecule dataset from the MoleculeNet dataset, and divide the small molecule dataset into the first training set and the test set;

[0112] Step 4.2: Add the linear classifier to the pre-trained first graph neural network obtained in Step 3, and train the pre-trained first graph neural network with the classifier added using the first training set to obtain the prediction network.

[0113] The training epochs are set to 200, the optimizer is set to the AdamW optimization algorithm, and the learning rate is set to 0.01.

[0114] Step 43: Test the prediction network using the test set. If the prediction network accuracy is greater than or equal to the second threshold, then use the current network as the molecular property prediction network. If the prediction network accuracy is less than the second threshold, adjust the hyperparameters of the prediction network and repeat Step 42 to obtain a prediction model with an accuracy greater than the second threshold as the molecular property prediction network.

[0115] During fine-tuning, the model was evaluated and its hyperparameters were fine-tuned. First, the loss function was calculated, and then backpropagation was performed to obtain the largest possible AUC value, thereby achieving better classification results.

[0116] Specific implementation method two: such as Figure 2 As shown, an interpretable molecular property prediction system based on graph neural networks includes: a small molecule dataset acquisition module, a functional group acquisition module, a functional group tree generation module, and a molecular property prediction module.

[0117] The small molecule dataset acquisition module is used to acquire small molecule datasets;

[0118] The functional group acquisition module is used to obtain a trained graph neural network model using a small molecule dataset, and to obtain functional groups using the trained graph neural network model.

[0119] The functional group tree generation module is used to generate a functional group tree based on functional groups;

[0120] The molecular property prediction module is used to obtain a molecular property prediction network based on the functional group tree, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties.

[0121] Specific implementation three: the functional group acquisition module is used to obtain a trained graph neural network model by using a small molecule dataset, and obtain a functional group by using the trained graph neural network model, and includes the following steps:

[0122] S1, converting data in the small molecule dataset into a molecular graph form, and dividing the small molecule dataset in the molecular graph form into a training set and a validation set;

[0123] The small molecule dataset in the molecular form is divided into the training set and the validation set by using a Scaffold splitting method;

[0124] The training set: test set: validation set = 8:2;

[0125] The obtained molecular dataset is from the MoleculeNet dataset, all data are included in the open source DeepChem package, the MoleculeNet dataset can be easily loaded, and some common (bio) chemical feature methods are included. The SMILES form is converted into a molecular graph form, and different substructures of the molecule are represented by one-hot encoding. The vector x obtained by traversing the atoms includes the atomic number, the total number of atomic connections, the atomic form charge, the atomic hybridization mode, and the like. The vector obtained by traversing the bond includes the first atomic index of the bond, the end atomic index of the bond, the bond type, and whether it is a conjugated bond. SMILES (Simplified molecular input line entry system) is a string of characters used to describe a three-dimensional chemical structure. Converting to a SMILES string needs to remove hydrogen, open the ring, and write the molecular branch in parentheses.

[0126] S2, training a graph neural network model by using the training set to obtain a trained graph neural network model:

[0127] A random seed is set, the same random seed will generate the same random number, and a random algorithm is executed based on the seed. The batch size is set to 50, the training round epoch is set to 200, the learning rate is set to 0.02, the loss is summarized once every step, the loss of each iteration is counted, then the back propagation is performed, the network parameters are updated according to the current gradient, and the current gradient is emptied before the next training.

[0128] The optimizer is set to the AdamW optimization algorithm, which is an adaptive moment estimation algorithm that dynamically adjusts the learning rate of each parameter using first and second moment estimates of the gradient. The learning rate is set to 0.02 to update the parameters, and the weight decay is set to 0.01. Weight decay is equivalent to L2 norm regularization. Regularization adds a penalty term to the model loss function to make the learned model parameter values smaller, preventing overfitting.

[0129] S3, verifying the trained graph neural network model using the verification set, if the accuracy of the trained graph neural network is greater than or equal to the first threshold, executing S4; if the accuracy of the trained graph neural network model is less than the first threshold, adjusting the hyperparameters of the trained graph neural network to re-execute step S2, so that the accuracy of the trained graph neural network is greater than the first threshold, and then executing S4;

[0130] S4, inputting the small molecule dataset and the trained graph neural network into the interpretable graph neural network model to obtain the functional group:

[0131] The graph neural network is composed of convolutional layers, pooling layers, and fully connected layers, using RELU as the activation function, which can make the neural network better solve complex problems. The pooling layer is used to compress data and parameter quantity, and then the dropout function is used to remove a certain number of neurons. It can significantly reduce the overfitting phenomenon, and the output neuron number of the last fully connected layer is the classification target number.

[0132] Input the trained GNN model into the interpretability model, as shown in Figure 3 The callability of the interpretability model will first clear the edge mask in the graph neural network, and then set an initial randomly generated edge mask. The edge mask is used as a trainable parameter for neural network training. The training goal is to calculate the optimal edge mask. When training the edge mask parameters, first set the gradient of the model parameters to 0, then calculate the loss function, backpropagate, and then update the edge mask value through the gradient descent method.

[0133] The loss is composed of three parts: the loss between the output of the trained graph neural network after adding the edge mask and the target label, the size of the edge mask, and the discrete degree of the edge mask. The loss function is as follows:

[0134] loss = CrossEntropy(f(data, model, edge_mask), label) + Size(edge_mask) + Discrete(edge_mask)

[0135] Set the number of iterations epochs = 50, set the learning rate 0.01, the edge mask of the node in the training process will be optimized, and finally the optimized edge mask is obtained, and the prediction of the graph is visualized.

[0136] The application uses a post-explanation method, that is, the model is regarded as a black box, and the model is explained in a way that people can understand. n×n Mapping the mask to a value between 0 and 1 (excluding 0 and 1) can introduce new noise to the prediction result, and this mask belongs to a soft mask.

[0137] Specific embodiment four: the functional group tree generation module is used to generate a functional group tree according to a functional group, and includes the following steps:

[0138] The functional group generated by the interpretable GNN is used as a node of the functional group tree, and the edge represents the relationship between the functional groups.

[0139] The likelihood of the functional group tree is modeled by the GNN model as It shows how these functional groups are connected, so is equal to the expectation of all possible orders, and the formula is as follows:

[0140]

[0141] Where π represents the order of adding functional groups, represents the generated functional group tree;

[0142] The breadth-first search method generates functional group nodes layer by layer, and if the nodes of the current layer have completed the generation of child nodes, it backtracks to the starting node. The depth-first search method judges whether each node has a child node to be generated, if it has a child node to be generated, the process is recursively called for the child node, and if it does not have a child node to be generated, it backtracks.

[0143] Embodiment five: the molecular property prediction module is used to obtain a molecular property prediction network according to a functional group tree, and input a small molecule data set to be predicted into the molecular property prediction network to obtain a molecular property, including the following steps:

[0144] First, a first graph neural network is newly created, the graph neural network is pre-trained based on the functional group tree to learn the connection mode of the functional group, and a pre-trained first graph neural network model is obtained:

[0145] The connection mode of the functional group is learned so as to pre-train on the molecular data in which the functional group is not identified, and then fine-tune for a specific task;

[0146] GRU is a kind of recurrent neural network, and the functional group node receives information from other generated functional groups for topology prediction and functional group prediction, and is suitable for message passing of the functional group tree. At each time step, the functional group node receives information from other generated functional groups, and the information is propagated through an information vector.

[0147] Functional group generation pre-training is performed: according to the existing functional groups and the connection mode of the functional groups, topology prediction and functional group prediction are performed. The functional group uses softmax for prediction, and the topology prediction uses a single hidden layer network and a sigmoid function for prediction. Finally, the functional group generation loss is the sum of the cross-entropy losses of the topology prediction and the functional group prediction, and the loss function is minimized in the optimization process.

[0148] Second, a small molecule data set is obtained in the MoleculeNet data set, and the small molecule data set is divided into a first training set and a test set;

[0149] Third, a linear classifier is added to the pre-trained first graph neural network obtained in the first, and the pre-trained first graph neural network with the added classifier is trained using the first training set to obtain a prediction network;

[0150] Fourth, the test set is used to test the prediction network, if the accuracy of the prediction network is greater than or equal to a second threshold, the current network is taken as a molecular property prediction network; if the accuracy of the prediction network is less than the second threshold, the hyperparameters of the prediction network are adjusted, and step three is re-executed to obtain a prediction model with an accuracy greater than the second threshold as a molecular property prediction network;

[0151] Fifth, a small molecule data set to be predicted is obtained, and the small molecule data set to be predicted is input into the molecular property prediction network to obtain a molecular property.

Claims

1. A method for predicting interpretable molecular properties based on graph neural networks, characterized in that... The specific process of the method is as follows: obtain the small molecule dataset to be predicted, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties; The molecular property prediction network was obtained through the following method: Step 1: Obtain a small molecule dataset and use it to obtain a training set and a validation set. Then, use the training set to train a graph neural network model to obtain a trained graph neural network model. Step 2: Input the trained graph neural network model and small molecule dataset obtained in Step 1 into the interpretable graph neural network model to obtain functional groups, including the following steps: Step 21: Remove the edge mask in the interpretable graph neural network model. Set an initial randomly generated edge mask, use the initial randomly generated edge mask as a trainable parameter, calculate the loss function of the trainable parameter, and then backpropagate to perform gradient update to obtain the optimal edge mask. Step 22: Compare the optimal edge mask mapping value obtained in Step 21 with the edge mask threshold. If the optimal edge mask mapping value is less than the threshold, remove the edge in the subgraph. If the optimal edge mask is greater than or equal to the threshold, retain the edge and connect the retained edges to form a subgraph as a functional group. Step 3: Use the functional groups obtained in Step 2 to generate a functional group tree, and use the functional group tree to pre-train the first graph neural network to learn the connection mode of the functional groups and obtain the pre-trained first graph neural network model. Step 4: Fine-tune the pre-trained first neural network model obtained in Step 3 to obtain the molecular property prediction network.

2. The interpretable molecular property prediction method based on graph neural networks according to claim 1, characterized in that: Step one, which involves obtaining a small molecule dataset, using the small molecule dataset to obtain and validate a dataset, and then using the training set to train a graph neural network model, includes the following steps: Step 1: Obtain the small molecule dataset, convert it into a molecular graph format, and then divide the small molecule dataset into a training set and a validation set. The molecular diagram includes the following features: atomic number, total number of atoms connected, atomic formal charge, atomic hybridization, index of the first atom of the bond, index of the last atom of the bond, type of bond, and whether it is a conjugated bond; Steps 1 and 2: Use the training set to train the graph neural network model to obtain the trained graph neural network model: The activation function of the graph neural network model is ReLU; Among them, the AdamW optimization algorithm is used for the training graph neural network model optimizer, and L2 norm regularization is used for weight decay; Step 13: Validate the trained graph neural network model using the validation set. If the accuracy of the trained graph neural network is greater than or equal to the first threshold, proceed to Step 2. If the accuracy of the trained graph neural network model is less than the first threshold, adjust the hyperparameters of the trained graph neural network and re-execute Step 12 to make the accuracy of the trained graph neural network greater than the first threshold, and then proceed to Step 2.

3. The interpretable molecular property prediction method based on graph neural networks according to claim 2, characterized in that: The trainable parameter loss function is as follows: loss=CrossEntropy(f(data,model,edge_mask),label)+Size(edge_mask)+Discrete(edge_mask) Here, CrossEntropy() is the cross-entropy loss function, (f(data,model,edge_mask),label) is the loss between the output of the trained graph neural network model and the target label, Size(edge_mask) is the edge mask size, and Discrete(edge_mask) is the edge mask dispersion.

4. The interpretable molecular property prediction method based on graph neural networks according to claim 3, characterized in that: Step three, which involves generating a functional group tree using the functional groups obtained in step two, and then using this tree to pre-train the first graph neural network to learn the connection patterns of the functional groups and obtain a pre-trained first graph neural network model, includes the following steps: Step 3.1: Generate a functional group tree using the functional groups obtained in Step 2, specifically as follows: The probabilistic objective is decomposed using an autoregressive approach, and a functional group is added in each iteration to generate a functional group tree. in, Let ε represent the set of nodes, and ε represent the set of edges. Indicates a functional group; The probabilistic objective is represented by the likelihood model of the following functional group tree: Where π represents the order in which functional groups are added, θ represents the functional group, and p θ Represents the probability of generating a functional group tree; The order in which functional groups are added is implemented using both depth-first search and breadth-first search algorithms. The functional groups in the functional group tree use a GRU network for message passing. Step 32: Create a new first graph neural network. Based on the functional group tree, pre-train the graph neural network to learn the connection mode of functional groups and obtain the pre-trained first graph neural network model. The loss function for pre-training is the sum of the cross-entropy loss of topology prediction and functional group prediction. The functional group prediction is implemented using softmax. The topology prediction comprises a single hidden layer network and a network implementation of a sigmoid function.

5. The interpretable molecular property prediction method based on graph neural networks according to claim 4, characterized in that: Step four, which involves fine-tuning the pre-trained first graph neural network model obtained in step three to obtain the molecular property prediction network, includes the following steps: Step 4:

1. Obtain the small molecule dataset from the MoleculeNet dataset, and divide the small molecule dataset into training and testing sets; Step 4.2: Add the linear classifier to the pre-trained first graph neural network obtained in Step 3, and train the pre-trained first graph neural network with the classifier added using the training set to obtain the prediction network. Step 43: Test the prediction network using the test set. If the prediction network accuracy is greater than or equal to the second threshold, then use the current network as the molecular property prediction network. If the prediction network accuracy is less than the second threshold, adjust the hyperparameters of the prediction network and repeat Step 42 to obtain a prediction model with an accuracy greater than the second threshold as the molecular property prediction network.

6. An interpretable molecular property prediction system based on graph neural networks, characterized in that: The system includes: a small molecule dataset acquisition module, a functional group acquisition module, a functional group tree generation module, and a molecular property prediction module; The small molecule dataset acquisition module is used to acquire small molecule datasets; The functional group acquisition module is used to obtain a trained graph neural network model using a small molecule dataset, and to obtain functional groups using the trained graph neural network model, including the following steps: S1. Convert the data in the small molecule dataset into molecular graph form, and divide the small molecule dataset in molecular graph form into training set and validation set; S2. Use the training set to train the graph neural network model to obtain the trained graph neural network model; S3. Validate the trained graph neural network model using the validation set. If the accuracy of the trained graph neural network is greater than or equal to the first threshold, proceed to S4. If the accuracy of the trained graph neural network model is less than the first threshold, adjust the hyperparameters of the trained graph neural network and re-execute step S2 to make the accuracy of the trained graph neural network greater than the first threshold, and then proceed to S4. S4. Input the small molecule dataset and the trained graph neural network into the interpretable graph neural network model to obtain functional groups: S401. Remove the edge mask in the interpretable graph neural network model. Set an initial randomly generated edge mask, use the initial randomly generated edge mask as a trainable parameter, calculate the loss function of the trainable parameter, and then backpropagate to perform gradient update to obtain the optimal edge mask. The trainable parameter loss function is as follows: loss=CrossEntropy(f(data,model,edge_mask),label)+Size(edge_mask)+Discrete(edge_mask) Where CrossEntropy() is the cross-entropy loss function, (f(data,model,edge_mask),label) is the loss between the output of the trained graph neural network model and the target label, Size(edge_mask) is the edge mask size, and Discrete(edge_mask) is the edge mask discreteness. S402. Set the edge mask threshold. Compare the optimal edge mask mapping value obtained in S401 with the threshold. If the optimal edge mask mapping value is less than the threshold, remove the edge in the subgraph. If the optimal edge mask is greater than or equal to the threshold, retain the edge. Connect the retained edges into a subgraph as a functional group. The functional group tree generation module is used to generate a functional group tree based on functional groups; The molecular property prediction module is used to obtain a molecular property prediction network based on the functional group tree, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties.

7. The interpretable molecular property prediction system based on graph neural networks according to claim 6, characterized in that: The functional group tree generation module is used to generate a functional group tree based on functional groups, specifically: An autoregressive approach is used to decompose the probabilistic objective, and a functional group is added in each iteration to generate a functional group tree. in, Let ε represent the set of nodes, and ε represent the set of edges. Indicates a functional group; The probabilistic objective is represented by the likelihood model of the following functional group tree: Where π represents the order in which functional groups are added, θ represents the functional group, and p θ Represents the probability of generating a functional group tree; The order in which functional groups are added is implemented using both depth-first search and breadth-first search algorithms. The functional groups in the functional group tree use a GRU network for message passing.

8. The interpretable molecular property prediction system based on graph neural networks according to claim 7, characterized in that: The molecular property prediction module is used to obtain a molecular property prediction network based on a functional group tree, and inputs the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties, including the following steps:

1. Create a new first graph neural network. Based on the functional group tree, pre-train the graph neural network to learn the connection mode of functional groups and obtain the pre-trained first graph neural network model.

2. Obtain a small molecule dataset from the MoleculeNet dataset and divide the small molecule dataset into a first training set and a test set; 3. Add the linear classifier to the pre-trained first graph neural network obtained in one step, and train the pre-trained first graph neural network with the classifier added using the first training set to obtain the prediction network. Fourth, test the prediction network using the test set. If the prediction network accuracy is greater than or equal to the second threshold, then use the current network as the molecular property prediction network. If the prediction network accuracy is less than the second threshold, adjust the hyperparameters of the prediction network and repeat step three to obtain a prediction model with an accuracy greater than the second threshold as the molecular property prediction network.

5. Obtain the small molecule dataset to be predicted, and input the small molecule dataset to be predicted into the molecular property prediction network to obtain molecular properties.

Citation Information

Patent Citations

  • Drug small molecule property prediction method, device and equipment based on graph neural network

    CN113707236A