A method and apparatus for training a molecular generation model

By acquiring and processing molecular expression information samples and structural representation samples, and using molecular generation models to predict molecular structures, the problems of time consumption and low efficiency in the process of analyzing unknown compounds are solved, achieving higher accuracy and efficiency.

CN115359856BActive Publication Date: 2026-01-23HANGZHOU CARBON SILICON SMART TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210877250.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-25
Publication Date
2026-01-23
Estimated Expiration
2042-07-25

AI Technical Summary

Technical Problem

In existing technologies, the process of determining the molecular structure of unknown compounds is time-consuming, inefficient, and inaccurate, and there is a possibility of incorrect molecular structure determination.

Method used

By acquiring training data, including molecular expression information samples and molecular structure representation samples, the molecular generation model to be trained is used to process the data, construct a loss function value, use the model as a molecular generation model within a preset range, and apply an encoder and decoder to predict molecular structures.

Benefits of technology

It improves the accuracy of molecular structure analysis of unknown compounds, reduces the time required for the analysis process, and increases analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115359856B_ABST
    Figure CN115359856B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a training method and device of a molecule generation model. The method comprises: obtaining training data, wherein the training data comprises expression information samples of molecules and molecule structure representation samples; processing the expression information samples of the molecules by using a to-be-trained molecule generation model to obtain training outputs; constructing a loss function value according to the training outputs and the molecule structure representation samples; and in a case where the loss function value or the training round number is within a preset range, taking the trained to-be-trained molecule generation model as the molecule generation model. Embodiments of the present application can improve the accuracy of the molecular structure analysis of unknown compounds, reduce the time consumption of the molecular structure analysis process of unknown compounds, and improve the analysis efficiency of the molecular structure.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a training method and device of a molecule generation model. BACKGROUND

[0002] Structure analysis of organic compounds is an important field of chemical research. Nuclear magnetic resonance carbon spectrum has been applied to the structure characterization of compounds since the 1970s, and has been used for more than 50 years. The chemical shift value of carbon spectrum is the characteristic of the carbon skeleton structure of organic compounds, which is information that other spectra cannot provide. Therefore, carbon spectrum is widely used in the structure analysis of compounds.

[0003] Usually, for unknown compounds, experts will analyze the molecular structure by means of nuclear magnetic resonance carbon spectrum and other molecular spectra such as mass spectrum, infrared spectrum, combined with their own experience, and manually consult literature. However, the structure of organic molecules is complex and diverse, and the number is huge, and it takes a long time for researchers to accumulate experience, and there is a great subjective limitation in structure analysis. Therefore, the molecular structure analysis process of unknown compounds often takes a long time, is low in efficiency, and often results in incorrect molecular structure, resulting in low accuracy of the molecular structure analysis result. SUMMARY

[0004] The technical problem to be solved by the embodiments of the present application is to provide a training method and device of a molecule generation model to reduce the time consumption of the molecular structure analysis process of unknown compounds, improve the analysis efficiency, and improve the accuracy of the molecular structure analysis result.

[0005] In a first aspect, the embodiments of the present application provide a training method of a molecule generation model, which comprises:

[0006] Obtaining training data, wherein the training data comprises: a molecular expression information sample and a molecular structure representation sample;

[0007] Using a to-be-trained molecule generation model to process the molecular expression information sample to obtain a training output;

[0008] According to the training output and the molecular structure representation sample, a loss function value is constructed, and in a case where the loss function value or the training round number is within a preset range, the to-be-trained molecule generation model after training is used as the molecule generation model.

[0009] Optionally, after the to-be-trained molecule generation model after training is used as the molecule generation model, the method further comprises:

[0010] Inputting the molecular expression information of the organic compound of the to-be-determined structure into the molecule generation model to obtain a predicted molecular structure representation of the organic compound of the to-be-determined structure.

[0011] Optionally, the expression information sample of the molecule is at least one of a molecular spectrum data sample, a molecular formula sample, and a molecular fragment sample.

[0012] Optionally, the molecular formula sample and the molecular fragment sample are generated according to the molecular structure representation sample, and the molecular spectrum data sample is at least one of real molecular spectrum data sample and simulated molecular spectrum data sample.

[0013] Optionally, the to-be-trained molecule generation model comprises an encoder and a decoder.

[0014] The processing of the expression information sample of the molecule by the to-be-trained molecule generation model to obtain a training output comprises:

[0015] Converting the molecular expression information sample into a vector;

[0016] Processing the vector by the encoder to obtain an encoding output;

