<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Are we making much progress? Revisiting chemical reaction yield prediction from an imbalanced regression perspective</title></titleStmt>
			<publicationStmt>
				<publisher>Association for Computing Machinery</publisher>
				<date>05/13/2024</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10534613</idno>
					<idno type="doi"></idno>
					
					<author>Y Ma</author><author>X Huang</author><author>B Nan</author><author>N Moniz</author><author>X Zhang</author><author>O Wiest</author><author>NV Chawla</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[The yield of a chemical reaction quantifies the percentage of the target product formed in relation to the reactants consumed during the chemical reaction. Accurate yield prediction can guide chemists toward selecting high-yield reactions during synthesis planning, offering valuable insights before dedicating time and resources to wet lab experiments. While recent advancements in yield prediction have led to overall performance improvement across the entire yield range, an open challenge remains in enhancing predictions for high-yield reactions, which are of greater concern to chemists. In this paper, we argue that the performance gap in high-yield predictions results from the imbalanced distribution of real-world data skewed towards low-yield reactions, often due to unreacted starting materials and inherent ambiguities in the reaction processes. Despite this data imbalance, existing yield prediction methods continue to treat different yield ranges equally, assuming a balanced training distribution. Through extensive experiments on three real-world yield prediction datasets, we emphasize the urgent need to reframe reaction yield prediction as an imbalanced regression problem. Finally, we demonstrate that incorporating simple cost-sensitive reweighting methods can significantly enhance the performance of yield prediction models on underrepresented high-yield regions.
CCS CONCEPTS• Applied computing → Chemistry; • Computing methodologies → Machine learning.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Recent advancements in machine learning have introduced a paradigm shift in the field of computational chemistry <ref type="bibr">[5]</ref>. These breakthroughs have led to a diverse array of machine learning models that now play critical roles in assisting chemists across a broad spectrum of tasks, including but not limited to retrosynthesis, product prediction, and drug discovery. Among this multifaceted landscape, the prediction of reaction yields <ref type="bibr">[1,</ref><ref type="bibr">12,</ref><ref type="bibr">13,</ref><ref type="bibr">15,</ref><ref type="bibr">17]</ref> emerges as an issue of paramount importance in the domain of synthesis planning, where complex molecules are synthesized through a sequence of reaction steps. Based on the empirical categorization, yields above 67% are classified as high yields and those below 33% are classified as low yields <ref type="bibr">[17]</ref>. In this context, the occurrence of a low-yield reaction within this sequence can drastically impact the feasibility and overall efficiency of the synthesis process. As a result, chemists often prioritize the accurate prediction of high-yield reactions.</p><p>While the introduction of numerous yield prediction models has indeed showcased improved performance across the entire yield range, the challenge of effectively enhancing performance for high-yield reactions remains an open problem <ref type="bibr">[9]</ref>. In real-world scenarios, yield data often exhibits a highly imbalanced distribution, with high yield values being much rarer than lower ones, despite their greater importance to chemists in synthesis planning. In this paper, we argue that the increased difficulty in predicting high-yield reactions stems from its limited availability of data samples, often due to unreacted starting materials and inherent ambiguities in the reaction processes. Despite the presence of such data imbalance, existing yield prediction methods continue to treat different yield ranges equally with the false assumption of a balanced data distribution.</p><p>To gain a deeper insight into the field's actual progress, we conduct extensive experiments to benchmark six state-of-the-art yield prediction methods on three real-world datasets. Surprisingly, the results become less impressive than claimed when we take data imbalance into account. We discover that the overall good performance across the entire yield spectrum primarily results from enhancing performance in areas with sufficient data, typically the low-yield range, while overlooking the significant performance gap in underrepresented high-yield regions. This finding has motivated us to revisit reaction yield prediction and reformulate it as an imbalanced regression problem, a well-established topic in machine learning.</p><p>Unlike imbalanced classification, reaction yield prediction involves regression rather than classification, and there has been limited exploration of addressing data imbalance in the regression context <ref type="bibr">[11]</ref>. Most prior research on imbalanced regression has directly adapted the SMOTE algorithm <ref type="bibr">[3]</ref> to regression settings <ref type="bibr">[2,</ref><ref type="bibr">14]</ref>. However, the continuous nature of target labels in regression tasks makes these adaptations less practical. A more intuitive solution is to apply cost-sensitive re-weighting strategies <ref type="bibr">[4,</ref><ref type="bibr">7,</ref><ref type="bibr">16]</ref> that can be seamlessly combined with various regression models. We demonstrate that incorporating these simple methods can significantly enhance the performance of existing yield prediction models on underrepresented high-yield regions without sacrificing the overall performance too much. We believe these findings have the potential to redirect the future research direction reaction yield prediction, benefiting both chemistry and machine learning communities. In summary, the contributions of this paper include:</p><p>&#8226; We are the first to introduce the novel concept of reformulating reaction yield prediction as an imbalanced regression problem. &#8226; We conduct comprehensive experiments on three real-world yield prediction datasets to uncover and understand the limitations of existing models when predicting high-yield reactions. &#8226; We demonstrate that incorporating cost-sensitive re-weighting methods into existing yield prediction models can lead to significant performance improvements on high-yield reactions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">THE EXAMINATION OF EXISTING YIELD PREDICTION METHODS</head><p>In this section, we begin by introducing the definitions of reaction yield prediction and imbalanced regression. We then proceed to evaluate six yield prediction methods on three real-world datasets.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Preliminaries</head><p>Definition 1: Reaction yield prediction. Reaction yield prediction is a regression problem that predicts the yield value &#119910; &#8712; [0, 100] of a chemical reaction &#119903;&#119909;&#119899; = (R, &#119875;) composed of multiple reactant molecules R and a single product molecule &#119875;. Definition 2: Imbalanced regression. Let D = {(&#119961; &#119894; , &#119910; &#119894; )} &#119873; &#119894;=1 denote the training dataset of a regression problem, where &#119961; &#119894; &#8712; R &#119889; is the input feature vector and &#119910; &#119894; &#8712; R is the label. We divide the label space Y into &#119870; disjoint bins with equal intervals, i.e., [&#119887; 0 , &#119887; 1 ), [&#119887; 1 , &#119887; 2 ), . . . , [&#119887; &#119870; -1 , &#119887; &#119870; ). Let C &#119896; be the set of data samples in the &#119896;-th bin with &#119896; &#8712; {1, 2, . . . , &#119861;}. The data imbalance occurs when the label distribution is highly skewed, i.e., max &#119896;</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Evaluation Settings for Yield Prediction</head><p>2.2.1 Datasets. We use three real-world datasets for predicting reaction yields, sourced from either high-throughput experimentation (HTE) or electronic laboratory notebooks (ELN). Following prior research on imbalanced regression <ref type="bibr">[4,</ref><ref type="bibr">8,</ref><ref type="bibr">16]</ref>, we categorize the bins within the target yield space into three disjoint subsets: many-shot (bins with over # upper reactions), medium-shot (bins with with the number of reactions per bin ranging from 1 to 209. Here, # lower is set to 20, and # upper is set to 65. &#8226; AZ <ref type="bibr">[12]</ref>: It includes 750 Buchward-Hartwig reactions from ELN at AstraZeneca, with the number of reactions per bin ranging from 0 to 145. Here, # lower is set to 3, and # upper is set to 5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.2">Yield prediction methods.</head><p>&#8226; Machine learning methods: Random Forest (RF), XGBoost, Support Vector Machines (SVM); &#8226; Deep learning methods: Multi-layer Perceptron (MLP), Yield-GNN <ref type="bibr">[12]</ref>, Yield-BERT <ref type="bibr">[13]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.3">Evaluation pipeline.</head><p>We report yield prediction results on many-shot, medium-shot, and few-shot regions as well as on the entire yield space (i.e., the all region). In all three datasets, 70% of the data is used for training and the remaining 30% is reserved for testing. Our evaluation employs common yield prediction metrics: mean absolute error (MAE) and root mean square error (RMSE). Additionally, we also utilize the geometric mean of &#119871;</p><p>1 errors (G-Mean) as a supplementary metric. Lower values (&#8595;) of MAE, RMSE, and G-Mean indicate better yield prediction performance. 2.2.4 Implementation details. For RF, XGBoost, SVM, and MLP, the input features include structural fingerprints (e.g., ECFP), chemical properties (e.g., NMR shifts, HOMO/LUMO energies, vibrations, dipole moments), and reaction-specific parameters (e.g., scale, volume, temperature). For Yield-BERT, the SMILES string of the reaction is used as input; an encoder based on a pre-trained BERT [6] for SMILES is employed, with a k-Nearest Neighbors (kNN) regressor serving as the decoder. For YieldGNN, we construct graph structures to represent the molecules involved in the reaction; a Dataset Method MAE &#8595; RMSE &#8595; G-Mean &#8595; All Many Med. Few All Many Med. Few All Many Med. Few B-H RF 5.5&#177;0.2 4.4&#177;0.2 6.0&#177;0.2 6.7&#177;0.6 8.1&#177;0.3 7.4&#177;0.3 8.4&#177;0.4 9.1&#177;0.8 2.8&#177;0.1 1.8&#177;0.1 3.6&#177;0.2 4.1&#177;0.4 XGBoost 4.7&#177;0.2 3.8&#177;0.2 5.2&#177;0.2 5.7&#177;0.5 6.9&#177;0.3 6.1&#177;0.4 7.1&#177;0.5 7.8&#177;0.7 2.7&#177;0.1 2.0&#177;0.1 3.2&#177;0.1 3.4&#177;0.3 SVM 14.6&#177;0.3 12.9&#177;0.5 12.9&#177;0.7 26.1&#177;1.1 18.5&#177;0.4 15.8&#177;0.5 17.2&#177;0.8 28.6&#177;0.9 9.2&#177;0.3 8.7&#177;0.5 7.7&#177;0.6 22.2&#177;1.6 MLP 4.5&#177;0.2 3.4&#177;0.3 5.3&#177;0.2 5.3&#177;0.4 7.0&#177;0.5 6.0&#177;1.0 7.6&#177;0.6 7.3&#177;0.6 2.5&#177;0.1 1.8&#177;0.1 3.1&#177;0.1 3.3&#177;0.3 YieldGNN 8.7&#177;7.9 8.6&#177;9.5 7.6&#177;4.6 12.8&#177;14.5 11.1&#177;8.7 10.6&#177;9.1 10.1&#177;5.9 14.7&#177;14.7 3.0&#177;0.4 2.3&#177;0.5 3.5&#177;0.4 3.9&#177;0.5 Yield-BERT 5.5&#177;0.3 3.8&#177;0.3 6.6&#177;0.4 6.6&#177;0.5 8.4&#177;0.4 7.1 &#177;1.4 9.1&#177;0.6 8.9&#177;0.8 3.2&#177;0.1 2.2&#177;0.1 4.1&#177;0.4 4.1&#177;0.5 Avg. Ranking -1.2 1.8 3.0 -1.2 2.2 2.7 -1.2 1.8 3.0 S-M RF 8.0&#177;0.2 6.1&#177;0.4 8.8&#177;0.3 12.8&#177;6.1 11.8&#177;0.4 11.2&#177;0.9 12.0&#177;0.3 15.9&#177;7.6 4.0&#177;0.2 2.3&#177;0.1 5.1&#177;0.3 9.8&#177;3.8 XGBoost 7.2&#177;0.2 6.1&#177;0.4 7.7&#177;0.2 6.8&#177;4.7 10.5&#177;0.2 10.1&#177;0.8 10.7&#177;0.2 9.7&#177;6.3 4.1&#177;0.1 3.1&#177;0.2 4.6&#177;0.1 3.9&#177;2.7 SVM 16.5&#177;0.2 14.8&#177;0.5 17.1&#177;0.2 31.6&#177;6.0 20.3&#177;0.2 18.7&#177;0.6 20.8&#177;0.3 33.0&#177;6.1 11.1&#177;0.2 9.6&#177;0.3 11.7&#177;0.3 30.3&#177;6.0 MLP 7.5&#177;0.3 6.1&#177;0.5 8.1&#177;0.4 8.5&#177;6.8 11.1&#177;0.4 10.7&#177;0.9 11.2&#177;0.5 12.3&#177;9.3 4.1&#177;0.2 2.9&#177;0.2 4.8&#177;0.3 4.5&#177;3.5 YieldGNN 9.1&#177;1.2 7.2&#177;0.9 9.9&#177;1.9 10.8&#177;7.3 12.6&#177;1.5 10.8&#177;1.4 13.2&#177;2.2 13.5&#177;8.2 5.4&#177;0.6 4.1&#177;0.5 6.1&#177;1.2 8.0&#177;6.9 Yield-BERT 9.1&#177;0.4 6.3&#177;0.4 10.2&#177;0.5 5.1&#177;5.4 13.3&#177;0.6 11.2&#177;0.9 14.1&#177;6.3 7.7&#177;7.6 5.0&#177;0.2 3.3&#177;0.2 6.0&#177;0.3 2.3&#177;2.7 Avg. Ranking -1.2 2.3 2.5 -1.3 2.3 2.3 -1.2 2.5 2.3 AZ RF 20.3&#177;0.8 19.1&#177;0.7 23.6&#177;2.5 32.0&#177;4.3 25.2&#177;0.9 23.6&#177;0.8 29.8&#177;3.0 36.4&#177;3.9 13.8&#177;0.8 13.1&#177;0.6 16.0&#177;3.0 26.0&#177;6.4 XGBoost 20.6&#177;1.0 19.5&#177;1.0 23.9&#177;3.4 30.4&#177;6.1 27.2&#177;1.3 25.6&#177;1.3 31.9&#177;3.6 37.9&#177;6.0 11.8&#177;1.0 11.3&#177;1.1 14.0&#177;3.6 19.7&#177;6.5 SVM 25.0&#177;0.8 23.5&#177;0.7 28.0&#177;2.4 41.7&#177;3.9 28.9&#177;0.9 27.1&#177;0.7 32.5&#177;2.4 43.9&#177;3.8 18.6&#177;0.9 17.5&#177;0.7 20.8&#177;2.9 37.6&#177;5.8 MLP 22.1&#177;1.7 21.5&#177;1.3 25.0&#177;5.0 26.0&#177;6.9 29.7&#177;2.1 28.9&#177;1.9 33.4&#177;4.9 32.8&#177;7.4 12.0&#177;1.2 11.6&#177;0.9 14.6&#177;5.0 15.6&#177;6.7 YieldGNN 22.5&#177;0.8 21.5&#177;0.6 25.5&#177;3.3 33.4&#177;6.7 28.0&#177;1.0 26.5&#177;1.0 32.0&#177;3.7 38.6&#177;6.0 15.2&#177;1.1 14.6&#177;0.9 17.0&#177;3.1 25.7&#177;9.2 Yield-BERT 25.6&#177;2.5 24.3&#177;2.6 28.7&#177;3.8 38.4&#177;10.1 32.5&#177;3.0 30.7&#177;3.0 37.5&#177;3.6 45.2&#177;9.9 15.7&#177;1.5 15.1&#177;1.7 18.0&#177;4.7 26.2&#177;10.8 Avg. Ranking -1.0 2.0 3.0 -1.0 2.2 2.8 -1.0 2.0 3.0 Table <ref type="table">1</ref>: Reaction yield prediction results on three real-world datasets. We report the average performance across 10 repetitions in all experiments and present the average rankings for the many-shot, medium-shot, and few-shot regions, respectively.</p><p>GNN is used to encode the reaction, while an MLP is used to decode the reaction embedding into yield predictions. We employ the &#119871; 1 distance as the training loss L in all experiments.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">Uncovering and Understanding the Performance Gap in High-Yield Predictions</head><p>Figure <ref type="figure">1</ref> provides an insightful comparison between yield distributions and test error distributions, both as functions of yield values.</p><p>Regarding the yield distribution, we note that the few-shot region predominantly comprises high-yield reactions, while the many-shot region primarily consists of low-yield reactions. Specifically in the B-H and S-M datasets, 81% and 100% of the few-shot reactions fall into the high-yield category, while 89% and 100% of the many-shot reactions belong to the low-yield category. This finding establishes a clear connection between yield values and their distributions.</p><p>To quantify the impact of data imbalance on prediction errors, we compute the Pearson correlation coefficients between the testing error distribution and the training yield distribution. Across all three reaction yield prediction datasets, we consistently observe negative correlation coefficients, with values of -0.42, -0.28, and -0.07, respectively. Moreover, in the right part of Figure <ref type="figure">1</ref>, it is evident that the few-shot region (in orange) exhibits the largest test error, while the many-shot region (in blue) demonstrates the smallest error. To complement this observation, we further evaluate the yield prediction performance of six state-of-the-art models using three metrics and report the average performance rankings for the three regions in Table <ref type="table">1</ref>. As a result, the average ranking indicates a decline in model performance as we transition from the many-shot region to the medium-shot and few-shot regions.</p><p>Therefore, both observations from Figure <ref type="figure">1</ref> and Table <ref type="table">1</ref> converge to the same conclusion: During the training process, low-yield values with a larger number of data samples tend to be learned better in comparison to those high yields with fewer samples. This highlights the demand for specialized machine learning techniques that can effectively address the challenge of data imbalance.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">MITIGATING DATA IMBALANCE FOR BETTER HIGH-YIELD PREDICTIONS</head><p>In this section, we present two cost-sensitive re-weighting methods for imbalanced regression, which can be seamlessly integrated into the learning process of existing yield prediction models. We also provide evidence of their effectiveness in high-yield predictions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Cost-sensitive Re-weighting Methods</head><p>The key idea is to assign a weight &#119908; &#119894; &#8712; W to each training sample (&#119961; &#119894; , &#119910; &#119894; ), resulting in the following modified loss function L &#8242; :</p><p>where L is a loss function for regression tasks, such as &#119871; 1 loss, MSE loss, and Huber loss. The distinctiveness of each re-weighting method arises from the various designs of training weights W.</p><p>3.1.1 Focal loss. The Focal loss <ref type="bibr">[7]</ref> is a specialized loss function designed to address imbalanced learning problems. It assigns varying weights to individual training samples based on their prediction difficulties. The goal is to reduce the impact of easily predictable samples while amplifying the importance of challenging samples during the training process. The weight &#119908; &#119894; is defined as:</p><p>where sigmoid(&#8226;) is the sigmoid function, and &#120572;, &#120574; are hyperparameters. This results in the scaling factor of each training sample ranging from 0 to 1, depending on the prediction error. Notably, when &#120574; = 0, the Focal loss is equivalent to the original loss L. In all experiments, we set &#120572; to 0.2 and &#120574; to 1.  <ref type="bibr">[16]</ref> assigns varying weights to training samples based on their label density. The objective is to mitigate the impact of redundant samples while accentuating the significance of sparsely represented samples during training. To account for the continuity of labels, a Gaussian kernel is employed to smooth the empirical label density distribution of the label space Y. The weight &#119908; &#119894; for each training sample is defined as:</p><p>where</p><p>represents a Gaussian kernel with kernel size &#8467; and standard deviation &#120590;, and C &#119896; denotes the set of training samples in the &#119896;-th bin where &#119910; &#119894; &#8712; [&#119887; &#119896; -1 , &#119887; &#119896; ). In all experiments, we set &#8467; to 5 and &#120590; to 2.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Effectiveness in High-Yield Predictions</head><p>Table <ref type="table">2</ref> presents the experiment results on the same three yield prediction datasets, demonstrating the effectiveness of cost-sensitive re-weighting methods (i.e., Focal loss, LDS, and the combination of both) when integrated with existing yield prediction models. Across all three datasets, imbalanced regression methods consistently achieve the best results in all 9 combinations of evaluation metrics (MAE, RMSE, and G-Mean) in the few-shot region. Meanwhile, the base model ("Vanilla") without any imbalanced regression designs maintains its superiority in 6 out of 9 combinations in the all region. This observation is understandable and aligns with the trade-off between prediction performance in underrepresented data regions and performance across the entire dataset.</p><p>However, it's important to note that while there is a performance drop in the all region, this drop is not significant compared to the substantial performance improvement observed in the few-shot region. Specifically, the average performance drops are 6.7%, 15.7%, and 0.7%, while the average performance improvements are 14.0%, 34.3%, and 7.3% on each dataset, respectively. This observation underscores the effectiveness of incorporating simple imbalanced regression methods into existing yield prediction models as a plugin module. Furthermore, it is important to highlight that by tailoring more sophisticated imbalanced regression techniques to yield prediction, we could anticipate a further performance improvement.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">CONCLUSION</head><p>In this paper, we have highlighted a critical issue in reaction yield prediction -the prevalent focus on achieving superior performance across the entire yield spectrum, often at the expense of overlooking yield regions with limited training samples, particularly the high-yield areas, which are of greater concern to chemists. Through extensive experiments on three real-world datasets, we have emphasized the urgent need to reframe reaction yield prediction as an imbalanced regression problem. Moreover, we have demonstrated that by incorporating simple cost-sensitive re-weighting techniques, we can significantly enhance the performance of yield prediction models in underrepresented high-yield regions.</p></div></body>
		</text>
</TEI>
