Molecular property prediction method, device, equipment and computer readable storage medium
By adding noise to the molecular subgraph and optimizing the noise prediction network, the problem of low prediction accuracy of molecular properties in the prior art is solved, and higher prediction accuracy is achieved.
Patent Information
- Application Number
- CN202311594483.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-11-24
AI Technical Summary
The noise prediction network trained by existing self-supervised methods has the problem of low accuracy in molecular properties prediction tasks.
By adding noise to the subgraph of sample molecules and using the noise prediction network to predict the noise added in the subgraph, the noise prediction network is optimized, and the pre-trained noise prediction network is obtained, and fine-tuning is performed on the target molecular properties prediction task, the result is obtained The first encoder for encoding.
The accuracy of molecular properties prediction is improved, and the prediction ability in downstream tasks is enhanced by capturing the sub-graph characteristics of molecules.
Smart Images

Figure CN117637017B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biopharmaceutical technology, and in particular to a molecular property prediction method, device, equipment and computer-readable storage medium. Background Art
[0002] The existing molecular pre-training methods are generally divided into direct supervision and self-supervision. Among them, the self-supervision method can effectively use a large amount of unlabeled data because it does not require labels. Among the self-supervision methods, there are mainly autoregression methods, context prediction methods, contrastive learning methods, and denoising methods. However, the noise prediction network trained by the self-supervision method still has the problem of poor accuracy in predicting molecular properties when applied to downstream molecular property prediction tasks. Summary of the invention
[0003] The main purpose of the present invention is to provide a molecular property prediction method, device, equipment and computer-readable storage medium, aiming to propose a molecular property prediction scheme to improve the accuracy of molecular property prediction.
[0004] To achieve the above object, the present invention provides a method for predicting molecular properties, comprising the following steps:
[0005] Acquiring first molecule data of a target molecule;
[0006] Inputting the first molecule data into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule, wherein the first encoder is pre-trained using a denoising-based pre-training method, and during the pre-training process, noise is added to a subgraph of a sample molecule in a first training data set to optimize a noise prediction network, and the pre-trained noise prediction network is fine-tuned on a target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network;
[0007] The predicted representation is input into a first molecular property predictor for prediction to obtain a property prediction result of the target molecule.
[0008] Optionally, before the step of inputting the first molecule data into a first encoder for encoding to obtain the predicted representation corresponding to the target molecule, the step further includes:
[0009] Acquire a first training data set, wherein the first training data set includes a plurality of sample molecules;
[0010] Acquire second molecular data of the sample molecule, wherein the second molecular data includes molecular structure data of the sample molecule and original coordinates of each vertex in the sample molecule;
[0011] Based on the second molecule data of the sample molecule, adding noise to the coordinates of each vertex in the subgraph of the sample molecule to transform the second molecule data of the sample molecule into third molecule data after adding noise;
[0012] Using a noise prediction network to be trained to predict the noise added to the third molecule data of the sample molecule, and calculating the noise prediction loss, and using the subgraph and the noise prediction loss to optimize the noise prediction network;
[0013] The first training data set is used to perform multiple rounds of iterative optimization on the noise prediction network to complete pre-training, and the pre-trained noise prediction network is fine-tuned on the target molecular property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network.
[0014] Optionally, the step of adding noise to the coordinates of each vertex in the subgraph of the sample molecule based on the second molecule data of the sample molecule to transform the second molecule data of the sample molecule into third molecule data after adding noise includes:
[0015] Randomly select T subgraphs from each subgraph of the sample molecule;
[0016] The second molecular data is used as the molecular data of the sample molecule at the 0th time step, and based on the molecular data of the sample molecule at the t-1th time step, noise is added to the coordinates of each vertex in the tth subgraph of T subgraphs to obtain the molecular data of the sample molecule at the tth time step, where t=1, 2...T;
[0017] The molecular data of the sample molecule at time steps 1 to T are respectively used as the third molecular data.
[0018] Optionally, the step of adding noise to the coordinates of each vertex in the t-th subgraph among the T subgraphs based on the molecular data of the sample molecule at the t-1th time step to obtain the molecular data of the sample molecule at the t-1th time step includes:
[0019] Based on standard Gaussian distribution sampling, noise values corresponding to each target vertex are obtained, wherein each target vertex is a vertex in the t-th subgraph;
[0020] The coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0021] Optionally, the step of performing weighted summation of the coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step and the corresponding noise value to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step includes:
[0022] Multiply the target binary vector and the preset noise weight corresponding to the t-th time step to obtain the actual noise weight corresponding to each vertex of the sample molecule, wherein the target binary vector is the binary vector corresponding to the t-th subgraph, the elements in the target binary vector correspond one-to-one to the vertices of the sample molecule, the vertices corresponding to the elements with a value of 1 are included in the t-th subgraph, and the vertices corresponding to the elements with a value of 0 are not included in the t-th subgraph;
[0023] The coordinates of each vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values using the corresponding actual noise weights to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0024] Optionally, the step of using a noise prediction network to be trained to predict the noise added to the third molecule data of the sample molecule and calculating the noise prediction loss, and using the subgraph and the noise prediction loss to optimize the noise prediction network comprises:
[0025] Inputting the third molecule data of the sample molecule into a noise prediction network for prediction, and obtaining predicted coordinate noise values corresponding to each vertex in the subgraph;
[0026] Calculate the noise prediction loss according to the predicted coordinate noise values corresponding to the vertices in the subgraph and the real coordinate noise values added to the coordinates of the vertices in the subgraph in the third molecular data;
[0027] Inputting the third molecular data into the subgraph prediction network to be trained for prediction to obtain subgraph prediction data;
[0028] Calculating a sub-graph prediction loss based on the sub-graph prediction data and the sub-graph;
[0029] A total loss is calculated based on the subgraph prediction loss and the noise prediction loss, and the total loss is used to optimize a noise prediction network.
[0030] Optionally, the step of fine-tuning the pre-trained noise prediction network on the target molecular property prediction task and obtaining the first encoder according to the fine-tuned noise prediction network includes:
[0031] The pre-trained noise prediction network and the molecular property predictor to be trained form a molecular property prediction model to be trained;
[0032] A second training data set is obtained for the target molecular property prediction task, and the molecular property prediction model to be trained is fine-tuned using the second training data set, and the fine-tuned noise prediction network is used as the first encoder, and the fine-tuned molecular property prediction is used as the first molecular property predictor.
[0033] To achieve the above object, the present invention further provides a molecular property prediction device, the molecular property prediction device comprising:
[0034] An acquisition module, used for acquiring first molecule data of a target molecule;
[0035] An encoding module, used for inputting the first molecule data into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule, wherein the first encoder is pre-trained by using a denoising-based pre-training method, and in the pre-training process, noise is added to a subgraph of the sample molecule in the first training data set to optimize the noise prediction network, the pre-trained noise prediction network is fine-tuned on the target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network;
[0036] The prediction module is used to input the prediction representation into the first molecular property predictor for prediction to obtain the property prediction result of the target molecule.
[0037] To achieve the above-mentioned purpose, the present invention also provides a molecular property prediction device, which includes: a memory, a processor, and a molecular property prediction program stored in the memory and executable on the processor, and when the molecular property prediction program is executed by the processor, the steps of the molecular property prediction method as described above are implemented.
[0038] In addition, to achieve the above objectives, the present invention also proposes a computer-readable storage medium, on which a molecular property prediction program is stored, and when the molecular property prediction program is executed by a processor, the steps of the molecular property prediction method as described above are implemented.
[0039] In an embodiment of the present invention, first molecular data of a target molecule is obtained, and the first molecular data is input into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule. Since the first encoder is pre-trained using a denoising-based pre-training method, and when adding noise, noise is not added to the entire molecular structure of the sample molecule, but to a subgraph of the sample molecule, and then a noise prediction network is used to predict the noise added in the subgraph, and the noise prediction network is optimized in turn, the noise prediction network learns how to extract subgraph features of the sample molecule, rather than just learning how to extract features of the entire molecular structure of the sample molecule, that is, the noise prediction network can capture the subgraph features of the molecule, so that when applied to downstream molecular property prediction tasks, the captured subgraph features can be used to predict the properties of the molecule, thereby improving the accuracy of the predicted properties. For example, when predicting the properties of drug molecules, the subgraph of the drug molecules plays a vital role in the properties of the drugs. Through the property prediction method of this embodiment, the prediction representation obtained by encoding the molecular data of the drug molecules based on the first encoder can characterize the subgraph characteristics of the drug molecules. The subgraph can be better identified during the downstream molecular property prediction, thereby making the property prediction of the drug molecule based on the prediction representation more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;
[0041] Figure 2 It is a schematic diagram of the process of the first embodiment of the molecular property prediction method of the present invention;
[0042] Figure 3 2D diagram of diphenyl ketone involved in the embodiment of the present invention;
[0043] Figure 4 3D diagram of diphenyl ketone involved in the embodiment of the present invention;
[0044] Figure 5 A schematic diagram of a process of a denoising-based pre-training method and fine-tuning on downstream tasks according to an embodiment of the present invention;
[0045] Figure 6 A schematic diagram of a noise adding effect involved in an embodiment of the present invention;
[0046] Figure 7 Schematic diagram of functional modules of a preferred embodiment of the molecular property prediction device of the present invention.
[0047] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0049] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0050] It should be noted that the molecular property prediction device in the embodiment of the present invention may be a personal computer, a server, a smart phone or other device, and is not specifically limited here.
[0051] like Figure 1 As shown, the molecular property prediction device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Wherein, the communication bus 1002 is used to realize the connection communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
[0052] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the molecular property prediction device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0053] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a molecular property prediction program. The operating system is a program that manages and controls the hardware and software resources of the device and supports the operation of the molecular property prediction program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the molecular property prediction program stored in the memory 1005 and execute the molecular property prediction method in the following embodiments.
[0054] Based on the above structure, various embodiments of the molecular property prediction method are proposed.
[0055] Reference Figure 2 , Figure 2 FIG. 4 is a flow chart of the first embodiment of the molecular property prediction method of the present invention.
[0056] The embodiments of the present invention provide embodiments of the method for predicting molecular properties. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that here. In this embodiment, the execution subject of the method for predicting molecular properties may be a personal computer, a server, a smart phone or other device, which is not limited in this embodiment. For ease of description, the execution subject is omitted to explain each embodiment. In this embodiment, the method for predicting molecular properties includes steps S10 to S30:
[0057] Step S10, obtaining first molecule data of the target molecule.
[0058] In the following embodiments, the complete molecule is referred to as a molecule, and the partial structure of the molecule is referred to as a subgraph to distinguish them. A molecule includes vertices and edges between vertices, and the molecular data of a molecule includes molecular structure data and the coordinates of each vertex in the molecule. The molecular structure data is used to characterize which vertices the molecule includes and which vertices are connected by edges. In this embodiment, the specific data form of the molecular structure data is not limited. For example, a 2D molecular graph can be used as molecular structure data, and the molecule can be represented as is a 2D molecular graph, including vertices and edges, and R represents the coordinates of all vertices. For example, diphenyl ketone has 13 carbon atoms and 1 oxygen atom, and its 2D graph can be seen Figure 3 , 3D image can be seen Figure 4 .
[0059] A subgraph of a molecule refers to a structure including some vertices in the molecule and the edges between the vertices.
[0060] Molecules can be small molecules or macromolecules. In small molecules, the vertices are atoms and the edges are the bonds between atoms. In macromolecules, the vertices can be the basic components of the molecule and the edges can be the connection between the basic components. For example, for protein macromolecules, the vertices can be amino acids and the edges can be the connection bonds between amino acids. The coordinates of the vertex are used to indicate the position of the vertex in the molecule in three-dimensional space, and can refer to the coordinates in the three-dimensional space coordinate system.
[0061] In this embodiment, the molecule that needs to be predicted for properties is called the target molecule, and the molecular data of the target molecule is called the first molecular data to distinguish it. The first molecular data includes the molecular structure data of the target molecule and the original coordinates of each vertex in the target molecule. The original coordinates are relative to the coordinates after adding noise. The original coordinates represent the correct coordinates of the vertex without adding noise. In each embodiment, in the absence of a description of the original coordinates or the coordinates after adding noise, it is not limited to whether the "coordinates" are the original coordinates or the coordinates after adding noise.
[0062] Step S20, inputting the first molecular data into a first encoder for encoding to obtain a predicted representation corresponding to the target molecule, wherein the first encoder is pre-trained using a denoising-based pre-training method, and during the pre-training process, noise is added to a subgraph of the sample molecules in the first training data set to optimize the noise prediction network, and the pre-trained noise prediction network is fine-tuned on the target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network.
[0063] Representation learning, also known as learning representation, refers to the form and method used to represent the model's input observation sample X through the model's parameters. Representation learning refers to learning an effective representation for the observation sample X.
[0064] The encoder (referred to as the first encoder to distinguish) can be obtained in advance by pre-training and fine-tuning. The first encoder has learned how to accurately represent the structural characteristics of the molecule through the pre-training and fine-tuning process, that is, by inputting the molecular data of the molecule into the first encoder for encoding, the corresponding representation of the molecule can be obtained (referred to as the predicted representation to distinguish). The data form of the predicted representation is not limited in the present embodiment, for example, it can be in the form of a matrix or a vector. The predicted representation of the molecule characterizes the structural characteristics of the hidden layer of the molecule. The pre-training and fine-tuning process is to enable the encoder to learn how to encode and obtain the accurate predicted representation of the molecule, and the accuracy of the predicted representation is embodied in that the properties of the molecule can be accurately predicted based on the predicted representation. The process of encoder learning representation refers to the process of optimizing the parameters in the encoder through pre-training and fine-tuning, that is, it is intended to find a set of encoder parameter values so that the encoder can obtain the accurate predicted representation based on the molecular data of the molecule, and the encoder containing the parameter values finally determined is the first encoder.
[0065] The existing diffusion model's denoising method treats each vertex of the molecule as an independent object, which is not conducive to the denoising model capturing the subgraph information of the molecule, resulting in the denoising model being unable to learn the subgraph information.
[0066] The pre-training process is based on a first training data set, which includes a plurality of sample molecules. In this embodiment, the denoising-based pre-training method is to add noise to the subgraph of the sample molecule, and then predict the added noise through a noise prediction network, and then optimize the noise prediction network to complete the pre-training of the noise prediction network. Using the noise prediction network to predict the added noise is equivalent to the process of using the noise prediction network for denoising, so the noise prediction network can also be called a denoising network. The denoising network can be an encoder, which is not limited in this embodiment. In a specific implementation, the noise prediction network can be optimized based on the noise prediction loss. The goal of optimizing the noise prediction network is to enable the noise prediction network to accurately predict the added noise. In this process, the noise prediction network learns how to represent the subgraph features of the molecule. By enhancing the learning ability of the subgraph, the noise prediction network obtained after pre-training can then be used to fine-tune the specific molecular property prediction task to obtain an encoder for predicting the molecular representation in the molecular property prediction task. Figure 5 As shown, a large number of data sets are first used for pre-training by denoising, and then fine-tuning is performed downstream after the training is completed to predict the properties of molecules.
[0067] In a specific implementation, adding noise to a subgraph may be adding noise to the coordinates of vertices in the subgraph, or may be adding noise to feature data (e.g., atomic features) of vertices in the subgraph. Adding noise to the coordinates of vertices in the subgraph means that when adding noise, noise is not added to the coordinates of all vertices of the sample molecule, but to the coordinates of vertices in the subgraph of the sample molecule, and then the noise added to the coordinates of the vertices in the subgraph is predicted using a noise prediction network, and the noise prediction network is optimized based on the noise prediction loss of the coordinates of the vertices in the subgraph, so that the noise prediction network learns how to extract the subgraph features of the sample molecule, rather than just learning how to extract the features of the entire molecule of the sample molecule.
[0068] In a specific implementation, data representing a subgraph of sample molecules can also be used to optimize the noise prediction network. The data representing a subgraph of sample molecules refers to data that can represent which vertices are included in the subgraph, or can also include data that represents which vertices in the subgraph are connected by edges. In this embodiment, the specific data form is not limited. For example, the subgraph of sample molecules can be represented in the form of a subgraph of a 2D molecular graph. For example, the vertices included in the subgraph can be represented by a binary vector. The binary vector will be explained in the following embodiments.
[0069] It should be noted that, in a specific implementation, there are many ways to add noise to the coordinates of each vertex in the subgraph, which are not limited in this embodiment. For example, a noise adding method based on a diffusion model can be used.
[0070] In a specific implementation, there are many ways to use the data of the subgraph representing the sample molecules to optimize the noise prediction network, which is not limited in the present embodiment; for example, in a feasible implementation, the data of the subgraph representing the sample molecules can be used as the input of the noise prediction network, that is, the molecular data of the sample molecules after adding noise and the data of the subgraph representing the sample molecules are input into the noise prediction network, the noise prediction network predicts the added noise based on the input data, and then optimizes the noise prediction network through the noise prediction loss. This method implicitly uses the data of the subgraph representing the sample molecules to optimize the noise prediction network.
[0071] After obtaining the pre-trained noise prediction network, the pre-trained noise prediction network can be used as an encoder for the target molecular property prediction task (referred to as the second encoder to distinguish), and the second encoder needs to be fine-tuned on the target molecular property prediction task. The fine-tuning process will further optimize the parameters in the second encoder, so that based on the parameter values in the optimized second encoder, it is possible to encode and obtain a more accurate prediction representation on the target molecular property prediction task. Among them, the target molecular property prediction task is a specific molecular property prediction task, for example, it can be one of the 12 downstream 3D molecular property prediction tasks (mu, alpha, HOMO, LUMO, Gap, R2, ZPVE, U0, U, H, G, Cv) of the QM9 data set, or it can also be other molecular property prediction tasks, which are not limited in this embodiment. The first encoder can be obtained according to the fine-tuned second encoder. In a specific implementation, the fine-tuned second encoder can be directly used as the first encoder, or the fine-tuned second encoder can be processed by other processes to obtain the first encoder according to the needs in the specific application scenario, which is not limited in this embodiment.
[0072] Step S30: input the prediction representation into a first molecular property predictor for prediction to obtain a property prediction result of the target molecule.
[0073] In the process of fine-tuning the second encoder on the target molecular property prediction task, the second encoder and the molecular property predictor to be trained are combined into a molecular property prediction model to be trained, and then the molecular property prediction model to be trained is fine-tuned using a second training data set for the target molecular property prediction task, and the first encoder is obtained based on the fine-tuned second encoder, and the first molecular property predictor is obtained based on the fine-tuned molecular property predictor.
[0074] After the first encoder is used to encode the first molecule data to obtain a prediction representation, the prediction representation is input into the first molecule property predictor for prediction, and a property prediction result of the target molecule under the target molecule property prediction task can be obtained.
[0075] In this embodiment, the existing noise prediction network trained by the self-supervised method still cannot predict the properties of the molecule well when applied to the downstream molecular property prediction task. After considering the reason, it is found that the dependence between each vertex in the molecule is not taken into account when adding noise, and each vertex in the molecule is regarded as independent, that is, the subgraph of the molecule is ignored, which is not conducive to the noise prediction model capturing the subgraph features of the molecule, so that when applied to the downstream molecular property prediction task, the molecular properties cannot be predicted well. Furthermore, in view of this reason, the molecular property prediction scheme of this embodiment is proposed. In this embodiment, by obtaining the first molecular data of the target molecule, the first molecular data is input into the first encoder for encoding to obtain the prediction representation corresponding to the target molecule. Since the first encoder is pre-trained using a denoising-based pre-training method, and when adding noise, noise is not added to the entire molecular structure of the sample molecule, but to a subgraph of the sample molecule, and then the noise prediction network is used to predict the noise added to the subgraph, so as to optimize the noise prediction network, the noise prediction network learns how to extract the subgraph features of the sample molecule, rather than just learning how to extract the features of the entire molecular structure of the sample molecule, that is, the noise prediction network can capture the subgraph features of the molecule, so that when applied to downstream molecular property prediction tasks, the captured subgraph features can be used to predict the properties of the molecule, thereby improving the accuracy of the predicted properties. For example, when predicting the properties of drug molecules, the subgraph of the drug molecules plays a vital role in the properties of the drugs. Through the property prediction method of this embodiment, the prediction representation obtained by encoding the molecular data of the drug molecules based on the first encoder can characterize the subgraph characteristics of the drug molecules. The subgraph can be better identified during the downstream molecular property prediction, thereby making the property prediction of the drug molecule based on the prediction representation more accurate.
[0076] Based on the above first embodiment, a second embodiment of the molecular property prediction method of the present invention is proposed. In this embodiment, the molecular property prediction method further includes steps S40 to S80:
[0077] Step S40: Acquire a first training data set, wherein the first training data set includes a plurality of sample molecules.
[0078] Step S50: acquiring second molecular data of the sample molecule, wherein the second molecular data includes molecular structure data of the sample molecule and original coordinates of each vertex in the sample molecule.
[0079] The training data set used in the pre-training process is referred to as the first training data set for distinction. The first training data set includes a plurality of sample molecules.
[0080] The molecular data corresponding to the plurality of sample molecules are obtained (referred to as second molecular data for distinction). The second molecular data corresponding to the sample molecules include molecular structure data representing the sample molecules and original coordinates of each vertex in the sample molecules.
[0081] In one feasible implementation, a public data set QM9 may be obtained, and GeoDiff (a molecular conformation generation method based on a diffusion model) may be used to characterize each molecule therein, and each atom has an atomic feature and its 3D coordinates. Then, a first training data set is selected from the QM9 data set, and the first training data set contains 40,000 molecules, each molecule has 5 conformations, and a total of 200,000 conformations.
[0082] Step S60: adding noise to the coordinates of each vertex in the subgraph of the sample molecule based on the second molecule data of the sample molecule, so as to transform the second molecule data of the sample molecule into third molecule data after adding noise.
[0083] The pre-training process performs multiple rounds of iterative optimization on the noise prediction network. Optimization refers to updating the parameter values of the network parameters of the noise prediction network. Multiple rounds refer to multiple updates of the parameter values of the network parameters in the noise prediction network. Iteration refers to each update of the parameter value based on the last updated noise prediction network. The process of each round of optimization is similar, so one round of optimization is used as an example for explanation.
[0084] One round of optimization process uses all or part of the sample molecules in the first training data set, which is specifically set according to needs and is not limited here.
[0085] During one round of optimization, for each sample molecule used, a noise adding operation is performed for each sample molecule, which can be adding noise to the molecular structure data of the sample molecule or adding noise to the vertex coordinates of the sample molecule. The following takes adding noise to the vertex coordinates of a sample molecule as an example for explanation.
[0086] Based on the second molecular data of the sample molecule, noise is added to the coordinates of each vertex in the subgraph of the sample molecule to obtain third molecular data. It should be noted that there are multiple subgraphs of the sample molecule. In a specific implementation, any one or more subgraphs can be selected to perform the operation of adding noise to the coordinates of the vertices in each subgraph, so as to obtain one or more third molecular data.
[0087] It is understandable that the third molecular data also includes the molecular structure data of the sample molecule and the coordinates of each vertex in the sample molecule, but the coordinates of some of the vertices are the coordinates after adding noise, and the molecular structure data in the third molecular data is the same as the molecular structure data in the second molecular data. It should be noted that the third molecular data can be obtained by adding noise to the coordinates of each vertex in a subgraph of the sample molecule on the basis of the second molecular data. Alternatively, the third molecular data can also be obtained by adding noise in multiple steps on the basis of the second molecular data, wherein each step adds noise to the coordinates of each vertex in a subgraph of the sample molecule, and the subgraphs of each step can be the same or different. When selecting a subgraph, the subgraph required for multiple steps can be selected; in the noise prediction stage, the noise added in the last step can be predicted.
[0088] Step S70: using the noise prediction network to be trained to predict the noise added to the third molecule data of the sample molecule, and calculating the noise prediction loss, and using the subgraph and the noise prediction loss to optimize the noise prediction network.
[0089] The noise prediction network to be trained can be implemented by using a preset network structure, such as SchNet, which is not limited in this embodiment. The parameter values of its network parameters can be initialized randomly or based on experience, and the noise prediction network is optimized by multiple rounds of iterations, that is, the parameter values of the network parameters in the noise prediction network are continuously updated.
[0090] The noise prediction loss is calculated by comparing the actual added noise value with the noise value predicted by the noise prediction network. The specific calculation method is not limited in this embodiment, and the MSE (mean square error) calculation method can be used. The noise prediction loss reflects the error between the actual added noise value in the third molecule data of each sample molecule and the noise value predicted by the noise prediction network. The goal of optimizing the noise prediction network is to reduce the error. Therefore, optimizing the noise prediction network through the noise prediction loss refers to updating the network parameters in the noise prediction network with the goal of reducing the noise prediction loss. There are many specific implementation methods for using subgraphs and noise prediction losses to optimize the noise prediction network, which are not limited in this embodiment.
[0091] Step S80, using the first training data set to perform multiple rounds of iterative optimization on the noise prediction network to complete pre-training, and fine-tuning the pre-trained noise prediction network on the target molecular property prediction task, and obtaining the first encoder based on the fine-tuned noise prediction network.
[0092] The noise prediction network is subjected to multiple rounds of iterative optimization using the first training data set. The number of rounds of iterative optimization is not limited, and the stop condition of the iterative optimization can be pre-set, for example, it can be set when the loss converges, or it can be set when a set number of rounds is reached, or it can be set when a set duration is reached, which is not limited in this embodiment. After the iterative optimization stops, the pre-training process is completed.
[0093] In a feasible implementation manner, in step S80, the pre-trained noise prediction network is fine-tuned on the target molecular property prediction task, and the step of obtaining the first encoder according to the fine-tuned noise prediction network includes steps S801 to S802:
[0094] Step S801, the pre-trained noise prediction network and the molecular property predictor to be trained are combined into a molecular property prediction model to be trained.
[0095] Step S802, obtaining a second training data set for the target molecular property prediction task, using the second training data set to fine-tune the molecular property prediction model to be trained, using the fine-tuned noise prediction network as the first encoder, and using the fine-tuned molecular property prediction as the first molecular property predictor.
[0096] In a feasible implementation manner, the step S60 includes steps S601 to S603:
[0097] Step S601: randomly selecting T subgraphs from each subgraph of the sample molecule.
[0098] Each subgraph of a sample molecule may include all possible subgraphs of the sample molecule, and T subgraphs are selected from each subgraph. The method of selecting subgraphs is not limited in this embodiment, for example, it may be randomly selected or determined by sampling in a certain distribution.
[0099] T can be preset as needed, for example, it can be set to 1000 to 5000. The number of vertices in the sample molecule is represented by M, then its subgraph has 2 M can be from 2 M T subgraphs are randomly selected from the subgraphs, for example, by sampling from a certain distribution. The T subgraphs can be regarded as a sequence, and each subgraph in the sequence can be repeated.
[0100] Step S602, using the second molecular data as the molecular data of the sample molecule at the 0th time step, and based on the molecular data of the sample molecule at the t-1th time step, adding noise to the coordinates of each vertex in the tth subgraph of T subgraphs to obtain the molecular data of the sample molecule at the tth time step, where t=1, 2...T.
[0101] The second molecular data of the sample molecule is taken as the molecular data of the sample molecule at time step 0. Based on the molecular data at time step 0, noise is added to the coordinates of each vertex in the first subgraph to obtain the molecular data of the sample molecule at time step 1; based on the molecular data at time step 1, noise is added to the coordinates of each vertex in the second subgraph to obtain the molecular data of the sample molecule at time step 2; based on the molecular data at time step 2, noise is added to the coordinates of each vertex in the third subgraph to obtain the molecular data of the sample molecule at time step 3; and so on, until, based on the molecular data at time step T-1, noise is added to the coordinates of each vertex in the Tth subgraph to obtain the molecular data of the sample molecule at time step T.
[0102] In this implementation manner, the size of the noise value added to the coordinates of each vertex at each time step is not limited and can be preset as needed.
[0103] Step S603: Using the molecular data of the sample molecule at time steps 1 to T as the third molecular data respectively.
[0104] That is, based on the second molecule data of the sample molecule, T third molecule data are converted.
[0105] In a feasible implementation, when the noise prediction network is used to predict the noise, the molecular data of the sample molecule at the t-th time step is input into the noise prediction network, and the noise value added to the coordinates of each vertex in the t-th subgraph based on the molecular data at the t-1th time step is predicted (referred to as the predicted coordinate noise value for distinction). The noise value actually added to the coordinates of each vertex in the t-th subgraph based on the molecular data at the t-1th time step is referred to as the real coordinate noise value for distinction.
[0106] In a feasible implementation manner, in step S602, based on the molecular data of the sample molecule at the t-1th time step, noise is added to the coordinates of each vertex in the tth subgraph of the T subgraphs to obtain the molecular data of the sample molecule at the tth time step, including steps S6021 to S6022:
[0107] Step S6021, obtaining noise values corresponding to respective target vertices based on standard Gaussian distribution sampling, wherein the respective target vertices are vertices in the t-th subgraph.
[0108] The standard Gaussian distribution is a Gaussian distribution with a mean of 0 and a variance of 1, which is represented by N(0,1). Each vertex in the t-th subgraph is called a target vertex to distinguish it. The noise value corresponding to each target vertex can be obtained based on the standard Gaussian distribution sampling. The noise value corresponding to each target vertex is independent and identically distributed.
[0109] Step S6022, performing weighted summation on the coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step and the corresponding noise value, so as to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0110] The weights used in the weighted summation can be preset as needed and are not limited in this embodiment.
[0111] It should be noted that in other implementations, other methods other than weighted summation may be used to add noise, such as multiplying the coordinate value by the noise value.
[0112] In a feasible implementation manner, the step S6022 includes steps S60221 to S60222:
[0113] Step S60221, multiplying the target binary vector and the preset noise weight corresponding to the t-th time step to obtain the actual noise weight corresponding to each vertex of the sample molecule, wherein the target binary vector is the binary vector corresponding to the t-th subgraph, and the elements in the target binary vector correspond one-to-one to the vertices of the sample molecule, the vertices corresponding to the elements with a value of 1 are included in the t-th subgraph, and the vertices corresponding to the elements with a value of 0 are not included in the t-th subgraph.
[0114] In this embodiment, a binary vector can be used as a data form to represent a subgraph. The number of elements in the binary vector is the number of vertices in the sample molecule, that is, the elements in the binary vector correspond to each vertex one by one, and the value of the element in the binary vector is 1 or 0, 1 indicates that the corresponding vertex is selected, and 0 indicates that the corresponding vertex is not selected. The binary vector corresponding to the t-th subgraph is called the target binary vector for distinction.
[0115] For example, diphenyl ketone has 13 atoms, numbered from 1 to 13. There are 13 elements in the binary vector, corresponding to each atom one by one. Assume that the target binary vector corresponding to the t-th subgraph of the benzene ring is represented as s t , if s t ={1,1,1,1,1,1,0,0,0,0,0,0,0}, it means that the vertices in the tth subgraph include the 1st to 6th atoms of the benzene ring.
[0116] Multiplying the target binary vector by the preset noise weight corresponding to the t-th time step to obtain the actual noise weight corresponding to each vertex in the sample molecule can be understood as obtaining a weight vector, in which the elements in the weight vector correspond one-to-one to each vertex in the sample molecule, and the value of the element represents the actual noise weight of the corresponding vertex. Since the value of the element in the target binary vector is 1 or 0, the actual noise weight corresponding to the vertex in the t-th subgraph is the preset noise weight of the vertex, and the actual noise weight corresponding to the vertex not included in the t-th subgraph is 0, so it is possible to achieve the effect of adding noise only to the coordinates of the vertices in the t-th subgraph. The preset noise weight can be a weight value obtained in a pre-set manner, and the preset noise weight corresponding to each vertex in the sample molecule can be the same or different, which is not limited in the present embodiment.
[0117] Step S60222, the coordinates of each vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values using the corresponding actual noise weights to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0118] It should be noted that when the noise value is sampled based on the standard Gaussian distribution in step S6021, the noise value corresponding to each vertex in the sample molecule can be sampled. It can be understood that, taking a vertex in the sample molecule as an example, the coordinates of the vertex in the molecular data of the sample molecule at the t-1th time step and the noise value corresponding to the vertex are weighted summed using the actual noise weight corresponding to the vertex to obtain the coordinates of the vertex after noise addition at the t time step.
[0119] In one feasible implementation, for T subgraphs of sample molecules, the 3D coordinates of each vertex are calculated in T steps: Add white noise, the process is as follows Figure 6 As shown, R t The calculation formula is (taking the coordinates of a single vertex as an example):
[0120]
[0121] Where t represents the time step. t =1-s t β t , To balance the Gaussian noise ∈ and the original 3D coordinates R of each vertex in the sample molecule 0 The weight coefficient of s t ∈{0, 1}, when the value is 0, it means that the vertex is not a vertex in the subgraph, and when the value is 1, it means that the vertex is a vertex in the subgraph. t, t=0, 1, ..., T} is a constant set in advance, that is, a preset noise weight, which is used to control the scale of the Gaussian noise added at each time step t. N(0, 1) is a standard Gaussian distribution with a mean of 0 and a variance of 1.
[0122] The above formula (1) can also be written in the form of Gaussian distribution as follows:
[0123]
[0124] Figure 6 Taking diphenyl ketone as an example, there are 13 atoms, numbered 1 to 13. In the first time step, the 0, 1 binary vector s1 = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0) is used to select the benzene ring composed of the above 1-6 atoms, and then Gaussian noise β1*∈1 is added to it to obtain the coordinate R after noise addition 1 In the second time step, the binary vector s1 = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1} is used to select the benzene ring below, and then Gaussian noise β2*∈2 is added to it to obtain the noisy coordinate R 2 By analogy, after T steps (T is 1000-5000), the coordinate information R which is almost white noise can be obtained. T In this way, the noise coordinate series is constructed, and the entire coordinate series is {R 0 , R 1 , R 2 , ..., R T The molecule has 13 atoms in total, so si is 13-dimensional, and is used to represent the binary vector sequence {s1, s2, ..., s T} can be set in advance or determined by sampling from a distribution (i.e., {s i ~p(s), i=1,...,T}). s i The 1 in the binary vector indicates selection, and the 0 indicates unselection. The selected atoms and the connections that retain the existing bonds in them are a subgraph.
[0125] Based on the above second embodiment, a third embodiment of the molecular property prediction method of the present invention is proposed. In this embodiment, step S70 includes:
[0126] Step S701: input the third molecule data of the sample molecule into a noise prediction network for prediction, and obtain the predicted coordinate noise value corresponding to each vertex in the subgraph.
[0127] In this embodiment, a feasible implementation method is proposed for explicitly using subgraph data representing sample molecules to optimize the noise prediction network, so that the noise prediction network can more accurately capture the subgraph features of the molecule, so that when applied to downstream molecular property prediction tasks, it can use the captured more accurate subgraph features to predict the properties of the molecule, thereby further improving the accuracy of the predicted properties.
[0128] The third molecule data of the sample molecule is input into the noise prediction network for prediction, and the predicted coordinate noise values corresponding to each vertex in the subgraph are obtained. It should be noted that the predicted coordinate noise value refers to the noise value added to the coordinates of the vertex, and there may be an error between the predicted coordinate noise value and the real coordinate noise value. The larger the error, the less accurate the prediction of the noise prediction network. The optimization of the noise prediction network is to continuously update the parameter values of the network parameters of the noise prediction network, hoping to find parameter values that can make the error smaller.
[0129] Step S702 , calculating the noise prediction loss according to the predicted coordinate noise value corresponding to each vertex in the subgraph and the real coordinate noise value added to the coordinates of each vertex in the subgraph in the third molecular data.
[0130] When calculating the noise prediction loss, the noise prediction loss can be calculated only based on the predicted coordinate noise value and the real coordinate noise value corresponding to each vertex in the subgraph, and the predicted coordinate noise value of each vertex outside the subgraph predicted by the noise prediction network can be ignored.
[0131] Step S703: input the third molecular data into the subgraph prediction network to be trained for prediction to obtain subgraph prediction data.
[0132] The sub-graph prediction network to be trained may be implemented by using a preset network structure, for example, SchNet+MLP, which is not limited in this embodiment. The parameter values of its network parameters may be initialized randomly or based on experience.
[0133] The third molecular data is input into the subgraph prediction network to be trained for prediction, and data for characterizing the predicted subgraph is obtained, which is called subgraph prediction data for distinction. It should be noted that the predicted subgraph is a subgraph predicted by the subgraph prediction network with added coordinate noise. There may be an error between the predicted subgraph and the actual subgraph with added coordinate noise. In the pre-training process, by continuously updating the parameter values of the network parameters in the subgraph prediction network, it is expected to find parameter values that can make the error smaller.
[0134] Step S704: Calculate the sub-graph prediction loss based on the sub-graph prediction data and the sub-graph.
[0135] There are many ways to calculate the sub-graph prediction loss based on the sub-graph prediction data and the data representing the sub-graph (the sub-graph to which coordinate noise is actually added), which are not limited in this embodiment. For example, a cross entropy loss calculation method can be used.
[0136] The subgraph prediction loss reflects the error between the predicted subgraph and the actual subgraph with added coordinate noise. One goal of the pre-training process is to reduce the noise prediction loss, and the other goal is to reduce the subgraph prediction loss, that is, the error between the predicted subgraph and the actual subgraph with added coordinate noise.
[0137] Step S705: Calculate a total loss based on the subgraph prediction loss and the noise prediction loss, and use the total loss to optimize the noise prediction network.
[0138] The method of calculating the total loss based on the subgraph prediction loss and the noise prediction loss can be to add the two parts of the loss, or to perform a weighted sum. The specific calculation method used is not limited in this embodiment. Using the total loss to optimize the noise prediction network means updating the network parameters in the noise prediction network and the network parameters in the subgraph prediction network with the goal of minimizing the total loss. In this embodiment, the specific method of updating the network parameters is not limited. For example, the gradient values corresponding to each network parameter in the noise prediction network and the subgraph prediction network can be calculated based on the total loss, and the gradient descent method can be used to update the parameter values of each network parameter based on the gradient value.
[0139] In this embodiment, a subgraph prediction network is added, the subgraph prediction loss is calculated based on the subgraph prediction data output by the subgraph prediction network and the data representing the subgraph (the subgraph to which coordinate noise is actually added), and the total loss is calculated together with the noise prediction loss. The noise prediction network is optimized by the total loss, so that the noise prediction network is affected by the goal of reducing the noise prediction loss while also being affected by the goal of reducing the subgraph prediction loss. This enables the noise prediction network to more accurately capture the subgraph features of the molecule, so that when applied to downstream molecular property prediction tasks, the captured more accurate subgraph features can be used to predict the properties of the molecule, thereby further improving the accuracy of the predicted properties.
[0140] In one feasible implementation, the training objectives in the pre-training process are divided into two parts. One part is the MSE (mean square error) of the predicted noise, that is, the noise prediction loss, and the second part is the cross entropy loss (BCE) for binary classification. The following formula (2) is used to explicitly convert the data s used to represent the subgraph into i Used in training noise prediction networks.
[0141]
[0142] where ∈ θ The neural network for predicting noise ∈, that is, the noise prediction network, can be implemented using SchNet, and its input includes: (i.e., the 2D molecular graph of the sample molecule), R t (the coordinates of each vertex in the sample molecule after adding t steps of noise) and the time step t of the noise addition. The neural network for predicting subgraphs, that is, the subgraph prediction network, can be implemented using SchNet+MLP (Multi-layer Perceptron). λ is the regularization weight.
[0143] You can also use other different methods to t Integrate it into the training, focusing on the binary vector s used to represent the sub-graph t Incorporate it into the model training to improve the denoising model's perception of sub-images.
[0144] During the pre-training process, each time we first get R is obtained by formula (1): t , and then use formula (2) to perform iterative training using the stochastic gradient descent of the Adam optimizer until convergence (if the difference between the losses of two adjacent iterations is less than a threshold such as 0.1), and then end the training to obtain the pre-trained model ∈ θ . Using the pre-trained model ∈ θ , as an encoder for molecular representation learning (input the molecular data of a molecule and output the predicted representation of the molecule), and then connected to a molecular property predictor (such as a multi-layer perceptron MLP), fine-tuned on 12 downstream 3D molecular property prediction tasks in the QM9 dataset (such as: mu, alpha, HOMO, LUMO, Gap, R2, ZPVE, U0, U, H, G, Cv), and evaluated the effect of the pre-training method on downstream molecular property prediction. Use the fine-tuned model to predict the properties of a specific task of molecular property prediction (such as HOMO energy prediction) for the target molecule.
[0145] In this embodiment, it is proposed to add subgraph constraints during pre-training using the denoising method, so that the denoising model can effectively capture the subgraph features of the molecule. Since the subgraph features are very important for the prediction of molecular properties, the solution of this embodiment can effectively improve the performance of the model in downstream molecular property prediction.
[0146] In addition, the present invention also provides a molecular property prediction device, referring to Figure 7 , the molecular property prediction device comprises:
[0147] An acquisition module 10, used to acquire first molecule data of a target molecule;
[0148] The encoding module 20 is used to input the first molecule data into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule, wherein the first encoder is pre-trained by using a denoising-based pre-training method, and in the pre-training process, noise is added to a subgraph of the sample molecule in the first training data set to optimize the noise prediction network, and the pre-trained noise prediction network is fine-tuned on the target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network;
[0149] The prediction module 30 is used to input the prediction representation into a first molecular property predictor for prediction to obtain a property prediction result of the target molecule.
[0150] In a feasible implementation manner, the acquisition module 10 is further used for:
[0151] Acquire a first training data set, wherein the first training data set includes a plurality of sample molecules; acquire second molecular data of the sample molecules, wherein the second molecular data includes molecular structure data of the sample molecules and original coordinates of each vertex in the sample molecules;
[0152] The molecular property prediction device also includes:
[0153] a noise adding module, configured to add noise to the coordinates of each vertex in the subgraph of the sample molecule based on the second molecule data of the sample molecule, so as to transform the second molecule data of the sample molecule into third molecule data after adding noise;
[0154] an optimization module, configured to predict the noise added to the third molecule data of the sample molecule by using a noise prediction network to be trained, calculate a noise prediction loss, and use the subgraph and the noise prediction loss to optimize the noise prediction network;
[0155] A fine-tuning module is used to use the first training data set to perform multiple rounds of iterative optimization on the noise prediction network to complete pre-training, and fine-tune the pre-trained noise prediction network on the target molecular property prediction task, and obtain the first encoder based on the fine-tuned noise prediction network.
[0156] In one feasible implementation, the noise adding module is further used for:
[0157] Randomly select T subgraphs from each subgraph of the sample molecule;
[0158] The second molecular data is used as the molecular data of the sample molecule at the 0th time step, and based on the molecular data of the sample molecule at the t-1th time step, noise is added to the coordinates of each vertex in the tth subgraph of T subgraphs to obtain the molecular data of the sample molecule at the tth time step, where t=1, 2...T;
[0159] The molecular data of the sample molecule at time steps 1 to T are respectively used as the third molecular data.
[0160] In one feasible implementation, the noise adding module is further used for:
[0161] Based on standard Gaussian distribution sampling, noise values corresponding to each target vertex are obtained, wherein each target vertex is a vertex in the t-th subgraph;
[0162] The coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0163] In one feasible implementation, the noise adding module is further used for:
[0164] Multiply the target binary vector and the preset noise weight corresponding to the t-th time step to obtain the actual noise weight corresponding to each vertex of the sample molecule, wherein the target binary vector is the binary vector corresponding to the t-th subgraph, the elements in the target binary vector correspond one-to-one to the vertices of the sample molecule, the vertices corresponding to the elements with a value of 1 are included in the t-th subgraph, and the vertices corresponding to the elements with a value of 0 are not included in the t-th subgraph;
[0165] The coordinates of each vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values using the corresponding actual noise weights to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
[0166] In one feasible implementation, the optimization module is further used for:
[0167] Inputting the third molecule data of the sample molecule into a noise prediction network for prediction, and obtaining predicted coordinate noise values corresponding to each vertex in the subgraph;
[0168] Calculate the noise prediction loss according to the predicted coordinate noise values corresponding to the vertices in the subgraph and the real coordinate noise values added to the coordinates of the vertices in the subgraph in the third molecular data;
[0169] Inputting the third molecular data into the subgraph prediction network to be trained for prediction to obtain subgraph prediction data;
[0170] Calculating a sub-graph prediction loss based on the sub-graph prediction data and the sub-graph;
[0171] A total loss is calculated based on the subgraph prediction loss and the noise prediction loss, and the total loss is used to optimize a noise prediction network.
[0172] In a feasible implementation manner, the fine-tuning module is further configured to include:
[0173] The pre-trained noise prediction network and the molecular property predictor to be trained form a molecular property prediction model to be trained;
[0174] A second training data set is obtained for the target molecular property prediction task, and the molecular property prediction model to be trained is fine-tuned using the second training data set, and the fine-tuned noise prediction network is used as the first encoder, and the fine-tuned molecular property prediction is used as the first molecular property predictor.
[0175] The expanded contents of the specific implementation of the molecular property prediction device of the present invention are basically the same as the various embodiments of the above-mentioned molecular property prediction method, and will not be elaborated here.
[0176] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a molecular property prediction program is stored. When the molecular property prediction program is executed by a processor, the steps of the molecular property prediction method described below are implemented.
[0177] The various embodiments of the molecular property prediction device and the computer-readable storage medium of the present invention can all refer to the various embodiments of the molecular property prediction method of the present invention, and will not be described in detail here.
[0178] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0179] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0181] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for predicting molecular properties, characterized in that: The molecular property prediction method comprises the following steps: Acquiring first molecule data of a target molecule; Inputting the first molecule data into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule, wherein the first encoder is pre-trained using a denoising-based pre-training method, and during the pre-training process, noise is added to a subgraph of a sample molecule in a first training data set to optimize a noise prediction network, and the pre-trained noise prediction network is fine-tuned on a target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network; Inputting the prediction representation into a first molecular property predictor for prediction to obtain a property prediction result of the target molecule; The method of optimizing the noise prediction network by adding noise to the subgraph of the sample molecules in the first training data set also includes: Acquire a first training data set, wherein the first training data set includes a plurality of sample molecules; Acquire second molecular data of the sample molecule, wherein the second molecular data includes molecular structure data of the sample molecule and original coordinates of each vertex in the sample molecule; Randomly select T subgraphs from each subgraph of the sample molecule; The second molecular data is used as the molecular data of the sample molecule at the 0th time step, and based on the molecular data of the sample molecule at the t-1th time step, noise is added to the coordinates of each vertex in the tth subgraph of T subgraphs to obtain the molecular data of the sample molecule at the tth time step, where t=1, 2...T; Using the molecular data of the sample molecule at time steps 1 to T as third molecular data respectively; The noise prediction network to be trained is used to predict the noise added to the third molecule data of the sample molecule, and the noise prediction loss is calculated, and the subgraph and the noise prediction loss are used to optimize the noise prediction network.
2. The molecular property prediction method according to claim 1, characterized in that: The step of adding noise to the coordinates of each vertex in the t-th subgraph among the T subgraphs based on the molecular data of the sample molecule at the t-1th time step to obtain the molecular data of the sample molecule at the t-1th time step comprises: Based on standard Gaussian distribution sampling, noise values corresponding to each target vertex are obtained, wherein each target vertex is a vertex in the t-th subgraph; The coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
3. The molecular property prediction method according to claim 2, characterized in that: The step of performing weighted summation of the coordinates of each target vertex in the molecular data of the sample molecule at the t-1th time step and the corresponding noise value to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step comprises: Multiply the target binary vector and the preset noise weight corresponding to the t-th time step to obtain the actual noise weight corresponding to each vertex of the sample molecule, wherein the target binary vector is the binary vector corresponding to the t-th subgraph, the elements in the target binary vector correspond one-to-one to the vertices of the sample molecule, the vertices corresponding to the elements with a value of 1 are included in the t-th subgraph, and the vertices corresponding to the elements with a value of 0 are not included in the t-th subgraph; The coordinates of each vertex in the molecular data of the sample molecule at the t-1th time step are weighted summed with the corresponding noise values using the corresponding actual noise weights to add noise to the coordinates of each vertex in the tth subgraph to obtain the molecular data of the sample molecule at the tth time step.
4. The molecular property prediction method according to claim 1, characterized in that: The steps of using the noise prediction network to be trained to predict the noise added to the third molecule data of the sample molecule, calculating the noise prediction loss, and using the subgraph and the noise prediction loss to optimize the noise prediction network include: Inputting the third molecule data of the sample molecule into a noise prediction network for prediction, and obtaining predicted coordinate noise values corresponding to each vertex in the subgraph; Calculate the noise prediction loss according to the predicted coordinate noise values corresponding to the vertices in the subgraph and the real coordinate noise values added to the coordinates of the vertices in the subgraph in the third molecular data; Inputting the third molecular data into the subgraph prediction network to be trained for prediction to obtain subgraph prediction data; Calculating a sub-graph prediction loss based on the sub-graph prediction data and the sub-graph; A total loss is calculated based on the subgraph prediction loss and the noise prediction loss, and the total loss is used to optimize a noise prediction network.
5. The molecular property prediction method according to any one of claims 1 to 4, characterized in that: The step of fine-tuning the pre-trained noise prediction network on the target molecular property prediction task and obtaining the first encoder according to the fine-tuned noise prediction network comprises: The pre-trained noise prediction network and the molecular property predictor to be trained form a molecular property prediction model to be trained; A second training data set is obtained for the target molecular property prediction task, and the molecular property prediction model to be trained is fine-tuned using the second training data set, and the fine-tuned noise prediction network is used as the first encoder, and the fine-tuned molecular property prediction is used as the first molecular property predictor.
6. A molecular property prediction device, characterized in that: The molecular property prediction device comprises: An acquisition module, used for acquiring first molecule data of a target molecule; An encoding module, used for inputting the first molecule data into a first encoder for encoding to obtain a prediction representation corresponding to the target molecule, wherein the first encoder is pre-trained by using a denoising-based pre-training method, and in the pre-training process, noise is added to a subgraph of the sample molecule in the first training data set to optimize the noise prediction network, the pre-trained noise prediction network is fine-tuned on the target molecule property prediction task, and the first encoder is obtained according to the fine-tuned noise prediction network; A prediction module, used for inputting the prediction representation into a first molecular property predictor for prediction, to obtain a property prediction result of the target molecule; The encoding module is also used for: Acquire a first training data set, wherein the first training data set includes a plurality of sample molecules; Acquire second molecular data of the sample molecule, wherein the second molecular data includes molecular structure data of the sample molecule and original coordinates of each vertex in the sample molecule; Randomly select T subgraphs from each subgraph of the sample molecule; The second molecular data is used as the molecular data of the sample molecule at the 0th time step, and based on the molecular data of the sample molecule at the t-1th time step, noise is added to the coordinates of each vertex in the tth subgraph of T subgraphs to obtain the molecular data of the sample molecule at the tth time step, where t=1, 2...T; Using the molecular data of the sample molecule at time steps 1 to T as third molecular data respectively; The noise prediction network to be trained is used to predict the noise added to the third molecule data of the sample molecule, and the noise prediction loss is calculated, and the subgraph and the noise prediction loss are used to optimize the noise prediction network.
7. A molecular property prediction device, characterized in that: The molecular property prediction device comprises: a memory, a processor, and a molecular property prediction program stored in the memory and executable on the processor. When the molecular property prediction program is executed by the processor, the steps of the molecular property prediction method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a molecular property prediction program, and when the molecular property prediction program is executed by a processor, the steps of the molecular property prediction method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Training method and device of molecular codec, equipment and storage medium
CN116959623A