[0017] Processing the encoding output by the decoder to obtain the training output.

[0018] Optionally, the to-be-trained molecule generation model is trained by a plurality of training tasks, and the plurality of training tasks comprise: performing partial occlusion on a molecular structure representation, generating a complete molecular structure representation based on the input partial-occluded molecular structure representation; generating a second structure representation of the molecule based on a first structure representation of the molecule, the first structure representation and the second structure representation being two different structure representations of the same molecule.

[0019] Optionally, the obtaining of the predicted molecular structure representation of the organic compound of the to-be-determined structure further comprises filtering processing, and the filtering processing is filtering out the predicted molecular structure representation inconsistent with the expression information of the molecule.

[0020] Optionally, the obtaining of the predicted molecular structure representation of the organic compound of the to-be-determined structure further comprises reordering processing.

[0021] The reordering processing is reordering the predicted molecular structure representation according to the similarity from high to low, based on a sorting model calculating the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound of the to-be-determined structure.

[0022] The sorting model is a cross-modal similarity sorting model trained by corresponding data of molecular spectrum data and molecular structure representation.

[0023] In a second aspect, an embodiment of the present application provides a device for training a molecule generation model, the device comprising:

[0024] a training data acquisition module configured to acquire training data, the training data comprising expression information samples of molecules and molecule structure representation samples;

[0025] a training output acquisition module configured to process the expression information samples of the molecules by using a to-be-trained molecule generation model to obtain training outputs;

[0026] a molecule generation model acquisition module configured to construct a loss function value according to the training outputs and the molecule structure representation samples, and acquire the to-be-trained molecule generation model after training as the molecule generation model when the loss function value or the number of training rounds is within a preset range.

[0027] Optionally, the device further comprises:

[0028] a predicted molecule structure representation acquisition module configured to input expression information of a molecule of an organic compound with a to-be-determined structure into the molecule generation model to obtain a predicted molecule structure representation of the organic compound with the to-be-determined structure.

[0029] Optionally, the expression information samples of the molecules are at least one of molecular spectrum data samples, molecular formula samples and molecular fragment samples.

[0030] The molecular formula samples and the molecular fragment samples are generated according to the molecule structure representation samples, and the molecular spectrum data samples are at least one of real molecular spectrum data samples and simulated molecular spectrum data samples.

[0031] Optionally, the to-be-trained molecule generation model comprises an encoder and a decoder.

[0032] The training output acquisition module comprises:

[0033] a vector conversion unit configured to convert the molecule expression information samples into vectors;

[0034] an encoding output acquisition unit configured to process the vectors by using the encoder to obtain encoding outputs;

[0035] a training output acquisition unit configured to process the encoding outputs by using the decoder to obtain the training outputs.

[0036] Optionally, the molecular generation model to be trained is trained through multiple training tasks, including: partially occluding the molecular structure representation, generating a complete molecular structure representation based on the partially occluded molecular structure representation; and generating a second structural representation of the molecule based on a first structural representation of the molecule, wherein the first structural representation and the second structural representation are two different structural representations of the same molecule.

[0037] Optionally, the predicted molecular structure representation of the organic compound whose structure is to be determined is further subjected to a filtering process, wherein the filtering process filters out predicted molecular structure representations that are inconsistent with the expression information of the molecule.

[0038] Optionally, the predicted molecular structure representation of the organic compound whose structure to be determined is obtained is further processed by reordering.

[0039] The reordering process involves calculating the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound whose structure is to be determined based on a ranking model, and then reordering the predicted molecular structure representation in descending order of similarity.

[0040] The ranking model is a cross-modal similarity ranking model trained from molecular spectrum data and corresponding data representing molecular structures.

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

[0042] 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 generation model described in any of the preceding claims.

[0043] 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 generation model described in any of the preceding claims.

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

[0045] In this embodiment, training data is acquired, including molecular expression information samples and molecular structure representation samples. A molecular generation model is used to process the molecular expression information samples to obtain a training output. A loss function value is constructed based on the training output and the molecular structure representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular generation model is used as the molecular generation model. This embodiment trains a molecular generation model for predicting molecular structures using molecular expression information samples. This molecular generation model can predict the molecular structure of unknown compounds. Compared to existing molecular structure analysis methods, it can improve the accuracy of unknown compound molecular structure analysis and reduce the time consumption of the molecular structure analysis process, thus improving the efficiency of molecular structure analysis.

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

[0047] Figure 1 A flowchart illustrating the steps of a training method for a molecular generation model provided in this application embodiment;

