A training method and device of a molecular optimal conformation prediction model

CN116052792BActive Publication Date: 2026-08-18HANGZHOU CARBON SILICON SMART TECH DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310095164.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2026-08-18
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

但是,由于分子的构像空间十分庞大,尤其是对于含有较多原子的分子,对其全构象空间进行分析需要消耗庞大的计算资源且用时较长

Benefits of technology

[0067]In this embodiment, training data is acquired, including molecular structure representation samples and optimal conformation representation samples. A molecular optimal conformation prediction model is used to process the molecular structure representation samples to obtain training output. A loss function value is constructed based on the training output and the optimal conformation representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model. This embodiment trains a molecular optimal conformation prediction model to predict the optimal conformation of molecules, thereby achieving fast and accurate prediction of the optimal conformation without analyzing its entire conformational space, reducing the computational resources and time consumed in resolving the optimal conformation of molecules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116052792B_ABST
    Figure CN116052792B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a training method and device of a molecular optimal conformation prediction model. The method comprises: obtaining training data, wherein the training data comprises a molecular structure representation sample and an optimal conformation representation sample; processing the molecular structure representation sample by using a to-be-trained molecular optimal conformation prediction model to obtain a training output; constructing a loss function value according to the training output and the optimal conformation representation sample; and in a case where the loss function value or the number of training rounds is within a preset range, taking the trained to-be-trained molecular optimal conformation prediction model as the molecular optimal conformation prediction model. Embodiments of the present application can quickly and accurately predict the molecular optimal conformation without analyzing the entire conformation space of the molecule, thereby reducing the calculation resources and time consumed for analyzing the molecular optimal conformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of artificial intelligence technology and molecular simulation, and in particular to a training method and apparatus for a molecular optimal conformation prediction model. Background Technology

[0002] The optimal conformation of a molecule is a crucial factor influencing its physicochemical properties and pharmaceutical activity. 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 essential, as it determines their physical, chemical, and biological properties. Generally, lower-energy conformations are more stable and constitute a larger proportion of the conformation set; the conformation with the highest proportion is the optimal conformation, which often has the greatest influence on molecular properties.

[0003] By scanning the potential energy surface of a molecule's entire conformational space using quantum mechanical or molecular mechanics methods, the three-dimensional conformation corresponding to the maximum Boltzmann weight can be obtained as the optimal conformation. However, due to the vast conformational space of molecules, especially for molecules containing a large number of atoms, analyzing their entire conformational space requires enormous computational resources and is 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 optimal conformation prediction model, so as to quickly and accurately predict the optimal conformation of a molecule without analyzing its entire conformation space, thereby reducing the computational resources and time consumed in resolving the optimal conformation of a molecule.

[0005] In a first aspect, embodiments of this application provide a method for training a molecular optimal conformation prediction model, the method comprising:

[0006] Acquire training data, which includes: molecular structure representation samples and optimal conformation representation samples;

[0007] The molecular structure representation samples are processed using the optimal conformation prediction model of the molecule to be trained to obtain the training output;

[0008] The loss function value is constructed based on the training output and the optimal conformation representation sample;

[0009] If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model.

[0010] Optionally, the molecular structure representation sample can be any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample;

[0011] The optimal conformation represents the sample as a distance matrix representation of the molecule and a three-dimensional coordinate representation of the sample.

[0012] Optionally, the optimal conformation prediction model for the molecule to be trained includes: a distance prediction network and a coordinate transformation module.

[0013] The process employs a molecular optimal conformation prediction model to be trained, processes the molecular structure representation samples, and obtains training output, including:

[0014] The distance prediction network is invoked to process the molecular structure representation samples to obtain a prediction distance matrix;

[0015] The coordinate transformation module is invoked to process the predicted distance matrix to obtain the predicted three-dimensional coordinates;

[0016] The predicted 3D coordinates and the predicted distance matrix are used as the training output.

[0017] Optionally, the distance prediction network includes: an embedding layer, an encoder, and a distance prediction layer.

[0018] The step of calling the distance prediction network to process the molecular structure representation sample to obtain the predicted distance matrix includes:

[0019] The embedding layer is invoked to process the molecular structure representation sample to obtain the molecular structure embedding vector;

[0020] The encoder is invoked to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features;

[0021] The distance prediction layer is invoked to process the atomic pair features to obtain the predicted distance matrix.

[0022] Optionally, the step of calling the embedding layer to process the molecular structure representation sample to obtain a molecular structure embedding vector includes:

[0023] Atom representations and chemical bond representations are extracted from the molecular structure representation sample; the chemical bond representations include: real bond representations and virtual bond representations, wherein the virtual bond representations are set based on the cis-trans isomerism rules of chemical bonds;

