Uncertainty-aware prediction of chemical reaction yields with graph neural networks
화학·수지 · (21) 에폭시수지 (19) 석유수지(20) 페놀수지
기본 정보
- 저자
- DOI
- 10.1186/s13321-021-00579-z
- 저널
- Journal of Cheminformatics
- 발행년도
- 2022
- 발행기관
- BioMed Central
- 피인용수
- 62
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1186/s13321-021-00579-z
- 토픽
- Fuel Cells and Related Materials
- OpenAlex ID
- W4206063340
평가 내용
- 관련도
- 사업분야
- 화학·수지 · (21) 에폭시수지
- 부 분야
- (19) 석유수지, (20) 페놀수지
- R&D 측면
- 분석·모델링
- 확신도
- 0.80
- 근거 용어
- chemical reaction yields, graph neural networks, molecular graphs, predictive distribution, uncertainty-aware
- 판단 근거
- 이 논문은 그래프 신경망(GNN)을 활용하여 화학 반응의 수율을 예측하고 불확실성을 정량화하는 AI 모델을 다룹니다. 이는 코오롱인더스트리의 에폭시, 페놀, 석유수지 등 다양한 화학 수지(Resin) 합성 공정에서 최적의 반응 조건을 예측하고 실험 비용을 절감하는 R&D 방법론으로 직접 활용 가능합니다.
- R&D 활용 포인트
- 신규 수지(에폭시, 페놀 등) 합성 시, 실험 횟수를 최소화하기 위해 AI 모델을 활용하여 반응 수율을 사전 예측하고, 불확실성이 높은 조건은 제외하는 효율적인 합성 경로 설계(Synthesis Planning)에 참고할 수 있습니다.
- 평가 입력
- 섹션 본문 22,197자
초록
본문 22,937자
본문 펼치기
섹션 본문 44문단 · 21,797자
(제목 없음)
1In this paper, we present a data-driven method for the uncertainty-aware prediction of chemical reaction yields. The reactants and products in a chemical reaction are represented as a set of molecular graphs. The predictive distribution of the yield is modeled as a graph neural network that directly processes a set of graphs with permutation invariance. Uncertainty-aware learning and inference are applied to the model to make accurate predictions and to evaluate their uncertainty. We demonstrate the effectiveness of the proposed method on benchmark datasets with various settings. Compared to the existing methods, the proposed method improves the prediction and uncertainty quantification performance in most settings.
Introduction
2In organic chemistry, the prediction of chemical reaction yields is an important research topic in chemical synthesis planning [1,2]. This enables the estimation of the overall yield of a complex synthetic pathway and the detection of low-yield reactions that negatively affect the overall yield. It also provides clues for designing new reactions that provide higher yields to save on the time and cost required for experimental syntheses.
3Machine learning has achieved remarkable success in the data-driven prediction of chemical reaction yields [1,[3][4][5][6][7]. The main concept is to construct a prediction model that predicts the yield of a chemical reaction by learning from previously accumulated data comprising a number of chemical reactions annotated with their experimentally measured yields. The successful application of a prediction model enables fast and efficient estimation of chemical reaction yields without performing experimental syntheses, which are costly and time-consuming.
4Early studies represented each chemical reaction as a fixed-size vector of handcrafted features, such as molecular fingerprints and chemical property descriptors, and constructed an off-the-shelf prediction model on top of the vector representation [3][4][5]8]. The limitation of this approach is that the choice of adequate features relies on chemical knowledge and intuition, and some inherent information to the original reaction may be lost in the representation. With advances in deep learning [9], recent studies have applied deep neural networks constructed on a more informative representation of a chemical reaction. Schwaller et al. [6,10] used simplified molecular-input line-entry system (SMILES) to represent a chemical reaction. To predict the reaction yield, they fine-tuned a bidirectional encoder representations from transformers (BERT) model pre-trained using a reaction SMILES database [11] to predict the yield. Saebi et al. [7] represented a chemical reaction as a set of graphs, on which a graph neural network was constructed to predict the yield.
5In this paper, we present an alternative method for predicting chemical reaction yields. As a prediction model, we adapt a graph neural network that directly operates on the graph representation of a chemical reaction in a permutation-invariant fashion. We use uncertaintyaware learning and inference in the model to make accurate predictions of yields and determine the confidence of predictions.
Data representation
6We suppose that a chemical reaction consists of a number of reactants and a single product. This chemical reaction is labeled with its reaction yield. Each instance is represented as (R, P, y) , where R = {G R,1 , . . . , G R,m } and P = {G P } are the set of m reactants and the resulting product in the reaction, respectively, and y is the reaction yield. The number of reactants m can be different for each reaction.
7Each molecule in R and P is defined as an undirected graph G = (V, E) , where V and E represent the set of nodes and the set of edges, respectively. The node feature vectors v j ∈ V and edge feature vectors e j,k ∈ E are associated with heavy atoms (e.g., C, N, O, and F) and their bonds (e.g., single, double, triple, and aromatic), respectively. Hydrogen atoms are treated implicitly. The number of heavy atoms and bonds in each molecule is the same as the number of node feature vectors and edge feature vectors in the corresponding graph representation, respectively. Figure 1 illustrates an example of the graph representation of a molecule.
8For the j-th atom, v j = (v j,1 , . . . , v j,p ) is a vector indicating the atom type, formal charge, degree, hybridization, number of hydrogens, valence, chirality, whether it accepts or donates electrons, whether it is aromatic, whether it is in a ring, and associated ring sizes. For the bond between the j-th and k-th atoms, e j,k = (e j,k,1 , . . . , e j,k,q ) is a vector indicating the bond type, stereochemistry, whether it is in a ring, and whether it is conjugated.
Prediction model
9To predict the reaction yield y, we introduce a predictive distribution for y conditioned on the set of reactants R and product P , denoted by p θ (y|R, P) , which is modeled as a normal distribution as follows:
10where µ and σ 2 are the mean and variance of the distribution, respectively. We parameterize the predictive distribution p θ using a neural network f that produces µ and σ 2 as a function of R and P with a set of parameters θ:
11To construct the neural network f, we adapt the architecture presented by Saebi et al. [7] to process two sets of molecular graphs with advanced neural network modules. Figure 2 illustrates the architecture used in this study. The architectural details of each component are presented next.
12A message passing neural network (MPNN) [12] is used as the GNN component of f to process each molecular graph G in R and P . The GNN is designed to take G as the input and return the graph representation vector r as the output:
13In the GNN, we apply multiple message passing steps using an edge network as a message function and a gated recurrent unit (GRU) network as an update function to generate node representation vectors. We then apply a set2set model [13] as a readout function for global pooling over the node representation vectors to obtain a graph-level embedding that is invariant to the order of the nodes. The embedding is sparsified by a fully-connected layer to obtain the graph representation vector r . The use of the GNN renders the representation invariant to graph isomorphism.
14(1) p θ (y|R, P) = N (y|µ, σ 2 ),
15(2) (µ, σ 2 ) = f (R, P; θ). We summate the graph representation vectors for R = {G R,1 , . . . , G R,m } . This makes the representation invariant with respect to the order of the reactants. The summated vector is concatenated with the graph representation vector P = {G P } to generate the reaction representation vector h:
16The reaction representation vector h is further processed by a feed-forward neural network (FNN) with two output units. The first unit returns the predictive mean µ . The second unit returns the log predictive variance log σ 2 . The main advantages of the prediction model f presented in this study can be summarized as follows. First, the input for the model is the graph representation of a chemical reaction, which can directly encompass various atom and bond features regarding their chemical properties that make the representation more informative. Second, the model can handle chemical reactions of varying sizes with different numbers of reactants as the input. Third, the output of the model is invariant to permutations of reactants in the input reaction and is also invariant to permutations of atoms in each of the reactants/ products. Fourth, the output of the model specifies the corresponding predictive distribution, which allows for uncertainty-aware learning and inference.
Uncertainty-aware learning
17The learning procedure aims to train the prediction model f such that it can estimate the predictive mean µ and variance σ 2 of the unknown yield y for a chemical reaction (R, P) . For the model f to learn from data, we construct a training dataset of N chemical reactions and their yields, denoted by
18. We train the model f based on the maximum likelihood estimation. Based on the normality assumption for the predictive distribution p θ , the log-likelihood is given by:
19Given a training dataset D , the model is trained to minimize the objective function J :
20which involves two learning objectives with the hyperparameter that controls the relative strength of each objective. The first term is to minimize the conventional mean squared error over the training dataset D , which corresponds to the maximization of the log-likelihood over D under the homoscedasticity assumption. The second term is to maximize the log-likelihood over D under the heteroscedasticity assumption. The first term contributes to stabilizing the training with respect to the predictive mean µ . The second term enables the predictive variance σ 2 to quantify the aleatoric uncertainty caused by the inherent noise in D.
Uncertainty-aware inference
21Once trained, the prediction model f is used to predict the yields of new chemical reactions. We employ the Monte-Carlo (MC) dropout [14] for the Bayesian approximation of the model f. Following the Bayesian approach, the approximate predictive distribution q is given by Given a query reaction (R * , P * ) , we wish to predict the unknown yield y * of the reaction as well as to quantify the uncertainty of the prediction. We empirically derive the MC estimates by sampling
22based on stochastic forward passes through the model f with dropout applied. Because some hidden units are randomly dropped out at each forward pass, the T predictions vary for the same reaction. The variability in the predictions is primarily caused by the epistemic uncertainty of the model f owing to the insufficiency of the training dataset D.
23For prediction, the predictive mean can be estimated by averaging over
24This is used as the prediction of y * . For uncertainty quantification, the predictive variance can be estimated as:
25q(y * |R * , P * ) = p θ (y * |R * , P * )dθ .
26where μ * = 1 T T t=1μ
27(t) * . This is used as the uncertainty score for the prediction. The predictive variance can be decomposed into two types of uncertainty [15]. The first term corresponds to the aleatoric uncertainty, which accounts for the statistical uncertainty caused by inherent noise in the dataset D . The second term corresponds to the epistemic uncertainty, which accounts for the systemic uncertainty in the model f caused by the insufficiency of D.
28The prediction of chemical reaction yields supports the identification of high-yield reactions from a pool of possible candidates in an efficient manner. The prerequisite is that the prediction model must be as accurate as possible. In practice, the prediction model may be imperfect and result in inaccurate predictions. To overcome this issue, we can selectively use the model based on uncertainty quantification. Because a high prediction uncertainty tends to cause erroneous predictions, the rejection of uncertain predictions would be beneficial for the actual use of the prediction model. If the prediction uncertainty is sufficiently low, we can use the model with confidence to identify whether a reaction has a high yield. Otherwise, the model abstains from predicting. Rejected cases can be carefully investigated by chemists in terms of their yields.
Experimental investigation Datasets
29We investigate the effectiveness of the proposed method using the following two benchmark datasets: Buchwald-Hartwig [3] and Suzuki-Miyaura [16]. In these datasets, each reaction was annotated with a measured yield ranging from 0% to 100%. The summary statistics of the datasets are presented in Table 1.
30The Buchwald-Hartwig dataset was released by Ahneman et al. [3]. They conducted high-throughput experiments on the class of Pd-catalyzed Buchwald-Hartwig C-N cross-coupling reactions. They experimented on combinations of 15 aryl halides, 4 ligands, 3 bases, and 23 additives. A total of 3955 reactions were reported with (9)
31their measured yields. The studies [3][4][5][6] evaluated the performance of the chemical reaction yield prediction on this dataset. The Suzuki-Miyaura dataset was released by Perera et al. [16]. They conducted high-throughput experiments on the class of Suzuki-Miyaura cross-coupling reactions. 15 couplings of electrophiles and nucleophiles across combinations of 12 ligands, 8 bases, and 4 solvents were considered, resulting in measured yields for a total of 5760 reactions. The studies [6,16,17] have investigated this dataset.
32For experimental investigations, we use 10 random shuffles for each benchmark dataset and 4 out-of-sample splits of the Buchwald-Hartwig dataset [3,6].
Implementation
33In the experimental investigation, we use the following configurations for the proposed method. For the GNN component of the model, the node representation vectors and graph representation vectors have dimensions of 64 and 1024, respectively. The graph representation vectors were set to have higher dimensionality because they are summated over multiple reactants to obtain the reaction representation vector. The number of message passing steps and set2set processing steps are both set to 3. Increasing the size of the GNN component may provide better performance, but it also incurs higher computational costs and memory usage. Thus, we set it to moderately large so that it can be trained in a reasonable time. The FNN component of the model has two fully-connected layers with 512 dimensions, followed by an output layer. During training, we standardize the yield y to have a mean of 0 and a variance of 1 over the training dataset D . A dropout rate of 0.1 is applied to the fully-connected layers in the FNN component. The hyperparameter in the objective function J is set to 0.1. L2 regularization with a factor of 10 −5 is applied to the parameters θ . To train the model f, we update the parameters θ for 500 epochs using the Adam optimizer with a batch size of 128. The learning rate is set to 10 −3 for the initial epochs and decayed to 10 −4 and 10 −5 over the last 100 epochs. We did not consider hyperparameter optimization through holdout validation, because it is unsuitable when the training dataset is very small. At inference, we set the number of forward passes T to 30 for MC dropout. We use Equation 8 and Equation 9 for the prediction and uncertainty score, respectively.
34The proposed method is implemented using PyTorch in Python. The source code used in this study is available online at http:// github. com/ seokh okang/ react ion_ yield_ nn/. The results of the experimental investigations are reported and discussed in the following section.
Prediction and uncertainty quantification
35We investigated the effectiveness of the proposed method for predicting the chemical reaction yields on the Buchwald-Hartwig and Suzuki-Miyaura datasets. For the proposed method, we derived two ablations by adjusting the hyperparameter in the objective function J . For the first ablation, the model was trained using only homoscedastic loss by setting = 0 , which is equivalent to fixing the predictive variance σ to 1. For the second ablation, the model was trained using only heteroscedastic loss by setting = 1 . For baselines, we considered YieldBERT [6] and YieldBERT-DA [10], which demonstrated superior performance compared to the other methods presented in the literature [3][4][5]. YieldBERT adapted a pre-trained BERT encoder [11] to predict the chemical reaction yield as a function of the reaction SMILES. YieldBERT-DA is an extension of YieldBERT based on data augmentation, which increases the quantity of the training dataset using SMILES randomization. For YieldBERT-DA, the prediction uncertainty score was computed using the prediction variance obtained from the test-time augmentation, as implemented in [10]. The source codes for YieldBERT and YieldBERT-DA are available online at https:// github. com/ rxn4c hemis try/ rxn_ yields/, which we used to reproduce the experimental results. Consequently, a total of five methods were compared: YieldBERT, YieldBERT-DA, and the proposed method with = 0 , 1, and 0.1.
36For performance evaluation, we split each dataset into training and test sets. We then trained the prediction , and coefficient of determination (R 2 ). Uncertainty quantification performance was evaluated in terms of the Spearman rank correlation coefficient ρ between the absolute prediction error and uncertainty score on the test set [10,18]. Table 2 reports the average and standard deviation of the results over the 10 repetitions. In terms of prediction performance, the proposed method outperformed all the baseline methods. Although YieldBERT-DA was the best baseline method, the MAE and RMSE values of the proposed method reduced by around 5 ∼10% compared to those of YieldBERT-DA on both benchmark datasets. The higher prediction performance indicates that the proposed method can provide more accurate predictions of yields for new reactions. Regarding uncertainty quantification performance, the proposed method yielded a Spearman ρ comparable to that of YieldBERT-DA.
37For the proposed method, the prediction performance with = 1 was slightly better than that with = 0 . The uncertainty quantification performance with = 1 was far better than that with = 0 , which implies that capturing the aleatoric uncertainty is beneficial. Compared to the ablations, setting = 0.1 yielded a better trade-off between prediction performance and uncertainty quantification performance. The results demonstrated that the use of both homoscedastic and heteroscedastic losses helped to improve performance.
Out-of-sample prediction
38We also evaluated the performance of the proposed method for out-of-sample prediction. As in [6,10], we used four out-of-sample training/test splits of the Buchwald-Hartwig dataset, which we denote by Test 1, Test 2, Test 3, and Test 4. In each split, certain additives are absent from the training set but only appear in the test set. The proposed method was compared with YieldBERT and YieldBERT-DA. The training configurations and evaluation scheme were the same as before. The experiments were repeated five times independently using different random seeds. Table 3 summarizes the results averaged over the five repetitions. Overall, the proposed method was comparable to the best of the baseline methods for out-of-sample prediction. In terms of prediction performance, the proposed method performed best on Test 2 and Test 4, while was comparable or inferior to the best baseline on Test 1 and Test 3. Among the baselines, YieldBERT-DA yielded a lower performance than YieldBERT on average. For uncertainty quantification performance, the proposed method yielded the highest Spearman ρ for Test 1, Test 3, and Test 4.
Selective prediction with rejection
39We investigated the effectiveness of the proposed method for selective prediction using 70/30 splits of benchmark datasets. For the proposed method, prediction uncertainty was quantified using the total predictive variance in Eq. 9.
40Because it can be decomposed into aleatoric and epistemic uncertainties, we conducted an ablation study to examine the effects of each component. The first ablation quantified the prediction uncertainty using the aleatoric uncertainty term. The second ablation used the epistemic uncertainty term. The proposed method was compared to the best baseline method, YieldBERT-DA, for which the uncertainty quantification was based on the test-time augmentation.
41To evaluate the selective prediction performance, we rejected the prediction for a reaction if its uncertainty score was above a certain threshold. The threshold controls the trade-off between prediction accuracy and coverage. As performance measures, we computed the MAE and RMSE on the test set with various prediction coverage rates ranging from 100% to 30%.
42Tables 4 and 5 present the comparison results for the selective prediction performance in terms of the MAE and RMSE with various prediction coverage rates, which are summarized in Fig. 3. The results clearly demonstrated that a high uncertainty score for a reaction causes its predicted yield to be less accurate for all compared methods. Reducing the prediction coverage with more rejections led to a significant improvement in the prediction performance. The proposed method outperformed YieldBERT-DA in most cases. The MAE and RMSE decreased by over 10% and were nearly halved at 90% and 40% coverages, respectively, for both datasets.
43Regarding the two ablations of the proposed method, the selective prediction performance with the epistemic uncertainty was superior at higher prediction coverages, whereas that with the aleatoric uncertainty was better at lower coverages. Compared to the ablations, using the
Conclusion
44We presented an uncertainty-aware method for predicting chemical reaction yields. We represented a chemical reaction as a set of graphs. We constructed a prediction model whose input was the graphs and output was the predictive mean and variance for the reaction yield. For a query reaction, the predictive mean of the model was used as the predicted yield and the predictive variance was used to quantify the uncertainty of the prediction, which allowed the model to avoid making predictions with high uncertainty. The effectiveness of the proposed method for chemical reaction yield prediction was successfully demonstrated through experimental validation on two benchmark datasets. We also demonstrated that a high predictive variance tends to cause a high prediction error, allowing for selective prediction with rejection. The accurate prediction of chemical reaction yields with uncertainty quantification can assist in advanced synthesis planning considering imposed constraints in practice, including availability, variability, and budget limits. Future research directions for improving prediction performance will be to enrich the data representation of chemical reactions to make it more informative by incorporating various atom/bond features and molecular descriptors associated with reaction yields.
참고문헌 13건
- Development of a Novel Fingerprint for Chemical Reactions and Its Application to Large-Scale Reaction Classification and Similarity Journal of Chemical Information and Modeling · American Chemical Society · 2014 10.1021/ci5006614
- A platform for automated nanomole-scale reaction screening and micromole-scale synthesis in flow Science · American Association for the Advancement of Science · 2018 10.1126/science.aap9112
- Predicting reaction performance in C–N cross-coupling using machine learning Science · American Association for the Advancement of Science · 2018 10.1126/science.aar5169
- Controlling an organic synthesis robot with machine learning to search for new reactivity Nature · Nature Portfolio · 2018 10.1038/s41586-018-0307-8
- Comment on “Predicting reaction performance in C–N cross-coupling using machine learning” Science · American Association for the Advancement of Science · 2018 10.1126/science.aat8603
- Deep learning Nature · Nature Portfolio · 2015 10.1038/nature14539
- The digitization of organic synthesis Nature · Nature Portfolio · 2019 10.1038/s41586-019-1288-y
- A Structure-Based Platform for Predicting Chemical Reactivity Chem · Elsevier BV · 2020 10.1016/j.chempr.2020.02.017
- Uncertainty Quantification Using Neural Networks for Molecular Property Prediction Journal of Chemical Information and Modeling · American Chemical Society · 2020 10.1021/acs.jcim.0c00502
- Mapping the space of chemical reactions using attention-based neural networks Nature Machine Intelligence · Nature Portfolio · 2021 10.1038/s42256-020-00284-w
- Machine Learning for Chemical Reactions Chemical Reviews · American Chemical Society · 2021 10.1021/acs.chemrev.1c00033
- Graph Neural Networks for Predicting Chemical Reaction Performance ChemRxiv · 2021 10.26434/chemrxiv.14589498
- Data augmentation strategies to improve reaction yield predictions and estimate uncertainty ChemRxiv · 2020 10.26434/chemrxiv.13286741