[0048] Figure 2 A schematic diagram of a molecular smile sequence provided for an embodiment of this application;

[0049] Figure 3 A schematic diagram of a model training process provided in an embodiment of this application;

[0050] Figure 4 A schematic diagram of a molecular generation model analysis process provided in an embodiment of this application;

[0051] Figure 5 A schematic diagram of a molecular structure analysis process provided for an embodiment of this application;

[0052] Figure 6 A schematic diagram of the structure of a training device for a molecular generation model provided in an embodiment of this application;

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

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

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

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

[0057] Reference Figure 1 The diagram illustrates a flowchart of the steps involved in training a molecular generation model according to an embodiment of this application. Figure 1 As shown, the training method for this molecular generation model may include the following steps:

[0058] Step 101: Obtain training data, which includes: molecular expression information samples and molecular structure representation samples.

[0059] The embodiments of this application can be applied to scenarios where molecular generative models for predicting molecular structures are obtained by training samples of molecular expression information.

[0060] Training data refers to the sample data used to train the molecular generation model. In this example, training data may include: molecular expression information samples and molecular structure representation samples.

[0061] The molecular expression information sample can be at least one of the following: molecular spectrum data sample, molecular formula sample, and molecular fragment sample.

[0062] The molecular formula samples and molecular fragment samples are generated based on the molecular structure identifier samples, and the molecular spectrum data samples are at least one of real molecular spectrum data samples and simulated molecular spectrum data samples.

[0063] In this embodiment, the number of molecular structures corresponding to the same molecular formula is extremely large. Furthermore, the constraints imposed on molecular fragments enable more precise generation of target molecules. Generating molecular representation sequence samples based on molecular formula sequence samples or molecular fragment representation sequence samples can serve as one of the pre-training tasks for molecular generation models.

[0064] Carbon NMR spectroscopy data is an effective method for characterizing compound structures and can be used for molecular structure resolution. Generating molecular representation sequence samples based on carbon NMR data can serve as a fine-tuning task for molecular generation models. Furthermore, molecular formulas and structural fragments can, in some cases, provide prior information about unknown compounds. Molecular structure resolution is essentially a multi-constraint molecular generation problem, aiming to generate molecular structures that satisfy constraints such as carbon NMR data and other prior information, including molecular formulas and structural fragments. Through flexible and adjustable multi-input formats, control terms such as carbon NMR data, molecular formulas, and structural fragments can be input to generate molecular structures that meet the constraints, serving as a fine-tuning task for molecular generation models.

[0065] When training a molecular generation model, training data can be acquired. Specifically, multiple molecules (e.g., 3000, 5000, etc.) can be acquired, along with their molecular structure representation samples. After obtaining the molecular structure representation samples of multiple molecules, molecular formula samples and molecular fragment samples for each molecule can be generated based on these samples.

[0066] After obtaining the molecular structure, the SMILES expression of the molecule can be derived from it. Molecular fragment samples can be obtained by segmenting the SMILES expression using either the Recap or BRICS algorithms. Molecular spectral data can be obtained by performing carbon NMR simulations on the molecular structure.

[0067] In practical implementations, the same molecule can have multiple SMILES sequence representation methods, such as... Figure 2 As shown, for the same molecule 401, multiple SMILES sequences 402 corresponding to molecule 401 can be obtained. Further, two different SMILES sequences are randomly selected from these multiple SMILES sequences. For example, corresponding to... Figure 2 The molecule 401 shown can be obtained from two different SMILES sequences, namely, the third and fifth types: C1C=CC(N2CCC(C=C)CC2)CC1, and C1CC(C=C)CCN1C1C=CCCC1. For unknown compounds extracted from natural products or synthesized organically, their molecular formulas can be obtained through high-resolution mass spectrometry. The molecular formula can be viewed as a character sequence composed of ASCII strings, such as... Figure 2As shown, for molecule 401, the molecular formula sequence sample 403 corresponding to molecule 401 can be obtained.

[0068] In this embodiment, the training data for model training may include the following formats:

[0069] 1. Only the molecular formula of the molecules is used as training data;

[0070] 2. Only molecular fragments of molecules are used as training data;

[0071] 3. Only molecular spectrum data of molecules are used as training data;

[0072] 4. Use molecular formulas and molecular fragments as training data;

[0073] 5. Use molecular formulas and molecular spectra as training data;

[0074] 6. Use molecular fragments and molecular spectrum data as training data;