[0024] The atomic representation and the chemical bond representation are used as input sequences, converted into corresponding token IDs, and then word embedding is performed to obtain the molecular structure embedding vector.

[0025] Optionally, the distance prediction network is an alternative structure, which includes: a convolutional layer, an encoder, and a distance prediction layer.

[0026] The step of calling the distance prediction network to process the molecular structure representation sample to obtain the predicted distance matrix includes:

[0027] Extract the atomic representation and atom pair representation from the molecular structure representation sample;

[0028] The convolutional layer is invoked to perform convolution processing on the multi-channel input atom representation to obtain a molecular structure convolution vector, and the multi-channel input atom pair representation is performed to obtain an attention bias;

[0029] The encoder is invoked to process the attention bias and the molecular structure convolution vector to obtain atom pair features;

[0030] The distance prediction layer is invoked to process the atomic pair features to obtain the predicted distance matrix.

[0031] Optionally, after using the trained optimal conformation prediction model of the molecule to be trained as the optimal conformation prediction model of the molecule, the method further includes:

[0032] Obtain structural representation information of the molecule whose optimal conformation is to be predicted;

[0033] The structural representation information is input into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule whose optimal conformation is to be predicted.

[0034] Secondly, embodiments of this application provide a training apparatus for a molecular optimal conformation prediction model, the apparatus comprising:

[0035] The training data acquisition module is used to acquire training data, which includes: molecular structure representation samples and optimal conformation representation samples;

[0036] The training output acquisition module is used to process the molecular structure representation sample using the optimal conformation prediction model of the molecule to be trained, and obtain the training output.

[0037] A loss function construction module is used to construct a loss function value based on the training output and the optimal conformation representation sample;

[0038] The prediction model acquisition module is used to use the trained optimal conformation prediction model of the molecule as the optimal conformation prediction model of the molecule when the loss function value or the number of training rounds is within a preset range.

[0039] Optionally, the molecular structure representation sample can be any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample;

[0040] The optimal conformation represents the sample as a distance matrix representation of the molecule and a three-dimensional coordinate representation of the sample.

[0041] Optionally, the optimal conformation prediction model for the molecule to be trained includes: a distance prediction network and a coordinate transformation module.

[0042] The training output acquisition module includes:

[0043] The distance prediction matrix acquisition unit is used to call the distance prediction network to process the molecular structure representation sample to obtain the distance prediction matrix;

[0044] The predicted 3D coordinate acquisition unit is used to call the coordinate transformation module to process the predicted distance matrix to obtain the predicted 3D coordinates;

[0045] The training output acquisition unit is used to take the predicted 3D coordinates and the predicted distance matrix as the training output.

[0046] Optionally, the distance prediction network includes: an embedding layer, an encoder, and a distance prediction layer.

[0047] The prediction distance matrix acquisition unit includes:

[0048] The molecular structure embedding vector acquisition subunit is used to call the embedding layer to process the molecular structure representation sample and obtain the molecular structure embedding vector;

[0049] The first atom pair feature acquisition subunit is used to call the encoder to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features;

[0050] The first predicted distance matrix acquisition subunit is used to call the distance prediction layer to process the atomic pair features and obtain the predicted distance matrix.

[0051] Optionally, the embedding vector acquisition subunit includes:

[0052] An atom representation extraction subunit is used to extract the atom representation and chemical bond representation in the molecular structure representation sample; the chemical bond representation includes: real bond representation and virtual bond representation, wherein the virtual bond representation is set based on the cis-trans isomerism rule of chemical bonds;

[0053] The embedding vector acquisition subunit is used to take the atom representation and the chemical bond representation as input sequences, convert them into corresponding token IDs and perform word embedding to obtain the molecular structure embedding vector.

[0054] Optionally, the distance prediction network is an alternative structure, which includes: a convolutional layer, an encoder, and a distance prediction layer.

[0055] The prediction distance matrix acquisition unit includes:

[0056] Atom pair representation extraction subunit is used to extract the atomic representation and atom pair representation in the molecular structure representation sample;

[0057] The attention bias acquisition subunit is used to call the convolutional layer to perform convolution processing on the multi-channel input atomic representation to obtain the molecular structure convolution vector, and to perform convolution processing on the multi-channel input atomic pair representation to obtain the attention bias;

[0058] The second atom pair feature acquisition subunit is used to call the encoder to process the attention bias and the molecular structure convolution vector to obtain atom pair features;

[0059] The second predicted distance matrix acquisition subunit is used to call the distance prediction layer to process the atomic pair features and obtain the predicted distance matrix.

