A training method and apparatus for a molecular multiconformation prediction model
By using a molecular multiconformation prediction model, which utilizes molecular structure encoders, conformation encoders, and flow models to process training data, the problems of high computational cost and long time consumption in traditional methods are solved, and fast and accurate molecular multiconformation prediction is achieved.
Patent Information
- Application Number
- CN202310694373.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-06-12
AI Technical Summary
Existing technologies struggle to predict multiple three-dimensional conformations of molecules quickly and accurately, and they consume significant computational resources and time, failing to address the issues of large computational loads and long processing times inherent in traditional methods.
A molecular multi-conformation prediction model is adopted. By acquiring training data, including molecular structure representation samples and molecular conformation samples, the model is processed using a molecular structure encoder, conformation encoder, conformation decoder and streaming model. The model is then trained using loss function values and reparameterization techniques to obtain predicted molecular conformations.
It enables rapid and accurate prediction of multiple three-dimensional conformations of molecules, reducing the computational resources and time consumption for resolving multiple three-dimensional conformations of molecules.
Smart Images

Figure CN116798536B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method and apparatus for a molecular multiconformation prediction model. Background Technology
[0002] The three-dimensional conformation of a molecule is a decisive factor in its physicochemical properties. In real-world scenarios, molecules exist in three-dimensional space, and their three-dimensional conformation can be represented by the three-dimensional coordinates of each atom that makes up the molecule. In fields such as cheminformatics and computer-aided drug discovery, analyzing the true three-dimensional conformation of molecules is crucial, as it determines their physical, chemical, and biological properties. Generally, lower-energy conformations are more stable, and each molecule often has multiple stable conformations. Therefore, comprehensively and accurately predicting molecular multiple conformations is of paramount importance.
[0003] Each molecule often has multiple stable three-dimensional conformations. Traditional experimental methods make it difficult to capture a comprehensive and accurate three-dimensional conformation. Computational methods based on quantum mechanics or molecular mechanics often require a comprehensive analysis of the molecular potential energy surface to find local minima and thus the corresponding three-dimensional conformation of the molecule. This process is computationally intensive, requires huge computational resources, and is also time-consuming. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of this application is to provide a training method and apparatus for a molecular multi-conformation prediction model, so as to realize the rapid and accurate prediction of multiple three-dimensional conformations of a molecule without analyzing its entire conformational space, thereby reducing the computational resources and time consumed in resolving multiple three-dimensional conformations of a molecule.
[0005] In a first aspect, embodiments of this application provide a method for training a molecular multiconformation prediction model, the method comprising:
[0006] Acquire training data, which includes: molecular structure representation samples and molecular conformation samples;
[0007] The molecular structure representation samples and the molecular conformation samples are processed using the molecular multiconformation prediction model to be trained to obtain the training output;
[0008] A loss function value is constructed based on the training output and the molecular conformation samples;
[0009] If the loss function value or the number of training rounds is within a preset range, the trained molecular multiformation prediction model is used as the molecular multiformation prediction model.
[0010] Optionally, the molecular structure representation sample is any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample; the molecular multi-conformation prediction model is first pre-trained on a molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task.
[0011] The molecular multi-conformation prediction model to be trained includes: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model.
[0012] The process of using a multi-conformation prediction model to be trained on the molecular structure representation samples and the molecular conformation samples to obtain training output includes:
[0013] The molecular structure representation sample is converted into a molecular structure embedding vector;
[0014] The molecular structure encoder is invoked to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-validation distribution;
[0015] The conformation encoder is invoked to process the molecular conformation sample to obtain a posterior distribution, and reparameterization is used to sample from the posterior distribution to obtain posterior sample values;
[0016] The flow model is invoked to process the posterior sampled value to obtain the pre-amplitude sampled value;
[0017] The conformation decoder is invoked to process the posterior sampled value to obtain the predicted molecular conformation;
[0018] The prior distribution, the posterior distribution, the prior sample value, and the predicted molecular conformation are used as the training output.
[0019] Optionally, constructing the loss function value based on the training output and the molecular conformation samples includes:
[0020] Construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation;
[0021] Construct the KL loss function value based on the prior a prior distribution, the posterior distribution, and the prior a prior sample value;
[0022] The loss function value is determined based on the reconstruction loss function value and the KL loss function value.
[0023] Optionally, the multi-conformation prediction model of the molecule to be trained is connected to a conformation discriminator.
[0024] Before constructing the loss function value based on the training output and the molecular conformation samples, the method further includes:
[0025] The conformation discriminator is invoked to process the predicted molecular conformation to obtain the intermediate layer features of the predicted molecular conformation and the predicted molecular conformation discrimination output, and the true conformation is the molecular conformation sample.
[0026] The conformation discriminator is invoked to process the molecular conformation sample to obtain the intermediate layer features of the true conformation and the true conformation discrimination output;
[0027] The step of constructing the loss function value based on the training output and the molecular conformation samples includes:
[0028] The first classification loss function value of the conformation discriminator is constructed based on the predicted molecular conformation discrimination output and the true conformation discrimination output;
[0029] Based on the predicted molecular conformation, the output is used to construct the second classification loss function value of the multi-conformation prediction model of the molecule to be trained;
[0030] Based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the true conformation, the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained is constructed.
[0031] The loss function value is determined based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
[0032] Optionally, after using the trained molecular multiconformation prediction model as the molecular multiconformation prediction model, the method further includes:
[0033] Obtain structural representation information of the molecule whose conformation is to be predicted;
[0034] The structural representation information of the molecule is input into the molecular multiconformation prediction model, and combined with reparameter skill sampling, the predicted molecular conformation of the molecule to be predicted is obtained.
[0035] Secondly, embodiments of this application provide a training apparatus for a molecular multiconformation prediction model, the apparatus comprising:
[0036] The training data acquisition module is used to acquire training data, which includes: molecular structure representation samples and molecular conformation samples.
[0037] The training output acquisition module is used to process the molecular structure representation samples and the molecular conformation samples using the molecular multi-conformation prediction model to be trained, and obtain the training output.
[0038] The loss function construction module is used to construct loss function values based on the training output and the molecular conformation samples.
[0039] The prediction model acquisition module is used to use the trained molecular multiconformation prediction model as the molecular multiconformation prediction model when the loss function value or the number of training rounds is within a preset range.
[0040] Optionally, the molecular structure representation sample is any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample; the molecular multi-conformation prediction model is first pre-trained on a molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task.
[0041] The molecular multi-conformation prediction model to be trained includes: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model.
[0042] The training output acquisition module includes:
[0043] An embedding vector acquisition unit is used to convert the molecular structure representation sample into a molecular structure embedding vector.
[0044] The pre-propagation distribution acquisition unit is used to call the molecular structure encoder to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-propagation distribution;
[0045] The posterior sampling value sampling unit is used to call the conformation encoder to process the molecular conformation sample to obtain the posterior distribution, and to sample the posterior sample value from the posterior distribution using reparameterization.
[0046] A pre-amplitude sample value acquisition unit is used to call the flow model to process the posterior sample value to obtain the pre-amplitude sample value;
[0047] The predicted molecular conformation acquisition unit is used to call the conformation decoder to process the posterior sampled value to obtain the predicted molecular conformation;
[0048] The training output acquisition unit is used to take the pre-a priori distribution, the posterior distribution, the pre-a priori sample value, and the predicted molecular conformation as the training output.
[0049] Optionally, the loss function construction module includes:
[0050] A reconstruction loss construction unit is used to construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation.
[0051] KL loss construction unit, used to construct KL loss function value based on the pre-aware distribution, the posterior distribution and the pre-aware sample value;
[0052] The first loss function determination unit is used to determine the loss function value based on the reconstruction loss function value and the KL loss function value.
[0053] Optionally, the multi-conformation prediction model of the molecule to be trained is connected to a conformation discriminator.
[0054] The device further includes:
[0055] The discrimination output acquisition module is used to call the conformation discriminator to process the predicted molecular conformation and obtain the intermediate layer features of the predicted molecular conformation and the discrimination output of the predicted molecular conformation.
[0056] The conformation discrimination output acquisition unit is used to call the conformation discriminator to process the molecular conformation sample to obtain the intermediate layer features of the real conformation and the real conformation discrimination output, wherein the real conformation is the molecular conformation sample.
[0057] The loss function construction module includes:
[0058] The first classification loss construction unit is used to construct the first classification loss function value of the conformation discriminator based on the predicted molecular conformation discrimination output and the true conformation discrimination output;
[0059] The second classification loss construction unit is used to discriminate and output the second classification loss function value of the multi-conformation prediction model of the molecule to be trained based on the predicted molecular conformation;
[0060] The feature loss construction unit is used to construct the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the real conformation.
[0061] The second loss function determination unit is used to determine the loss function value based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
[0062] Optionally, the device further includes:
[0063] The structure representation information acquisition module is used to acquire the structure representation information of the molecule whose conformation is to be predicted;
[0064] The predicted molecular conformation acquisition module is used to input the structural representation information of the molecule into the molecular multiconformation prediction model, and combine it with reparameter skill sampling to obtain the predicted molecular conformation of the molecule with the conformation to be predicted.
[0065] Thirdly, embodiments of this application provide an electronic device, including:
[0066] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the training method for the molecular multiconformation prediction model described in any of the preceding claims.
[0067] Fourthly, embodiments of this application provide a computer-readable storage medium that, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the training method for the molecular multiconformation prediction model described in any of the preceding claims.
[0068] Compared with the prior art, the embodiments of this application have the following advantages:
[0069] In this embodiment, training data is acquired, including molecular structure representation samples and molecular conformation samples. A multi-conformation prediction model is used to process the molecular structure representation samples and molecular conformation samples to obtain training output. A loss function value is constructed based on the training output and the molecular conformation samples. If the loss function value or the number of training rounds is within a preset range, the trained multi-conformation prediction model is used as the molecular multi-conformation prediction model. This embodiment trains a multi-conformation prediction model to predict multiple three-dimensional conformations of a molecule, thereby enabling fast and accurate prediction of multiple three-dimensional conformations without analyzing their potential energy surfaces, reducing the computational resources and time consumed in resolving multiple three-dimensional conformations of molecules.
[0070] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0071] Figure 1 A flowchart illustrating the steps of a training method for a molecular multiconformation prediction model provided in this application embodiment;
[0072] Figure 2 A schematic diagram of a molecule and its multiple conformations provided for embodiments of this application;
[0073] Figure 3 A schematic diagram illustrating the function of a molecular multiconformation prediction model provided in an embodiment of this application;
[0074] Figure 4 A schematic diagram illustrating the training process of a molecular multiconformation prediction model provided in this application embodiment;
[0075] Figure 5 A schematic diagram of the reasoning process of a molecular multiconformation prediction model provided in an embodiment of this application;
[0076] Figure 6 A schematic diagram illustrating an application example of a molecular multiconformation prediction model provided in this application embodiment;
[0077] Figure 7 A schematic diagram of the structure of a training device for a molecular multiconformation prediction model provided in an embodiment of this application;
[0078] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0079] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0080] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0081] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes said element.
[0082] Reference Figure 1 The diagram illustrates a flowchart of the training method for a molecular multiconformation prediction model provided in an embodiment of this application. Figure 1 As shown, the training method for this molecular multiconformation prediction model may include the following steps:
[0083] Step 101: Obtain training data, which includes molecular structure representation samples and molecular conformation samples.
[0084] The embodiments of this application can be applied to scenarios where molecular multiconformation prediction models are trained.
[0085] In practice, each molecule has multiple three-dimensional conformations, such as... Figure 2 As shown, a molecule and two of its multiple three-dimensional conformations are presented, namely conformation one and conformation two.
[0086] In this embodiment, when training and analyzing the multi-conformation prediction model, training data can be obtained, which may include: molecular structure representation samples and molecular conformation samples.
[0087] In this example, the molecular structure representation sample can be any of the following: a one-dimensional string representation sample, a two-dimensional graph representation sample, or a three-dimensional representation sample. The molecular conformation sample is a three-dimensional coordinate representation sample. Of course, the molecular conformation sample can also be a distance matrix representation sample. In this case, during model inference, the direct output of the molecular multi-conformation prediction model is the distance matrix, which can be converted into a three-dimensional coordinate representation.
[0088] After obtaining the training data, proceed to step 102.
[0089] Step 102: The molecular structure representation samples and the molecular conformation samples are processed using the molecular multi-conformation prediction model to be trained to obtain the training output.
[0090] After obtaining the training data, the molecular structure representation samples and molecular conformation samples from the training data can be input into the multi-conformation prediction model to be trained. This model will then process the molecular structure representation samples and molecular conformation samples to obtain the corresponding training output. In this example, the training output may include: the a priori distribution, the posterior distribution, the a priori sample value, and the predicted molecular conformation.
[0091] In this embodiment, the molecular multi-conformation prediction model can be pre-trained on a large-scale molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task. The model training process can be described in detail below with reference to the specific implementation method.
[0092] In one specific implementation of this application, the molecular multi-conformation prediction model to be trained may include: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model. Step 102 above may include the following sub-steps:
[0093] Sub-step A1: Convert the molecular structure representation sample into a molecular structure embedding vector.
[0094] In this implementation, the molecular multi-conformation prediction model to be trained includes four modules: molecular structure encoder, conformation encoder, conformation decoder, and Flow (i.e., flow model). Among them, the molecular structure encoder, conformation encoder, and conformation decoder are built based on GNN, or can be built based on Transformer.
[0095] After obtaining the training data, the molecular structure representation samples and molecular conformation samples from the training data can be input into the molecular multi-conformation prediction model to be trained. Then, the molecular structure representation samples can be converted into molecular structure embedding vectors. That is, the molecular structure representation samples are encoded to obtain the molecular structure embedding vectors.
[0096] After converting the molecular structure representation samples into molecular structure embedding vectors, substep A2 is performed.
[0097] Sub-step A2: Call the molecular structure encoder to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-test distribution.
[0098] After converting the molecular structure representation samples into molecular structure embedding vectors, these vectors can be input into the molecular structure encoder. The encoder can then process the embedding vectors to obtain the molecular structure feature vectors and the pre-defined distribution. For example... Figure 4 As shown, the molecular structure representation input into the molecular structure encoder yields a pre-defined distribution. The molecular structure feature vector output by the molecular structure encoder can be used as input to the conformation encoder and conformation decoder.
[0099] In the specific implementation, after the molecular structure representation sample is input into the molecular structure encoder, the molecular structure representation sample can first be encoded into a molecular feature vector (i.e., the molecular structure embedding vector in this example). Then, the molecular feature vector is used to map out the parameters describing the a priori distribution. The a priori distribution can be a Gaussian distribution, and the parameters describing the a priori distribution can include the mean m_p and the variance s_p.
[0100] After calling the molecular structure encoder to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-test distribution, sub-step A3 is executed.
[0101] Sub-step A3: Call the conformation encoder to process the molecular conformation sample to obtain the posterior distribution, and use reparameterization to sample from the posterior distribution to obtain the posterior sample value.
[0102] After the molecular structure embedding vector is processed by the molecular structure encoder to obtain the molecular structure feature vector and the prior distribution, the molecular structure embedding vector and the molecular conformation sample can be input into the conformation encoder.
[0103] A conformational encoder can process molecular conformational samples to obtain a posterior distribution, and then use reparameterization to sample posterior values from this distribution. Specifically, the molecular feature vector and molecular conformational representation R_r obtained from the molecular structure encoder can be input into the conformational encoder, and after processing, parameters describing the posterior distribution can be obtained. The posterior distribution can also be a Gaussian distribution, and the parameters describing the posterior distribution can include the mean m_q and variance s_q. For example... Figure 4 As shown, the conformation encoder can process the input molecular conformation representation and the molecular feature vector output by the molecular structure encoder to obtain the posterior distribution, and then sample the posterior distribution and input it to the Flow and conformation decoder.
[0104] After obtaining the parameters describing the posterior distribution, posterior sampled values can be obtained from the posterior distribution using reparameterization. Specifically, the posterior sampled value z_q can be sampled from the posterior distribution using the reparameterization technique.
[0105] After calling the conformation encoder to process the molecular conformation sample to obtain the posterior distribution, and then using reparameterization to sample the posterior sample value from the posterior distribution, substep A4 is executed.
[0106] Sub-step A4: Call the flow model to process the posterior sampled value to obtain the pre-amplitude sampled value.
[0107] After processing the molecular conformation samples using the conformation encoder to obtain the posterior distribution, and then sampling the posterior sample values from the posterior distribution using reparameterization, the flow model can be called to process the posterior sample values to obtain the pre-posterior sample values. Specifically, after sampling the posterior sample value z_q, z_q can be input into the Flow, and after processing, the pre-posterior sample value z_p can be obtained. For example... Figure 4 As shown, after Flow processes the posterior sampled value z_q output by the conformation encoder, z_p can be obtained.
[0108] After the posterior sampled value is processed by the flow model to obtain the pre-amplitude sampled value, sub-step A5 is executed.
[0109] Sub-step A5: Call the conformation decoder to process the posterior sampled value to obtain the predicted molecular conformation.
[0110] After processing the posterior sampled values using the streaming model to obtain the pre-posterior sampled values, the conformation decoder can be called to process the posterior sampled values to obtain the predicted molecular conformation. In a specific implementation, the molecular feature vector obtained using the molecular structure encoder and z_q can be input into the conformation decoder, and after processing, the predicted molecular conformation z can be obtained. For example... Figure 4As shown, the conformation decoder processes the posterior sampled value z_q output by the conformation encoder and the molecular feature vector output by the molecular structure encoder to obtain the final training output.
[0111] Understandably, the obtained predicted molecular conformation can be multiple predicted molecular conformations, such as... Figure 3 As shown, after the molecular structure representation is input into the multi-conformation prediction model, the multi-conformation prediction model can process the molecular structure representation and output multiple predicted molecular conformations, such as conformation one, conformation two, ... conformation N (N is a positive integer).
[0112] During the specific training process, sub-steps A3 to A5 can be executed iteratively to obtain multiple predicted molecular conformations.
[0113] After calling the conformation decoder to process the posterior sampled values to obtain the predicted molecular conformation, sub-step A6 is executed.
[0114] Sub-step A6: Use the pre-a priori distribution, the posterior distribution, the pre-a priori sampled value, and the predicted molecular conformation as the training output.
[0115] In this embodiment, after obtaining the pre-approval distribution, posterior distribution, pre-approval sample value and predicted molecular conformation through the above sub-steps, the pre-approval distribution, posterior distribution, pre-approval sample value and predicted molecular conformation can be used together as training output.
[0116] After processing the molecular structure representation samples and molecular conformation samples using the molecular multiconformation prediction model to be trained to obtain the training output, step 103 is executed.
[0117] Step 103: Construct loss function values based on the training output and the molecular conformation samples.
[0118] After processing the molecular structure representation samples and molecular conformation samples using the molecular multi-conformation prediction model to obtain the training output, the loss function value can be constructed based on the training output and the molecular conformation samples. In this example, the constructed loss function value can be the reconstruction loss and the KL loss. The process of constructing the loss function value can be described in detail below with reference to the specific implementation method.
[0119] In another specific implementation of this application, step 103 may include:
[0120] Sub-step B1: Construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation.
[0121] In this embodiment, after obtaining the predicted molecular conformation, a reconstruction loss function value can be constructed based on the molecular conformation sample and the predicted molecular conformation. That is, the reconstruction loss function value is the L1 loss between the true molecular conformation representation and the predicted molecular conformation representation.
[0122] Sub-step B2: Construct the KL loss function value based on the prior distribution, the posterior distribution, and the prior sampled value.
[0123] After obtaining the pre-amplitude distribution, posterior distribution, and pre-amplitude sampled values, the KL loss function can be constructed based on these values. The formula for calculating the KL loss function is as follows:
[0124]
[0125] Sub-step B3: Determine the loss function value based on the reconstruction loss function value and the KL loss function value.
[0126] After obtaining the reconstruction loss function value and the KL loss function value, the loss function value can be determined based on the reconstruction loss function value and the KL loss function value.
[0127] In practical implementation, the molecular multi-conformation prediction model can be trained using GAN methods in addition to the original model. Specifically, the molecular multi-conformation prediction model is used as a generator, and a separate conformation discriminator is constructed. For the molecular multi-conformation prediction model, a discriminant loss is added to the original loss function (reconstruction loss and KL loss). The implementation process can be described in detail below.
[0128] In another specific implementation of this application, before step 103 above, the following may also be included:
[0129] Step C1: Call the conformation discriminator to process the predicted molecular conformation, and obtain the intermediate layer features of the predicted molecular conformation and the predicted molecular conformation discrimination output.
[0130] In this embodiment, after obtaining the predicted molecular conformation output by the molecular multi-conformation prediction model, the predicted molecular conformation can be input into the conformation discriminator. The conformation discriminator can process the predicted molecular conformation to obtain the intermediate layer features of the predicted molecular conformation and the predicted molecular conformation discrimination output.
[0131] Step C2: Call the conformation discriminator to process the molecular conformation sample to obtain the intermediate layer features of the true conformation and the true conformation discrimination output.
[0132] Simultaneously, a conformation discriminator can be invoked to process the molecular conformation samples to obtain the intermediate layer features of the true conformation and the true conformation discrimination output. In this example, the true conformation is the molecular conformation sample.
[0133] After obtaining the intermediate layer features and discriminant outputs of the predicted molecular conformation, as well as the intermediate layer features and discriminant outputs of the true conformation, they can be applied to the subsequent calculation process of the class loss function.
[0134] Step 103 above may include:
[0135] Sub-step D1: Construct the first classification loss function value of the conformation discriminator based on the predicted molecular conformation discrimination output and the true conformation discrimination output.
[0136] After obtaining the intermediate layer features and discriminant output of the predicted molecular conformation, as well as the intermediate layer features and discriminant output of the true conformation, the first classification loss function value of the conformation discriminator can be constructed based on the discriminant output of the predicted molecular conformation and the true conformation.
[0137] Sub-step D2: Based on the predicted molecular conformation, output the second classification loss function value to construct the multi-conformation prediction model of the molecule to be trained.
[0138] The second classification loss function value can be used to construct a multi-conformation prediction model for the molecule to be trained based on the predicted molecular conformation.
[0139] Sub-step D3: Based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the true conformation, construct the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained.
[0140] Simultaneously, the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained can be constructed based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the real conformation.
[0141] Sub-step D4: Determine the loss function value based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
[0142] After constructing the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value, the loss function value can be determined based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value. In specific implementation, the discriminant loss includes two parts: inputting the predicted molecular conformation output by the molecular multi-conformation prediction model into the conformation discriminator, processing it to obtain the discrimination result, and calculating the classification loss based on the discrimination result; inputting the predicted molecular conformation output by the molecular multi-conformation prediction model into the conformation discriminator to obtain the intermediate layer features of the predicted molecular conformation, and simultaneously inputting the real molecular conformation into the conformation discriminator to obtain the intermediate layer features of the real molecular conformation, and calculating the loss based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the real molecular conformation.
[0143] For a conformation discriminator, its loss consists of two parts: First, the predicted molecular conformation output by the molecular multi-conformation prediction model is input into the conformation discriminator, processed to obtain the discrimination result, and the classification loss is calculated based on the discrimination result. Second, the actual molecular conformation is input into the conformation discriminator, processed to obtain the discrimination result, and the classification loss is calculated based on the discrimination result. The classification loss can be cross-entropy loss or other losses.
[0144] After constructing the loss function value based on the training output and molecular conformation samples, step 104 is executed.
[0145] Step 104: If the loss function value or the number of training rounds is within a preset range, use the trained molecular multiformation prediction model as the molecular multiformation prediction model.
[0146] After constructing the loss function value based on the training output and molecular conformation samples, the trained molecular multiconformation prediction model can be used as the molecular multiconformation prediction model, provided that the loss function value or the number of training epochs is within a preset range. This molecular multiconformation prediction model can then be applied to scenarios involving molecular multiconformation prediction.
[0147] This application embodiment trains a molecular multi-conformation prediction model to predict multiple three-dimensional conformations of a molecule, thereby enabling fast and accurate prediction of multiple three-dimensional conformations of a molecule without analyzing its potential energy surface, reducing the computational resources and time consumed in resolving multiple three-dimensional conformations of a molecule.
[0148] The reasoning process of the molecular multiconformation prediction model can be described in detail below in conjunction with the specific implementation method.
[0149] In another specific implementation of this application, after step 104 above, the following may also be included:
[0150] Step E1: Obtain the structural representation information of the molecule whose conformation is to be predicted.
[0151] In this embodiment, when performing multiconformation prediction of molecules, the structural representation information of the molecule with the conformation to be predicted can be obtained.
[0152] After obtaining the structural representation information of the molecule whose conformation to be predicted, step E2 is executed.
[0153] Step E2: Input the structural representation information of the molecule into the molecular multiconformation prediction model, and combine it with reparameter trick sampling to obtain the predicted molecular conformation of the molecule with the conformation to be predicted.
[0154] After obtaining the structural representation information of the molecule with the desired conformation, the structural representation information can be input into the molecular multiconformation prediction model. Combined with reparameter technique sampling, the predicted molecular conformation of the molecule with the desired conformation can be obtained.
[0155] The reasoning process of the molecular multiconformation prediction model can be combined with Figure 5 The following is a detailed description. This reasoning process may include the following steps:
[0156] 1. The molecular structure representation is input into the molecular structure encoder. First, the molecular structure representation is encoded into a molecular feature vector. Then, the molecular feature vector is used to map out the parameters describing the a priori distribution. The a priori distribution can be a Gaussian distribution, and the parameters describing the a priori distribution include the mean m_p and the variance s_p.
[0157] 2. Use the reparameterization technique to sample z_p from the pre-tested distribution, input z_p into the inverse flow, and obtain z after processing.
[0158] 3. Input the molecular feature vector and sampled value z obtained by the molecular structure encoder into the conformation decoder, and obtain the predicted molecular conformation after processing.
[0159] 4. Repeat steps 2 and 3 N times to obtain N predicted molecular conformations.
[0160] like Figure 6As shown, the molecular structure representation of the conformation to be predicted is input into the molecular multi-conformation prediction model. The molecular structure encoder obtains the molecular structure feature vector and the parameters m_p and s_p describing the a priori distribution. Using a reparameterization technique, z_p_1 is sampled from the a priori distribution. z_p_1 is then input into the inverse flow, processed to obtain z_1. The molecular structure feature vector and z_1 are then input into the conformation decoder, and after processing, conformation one is obtained. The sampling step is repeated to sample z_p_2 from distribution 1. z_p_2 is then input into the inverse flow, processed to obtain z_2. The molecular structure feature vector and z_2 are then input into the conformation decoder, and after processing, conformation two is obtained.
[0161] The method for training a molecular multiconformation prediction model provided in this application involves acquiring training data, including molecular structure representation samples and molecular conformation samples. The molecular multiconformation prediction model to be trained processes the molecular structure representation samples and molecular conformation samples to obtain training output. A loss function value is constructed based on the training output and the molecular conformation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular multiconformation prediction model is used as the molecular multiconformation prediction model. This application embodiment trains a molecular multiconformation prediction model to predict multiple three-dimensional conformations of molecules, thereby achieving fast and accurate prediction of multiple three-dimensional conformations of molecules without analyzing their potential energy surfaces, reducing the computational resources and time consumed in resolving multiple three-dimensional conformations of molecules.
[0162] Reference Figure 7 The diagram shows a schematic representation of the structure of a training device for a molecular multiconformation prediction model provided in an embodiment of this application. Figure 7 As shown, the training device 700 for the molecular multiconformation prediction model may include the following modules:
[0163] The training data acquisition module 710 is used to acquire training data, which includes: molecular structure representation samples and molecular conformation samples.
[0164] The training output acquisition module 720 is used to process the molecular structure representation samples and the molecular conformation samples using the molecular multi-conformation prediction model to be trained, and obtain the training output.
[0165] The loss function construction module 730 is used to construct a loss function value based on the training output and the molecular conformation sample.
[0166] The prediction model acquisition module 740 is used to use the trained molecular multiconformation prediction model as the molecular multiconformation prediction model when the loss function value or the number of training rounds is within a preset range.
[0167] Optionally, the molecular structure representation sample is any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample; the molecular multi-conformation prediction model is first pre-trained on a molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task.
[0168] The molecular multi-conformation prediction model to be trained includes: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model.
[0169] The training output acquisition module includes:
[0170] An embedding vector acquisition unit is used to convert the molecular structure representation sample into a molecular structure embedding vector.
[0171] The pre-propagation distribution acquisition unit is used to call the molecular structure encoder to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-propagation distribution;
[0172] The posterior sampling value sampling unit is used to call the conformation encoder to process the molecular conformation sample to obtain the posterior distribution, and to sample the posterior sample value from the posterior distribution using reparameterization.
[0173] A pre-amplitude sample value acquisition unit is used to call the flow model to process the posterior sample value to obtain the pre-amplitude sample value;
[0174] The predicted molecular conformation acquisition unit is used to call the conformation decoder to process the posterior sampled value to obtain the predicted molecular conformation;
[0175] The training output acquisition unit is used to take the pre-a priori distribution, the posterior distribution, the pre-a priori sample value, and the predicted molecular conformation as the training output.
[0176] Optionally, the loss function construction module includes:
[0177] A reconstruction loss construction unit is used to construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation.
[0178] KL loss construction unit, used to construct KL loss function value based on the pre-aware distribution, the posterior distribution and the pre-aware sample value;
[0179] The first loss function determination unit is used to determine the loss function value based on the reconstruction loss function value and the KL loss function value.
[0180] Optionally, the multi-conformation prediction model of the molecule to be trained is connected to a conformation discriminator.
[0181] The device further includes:
[0182] The discrimination output acquisition module is used to call the conformation discriminator to process the predicted molecular conformation and obtain the intermediate layer features of the predicted molecular conformation and the discrimination output of the predicted molecular conformation.
[0183] The conformation discrimination output acquisition unit is used to call the conformation discriminator to process the molecular conformation sample to obtain the intermediate layer features of the real conformation and the real conformation discrimination output, wherein the real conformation is the molecular conformation sample.
[0184] The loss function construction module includes:
[0185] The first classification loss construction unit is used to construct the first classification loss function value of the conformation discriminator based on the predicted molecular conformation discrimination output and the true conformation discrimination output;
[0186] The second classification loss construction unit is used to discriminate and output the second classification loss function value of the multi-conformation prediction model of the molecule to be trained based on the predicted molecular conformation;
[0187] The feature loss construction unit is used to construct the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the real conformation.
[0188] The second loss function determination unit is used to determine the loss function value based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
[0189] Optionally, the device further includes:
[0190] The structure representation information acquisition module is used to acquire the structure representation information of the molecule whose conformation is to be predicted;
[0191] The predicted molecular conformation acquisition module is used to input the structural representation information of the molecule into the molecular multiconformation prediction model, and combine it with reparameter skill sampling to obtain the predicted molecular conformation of the molecule with the conformation to be predicted.
[0192] The molecular generation model training device provided in this application acquires training data, including molecular structure representation samples and molecular conformation samples. The molecular structure representation samples and molecular conformation samples are processed using a molecular multi-conformation prediction model to be trained, resulting in training output. A loss function value is constructed based on the training output and the molecular conformation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular multi-conformation prediction model is used as the molecular multi-conformation prediction model. This application embodiment trains a molecular multi-conformation prediction model to predict multiple three-dimensional conformations of a molecule, thereby achieving fast and accurate prediction of multiple three-dimensional conformations of a molecule without analyzing its potential energy surface, reducing the computational resources and time consumed in resolving multiple three-dimensional conformations of a molecule.
[0193] This application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the training method of the above-mentioned molecular multiconformation prediction model.
[0194] Figure 8 A schematic diagram of the structure of an electronic device 800 according to an embodiment of the present invention is shown. Figure 8 As shown, the electronic device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 802 or loaded from storage unit 808 into random access memory (RAM) 803. The RAM 803 can also store various programs and data required for the operation of the electronic device 800. The CPU 801, ROM 802, and RAM 803 are interconnected via bus 804. An input / output (I / O) interface 805 is also connected to bus 804.
[0195] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, microphone, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0196] The various processes and handling described above can be executed by processing unit 801. For example, the methods of any of the above embodiments can be implemented as computer software programs tangibly contained in a computer-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by CPU 801, one or more actions of the methods described above can be performed.
[0197] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the aforementioned molecular multiconformation prediction model.
[0198] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0199] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0200] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminals (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0201] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal, causing a series of operational steps to be executed on the computer or other programmable terminal to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0203] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0204] The foregoing has provided a detailed description of a training method for a molecular multiconformation prediction model, a training device for a molecular multiconformation prediction model, an electronic device, and a computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A training method for a molecular multiconformation prediction model, characterized in that, The method includes: Acquire training data, which includes: molecular structure representation samples and molecular conformation samples; The molecular structure representation samples and the molecular conformation samples are processed using the molecular multiconformation prediction model to be trained to obtain the training output; A loss function value is constructed based on the training output and the molecular conformation samples; If the loss function value or the number of training rounds is within a preset range, the trained molecular multiconformation prediction model will be used as the molecular multiconformation prediction model. The molecular multi-conformation prediction model to be trained includes: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model. The process of using a multi-conformation prediction model to be trained on the molecular structure representation samples and the molecular conformation samples to obtain training output includes: The molecular structure representation sample is converted into a molecular structure embedding vector; The molecular structure encoder is invoked to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-validation distribution; The conformation encoder is invoked to process the molecular conformation sample to obtain a posterior distribution, and reparameterization is used to sample from the posterior distribution to obtain posterior sample values; The flow model is invoked to process the posterior sampled value to obtain the pre-amplitude sampled value; The conformation decoder is invoked to process the posterior sampled value to obtain the predicted molecular conformation; The prior distribution, the posterior distribution, the prior sample value, and the predicted molecular conformation are used as the training output.
2. The method according to claim 1, characterized in that, The molecular structure representation samples are any one of the following: one-dimensional string representation samples, two-dimensional graph representation samples, and three-dimensional representation samples; the molecular multi-conformation prediction model is first pre-trained on the molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task.
3. The method according to claim 1, characterized in that, The step of constructing the loss function value based on the training output and the molecular conformation samples includes: Construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation; Construct the KL loss function value based on the prior a prior distribution, the posterior distribution, and the prior a prior sample value; The loss function value is determined based on the reconstruction loss function value and the KL loss function value.
4. The method according to claim 3, characterized in that, The multi-conformation prediction model for the molecule to be trained is connected to the conformation discriminator. Before constructing the loss function value based on the training output and the molecular conformation samples, the method further includes: The conformation discriminator is invoked to process the predicted molecular conformation, thereby obtaining the intermediate layer features of the predicted molecular conformation and the predicted molecular conformation discrimination output; The conformation discriminator is invoked to process the molecular conformation sample to obtain the intermediate layer features of the true conformation and the true conformation discrimination output, wherein the true conformation is the molecular conformation sample. The step of constructing the loss function value based on the training output and the molecular conformation samples includes: The first classification loss function value of the conformation discriminator is constructed based on the predicted molecular conformation discrimination output and the true conformation discrimination output; Based on the predicted molecular conformation, the output is used to construct the second classification loss function value of the multi-conformation prediction model of the molecule to be trained; Based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the true conformation, the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained is constructed. The loss function value is determined based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
5. The method according to claim 1, characterized in that, After using the trained molecular multiconformation prediction model as the molecular multiconformation prediction model, the method further includes: Obtain structural representation information of the molecule whose conformation is to be predicted; The structural representation information of the molecule is input into the molecular multiconformation prediction model, and combined with reparameter skill sampling, the predicted molecular conformation of the molecule to be predicted is obtained.
6. A training device for a molecular multiconformation prediction model, characterized in that, The device includes: The training data acquisition module is used to acquire training data, which includes: molecular structure representation samples and molecular conformation samples. The training output acquisition module is used to process the molecular structure representation samples and the molecular conformation samples using the molecular multi-conformation prediction model to be trained, and obtain the training output. The loss function construction module is used to construct loss function values based on the training output and the molecular conformation samples. The prediction model acquisition module is used to use the trained molecular multiconformation prediction model as the molecular multiconformation prediction model when the loss function value or the number of training rounds is within a preset range. The molecular multi-conformation prediction model to be trained includes: a molecular structure encoder, a conformation encoder, a conformation decoder, and a streaming model. The training output acquisition module includes: An embedding vector acquisition unit is used to convert the molecular structure representation sample into a molecular structure embedding vector. The pre-propagation distribution acquisition unit is used to call the molecular structure encoder to process the molecular structure embedding vector to obtain the molecular structure feature vector and the pre-propagation distribution; The posterior sampling value sampling unit is used to call the conformation encoder to process the molecular conformation sample to obtain the posterior distribution, and to sample the posterior sample value from the posterior distribution using reparameterization. A pre-amplitude sample value acquisition unit is used to call the flow model to process the posterior sample value to obtain the pre-amplitude sample value; The predicted molecular conformation acquisition unit is used to call the conformation decoder to process the posterior sampled value to obtain the predicted molecular conformation; The training output acquisition unit is used to take the pre-a priori distribution, the posterior distribution, the pre-a priori sample value, and the predicted molecular conformation as the training output.
7. The apparatus according to claim 6, characterized in that, The molecular structure representation samples are any one of the following: one-dimensional string representation samples, two-dimensional graph representation samples, and three-dimensional representation samples; the molecular multi-conformation prediction model is first pre-trained on the molecular single-conformation dataset with molecular single-conformation prediction as the task, and then trained with molecular multi-conformation prediction as the task.
8. The apparatus according to claim 6, characterized in that, The loss function construction module includes: A reconstruction loss construction unit is used to construct a reconstruction loss function value based on the molecular conformation sample and the predicted molecular conformation. KL loss construction unit, used to construct KL loss function value based on the pre-aware distribution, the posterior distribution and the pre-aware sample value; The first loss function determination unit is used to determine the loss function value based on the reconstruction loss function value and the KL loss function value.
9. The apparatus according to claim 8, characterized in that, The multi-conformation prediction model for the molecule to be trained is connected to the conformation discriminator. The device further includes: The discrimination output acquisition module is used to call the conformation discriminator to process the predicted molecular conformation and obtain the intermediate layer features of the predicted molecular conformation and the discrimination output of the predicted molecular conformation. The conformation discrimination output acquisition unit is used to call the conformation discriminator to process the molecular conformation sample to obtain the intermediate layer features of the real conformation and the real conformation discrimination output, wherein the real conformation is the molecular conformation sample. The loss function construction module includes: The first classification loss construction unit is used to construct the first classification loss function value of the conformation discriminator based on the predicted molecular conformation discrimination output and the true conformation discrimination output; The second classification loss construction unit is used to discriminate and output the second classification loss function value of the multi-conformation prediction model of the molecule to be trained based on the predicted molecular conformation; The feature loss construction unit is used to construct the intermediate layer feature loss function value of the multi-conformation prediction model of the molecule to be trained based on the intermediate layer features of the predicted molecular conformation and the intermediate layer features of the real conformation. The second loss function determination unit is used to determine the loss function value based on the reconstruction loss function value, the KL loss function value, the first classification loss function value, the second classification loss function value, and the intermediate layer feature loss function value.
10. The apparatus according to claim 6, characterized in that, The device further includes: The structure representation information acquisition module is used to acquire the structure representation information of the molecule whose conformation is to be predicted; The predicted molecular conformation acquisition module is used to input the structural representation information of the molecule into the molecular multiconformation prediction model, and combine it with reparameter skill sampling to obtain the predicted molecular conformation of the molecule with the conformation to be predicted.
Citation Information
Patent Citations
Determining a distribution of atom coordinates of a macromolecule from images using auto-encoders
US20220415453A1