[0075] 7. Use molecular formulas, molecular fragments, and molecular spectra as training data.

[0076] Among the above-mentioned training data, when molecular spectrum data is included in the training data, the training data may contain only real molecular spectrum data of molecules, only simulated molecular spectrum data of molecules, or both real and simulated molecular spectrum data of molecules.

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

[0078] Step 102: Use the molecular generation model to process the expression information samples of the molecules to obtain training output.

[0079] The molecular generation model to be trained is a model for predicting molecular structures that has not yet begun training. In this example, the molecular generation model to be trained can be pre-built. This model is based on a natural language generation model (such as the BART model) and includes an input layer and hidden layers. The input layer is the embedding layer, used to convert the input sequence into a vector. The hidden layers can include multiple encoders and multiple decoders (e.g., 6 layers each for encoders and decoders). The encoders can use a bidirectional self-attention mechanism, and the decoders can use a unidirectional self-attention mechanism. Both the encoder and decoder can be implemented based on Transformer.

[0080] After obtaining the training data for the molecular generation model to be trained, the training data can be input into the model to process the molecular expression information samples using the molecular generation algorithm to obtain the training output. In this example, the model input is the molecular expression information, which is treated as a string, segmented and embedded, and then input into the encoder; the output is the SMILES expression of the molecule (i.e., the molecular structure representation).

[0081] In this example, the molecular generation model to be trained can be trained through multiple training tasks, which may include: partially occluding the molecular structure representation, generating a complete molecular structure representation based on the partially occluded molecular structure representation of the input, and generating a second structural representation of the molecule based on a first structural representation of the molecule, wherein the first structural representation and the second structural representation are two different structural representations of the same molecule.

[0082] In this embodiment, the molecular generation model to be trained may include an encoder and a decoder. The process of processing the model input to obtain the training output for the molecular generation model to be trained can be described in detail in conjunction with the specific implementation method below.

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

[0084] Sub-step S1: Convert the molecular expression information sample into a vector.

[0085] In this embodiment, after inputting molecular expression information samples into the molecular generation model to be trained, the molecular expression information samples can be vectorized to convert them into vectors. For example... Figure 3 As shown, the input training data (such as NMR carbon spectrum data, molecular formulas, molecular fragments, etc.) can be processed by the embedding layer to obtain the corresponding vector.

[0086] After converting the molecular expression information samples into vectors, sub-step S2 is executed.

[0087] Sub-step S2: The encoder is used to process the vector to obtain the encoded output.

[0088] After converting the molecular expression information samples into vectors, an encoder can be used to process the converted vectors to obtain the encoded output.

[0089] After the vector is processed by the encoder to obtain the encoded output, sub-step S3 is executed.

[0090] Sub-step S3: The decoder is used to process the encoded output to obtain the training output.

[0091] After the encoder processes the vector to obtain the encoded output, the decoder can then process the encoded output to obtain the training output of the molecule. For example... Figure 3 As shown, after obtaining the vectors corresponding to the training data, the encoder and decoder can be used for corresponding processing to obtain the training output.

[0092] After processing the molecular expression information samples using the molecular generation model to be trained to obtain the training output, step 103 is executed.

[0093] Step 103: Construct a loss function value based on the training output and the molecular structure representation sample. If the loss function value or the number of training rounds is within a preset range, use the trained molecular generation model as the molecular generation model.

[0094] The preset range refers to a pre-set numerical range used to determine whether the molecular generation model to be trained has converged. In this example, the preset range can be divided into two types: the range of loss function values ​​and the range of training epochs. The specific values ​​of the preset range can be determined according to business needs, and this embodiment does not impose any restrictions on them.

[0095] In this embodiment, the training process of the molecular generation model to be trained can end in two ways: one is to determine whether the constructed loss function value is within a preset range, and the other is to determine whether the number of training rounds is within a preset training round range.

[0096] After processing the molecular expression information samples using the molecular generation model to obtain the training output, a loss function value for the molecular generation model can be constructed based on the training output and the molecular structure representation samples. When the loss function value is within a preset range, it indicates that the molecular generation model has converged. At this point, the trained molecular generation model can be used as the final molecular generation model for predicting the molecular structure of unknown compounds. In this example, the cross-entropy between the decoder output and the true value is used as the loss during model training. Figure 3 As shown, after obtaining the training output, the cross-entropy loss function can be calculated by combining the training output with the molecular representation sequence samples (i.e., molecular structure representation samples).