[0060] Optionally, the device further includes:

[0061] The structure representation information acquisition module is used to acquire the structure representation information of the molecule whose optimal conformation is to be predicted;

[0062] The molecular optimal conformation prediction module is used to input the structural representation information into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule whose optimal conformation is to be predicted.

[0063] Thirdly, embodiments of this application provide an electronic device, including:

[0064] 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 optimal conformation prediction model described in any of the preceding claims.

[0065] 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 execute the training method for the molecular optimal conformation prediction model described in any of the preceding claims.

[0066] Compared with the prior art, the embodiments of this application have the following advantages:

[0067] In this embodiment, training data is acquired, including molecular structure representation samples and optimal conformation representation samples. A molecular optimal conformation prediction model is used to process the molecular structure representation samples to obtain training output. A loss function value is constructed based on the training output and the optimal conformation representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model. This embodiment trains a molecular optimal conformation prediction model to predict the optimal conformation of molecules, thereby achieving fast and accurate prediction of the optimal conformation without analyzing its entire conformational space, reducing the computational resources and time consumed in resolving the optimal conformation of molecules.

[0068] 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

[0069] Figure 1 A flowchart illustrating the steps of a method for training a molecular optimal conformation prediction model provided in this application embodiment;

[0070] Figure 2 A schematic diagram illustrating the three-dimensional coordinate representation and distance matrix representation of an optimal molecular conformation provided in an embodiment of this application;

[0071] Figure 3 A schematic diagram of a molecular optimal conformation prediction model provided in an embodiment of this application;

[0072] Figure 4 A schematic diagram illustrating the training process of a distance prediction network provided in an embodiment of this application;

[0073] Figure 5 A schematic diagram illustrating an example of a virtual key provided in an embodiment of this application;

[0074] Figure 6 A schematic diagram of the reasoning process of a molecular optimal conformation prediction model provided in an embodiment of this application;

[0075] Figure 7 A schematic diagram of the structure of a training device for a molecular optimal conformation prediction model provided in an embodiment of this application;

[0076] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0077] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0078] 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.

[0079] It should be noted that, in this document, relational terms such as "first" and "second" are used only 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.

[0080] Reference Figure 1 The flowchart illustrates the steps of a training method for a molecular optimal conformation prediction model provided in an embodiment of this application. Figure 1 As shown, the training method for this molecular optimal conformation prediction model may include the following steps:

[0081] Step 101: Obtain training data, which includes molecular structure representation samples and optimal conformation representation samples.

[0082] The embodiments of this application can be applied to scenarios where molecular optimal conformation prediction models are trained.

[0083] When training a molecular optimal conformation prediction model, training data can be obtained, which may include molecular structure representation samples and optimal conformation representation samples.

[0084] In practical implementation, molecular structure representation samples can be any of the following: one-dimensional string representation samples, two-dimensional graph representation samples, and three-dimensional representation samples. Optimal conformation representation samples can be represented by the molecular distance matrix or by three-dimensional coordinates. For example, Figure 2 Two representations of an example molecular conformation are presented: a three-dimensional coordinate representation and a distance matrix representation.

[0085] After obtaining the training data, proceed to step 102.

[0086] Step 102: Use the optimal conformation prediction model of the molecule to be trained to process the molecular structure representation sample and obtain the training output.

[0087] After obtaining the training data, the optimal conformation prediction model of the molecule to be trained can be used to process the molecular structure representation samples to obtain the training output.

[0088] In this example, the optimal conformation prediction model for the molecule to be trained may include: a distance prediction network and a coordinate transformation module (such as...). Figure 3 (As shown). The distance prediction network receives the molecular structure representation as input and predicts the distance matrix representation of the optimal molecular conformation. Then, the coordinate transformation module converts the distance matrix representation output by the distance prediction network into a three-dimensional coordinate representation. Through this process, the three-dimensional coordinate representation of the optimal molecular conformation can be obtained. This implementation process can be described in detail below with reference to the specific implementation method.

[0089] In one specific implementation of this application, step 102 may include:

[0090] Sub-step A1: Call the distance prediction network to process the molecular structure representation sample to obtain the predicted distance matrix.

[0091] In this embodiment, after obtaining the training data and inputting it into the optimal conformation prediction model to be trained, a distance prediction network can be invoked to process the molecular structure representation samples to obtain the prediction distance matrix. This implementation process can be described in detail below with reference to the specific implementation method.

[0092] In another specific implementation of this application, the above sub-step A1 may include:

[0093] Sub-step B1: Call the embedding layer to process the molecular structure representation sample to obtain the molecular structure embedding vector.

