A method for improving retrosynthesis credibility through multi-model ensemble learning
Through multi-model ensemble learning and deduplication processing, the accuracy of the chemical reaction inverse synthesis model is improved, and the problem of low accuracy of the prediction of inverse synthesis model in the prior art is solved, thereby achieving more efficient chemical reaction prediction.
Patent Information
- Application Number
- CN202210370066.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The existing chemical reaction inverse synthesis model has low prediction accuracy, and it is necessary to develop a more accurate inverse synthesis prediction method.
Using a multi-model ensemble learning method, multiple inverse synthesis models and forward reaction prediction models are trained, combined with deduplication processing and confidence calculation, high-confidence candidate reactants are screened, and data training and prediction are used using the Transformer model.
The diversity of reverse synthesis candidate reactions and the accuracy of single-step reverse synthesis are improved, the number of redundant candidate reactions is reduced, and the accuracy of chemical reaction prediction is improved.
Smart Images

Figure CN115512781B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for predicting chemical reaction retrosynthesis. Background Art
[0002] In the field of medicinal chemistry, the organic synthesis of new chemical molecules requires the decomposition of the target product P into more readily available or synthesized reactants in each step. This process, known as retrosynthesis, involves working backwards to determine the reactants A+B+C that react to produce P. Retrosynthesis typically involves multiple decomposition strategies, generating a variety of candidate reactions. For each candidate reaction, envisioned by an organic chemist or generated virtually by a computer algorithm, forward prediction is necessary to avoid losses and waste caused by experimental failure. Automated retrosynthesis planning is a necessary step in implementing automated organic synthesis design equipment.
[0003] Artificial intelligence (AI), particularly deep learning models, trained on large amounts of organic chemical reaction data provides an effective modeling approach for retrosynthesis and reaction prediction. In automated organic synthesis systems, reaction prediction serves as a "referee" to determine whether a single-step retrosynthesis reaction is acceptable. The success of automated synthetic routes depends on the accuracy of the predictions for candidate single-step reactions.
[0004] At present, the accuracy of multiple candidate reactions generated by the retrosynthesis generation model is low, and there is a need to further develop more accurate retrosynthesis prediction methods. Summary of the Invention
[0005] Based on this, it is necessary to provide a method and device for predicting chemical reaction products to address the technical problem that the current reaction prediction model has low prediction accuracy.
[0006] In one aspect, the present invention discloses a method for predicting retrosynthetic chemical reactants, the method comprising:
[0007] Step 1: Train and output M>1 retrosynthesis models, rmt1, rmt2, ... rmtM, and train and output N>1 forward reaction prediction models fmt1, fmt2, ... fmtN;
[0008] Step 2: De-duplicate the reactants generated by the retrosynthesis model, remove duplicate reactants, and retain the remaining candidate reactants;
[0009] Step 3: Calculate the credibility of candidate reactants and candidate backbone reactions through the forward reaction prediction model, obtain n≤N credibility conf1, conf2, ...confn of N models, output the average credibility C, and screen the candidate reactants that finally pass through C≥th, where th is selected from any number between 0.2 and 1.0, preferably any number between 0.9 and 1.0.
[0010] In a specific embodiment, the repeated reactants are one or more of the repeated reaction reagents and reaction conditions in multiple retrosynthetic models.
[0011] In a specific embodiment, the method for generating the retrosynthesis model in step 1 includes: initializing network parameters with random seeds, sampling different samples from the data set to construct a training set or different transformer network architectures.
[0012] In a specific embodiment, the method for generating the forward model in step 1 includes: initializing network parameters with random seeds or sampling different samples from a data set to construct a training set.
[0013] In a specific embodiment, the step of removing duplicate backbone reactions in step 2 includes: the retrosynthesis model generates multiple candidate reactions at a time, and if the candidate reactions include duplicate reactants, the duplicate reactants are deleted and only one instance is retained; the compounds of the candidate reactions after duplication are deleted are sorted by the number of atoms or character length, and if the sorted compounds of the two backbone reactions after sorting are exactly the same and can be completely matched through standardized SMILES representation, they are judged as duplicates and only one is retained.
[0014] In a specific embodiment, the average credibility C in step 3 is calculated as follows:
[0015] In another aspect, the present invention provides a device for predicting chemical reaction products, comprising:
[0016] The first module is used to train and output M>1 retrosynthesis models, rmt1, rmt2, ... rmtM, and train and output N>1 forward reaction prediction models fmt1, fmt2, ... fmtN;
[0017] The second module is used to perform deduplication processing on the reactants generated by the retrosynthesis model, remove duplicate reactants and duplicate backbone reactions, and retain the remaining candidate reactants and candidate backbone reactions;
[0018] The third module is used to calculate the credibility of candidate reactants and candidate backbone reactions through the forward reaction prediction model, obtain n≤N credibility conf1, conf2, ... confn of N models, output the average credibility C, and screen the candidate reactants that finally pass the test through C≥th, where th is selected from any number between 0.2 and 1.0, preferably any number between 0.9 and 1.0.
[0019] In a specific embodiment, the repeated reactants are one or more of the repeated reaction reagents and reaction conditions in multiple retrosynthetic models.
[0020] In a specific embodiment, in the first module, the method for generating the retrosynthesis model includes: initializing network parameters with random seeds, sampling different samples from the data set to construct a training set or different transformer network architectures.
[0021] In a specific embodiment, in the first module, the method for generating the forward model includes: initializing network parameters with random seeds or sampling different samples from the data set to construct a training set.
[0022] In a specific embodiment, in the second module, the step of removing repeated backbone reactions includes: the retrosynthesis model generates multiple candidate reactions at a time, and if the candidate reactions include repeated reactants, the repeated reactants are deleted and only one instance is retained; the compounds of the candidate reactions after deleting the duplicates are sorted by the number of atoms or character length, and if the sorted compounds of the two backbone reactions after sorting are exactly the same and can be completely matched through standardized SMILES representation, they are judged as duplicates and only one is retained.
[0023] In a specific embodiment, in the third module, the average credibility C is calculated as follows:
[0024] C=(conf1+conf2+…+confn) / n
[0025] On the other hand, the present invention provides a device comprising a processor or a storage device, wherein the storage device is used to store a computer program, and the processor is used to execute the aforementioned method for predicting reactants of reverse reaction compounds according to the computer program.
[0026] In yet another aspect, the present invention provides a computer-readable storage medium for storing a computer program for executing the aforementioned method for predicting reactants of reverse reaction compounds. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1Shows the relationship between retrosynthesis (Synthesis design, or Retrosynthesis) and reaction prediction (Reaction prediction). The question marks indicate the target to be predicted for each problem.
[0028] Figure 2 A schematic flow chart showing the method for predicting compound reaction products. DETAILED DESCRIPTION
[0029] The present invention will be described in detail below based on the embodiments and in conjunction with the accompanying drawings. The above aspects of the present invention and other aspects of the present invention will be apparent from the detailed description below. The scope of the present invention is not limited to the following embodiments.
[0030] Combine Figure 2 Description, the present invention controls the data set differences and model parameters to train M>1 single-step reverse retrosynthesis models, rmt1, rmt2, ... rmtM, and N>1 forward reaction prediction models fmt1, fmt2, ... fmtN; integrates the output candidates of M retrosynthesis models; integrates the outputs of N forward reaction prediction models, removes duplications in the reaction sense through the reaction discrimination method of trunk deduplication, and retains reaction candidates with true diversity; calculates the comprehensive confidence (Confidence) C of multiple models, and screens the reaction candidates that finally pass through C≥th; a feature of the present invention is that th can be set in the range of [0.2, 1.0], preferably [0.9, 1.0], for example, th can be selected as 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9 or 1.0, preferably 0.9, 0.95, 0.99 or 1.0.
[0031] A feature of the present invention is a reaction discrimination method for deduplication of backbone reactions. By removing compounds irrelevant to the reaction transformation strategy, the method determines whether multiple reactions contain important and distinct compounds, retains candidates with diverse reaction significance, and deletes duplicate reactions. Specifically, the method maintains a list of known reagents and deletes candidate reactions containing compounds from the list. The deleted reactions are called backbone reactions, and the backbone compounds are sorted by atom number or character length. If two backbone reactions are identical after sorting, they are identified as duplicates and only one instance is retained.
[0032] In one embodiment of the present invention, for M rmt1, rmt2, ... rmtM retrosynthesis models, each model selects K≥1 candidate reactions with the highest output credibility, called Top-K, and takes the union of the generated candidates to improve the diversity of candidate reactions.
[0033] In one embodiment of the present invention, for N fmt1, fmt2, ..., fmtN forward reaction prediction models, the top-K predictions output by each model only take one prediction that matches the candidate reaction target product, or take zero if there is no match. Finally, n≤N credibility conf1, conf2, ... confn are obtained from the predictions of the N models, and an integration operation is performed, such as outputting the average credibility (Mean), to obtain the comprehensive credibility C of the candidate reaction.
[0034] A feature of the device of the present invention is that high-confidence retrosynthetic candidate reactions that have passed the above-mentioned method of first removing duplicates from the backbone and then performing credibility integration calculations are input into a search module, sorted according to relevant search scores, and reactants not included in the reagent list are taken as further target products to be synthesized and input into M single-step retrosynthetic models for reverse deduction.
[0035] When all the reverse reaction products can be contained in the raw material library, the above process is terminated, and an automatically designed multi-step synthesis reaction route starting from the compounds contained in the raw material library is obtained, and the final target product can be obtained after all the reaction steps.
[0036] The related routes can optionally be connected to automatically operated reaction equipment to conduct automated synthesis experiments.
[0037] Example 1 Prediction Method for Retrosynthetic Chemical Reactants
[0038] This embodiment selects the machine translation transformer (Transformer) [Philippe Schwaller et al.Molecular transformer:A model for uncertainty-calibrated chemical reaction prediction, 2019 Sep 25; 5(9): 1572-1583, Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017] model. For example, by selecting different model network layers layers = {4, 6, 8}, the number of heads of the attention mechanism in the model heads = {4, 8, 16}, and the vector length vectors = {256, 384, 512} of the encoding-related reaction layer, a maximum of 3×3×3 = 27 different forward prediction models can be obtained. In forward model training, the reaction dataset is used as training data, with the reactants as training inputs and the products as training outputs. Similarly, the inverse model can use the same transformer model, but the difference from the forward prediction is that the products in the training reaction dataset are used as training inputs, and the reactants are used as training outputs.
[0039] The training data used in this example is a public chemical reaction dataset, which comes from patent reactions published by the USPTO. The reaction data is expressed as Precursors->Product, where Precursors are reactants including reagents, such as Figure 1 A+B+C can be expressed as ABC; Product is the product of the reaction, such as Figure 1 Compound P. Compounds can be represented by standard SMILES sequence characters.
[0040] In Transformer model training, input sequence data X and output sequence data Y are required to form a training dataset D containing tens of thousands to millions of training data pairs (X, Y). The model updates its model parameters θ through a fixed number of iterations, so that the Y obtained by the model's transformation function Y = f(X|θ) is as consistent as possible with the true Y, and its Confidence = p(Y |X,θ) is maximized. This embodiment can use the same reaction dataset format to train the reverse and forward directions separately. In reverse training, (X, Y) is (Product, Precursors); in forward prediction training, (X, Y) is (Precursors, Product).
[0041] There are three ways to generate different inverse models: using different random seeds to initialize network parameters, sampling different samples from the dataset to construct the training set, or using different transformer network architectures. Through these methods, N different inverse models were obtained.
[0042] The ensemble method of the inverse model is to take the union predictions (Predictions) of the prediction results of different models (pm1, pm2, pm3...):
[0043] Predictions = p m1 ∪p m2 ∪p m3
[0044] It should be noted that the prediction results of different models may be repeated, or the important "backbone" reactants in the reaction may be the same, and redundant candidate reactions need to be removed.
[0045] There are two ways to generate different forward models: use different random seeds to initialize network parameters or use different samples from the data set to construct the training set. Through the above method, M different forward models can be obtained
[0046] The ensemble method of the forward model is the classic "deep ensemble":
[0047] Ensemble the decoder output and attention part, and then generate corresponding smiles.
[0048] Using the "backbone" deduplication method, reactants can be divided into two categories. One category appears in lists of known compounds, such as commonly used reagent lists. These lists are available on various public compound websites, such as https: / / www.labnetwork.com.cn / , which contains over 50,000 undeduplicated reagents. These compounds are of no significance for the subsequent retrosynthetic analysis and can be ignored. The other category, which does not appear in the reagent list, is defined as the backbone, representing molecules that require further analysis. As shown below, if two reactions have the same backbone, their significance in the retrosynthetic analysis is the same, and only one reaction can be retained.
[0049]
[0050] Take the backbone reaction with the largest Confidence as the true candidate reaction
[0051] The specific calculation method of Confidence can be to reflect the X part of the data. After the weight calculation of each layer of the multi-layer neural network of the trained machine model Transformer, the original weights zi (>0) of all possible M element symbols in the output product are obtained at the output layer of the model, i = 1, 2, ..., M. The normalized probability is calculated as the confidence of each character i through the following Softmax, and the element symbol sequence with the highest probability is output as the prediction Y.
[0052]
[0053] In other embodiments, the machine model can be replaced with other deep neural network-based models, such as [Coley, Connor W., et al. A graph-convolutional neural network model for the prediction of chemical reactivity. Chemical science 10.2(2019): 370- 377., John Bradshaw, Matt J. Kusner, Brooks Paige, Marwin HSSegler, José Miguel Hernández-Lobato, A Generative Model For Electron Paths, https: / / arxiv.org / abs / 1805.10970], all of which use the same Softmax to calculate the output layer, except that the symbolic form of the output elements is changed.
[0054] Internal experiments have shown that, in a test of single-step retrosynthesis of 50 new target compounds (3 times = 150), the diversity of candidate reactions for single-step retrosynthesis using this model ensemble learning method increased by an average of 50% compared to a single model. The single-step accuracy of the forward model ensemble was also improved by 1.9%. Under the same parameter settings, the number of synthetic routes for every 50 target compounds that could be completed within the specified computational steps increased from 45 to 50.
[0055] Further detailed experiments in this example show that after deduplication of the total number of candidate reactions generated by reverse engineering for 25 molecules, the number of redundant candidates decreased by 330%, and the corresponding search computational efficiency increased by 5.2 times. The total number of candidate reactions was 28,621 before deduplication and 8,658 after deduplication.
[0056] After deduplication, the number of candidate reactions in the three reverse model ensembles increased from 350-427 in a single reverse model to 734, corresponding to 1.7-2.1 times the diversity of a single model. The forward model ensemble also improved single-step accuracy by 1.9%.
[0057] Model 1 Model 2 Model 3 After deduplication of the integrated trunk 350 369 427 734
[0058] The method of the present invention can improve the accuracy rate, so that high-confidence predictions have high accuracy, and ultimately improve the accuracy of reaction predictions. At the same time, this method also has the advantages of small data volume and short time.
[0059] It will be appreciated by those skilled in the art that, although specific embodiments of the present invention have been described herein for illustrative purposes, various modifications may be made thereto without departing from the spirit and scope of the present invention. Therefore, the specific embodiments and examples of the present invention should not be construed as limiting the scope of the present invention. The present invention is limited only by the appended claims. All documents cited herein are incorporated herein by reference in their entirety.
Claims
1. A method for predicting retrosynthetic chemical reactants, comprising the following steps: Step 1: Train and output M>1 retrosynthesis models rmt1, rmt2, … rmtM, and train and output N>1 forward reaction prediction models fmt1, fmt2, … fmtN; Step 2: De-duplicate the reactants generated by the retrosynthesis model, remove duplicate reactants and duplicate backbone reactions, and retain the remaining candidate reactants and candidate backbone reactions; Step 3: Calculate the credibility of candidate reactants and candidate backbone reactions through the forward reaction prediction model, obtain n≤N credibility conf1, conf2, ... confn of N models, output the average credibility C, and screen the candidate reactants that finally pass through C≥ th, where th is selected from any number between 0.2 and 1.
0. The method for generating the retrosynthetic model in step 1 includes: initializing network parameters with random seeds, sampling different samples from the data set to construct a training set or different transformer network architectures, and The method for generating the forward model in step 1 includes: initializing network parameters with random seeds or sampling different samples from the data set to construct a training set.
2. The method of claim 1, wherein The repeated reactants are one or more of the repeated reaction reagents and reaction conditions in multiple retrosynthesis models. The method according to claim 1 , wherein th is any number between 0.9 and 1.
0.
4. The method of claim 1, wherein the step of removing duplicate backbone reactions in step 2 comprises: If the candidate reaction includes duplicate reactants, delete them and keep only one of them. Then sort the compounds in the deleted reactions by atom number or character length. If the two backbone reactions after sorting are completely identical through standardized SMILES representation, they are judged as duplicates and only one is retained.
5. The method according to claim 1, wherein the average credibility C in step 3 is calculated as follows: C = (conf1 + conf2 + … + confn) / n Each forward reaction prediction model x, x = 1, 2, …, n, generates confx by calculating each element symbol represented by the compound in the reaction according to the weights of each layer of the multi-layer neural network of the trained machine model. At the output layer of the model, the original weights zi (>0) of all possible M element symbols in the output product are obtained, i=1,2, …, M, and the normalized probability is calculated as the confidence of each character i through the following Softmax, and the multiplied sequence confidence is Softmaxed again as the output confx 。 6. A device for predicting chemical reaction products, comprising: The first module is used to train and output M>1 retrosynthesis models rmt1, rmt2, ... rmtM, and train and output N>1 forward reaction prediction models fmt1, fmt2, ... fmtN; The second module is used to perform deduplication processing on the reactants generated by the retrosynthesis model, remove duplicate reactants and duplicate backbone reactions, and retain the remaining candidate reactants and candidate backbone reactions; The third module is used to calculate the credibility of candidate reactants and candidate backbone reactions through the forward reaction prediction model, obtain n≤N credibility conf1, conf2, ... confn of N models, output the average credibility C, and screen the final candidate reactants by C≥ th, where th is selected from any number between 0.2 and 1.
0. In the first module, the method for generating the retrosynthesis model includes: initializing network parameters with random seeds, sampling different samples from the data set to construct a training set or different transformer network architectures, and In the first module, the method for generating the forward model includes: initializing network parameters with random seeds or sampling different samples from the data set to construct a training set.
7. The device according to claim 6, wherein The repeated reactants are one or more of the repeated reaction reagents and reaction conditions in multiple retrosynthesis models. The device according to claim 6 , wherein th is any number between 0.9 and 1.
0.
9. The apparatus of claim 6, wherein in the second module, the step of removing duplicate backbone reactions comprises: The retrosynthesis model generates multiple candidate reactions at a time. If the candidate reactions include repeated reactants, the repeated reactants are deleted and only one instance is retained. The compounds of the candidate reactions after deleting the duplicates are sorted by the number of atoms or character length. If the sorted compounds of the two backbone reactions after sorting are exactly the same and can be fully matched through standardized SMILES representation, they are judged as duplicates and only one is retained.
10. The apparatus according to claim 6, wherein in the third module, the average credibility C is calculated as follows: C = (conf1 + conf2 + … + confn) / n Each forward reaction prediction model x, x = 1, 2, …, n, generates confx by calculating each element symbol represented by the compound in the reaction according to the weights of each layer of the multi-layer neural network of the trained machine model. At the output layer of the model, the original weights zi (>0) of all possible M element symbols in the output product are obtained, i=1,2, …, M, and the normalized probability is calculated as the confidence of each character i through the following Softmax, and the multiplied sequence confidence is Softmaxed again as the output confx 。 11. A device comprising a processor or a storage, wherein the storage is used to store a computer program, and the processor is used to execute the method for predicting retrosynthetic chemical reactants according to any one of claims 1 to 5 according to the computer program.
12. A computer-readable storage medium for storing a computer program for executing the method for predicting retrosynthetic chemical reactants according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and system for automatically cleaning noise data of chemical reaction
CN113886377A
Method for constructing reagent compound prediction model, and method and device for automatically predicting and complementing chemical reaction reagents
CN113990405A