[0097] When the number of training rounds is within a preset range, it indicates that the molecular generation model to be trained has been completed. At this point, the trained molecular generation model can be used as the final molecular generation model for predicting the molecular structure of unknown compounds.

[0098] In this embodiment, the training methods for the molecular generation model to be trained may include the following:

[0099] 1. Only one of the following can be used as the training sample: molecular spectrum data sample, molecular formula sample, and molecular fragment sample.

[0100] During training, any one of the following samples—molecular spectra, molecular formulas, or molecular fragments—can be used as input to the molecular generation model to be trained. The model then processes these samples to obtain the training output. This training process is repeated iteratively until the molecular generation model converges.

[0101] 2. Molecular spectrum data samples and molecular formula samples were used as training samples.

[0102] During training, molecular spectrum data samples and molecular formula samples can be used as inputs to the molecular generation model to be trained. Specifically, the acquired training data includes molecular spectrum data samples of the first molecule and molecular formula samples of the second molecule. When inputting the training data, the expression information samples of each molecule (i.e., molecular spectrum data samples and molecular formula samples) are used separately as inputs to the molecular generation model to be trained, so as to obtain the training output of the corresponding molecule. This training process is executed iteratively until the molecular generation model to be trained converges.

[0103] During this training process, the molecular spectrum data samples may include at least one of simulated molecular spectrum data samples and real molecular spectrum data samples.

[0104] When the molecular spectrum data samples only contain simulated or real molecular spectrum data samples, the model training process can be divided into two stages: The first stage involves model training using molecular formula samples to obtain a pre-trained molecular generation model. Then, the second stage involves model training using either simulated or real molecular spectrum data samples to obtain the final molecular generation model.

[0105] When the molecular spectrum data samples include both simulated and real molecular spectrum data samples, the model training process can be divided into three stages: The first stage involves training the model using molecular formula samples to obtain a pre-trained molecular generation model. Then, the second stage involves training the model using simulated molecular spectrum data samples to obtain a second-stage molecular generation model. Finally, the third stage involves training the second-stage molecular generation model using real molecular spectrum data samples to obtain the final molecular generation model. Of course, in this training process, the second stage can use real molecular spectrum data samples, and the third stage can use simulated molecular spectrum data samples, etc.

[0106] 3. Molecular spectrum data samples and molecular fragment samples were used as training samples.

[0107] During training, molecular spectrum data samples and molecular fragment samples can be used as inputs to the molecular generation model to be trained. Specifically, the acquired training data includes molecular spectrum data samples of the first molecule and molecular fragment samples of the second molecule. When inputting the training data, the expression information samples of each molecule (i.e., molecular spectrum data samples and molecular fragment samples) are used separately as inputs to the molecular generation model to be trained, so as to obtain the training output of the corresponding molecule. This training process is executed iteratively until the molecular generation model to be trained converges.

[0108] During this training process, the molecular spectrum data samples may include at least one of simulated molecular spectrum data samples and real molecular spectrum data samples.

[0109] When the molecular spectrum data samples only contain simulated or real molecular spectrum data samples, the model training process can be divided into two stages: The first stage involves training the model using molecular fragment samples to obtain a pre-trained molecular generation model. Then, the second stage involves training the model using either simulated or real molecular spectrum data samples to obtain the final molecular generation model.

[0110] When the molecular spectrum data samples include both simulated and real molecular spectrum data samples, the model training process can be divided into three stages: The first stage involves training the model using molecular fragment samples to obtain a pre-trained molecular generation model. Then, the second stage involves training the model using simulated molecular spectrum data samples to obtain a second-stage molecular generation model. Finally, the third stage involves training the second-stage molecular generation model using real molecular spectrum data samples to obtain the final molecular generation model. Of course, in this training process, the second stage can use real molecular spectrum data samples, and the third stage can use simulated molecular spectrum data samples, etc.

[0111] 4. Use molecular formula samples and molecular fragment samples as training samples.

[0112] During training, molecular formula samples and molecular fragment samples can be used as inputs to the molecular generation model to be trained. Specifically, the acquired training data includes molecular formula samples of the first molecule and molecular fragment samples of the second molecule. When inputting the training data, the expression information samples (i.e., molecular formula samples and molecular fragment samples) of each molecule are used separately as inputs to the molecular generation model to be trained, so as to obtain the training output of the corresponding molecule. This training process is executed iteratively until the molecular generation model to be trained converges.

[0113] 5. Molecular formula samples, molecular fragment samples, and molecular spectrum data samples are used as training samples.