[0094] In this embodiment, the distance prediction network may include an embedding layer, an encoder, and a distance prediction layer.

[0095] After inputting the training data into the optimal conformation prediction model to be trained, the embedding layer can be invoked to process the molecular structure representation samples to obtain the molecular structure embedding vector. Specifically, firstly, the atomic representations and chemical bond representations in the molecular structure representation samples can be extracted. The chemical bond representations can include both real bond representations and virtual bond representations, with the virtual bond representations set based on the cis-trans isomerism rule of chemical bonds. Then, the atomic representations and chemical bond representations can be used as input sequences, converted into corresponding token IDs, and word embedding performed to obtain the molecular structure embedding vector.

[0096] After the molecular structure representation sample is processed by the embedding layer to obtain the molecular structure embedding vector, sub-step B2 is executed.

[0097] Sub-step B2: Call the encoder to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features.

[0098] After obtaining the molecular structure embedding vector, the encoder can be called to process the attention bias corresponding to the molecular structure embedding vector and the connection relationship of the molecules to obtain the atom pair features.

[0099] In this example, the encoder can be composed of stacked Transformers, or other networks, and this embodiment does not limit this.

[0100] After obtaining the atomic pair characteristics, proceed with sub-step B3.

[0101] Sub-step B3: Call the distance prediction layer to process the atomic pair features to obtain the predicted distance matrix.

[0102] After obtaining the atomic pair features, the distance prediction layer can be called to process the atomic pair features and obtain the predicted distance matrix.

[0103] The distance prediction layer can process atomic feature vectors in a weighted, classification-based manner. For example, taking atoms i and j that make up a molecule as an example, the feature vectors of atom i and atom j are concatenated to obtain the feature vector of atom pair ij. Then, after passing through a fully connected layer and Softmax, the probability values ​​corresponding to M distance categories are obtained, where the probability value and distance value corresponding to the m-th distance category are represented by Pm. ij As shown in the formula below, the distance d between atoms i and j can be obtained by weighting and summing these M distance values ​​according to their corresponding probability values. ij The formula is as follows:

[0104]

[0105] The above implementation process can be combined with Figure 4 The following is a detailed description.

[0106] like Figure 4 As shown, firstly, the atomic representations, chemical bond representations, and connectivity relationships of the molecule are obtained based on the molecular structure representation. The atomic and chemical bond representations are converted into token IDs and then sequentially passed through an embedding layer and an encoder, thus being encoded into atomic feature vectors and chemical bond feature vectors. The connectivity relationships are input into the encoder as attention biases. The atomic feature vectors are processed by a distance prediction layer to obtain the prediction output. The prediction output refers to the predicted optimal conformational distance matrix.

[0107] The representation of atoms can include the type of atom and its properties, which may include, but are not limited to, atomic orbital hybridization, charge, and chirality.

[0108] A chemical bond representation can include the type of chemical bond (e.g., single bond, double bond, triple bond, aromatic bond, and dummy bond), the types of atoms at both ends of the bond, and related properties. These properties can include conjugation and cis-trans isomerism information. A dummy bond refers to a bond added between other atoms directly connected to the atoms at both ends of a cis-trans isomeric chemical bond. For example... Figure 5 As shown, the two ends of the carbon-carbon double bond are atoms 5 and 6. Atoms directly bonded to atom 5 are atoms 1 and 3, and atoms directly bonded to atom 6 are atoms 2 and 4. Spatially, atoms 1 and 2 are located on the same side of the carbon-carbon double bond formed by atoms 5 and 6, thus a dummy bond is formed between atoms 1 and 2. Similarly, atoms 3 and 4 are located on the same side of the carbon-carbon double bond, thus a dummy bond is formed between atoms 1 and 2.

[0109] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.

[0110] Connection relationships can include connections between atoms, connections between chemical bonds, and connections between atoms and chemical bonds. The rules for connections between atoms are: atoms are connected to each other, but not to other atoms. Chemical bonds are connected to each other, but not to other chemical bonds. A chemical bond is connected to the two atoms forming that bond, but not to other atoms; an atom is connected to the chemical bond it belongs to, but not to other chemical bonds.

[0111] After calling the distance prediction network to process the molecular structure representation samples to obtain the predicted distance matrix, sub-step A2 is executed.

[0112] Sub-step A2: Call the coordinate transformation module to process the predicted distance matrix to obtain the predicted three-dimensional coordinates.

[0113] After the distance prediction network is called to process the molecular structure representation sample to obtain the predicted distance matrix, the coordinate transformation module can be called to process the predicted distance matrix to obtain the predicted three-dimensional coordinates.

[0114] After calling the coordinate transformation module to process the predicted distance matrix to obtain the predicted 3D coordinates, sub-step A3 is executed.

[0115] Sub-step A3: Use the predicted 3D coordinates and the predicted distance matrix as the training output.

[0116] After calling the coordinate transformation module to process the predicted distance matrix and obtain the predicted 3D coordinates, the predicted 3D coordinates and the predicted distance matrix can be used as training output.

[0117] In the above implementation, predicting the optimal molecular conformation involves two modules: first, predicting the distance matrix, and then converting the distance matrix into three-dimensional coordinates. The module predicting the distance matrix is ​​implemented by extracting atomic representations, chemical bond representations, and connectivity relationships from the molecular structure. The atomic and chemical bond representations are then used together as token IDs, while the connectivity relationships are used as attention biases input into the distance prediction network to predict the distance matrix. An alternative approach is to extract atomic and atom pair representations from the molecular structure, treating each type of atomic information in the atomic representation as a channel to construct a multi-channel atomic representation. Similarly, the atom pair representation treats each type of atom pair information as a channel to construct a multi-channel atom pair representation. These multi-channel atomic and atom pair representations are then input into the distance prediction network. A 1×1 convolutional kernel replaces the original embedding layer, mapping the atomic representations from the channel dimension to the feature dimension, before inputting them into the encoding layer. The 1×1 convolutional kernel maps the atom pair representations from the channel dimension to the target dimension, which then functions as the attention biases of the encoder.

[0118] The distance prediction layer mentioned above is implemented based on atomic feature vectors, but it can also be implemented based on atomic pair feature vectors.

[0119] In this embodiment, the distance prediction network can also adopt an alternative structure, which may include: convolutional layers, encoders and distance prediction layers. The process of obtaining the distance matrix can be described in detail in conjunction with the following specific implementation method.

[0120] In another specific implementation of this application, the above sub-step A1 may include:

[0121] Sub-step C1: Extract the atomic representation and atom pair representation from the molecular structure representation sample.

[0122] In this embodiment, after inputting the training data into the molecular optimal conformation prediction model to be trained, the atom representation and atom pair representation in the molecular structure representation sample can be extracted.

[0123] After extracting the atomic representations and atom pair representations from the molecular structure representation sample, substep C2 is performed.

[0124] Sub-step C2: Call the convolutional layer to perform convolution processing on the multi-channel input atom representation to obtain the molecular structure convolution vector, and perform convolution processing on the multi-channel input atom pair representation to obtain the attention bias.

[0125] After extracting the atomic representations and atom pair representations from the molecular structure representation samples, convolutional layers can be called to convolve the multi-channel input atomic representations to obtain the molecular structure convolution vector, and convolutional layers can be used to convolve the multi-channel input atom pair representations to obtain the attention bias.

[0126] After obtaining the attention bias and molecular structure convolution vector, substep C3 is executed.

[0127] Sub-step C3: Call the encoder to process the attention bias and the molecular structure convolution vector to obtain atom pair features.

[0128] After obtaining the attention bias and molecular structure convolution vector, the encoder can be called to process the attention bias and molecular structure convolution vector to obtain atom pair features.

[0129] After calling the encoder to process the attention bias and molecular structure convolution vector to obtain atom pair features, substep C4 is executed.

[0130] Sub-step C4: Call the distance prediction layer to process the atomic pair features to obtain the predicted distance matrix.

[0131] After the encoder processes the attention bias and molecular structure convolution vectors to obtain atom pair features, the distance prediction layer can be called to process the atom pair features to obtain the predicted distance matrix.

[0132] In this embodiment, the atomic pair features are input into the distance prediction layer for processing, and the resulting predicted distance matrix can be obtained using a classification weighting method.

[0133] After processing the molecular structure representation samples using the optimal conformation prediction model of the molecule to be trained to obtain the training output, step 103 is executed.

[0134] Step 103: Construct the loss function value based on the training output and the optimal conformation representation sample.

[0135] After processing the molecular structure representation samples using the optimal conformation prediction model of the molecule to be trained to obtain the training output, the loss function value can be constructed based on the training output and the optimal conformation representation samples.

[0136] In practice, the loss function can be L1 loss function, L2 loss function, smooth L1 loss function, or other loss functions.

[0137] After constructing the loss function value based on the training output and the optimal conformation representation sample, step 104 is executed.

[0138] Step 104: If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model.

[0139] After constructing the loss function value based on the training output and the optimal conformation representation samples, the trained molecular optimal conformation prediction model can be used as the molecular optimal conformation prediction model, provided that the loss function value or the number of training epochs is within a preset range. This molecular optimal conformation prediction model can then be applied to subsequent molecular optimal conformation prediction scenarios.