[0114] During training, molecular formula samples, molecular fragment samples, and molecular spectrum data samples can be used as inputs to the molecular generation model to be trained. Specifically, the acquired training data includes the molecular formula sample of the first molecule, the molecular fragment sample of the second molecule, and the molecular spectrum data sample of the third molecule. When inputting the training data, the expression information sample of each molecule (i.e., the molecular formula sample and the molecular fragment sample) is used separately as input to the molecular generation model to be trained, so as to obtain the training output of the corresponding molecule. This training process is executed iteratively until the molecular generation model to be trained converges.

[0115] During this training process, the molecular spectrum data samples may include at least one of simulated molecular spectrum data samples and real molecular spectrum data samples.

[0116] When the molecular spectrum data samples only contain simulated or real molecular spectrum data samples, the model training process can be divided into two stages: The first stage involves model training using molecular formula samples and molecular fragment samples to obtain a pre-trained molecular generation model. Then, the second stage involves model training using either simulated or real molecular spectrum data samples to obtain the final molecular generation model.

[0117] When the molecular spectrum data samples include both simulated and real molecular spectrum data samples, the model training process can be divided into three stages: The first stage involves training the model using molecular formula and fragment samples to obtain a pre-trained molecular generation model. The second stage involves training the model using simulated molecular spectrum data samples to obtain a second-stage molecular generation model. Finally, the third stage involves training the second-stage molecular generation model using real molecular spectrum data samples to obtain the final molecular generation model. Of course, in this training process, the second stage can use real molecular spectrum data samples, and the third stage can use simulated molecular spectrum data samples, etc.

[0118] In this embodiment, the performance of the deep learning model is positively correlated with the amount of training data; the more training data, the better the model's performance. However, measured NMR spectroscopy data can be collected manually, which is very time-consuming and labor-intensive, thus limiting the amount of measured NMR spectroscopy data that can be collected. In contrast, the cost of collecting simulated NMR spectroscopy data using NMR prediction tools is low, and the field of predicting NMR spectroscopy data based on molecular structure is currently well-developed, resulting in good accuracy of simulated NMR spectroscopy data. Considering these factors, the molecular generation model can be first fine-tuned based on a large amount of simulated NMR spectroscopy data, and then second fine-tuned based on measured NMR spectroscopy data with higher data quality.

[0119] After training to obtain the molecular generation model, the molecular generation model can be applied to the scenario of predicting the molecular structure of unknown compounds. The process can be described in detail below with reference to the specific implementation method.

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

[0121] Step M: Input the molecular expression information of the organic compound whose structure is to be determined into the molecular generation model to obtain the predicted molecular structure representation of the organic compound whose structure is to be determined.

[0122] In this embodiment, the organic compound whose structure is to be determined refers to an organic compound with an unknown molecular structure.

[0123] When predicting the molecular structure of an organic compound with a known structure, the molecular expression information of the compound can be input into a molecular generation model to obtain a predicted molecular structure representation. For example... Figure 4 As shown, at least one of the known information of an unknown compound, such as carbon NMR data, molecular formula, or molecular structure fragments, can be used as input to a molecular generation model. Through processing by encoders, decoders, etc., a molecular representation of the organic compound whose structure is to be determined can be obtained, i.e., a predicted molecular structure representation.

[0124] During model inference, multiple SMILES expressions (i.e., predicted molecular structure representations) that satisfy the input conditions can be generated by combining bundle search, such as... Figure 6 As shown in the figure. This embodiment uses a molecular generation model combined with cluster search to generate molecular structures that meet multiple constraints such as NMR carbon spectrum data, molecular formula, and structural fragments, thereby more accurately resolving the molecular structure of unknown compounds.

[0125] After obtaining the predicted molecular structure representation of the organic compound whose structure is to be determined, the predicted molecular structure representation can be further filtered to remove the predicted molecular structure representations that are inconsistent with the expression information of the molecule.

[0126] After obtaining the predicted molecular structure representation of the organic compound whose structure is to be determined, the predicted molecular structure representation of the organic compound whose structure is to be determined can be further processed by reordering. This reordering process is based on the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound whose structure is to be determined, calculated by a sorting model, and the predicted molecular structure representation is reordered in order of high to low similarity.