[0140] The coordinate transformation module of the optimal conformation prediction model has no parameters to be trained. It receives the distance matrix output from the distance prediction network and uses it as the target distance matrix. First, it initializes the 3D coordinates of N atoms based on the total number of atoms N corresponding to the target distance matrix. Then, it calculates a temporary distance matrix based on the 3D coordinates of the atoms. Next, it constructs a loss function value based on the temporary distance matrix and the target distance matrix, and performs gradient backpropagation to update the 3D coordinates of the atoms. This process is iterated repeatedly until the loss function value or the number of iterations is within a preset range. Finally, the optimized 3D coordinates are output as the optimal conformation 3D coordinates of the molecular optimal conformation prediction model.

[0141] The reasoning process of the molecular optimal conformation prediction model can be described in detail below in conjunction with the specific implementation method.

[0142] In one specific implementation of this application, after step 104 above, the following may also be included:

[0143] Step D1: Obtain the structural representation information of the molecule whose optimal conformation is to be predicted.

[0144] In this embodiment, when predicting the optimal conformation of a molecule, the structural representation information of the molecule whose optimal conformation is to be predicted can be obtained.

[0145] After obtaining the structural representation information of the molecule whose optimal conformation to be predicted is obtained, step D2 is executed.

[0146] Step D2: Input the structural representation information into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule to be predicted.

[0147] After obtaining the structural representation information of the molecule whose optimal conformation is to be predicted, this information can be input into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation. For example... Figure 6As shown, taking a molecule as an example, the process of predicting the optimal conformation using the molecular optimal conformation prediction model in this embodiment is presented. In this example, the molecular structure is represented as a 2D molecular diagram. First, the atom representation, chemical bond representation, and connection relationships are extracted from the molecular structure representation. For ease of presentation, the atom representation only shows the atom type, i.e., (O, C, C, C, C, C, O). The chemical bond representation only shows the chemical bond type, i.e., (O=C, CC, CC, CC, CC, CO). The connection relationships are presented in matrix form, where 1 represents a connection and 0 represents no connection. It can be seen that the connection relationship between atoms is 1, and the connection relationship between atoms and other atoms is 0. The chemical bond O=C has a connection relationship of 1 with the atoms at both ends (atom C and atom O), while the connection relationship with other atoms is 0. Next, the atom representation and chemical bond representation are converted into their corresponding token IDs and input into the distance prediction network. In addition, the connection relationships are also input into the distance prediction network.

[0148] After processing, the distance prediction network outputs a predicted distance matrix. Next, the coordinate transformation module receives the distance matrix and outputs a three-dimensional coordinate representation of the molecule. Through this process, the molecular optimal conformation prediction model predicts the optimal conformation of the example molecule.

[0149] The method for training a molecular optimal conformation prediction model provided in this application involves acquiring training data, including molecular structure representation samples and optimal conformation representation samples. The molecular optimal conformation prediction model to be trained is then used to process the molecular structure representation samples to obtain training output. A loss function value is constructed based on the training output and the optimal conformation representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model. This application embodiment achieves rapid and accurate prediction of molecular optimal conformations by training a molecular optimal conformation prediction model, without needing to analyze the entire conformational space, thus reducing the computational resources and time consumed in resolving molecular optimal conformations.

[0150] Reference Figure 7 The diagram shows a schematic representation of the structure of a training device for a molecular optimal conformation prediction model provided in an embodiment of this application. Figure 7 As shown, the training device 700 for the molecular optimal conformation prediction model may include the following modules:

[0151] The training data acquisition module 710 is used to acquire training data, which includes: molecular structure representation samples and optimal conformation representation samples;

[0152] The training output acquisition module 720 is used to process the molecular structure representation sample using the optimal conformation prediction model of the molecule to be trained, and obtain the training output.

[0153] The loss function construction module 730 is used to construct a loss function value based on the training output and the optimal conformation representation sample;

[0154] The prediction model acquisition module 740 is used to use the trained optimal conformation prediction model of the molecule as the optimal conformation prediction model of the molecule when the loss function value or the number of training rounds is within a preset range.

[0155] Optionally, the molecular structure representation sample can be any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, and a three-dimensional representation sample;

[0156] The optimal conformation represents the sample as a distance matrix representation of the molecule and a three-dimensional coordinate representation of the sample.

[0157] Optionally, the optimal conformation prediction model for the molecule to be trained includes: a distance prediction network and a coordinate transformation module.