[0127] The molecular generation model training method provided in this application involves acquiring training data, including molecular expression information samples and molecular structure representation samples. The molecular generation model to be trained processes the molecular expression information samples to obtain training output. A loss function value is constructed based on the training output and the molecular structure representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular generation model is used as the molecular generation model. This application embodiment trains a molecular generation model for predicting molecular structures using molecular expression information samples. This molecular generation model can predict the molecular structure of unknown compounds. Compared to existing molecular structure analysis methods, it can improve the accuracy of unknown compound molecular structure analysis and reduce the time consumption of the unknown compound molecular structure analysis process, thus improving the efficiency of molecular structure analysis.

[0128] Reference Figure 6 The diagram shows a schematic representation of a training device for a molecular generation model provided in an embodiment of this application. Figure 6 As shown, the training device 600 for the molecular generation model may include the following modules:

[0129] The training data acquisition module 610 is used to acquire training data, which includes: molecular expression information samples and molecular structure representation samples;

[0130] The training output acquisition module 620 is used to process the expression information samples of the molecule using the molecule generation model to be trained, so as to obtain the training output.

[0131] The molecular generation model acquisition module 630 is used to construct a loss function value based on the training output and the molecular structure representation sample, and when the loss function value or the number of training rounds is within a preset range, the trained molecular generation model to be trained is used as the molecular generation model.

[0132] Optionally, the device further includes:

[0133] The predicted molecular structure representation acquisition module is used to input the molecular expression information of the organic compound whose structure is to be determined into the molecular generation model to obtain the predicted molecular structure representation of the organic compound whose structure is to be determined.

[0134] Optionally, the expression information sample of the molecule is at least one of: molecular spectrum data sample, molecular formula sample, and molecular fragment sample;

[0135] The molecular formula sample and the molecular fragment sample are generated based on the molecular structure representation sample, and the molecular spectrum data sample is at least one of real molecular spectrum data sample and simulated molecular spectrum data sample.

[0136] Optionally, the molecular generation model to be trained includes an encoder and a decoder;

[0137] The training output acquisition module includes:

[0138] A vector conversion unit is used to convert the molecular expression information sample into a vector.

[0139] The encoding output acquisition unit is used to process the vector using the encoder to obtain the encoding output;

[0140] The training output acquisition unit is used to process the encoded output using the decoder to obtain the training output.

[0141] Optionally, the molecular generation model to be trained is trained through multiple training tasks, including: partially occluding the molecular structure representation, generating a complete molecular structure representation based on the partially occluded molecular structure representation; and generating a second structural representation of the molecule based on a first structural representation of the molecule, wherein the first structural representation and the second structural representation are two different structural representations of the same molecule.

[0142] Optionally, the predicted molecular structure representation of the organic compound whose structure is to be determined is further subjected to a filtering process, wherein the filtering process filters out predicted molecular structure representations that are inconsistent with the expression information of the molecule.

[0143] Optionally, the predicted molecular structure representation of the organic compound whose structure to be determined is obtained is further processed by reordering.

[0144] The reordering process involves calculating the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound whose structure is to be determined based on a ranking model, and then reordering the predicted molecular structure representation in descending order of similarity.

[0145] The ranking model is a cross-modal similarity ranking model trained from molecular spectrum data and corresponding data representing molecular structures.

[0146] The molecular generation model training device provided in this application acquires training data, including molecular expression information samples and molecular structure representation samples. The molecular generation model to be trained processes the molecular expression information samples to obtain training output. A loss function value is constructed based on the training output and the molecular structure representation samples. If the loss function value or the number of training rounds is within a preset range, the trained molecular generation model is used as the molecular generation model. This application embodiment trains a molecular generation model for predicting molecular structures using molecular expression information samples. This molecular generation model can predict the molecular structure of unknown compounds. Compared with existing molecular structure analysis methods, it can improve the accuracy of unknown compound molecular structure analysis and reduce the time consumption of the unknown compound molecular structure analysis process, thus improving the efficiency of molecular structure analysis.

[0147] Example 3

[0148] 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-described molecular generation model.

[0149] Figure 7 A schematic diagram of the structure of an electronic device 700 according to an embodiment of the present invention is shown. Figure 7 As shown, the electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 702 or loaded from storage unit 708 into random access memory (RAM) 703. The RAM 703 can also store various programs and data required for the operation of the electronic device 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0150] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, microphone, etc.; output unit 707, such as various types of displays, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0151] The various processes and handling described above can be executed by processing unit 701. For example, the methods of any of the above embodiments can be implemented as computer software programs, which are tangibly contained in a computer-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by CPU 701, one or more actions of the methods described above can be performed.

[0152] Example 4

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

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

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

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

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

[0158] 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 Figure 1 The steps of the function specified in one or more boxes.

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