[0158] The training output acquisition module includes:

[0159] The distance prediction matrix acquisition unit is used to call the distance prediction network to process the molecular structure representation sample to obtain the distance prediction matrix;

[0160] The predicted 3D coordinate acquisition unit is used to call the coordinate transformation module to process the predicted distance matrix to obtain the predicted 3D coordinates;

[0161] The training output acquisition unit is used to take the predicted 3D coordinates and the predicted distance matrix as the training output.

[0162] Optionally, the distance prediction network includes: an embedding layer, an encoder, and a distance prediction layer.

[0163] The prediction distance matrix acquisition unit includes:

[0164] The molecular structure embedding vector acquisition subunit is used to call the embedding layer to process the molecular structure representation sample and obtain the molecular structure embedding vector;

[0165] The first atom pair feature acquisition subunit is used to call the encoder to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features;

[0166] The first predicted distance matrix acquisition subunit is used to call the distance prediction layer to process the atomic pair features and obtain the predicted distance matrix.

[0167] Optionally, the embedding vector acquisition subunit includes:

[0168] An atom representation extraction subunit is used to extract the atom representation and chemical bond representation in the molecular structure representation sample; the chemical bond representation includes: real bond representation and virtual bond representation, wherein the virtual bond representation is set based on the cis-trans isomerism rule of chemical bonds;

[0169] The embedding vector acquisition subunit is used to take the atom representation and the chemical bond representation as input sequences, convert them into corresponding token IDs and perform word embedding to obtain the molecular structure embedding vector.

[0170] Optionally, the distance prediction network is an alternative structure, which includes: a convolutional layer, an encoder, and a distance prediction layer.

[0171] The prediction distance matrix acquisition unit includes:

[0172] Atom pair representation extraction subunit is used to extract the atomic representation and atom pair representation in the molecular structure representation sample;

[0173] The attention bias acquisition subunit is used to call the convolutional layer to perform convolution processing on the multi-channel input atomic representation to obtain the molecular structure convolution vector, and to perform convolution processing on the multi-channel input atomic pair representation to obtain the attention bias;

[0174] The second atom pair feature acquisition subunit is used to call the encoder to process the attention bias and the molecular structure convolution vector to obtain atom pair features;

[0175] The second predicted distance matrix acquisition subunit is used to call the distance prediction layer to process the atomic pair features and obtain the predicted distance matrix.

[0176] Optionally, the device further includes:

[0177] The structure representation information acquisition module is used to acquire the structure representation information of the molecule whose optimal conformation is to be predicted;

[0178] The molecular optimal conformation prediction module is used to input the structural representation information into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule whose optimal conformation is to be predicted.

[0179] The molecular optimal conformation prediction model training device provided in this application acquires training data, including molecular structure representation samples and optimal conformation representation samples. The molecular optimal conformation prediction model to be trained processes the molecular structure representation samples to obtain training output. A loss function value is constructed based on the training output and the optimal conformation representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model is used as the molecular optimal conformation prediction model. This application embodiment achieves rapid and accurate prediction of molecular optimal conformations by training a molecular optimal conformation prediction model, without needing to analyze the entire conformational space, thus reducing the computational resources and time consumed in resolving molecular optimal conformations.

[0180] Example 3

[0181] 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 optimal conformation prediction model.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] Example 4

[0186] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the training method for the above-described molecular optimal conformation prediction model.

[0187] 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.

[0188] 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.

[0189] 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.

[0190] 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 operate 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.

[0191] 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.

[0192] 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.

[0193] The above provides a detailed description of the training method, training device, electronic device, and computer-readable storage medium for a molecular optimal conformation prediction model 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 optimal conformation prediction model, characterized in that, The method includes: Acquire training data, which includes: molecular structure representation samples and optimal conformation representation samples; The molecular structure representation samples are processed using the optimal conformation prediction model of the molecule to be trained to obtain the training output; The loss function value is constructed based on the training output and the optimal conformation representation sample; If the loss function value or the number of training rounds is within a preset range, the trained molecular optimal conformation prediction model will be used as the molecular optimal conformation prediction model. The molecular structure representation sample can be any one of a one-dimensional string representation sample, a two-dimensional graph representation sample, or a three-dimensional representation sample; The optimal conformation represents the sample as a distance matrix of molecules and a three-dimensional coordinate representation of the sample; The optimal conformation prediction model for the molecule to be trained includes: a distance prediction network and a coordinate transformation module. The process employs a molecular optimal conformation prediction model to be trained, processes the molecular structure representation samples, and obtains training output, including: The distance prediction network is invoked to process the molecular structure representation samples to obtain a prediction distance matrix; The coordinate transformation module is invoked to process the predicted distance matrix to obtain the predicted three-dimensional coordinates; The predicted 3D coordinates and the predicted distance matrix are used as the training output; The distance prediction network includes an embedding layer, an encoder, and a distance prediction layer. The step of calling the distance prediction network to process the molecular structure representation sample to obtain the predicted distance matrix includes: The embedding layer is invoked to process the molecular structure representation sample to obtain the molecular structure embedding vector; The encoder is invoked to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features; The distance prediction layer is invoked to process the atomic pair features to obtain the predicted distance matrix; The step of calling the embedding layer to process the molecular structure representation sample to obtain the molecular structure embedding vector includes: Atom representations and chemical bond representations are extracted from the molecular structure representation sample; the chemical bond representations include: real bond representations and virtual bond representations, wherein the virtual bond representations are set based on the cis-trans isomerism rules of chemical bonds; The atomic representation and the chemical bond representation are used as input sequences, converted into corresponding token IDs, and then word embedding is performed to obtain the molecular structure embedding vector.