[0160] The above provides a detailed description of the training method, apparatus, electronic device, and computer-readable storage medium for a molecular generation 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 generation model, characterized in that, The method includes: Acquire training data, which includes: molecular expression information samples and molecular structure representation samples; The expression information samples of the molecules are processed using a molecule generation model to be trained in order to obtain training output. Based on the training output and the molecular structure representation sample, a loss function value is constructed. If the loss function value or the number of training rounds is within a preset range, the trained molecular generation model is used as the molecular generation model. The molecular expression information of the organic compound whose structure is to be determined is input into the molecular generation model to obtain the predicted molecular structure representation of the organic compound whose structure is to be determined. The molecular generation model to be trained is trained through multiple training tasks, including: partially occluding the molecular structure representation, generating a complete molecular structure representation based on the partially occluded molecular structure representation; and generating a second structural representation of the molecule based on a first structural representation of the molecule, wherein the first structural representation and the second structural representation are two different structural representations of the same molecule. The predicted molecular structure representation of the organic compound whose structure is to be determined is further subjected to a filtering process, wherein the filtering process is to filter out the predicted molecular structure representation that is inconsistent with the expression information of the molecule. The predicted molecular structure representation of the organic compound whose structure to be determined is obtained is further processed by reordering. The reordering process involves calculating the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound whose structure is to be determined based on a ranking model, and then reordering the predicted molecular structure representation in descending order of similarity. The ranking model is a cross-modal similarity ranking model trained from molecular spectrum data and corresponding data representing molecular structures.

2. The method according to claim 1, characterized in that, The molecular expression information sample is at least one of the following: molecular spectrum data sample, molecular formula sample, and molecular fragment sample; The molecular formula sample and the molecular fragment sample are generated based on the molecular structure representation sample, and the molecular spectrum data sample is at least one of real molecular spectrum data sample and simulated molecular spectrum data sample.

3. The method according to claim 1, characterized in that, The molecular generation model to be trained includes an encoder and a decoder; The process of using a molecule generation model to be trained to process the expression information samples of the molecules to obtain training output includes: Convert the molecular expression information samples into vectors; The encoder is used to process the vector to obtain the encoded output; The decoder is used to process the encoded output to obtain the training output.

4. A training device for a molecular generation model, characterized in that, The device includes: The training data acquisition module is used to acquire training data, which includes: molecular expression information samples and molecular structure representation samples; The training output acquisition module is used to process the expression information samples of the molecules using the molecule generation model to be trained, so as to obtain the training output. The molecular generation model acquisition module is used to construct a loss function value based on the training output and the molecular structure representation sample. When the loss function value or the number of training rounds is within a preset range, the trained molecular generation model to be trained is used as the molecular generation model. The predicted molecular structure representation acquisition module is used to input the molecular expression information of the organic compound whose structure is to be determined into the molecular generation model to obtain the predicted molecular structure representation of the organic compound whose structure is to be determined. After obtaining the predicted molecular structure representation, the predicted molecular structure representation is processed as follows: The predicted molecular structure representation of the organic compound whose structure is to be determined is further subjected to a filtering process, wherein the filtering process filters out predicted molecular structure representations that are inconsistent with the expression information of the molecule; and / or The predicted molecular structure representation of the organic compound whose structure is to be determined is further subjected to a reordering process; the reordering process is based on the similarity between the predicted molecular structure representation and the molecular spectrum data of the organic compound whose structure is to be determined, calculated by a ranking model, and the predicted molecular structure representation is reordered in descending order of similarity; the ranking model is a cross-modal similarity ranking model trained from the corresponding data of molecular spectrum data and molecular structure representation.

5. The apparatus according to claim 4, characterized in that, The molecular expression information sample is at least one of the following: molecular spectrum data sample, molecular formula sample, and molecular fragment sample; wherein, the molecular formula sample and the molecular fragment sample are generated based on the molecular structure representation sample, and the molecular spectrum data sample is at least one of the following: real molecular spectrum data sample and simulated molecular spectrum data sample. The molecular generation model to be trained includes an encoder and a decoder; The training output acquisition module includes: A vector conversion unit is used to convert the molecular expression information sample into a vector. The encoding output acquisition unit is used to process the vector using the encoder to obtain the encoding output; The training output acquisition unit is used to process the encoded output using the decoder to obtain the training output.

Citation Information

Patent Citations

  • Methods, systems, and media for predicting functions of molecular sequences

    US20210043273A1

  • Drug molecule screening method and system

    WO2022047677A1