2. The method according to claim 1, characterized in that, The distance prediction network is an alternative structure, which includes: a convolutional layer, an encoder, and a distance prediction layer. The step of calling the distance prediction network to process the molecular structure representation sample to obtain the predicted distance matrix includes: Extract the atomic representation and atom pair representation from the molecular structure representation sample; The convolutional layer is invoked to perform convolution processing on the multi-channel input atom representation to obtain a molecular structure convolution vector, and the multi-channel input atom pair representation is performed to obtain an attention bias; The encoder is invoked to process the attention bias and the molecular structure convolution vector to obtain atom pair features; The distance prediction layer is invoked to process the atomic pair features to obtain the predicted distance matrix.

3. The method according to claim 1, characterized in that, After using the trained optimal conformation prediction model of the molecule to be trained as the optimal conformation prediction model of the molecule, the method further includes: Obtain structural representation information of the molecule whose optimal conformation is to be predicted; The structural representation information is input into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule whose optimal conformation is to be predicted.

4. A training device for a molecular optimal conformation 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 optimal conformation representation samples; The training output acquisition module is used to process the molecular structure representation sample using the optimal conformation prediction model of the molecule to be trained, and obtain the training output. A loss function construction module is used to construct a loss function value based on the training output and the optimal conformation representation sample; The prediction model acquisition module is used to use the trained optimal conformation prediction model of the molecule as the optimal conformation prediction model of the molecule when the loss function value or the number of training rounds is within a preset range. Wherein, 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 optimal conformation representation sample is a molecular distance matrix representation sample and a three-dimensional coordinate representation sample; The optimal conformation prediction model for the molecule to be trained includes: a distance prediction network and a coordinate transformation module; The training output acquisition module includes: The distance prediction matrix acquisition unit is used to call the distance prediction network to process the molecular structure representation sample to obtain the distance prediction matrix; The predicted 3D coordinate acquisition unit is used to call the coordinate transformation module to process the predicted distance matrix to obtain the predicted 3D coordinates; The training output acquisition unit is used to take the predicted 3D coordinates and the predicted distance matrix as the training output; The distance prediction network includes an embedding layer, an encoder, and a distance prediction layer. The prediction distance matrix acquisition unit includes: The molecular structure embedding vector acquisition subunit is used to call the embedding layer to process the molecular structure representation sample and obtain the molecular structure embedding vector; The first atom pair feature acquisition subunit is used to call the encoder to process the attention bias corresponding to the molecular structure embedding vector and the molecular connection relationship to obtain atom pair features; The first prediction distance matrix acquisition subunit is used to call the distance prediction layer to process the atomic pair features to obtain the prediction distance matrix; The molecular structure embedding vector acquisition subunit includes: An atom representation extraction subunit is used to extract the atom representation and chemical bond representation in the molecular structure representation sample; the chemical bond representation includes: real bond representation and virtual bond representation, wherein the virtual bond representation is set based on the cis-trans isomerism rule of chemical bonds; The embedding vector acquisition subunit is used to take the atom representation and the chemical bond representation as input sequences, convert them into corresponding token IDs and perform word embedding to obtain the molecular structure embedding vector.

5. The apparatus according to claim 4, 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 optimal conformation is to be predicted; The molecular optimal conformation prediction module is used to input the structural representation information into the molecular optimal conformation prediction model to obtain the predicted molecular optimal conformation of the molecule whose optimal conformation is to be predicted.

Citation Information

Patent Citations

  • Determining a distribution of atom coordinates of a macromolecule from images using auto-encoders

    US20220415453A1