<?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'>A penalized complexity prior for deep Bayesian transfer learning with application to materials informatics</title></titleStmt>
			<publicationStmt>
				<publisher>Institute of Mathematical Statistics</publisher>
				<date>12/01/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10505382</idno>
					<idno type="doi">10.1214/23-AOAS1759</idno>
					<title level='j'>The Annals of Applied Statistics</title>
<idno>1932-6157</idno>
<biblScope unit="volume">17</biblScope>
<biblScope unit="issue">4</biblScope>					

					<author>Mohamed A. Abba</author><author>Jonathan P. Williams</author><author>Brian J. Reich</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[A key task in the emerging field of materials informatics is to use machine learning to predict a material's properties and functions. A fast and accurate predictive model allows researchers to more efficiently identify or construct a material with desirable properties. As in many fields, deep learning is one of the state-of-the art approaches, but fully training a deep learning model is not always feasible in materials informatics due to limitations on data availability, computational resources, and time. Accordingly, there is a critical need in the application of deep learning to materials informatics problems to develop efficient transfer learning algorithms. The Bayesian framework is natural for transfer learning because the model trained from the source data can be encoded in the prior distribution for the target task of interest. However, the Bayesian perspective on transfer learning is relatively unaccounted for in the literature and is complicated for deep learning because the parameter space is large and the interpretations of individual parameters are unclear. Therefore, rather than subjective prior distributions for individual parameters, we propose a new Bayesian transfer learning approach based on the penalized complexity prior on the Kullback-Leibler divergence between the predictive models of the source and target tasks. We show via simulations that the proposed method outperforms other transfer learning methods across a variety of settings. The proposed method is applied to predict the properties of a molecular crystal, based on its structural properties, and we show improved precision for estimating the band gap of a material compared to state-of-the-art methods currently used in materials science.]]></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"><p>1. Introduction. Materials informatics has fundamentally changed materials science research (e.g., <ref type="bibr">Himanen et al. (2019)</ref>). To design or select a material for a particular function, researchers have traditionally relied on intuition and costly experimentation. This process is now supplemented by machine learning to predict a candidate material's properties and triage materials for further experimentation. The addition of machine learning has been shown to improve efficiency, especially when using multiple data sources (e.g., <ref type="bibr">Batra (2021)</ref>). We aim to build a predictive model for a material's band gap, defined as the energy differential between the lowest-unoccupied and highest-occupied electronic states <ref type="bibr">(Kittel, McEuen and Wiley (2019)</ref>). The band gap governs desirable properties that are useful in industrial sectors such as electric and photovoltaic conductivity. Traditionally, band gap size is computed using methods in quantum mechanics such as density functional theory (DFT; <ref type="bibr">Kohn and Sham (1965)</ref>). However, these methods require running costly computer simulations, and so it is not feasible to exhaustively search over a broad class of materials. Our objective is to build a statistical model (sometimes called a meta-model, surrogate model, or emulator; O <ref type="bibr">'Hagan (2006)</ref>) along with an accompanying transfer learning methodology that is both effective at predicting the output of the DFT simulation and is able to optimize experimentation on future test data sets from related data sources.</p><p>Deep neural network (DNN) architectures have emerged as leading models in materials informatics. Beyond materials science DNNs have revolutionized the field of machine learning with significant breakthroughs in a wide variety of applications including computer vision <ref type="bibr">(Voulodimos et al. (2018)</ref>), natural language processing <ref type="bibr">(Young et al. (2018)</ref>), and protein folding <ref type="bibr">(Senior et al. (2020)</ref>); see <ref type="bibr">Dargan et al. (2020)</ref> for further references to modern applications. Their ability to model complex nonlinear processes enables them to handle a large class of prediction problems. Training a neural network, however, is not an easy task, often requiring intensive computational cost, large quantities of training data, and careful hyperparameter selection <ref type="bibr">(Bengio (2012)</ref>). As an overparameterized expressive model, DNNs are prone to overfitting, especially in the case of small data sets. <ref type="bibr">Tan et al. (2018)</ref> conclude that the number of parameters in a DNN and the size of the data required for good generalization performance have an almost linear relationship. Since these models tend to have thousands (sometimes millions) of parameters, the size of the data required becomes quickly prohibitive. This is where transfer learning plays a central role.</p><p>Broadly defined, transfer learning describes a machine learning approach for augmenting the training of a learning task on a target population data set with a learning algorithm that has already been trained on a closely related data set from a source population, particularly for scenarios where the target and source populations are not identical; see <ref type="bibr">Weiss, Khoshgoftaar and Wang (2016)</ref> for a recent survey on transfer learning. By developing effective transfer learning strategies, it is possible to reduce the computational burden and the need for large training data sets for training DNN models in applications where complex DNNs have already been trained for similar data sets. For example, <ref type="bibr">Raghu et al. (2019)</ref> and <ref type="bibr">Ahishakiye et al. (2021)</ref> investigated the use of a pretrained DNN on ImageNet <ref type="bibr">(Deng et al. (2009)</ref>) to improve the accuracy in medical imaging tasks where labeled data is usually scarce. Although the potential benefits for transfer learning are significant, there are no generally accepted procedures for how to construct or evaluate a transfer-learning strategy, and this is especially true from the Bayesian perspective. <ref type="bibr">Dube et al. (2020)</ref> provides a review of the current approaches to address a variety of important questions of concern for developing transfer-learning methods. For instance, what aspects of the source tasks can be leveraged to improve performance on the target task? In the case of DNN source models, this commonly boils down to isolating the layers that are task agnostic versus those that are task dependent.</p><p>1.1. Data and motivation. Motivated by the predictive materials science application of estimating the band gap of a material based on its structural properties, we propose a principled statistical approach to transfer learning within a Bayesian framework. In materials science, the band gap governs desirable properties of candidate materials. The conductivity of a solid is closely related to the band gap size. For example, materials with large band gaps are generally insulators, while materials with low band gaps are semiconductors (Van de Walle ( <ref type="formula">2012</ref>)). Band gap size (measured in electronvolts, eV) is typically computed using different quantum mechanics methods like the DFT. DFT calculation can be expensive for large molecules and crystals. This, combined with the large possible number of materials, has driven the need for fast screening methods. According to <ref type="bibr">Olsthoorn et al. (2019)</ref>, there has been a growing interest in the development of accurate machine learning models for material sciences and quantum systems. For small organic molecules, <ref type="bibr">Olsthoorn et al. (2019)</ref> reported that DNN models have reached chemical accuracy. For large molecular crystals, however, the task of band gap prediction seems to be much harder. In addition, DFT calculations are more expensive to perform on molecular crystals. For example, <ref type="bibr">Ma et al. (2021)</ref> found that the algorithmic complexity of DFT is cubic in the number of particles for a given molecule; hence, it is easier to collect and compute band gap values for molecules than it is for molecular crystals. Given the difficulty of band gap calculation for molecular crystals, we propose to use transfer-learning methods to borrow information from molecules (source) to molecular crystals (target) to improve prediction. The target data considered here will consist of 50,000 molecular crystals and their band gap values computed using DFT. This data set was provided by the Material Science Research Group at Carnegie Mellon University and required a sustained effort over several years to produce. The source data will be the OE62 data set <ref type="bibr">(Stuke et al. (2019)</ref>), which consists of 62,000 molecules and their band gap values. The molecules in the source data were all extracted from organic crystals, and the band gap values were also computed using DFT.</p><p>1.2. Literature review. Bayesian neural networks have attracted considerable attention in recent years as a result of computational advances (e.g., <ref type="bibr">Wilson (2020)</ref>). One of the earliest works on Bayesian transfer learning in DNNs was <ref type="bibr">Wohlert et al. (2018)</ref>, where a single source task is considered and a DNN with feed forward layers is trained using mean field variational Bayes (VB; <ref type="bibr">Zhang et al. (2019)</ref>). The approximate posterior learned on the source task is used as a prior on the parameters for the target task. <ref type="bibr">Wohlert et al. (2018)</ref> did not, however, address the problem of freezing or training the transferred layers and surprisingly gave worse performance than training using only the target data. <ref type="bibr">Chandra and Kapoor (2020)</ref> introduced a new method for Bayesian multisource transfer learning where they proposed a new Markov chain Monte Carlo (MCMC) sampling scheme with parameter proposals for the target task based on proposals for all the source tasks. At first, all source task parameters are sampled, and then a single source for transfer of knowledge is used for the proposals for the target task. This method requires storing all source tasks data in memory together with the target task and does not fall under the two-stage inductive transfer-learning framework considered in our paper. <ref type="bibr">Bueno et al. (2019)</ref> used Bayesian transfer learning for volcanoseismic prediction and uncertainty quantification using variational inference. <ref type="bibr">Yang, Jiao and Sun (2020)</ref> focused on Bayesian hyperparameter optimization for transfer learning. <ref type="bibr">Zhou et al. (2020)</ref> proposed a new form of regularization that can be viewed as a Gaussian prior on the network weights where the Fisher information from the source task is used as the precision matrix. More generally, Bayesian transfer learning for models other than DNNs has been considered by other articles in the literature, most commonly attributable to the fact that it is natural to borrow strength across data sets via prior distributions (e.g., <ref type="bibr">Karbalayghareh, Qian and Dougherty (2018)</ref>).</p><p>The Bayesian transfer-learning methodology that we develop sequentially trains a DNN on a target data set by first specifying a prior distribution concentrated on parameter estimates for the DNN trained from a source data set. While this approach is sensible, the primary challenge is that constructing prior densities from pretrained DNN layers is not trivial because individual parameters are not identifiable nor do they have inherent meaning. Accordingly, to solve this issue we extend the fundamental notion of penalized complexity priors (PCPs) from <ref type="bibr">Simpson et al. (2017)</ref> to the deep-learning setting and specify our transfer-learning prior distribution in terms of the Kullback-Leibler divergence between the source and target model. This prior is constructed with the intuition that the predictive model is likely shared (to some extent) across tasks but is flexible enough to disregard the source task if appropriate.</p><p>The target data set in our materials science application is small, and so we implement a fully Bayesian analysis with computations via MCMC sampling strategies. However, since the source data set is large, a fully Bayesian analysis is prohibitive, and so we analyze the source data using both optimization and variational-inference (VI; <ref type="bibr">Blundell et al. (2015)</ref>) methods. Both methods provide point estimates for each parameter, but VI also provides (approximate) uncertainty quantification. Therefore, in addition to applying to cases where data sets from both the target and the source are available, our proposed method can be applied using source data DNNs trained by other users, such as ImageNet (Deng et al. ( <ref type="formula">2009</ref>)). In our exposition we develop our transfer-learning methods using the optimization-based source model and the VI-based source model in parallel, and we show that both provide improvements over traditional transfer-learning methods for both synthetic and real data.</p><p>The remainder of the paper proceeds as follows. Section 2 reviews background material on DNNs and transfer learning. Section 3 introduces the proposed PCP priors for transfer learning in DNNs. The proposed methods are then evaluated using simulated and real data in Sections 4 and 5, respectively. Section 6 concludes. The code for reproducing our empirical results is available at <ref type="url">https://github.ncsu.edu/mabba/Pybayes.git</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Background material.</head><p>2.1. Deep-learning model. We begin by briefly reviewing the DNN model; for a more comprehesive review, see <ref type="bibr">Goodfellow, Bengio and Courville (2016)</ref>. In general, DNNs are comprised of successive layers, starting with an input layer, followed by one or more hidden layers, and finally an output layer. Each layer contains a number of nodes that are connected to the next layer through weights that control the impact of a given layer on the next. For concreteness we describe the Bayesian transfer-learning model in the simple case of a continuous response and fully-connected feed forward neural network. However, the ideas proposed in this paper translate to other structures, including recurrent <ref type="bibr">(Medsker and Jain (2001)</ref>) and convolutional (LeCun, <ref type="bibr">Bengio et al. (1995)</ref>) networks (see Section 6 for further discussion).</p><p>A dense feed forward layer is a function l : R d -&#8594; R k characterized by a weight matrix W &#8712; R k&#215;d , a bias vector b &#8712; R k , and a real-valued activation function a applied elementwise to a vector argument. For x &#8712; R d , the dense layer applies an affine transformation to x followed by the activation function, l(x) = a(W x + b). A DNN with L hidden layers first applies an input layer, typically l 0 (x) = x, then L -1 hidden layers, and one output layer; each layer is assigned unique weights, biases, and (potentially) activation functions; that is, l i (x) = a i (W i x + b i ) for layer i &#8712; {1, . . . , L}. The composition of these L layers defines a function f from the input space X to the output space Y,</p><p>where &#952; := {&#952; 1 , . . . , &#952; L } and &#952; i := {b i , W i } are the parameters for layer i. For a regression task, we consider f (x; &#952;) to be the mean response given x, whereas for a classification task, f (x; &#952;) represents a vector of probabilities.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">Transfer learning.</head><p>Before discussing transfer learning for DNNs, we review general definitions and concepts of transfer learning. We adopt notation from <ref type="bibr">Pan and Yang (2009)</ref> and <ref type="bibr">Weiss, Khoshgoftaar and Wang (2016)</ref> whose early work has been widely adopted in the literature. A domain is composed of two parts, a feature space X and a sampling distribution p(X), where X denotes a set of instances X = {x i |x i &#8712; X , i = 1, . . . , n}. Accordingly, D = {X , p}. Next, a task (e.g., classification or prediction) consists of a label space Y and a decision function f ; that is, T = {Y, f }.</p><p>Transfer learning considers two domains: the source and the target. The main objective is to perform the target task in the target domain, and the analysis are supplemented by the related data from the source task (or multiple source tasks, e.g., <ref type="bibr">Maurer, Pontil and Romera-Paredes (2016)</ref>). For a source domain and task, denoted D S and T S , respectively, an observed data set is the collection {(x i , y i )|x i &#8712; X S , y i &#8712; Y S , 1 &#8804; i &#8804; n S }, and f S is understood as a conditional distribution or decision function for the instances y i , given</p><p>as the domain, task, and data for the target domain. DNNs typically require inductive transfer learning where the feature space is the same across tasks <ref type="bibr">(Pan and Yang (2009)</ref>), i.e., X S = X T . Therefore, we will drop the subscript on the feature space and simply use X . Note that this does not imply that the conditional decision functions or the sampling distributions of the features are the same for the source and target.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">Transfer learning with DNN architectures.</head><p>As discussed in Section 2.1, DNNs are composed of many layers, each performing a transformation of the data. These transformations can be viewed as learned representations. It has been argued that different layers may learn different concepts relating to the task <ref type="bibr">(Dube et al. (2020)</ref>). Specifically, there is evidence that early layers learn general representations of the data, while the the deeper layers are more task specific and learn specialized representations. In <ref type="bibr">Zeiler and Fergus (2013)</ref>, the authors studied the activation of early layers of DNNs in computer vision problems, where convolutional layers are typically used, and noted that early convolutional layers extract highlevel features with the potential to generalize to different image domains. Using this logic, it follows that transfer learning for DNNs amounts to determining how many early layers to share across tasks and how many to assign as task specific.</p><p>As defined in (1), in DNNs the tasks are defined by the weight parameters for each layer of the network. Assuming the same network architecture for both tasks, define &#952; S = {&#952; S1 , . . . , &#952; SL } and &#952; T = {&#952; T 1 , . . . , &#952; T L } as the parameters for the source and target tasks, respectively. A transfer-learning strategy with DNNs can be defined as the process of learning simultaneously the parameters &#952; S to augment the learning of &#952; T on the target task. The transferred layers can either be held fixed on the target task (referred to as freezing) or finetuned. Recently, <ref type="bibr">Dube et al. (2020)</ref> investigated the empirical performances of freezing and fine-tuning. In their work they focused on a computer vision task with pretrained layers from different architectures that were fit to the Imagenet data set. The conclusion was that freezing pretrained layers, although not optimal, was always better than random initialization. The best performance was obtained when the learning rate for the pretrained layers was significantly lower than the rate of the other layers in the model. They advocate for a factor of 10% as a default choice.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">PCPs for deep Bayesian transfer learning.</head><p>For the target task, let &#952; T &#8801; &#952; = {&#952; 1 , . . . , &#952; L }, and denote v i as the number of parameters in &#952; i ; for the source task, denote &#952; = { &#952; 1 , . . . , &#952;L } as the estimated values for &#952; that are trained from the source data, and when available, let i be the covariance matrix for &#952; i (e.g., the posterior covariance, given the source data). Our goal is to leverage these estimated parameters to construct an informative prior for the target task. If the tasks were the same, the natural solution would be to set &#952; = &#952; . On the other hand, if the tasks were not at all related, &#952; does not encode any information for the target task and would probably be worse than random initialization. In between these two extreme cases lies the core of transfer learning, where there is a reason to assume that tasks are related but we do not know to which degree.</p><p>The focus of our analysis is a judicious choice of the prior distribution for &#952; . Constructing a prior distribution that uses &#952; requires, first, the choice of a method for computing &#952; from the source data, and second, requires specification of the prior distribution for &#952; , given &#952; . As described in the next subsection, we use the PCP of <ref type="bibr">Simpson et al. (2017)</ref> for the prior distribution of &#952; , given &#952; . The remainder of this section provides an overview the PCP idea of <ref type="bibr">Simpson et al. (2017)</ref> and then describes two methods we propose for constructing &#952; . The PCP is derived for both methods of constructing &#952; .</p><p>3.1. Penalized complexity priors. In the framework of <ref type="bibr">Simpson et al. (2017)</ref>, the problem of prior choice is considered from a model complexity perspective. The prior on the parameter of interest &#952; is controlled by a flexibility parameter &#964; . The base (or simplest) model for &#952; , which we will denote by p 0 (&#952; ), corresponds to the case where &#964; = 0, and for larger values of &#964; , the prior deviates from the base model. Following Occam's razor, simple models should be preferred until there is evidence for more complex ones; in other words, the hyperprior on &#964; should favor the base model. PCPs, as defined in <ref type="bibr">Simpson et al. (2017)</ref>, give a principled way of choosing a prior on &#964; that controls the deviation from the base model by penalizing a scaled version of the Kullback-Liebler divergence from p 0 (&#952; ) to p(&#952;|&#964; ),</p><p>(2)</p><p>and notice that h(&#964; ) = 0 if and only if &#964; = 0. Furthermore, if h(&#8226;) is strictly increasing, penalising h(&#964; ) for large values induces a prior that penalizes large values of &#964; and, consequently, puts more mass close to the base model. <ref type="bibr">Simpson et al. (2017)</ref> recommend using an exponential distribution, h(&#964; ) &#8764; Exp(&#955;) to ensure a mode at &#964; = 0 and a constant rate of penalization for larger &#964; . Let</p><p>where N is the multivariate Gaussian density function, g is an increasing function, the flexibility parameter &#964; i controls the deviation from the base model in layer i, and &#964; = (&#964; 1 , . . . , &#964; L ).</p><p>The case &#964; = 0 is used to define the base model. This layerwise specification reflects the fact that some layers can be more transferable than others and hence require more penalization.</p><p>If we marginalize over &#964; , the prior model becomes a scale mixture of Gaussian distributions, where the mixing distribution will be the prior on &#964; . This latter distribution will be implicitly defined by placing an exponential distribution on h(&#964; ) = d KL (p(&#952; T |&#964; )||p 0 (&#952; T )). When L &gt; 1, the implicit prior on &#964; is not identifiable since the mapping h : R L + -&#8594; R + cannot be bijective and hence is not invertible. To circumvent this issue, <ref type="bibr">Simpson et al. (2017)</ref> extend the PCP prior to a multivariate parameter &#964; by having the prior on &#964; uniform on each level set of h(&#8226;). Instead, we opt for the simpler approach of constraining &#964; to the (L -1)simplex given by any weighted combination of its elements. This is equivalent to &#964; = &#964; c, where c &#8764; Dirichlet(1 L ) and &#964; &#8712; R + . In this formulation &#964; becomes a global flexibility parameter, and the weights c i control how much deviation each layer is allowed since &#964; i = &#964; c i . Thus, given the vector of weights c, we have a one-to-one mapping h c ( &#964; ) through which we have an explicit penalising prior on the global parameter &#964; .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">PCP for the VI case.</head><p>If the source data are analyzed using VB methods, then &#952; i is an approximate posterior mean and i is an approximate v i &#215; v i posterior covariance matrix. Because standard VB methods approximate the posterior as independent across parameters, i is a diagonal matrix for each i. We incorporate this information in the prior by setting g(&#964; ) = 1 + &#964; so that the base model with &#964; = 0 uses the posterior of the source data directly as the prior for the target data, which would be optimal Bayesian learning if the two tasks are the same. If &#964; i &gt; 0, then the prior variance increases to reflect uncertainty about the relationship between source and target tasks. Under this prior distribution, the KL divergence is</p><p>, the one-to-one mapping between d and &#964; is</p><p>where &#966;(x) = xlog(1 + x). Furthermore, &#966; is continuously differentiable and strictly increasing; hence, given c, we have a unique prior on &#964; corresponding to the desired prior on the KL divergence from the base model. The induced prior is <ref type="formula">4</ref>), coupled with the Dirichlet prior on the weight c, completely specifies a prior distribution on the vector of scales &#964; . Using numerical inversion of the mapping in (3), sampling from this prior is straightforward.</p><p>It can be shown that the induced prior on the global flexibility parameter in (4) has a mode at zero with a strictly decreasing density, as &#964; increases. Also, the tail of the prior behaves like a modified Weibull distribution <ref type="bibr">(Almalki and Nadarajah (2014)</ref>) with rate &#955; v i c i and shape 0.5. Figure <ref type="figure">1</ref> plots the density when &#955; = 1.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.">PCP for the point estimate case.</head><p>Assume that a point estimate &#952; is derived from the source data but no measure of uncertainty is provided. In this case the source data does not define a base distribution for &#952; , and thus we cannot compute the KL divergence between base and full models for &#952; without further assumptions. Since DNNs are primarily used for prediction, we place a prior on the KL divergence between the predictive model under the source and target models. Let f (x|&#952; ) denote the target DNN output for a given input x and parameter values (&#952;). Let the regression model likelihood be p(y) &#8764; Normal(f (x|&#952;), &#963; 2 ) and &#952; i &#8764; Normal( &#952; i , &#964; i I), which induces a prior distribution on the function f . Unfortunately, for the DNN model it is not available in analytical form. To overcome this, we approximate the DNN output using a first-order Taylor approximation around &#952;</p><p>For small values of &#964; (i.e., the most relevant values for the prior, assuming the target and source are similar), a first-order approximation is arguably tight enough. Furthermore, if the activation functions used in the model are piecewise linear, like the widely used ReLU function <ref type="bibr">(Agarap (2018)</ref>), the output function f (x|&#952; ) will also be piecewise linear, and we cannot go beyond a first-order Taylor expansion.</p><p>Based on the approximation, for the base model with &#964; = 0, we get the prior distribution</p><p>and for the flexible model, the prior on f (y| &#964; , c) is</p><p>where &#945;(x) = ( &#8711; &#952; i f (x| &#952; , ) 2 ) 1&#8804;i&#8804;L . Now that we have two normal models, an analytic expression for the KL distance is</p><p>In equation ( <ref type="formula">6</ref>) &#945;(x) depends on the gradient of f (x| &#952; ) for a given input point x. Assuming that the inputs are identically distributed and we have N target data points, the marginal KL divergence can be approximated by</p><p>Using (7), we have a one-to-one mapping between d = &#8730; 2KL(p||p 0 ) and the global flexibility parameter &#964; . Hence, an exponential distribution on d induces a prior on &#964; , which can be obtained with the same simple change of variables as in (4). Let</p><p>The form of the prior in ( <ref type="formula">8</ref>) is similar to (4): in both cases the prior induced on &#964; has mode at zero, is a strictly decreasing density as &#964; increases, and has the same tail behavior.</p><p>We evaluate the approximation used in (5) to verify that the derived prior on &#964; will result in an approximately exponential distribution on the KL divergence between the two models. We assume L = 3 layers with {64, 32, 1} nodes, respectively. The source-data estimates &#952; i are generated following the Glorot initialization scheme <ref type="bibr">(Glorot and Bengio (2010)</ref>). Since we cannot compute the KL divergence analytically, the distribution of KL divergence is approximated with Monte Carlo sampling. The approximation is evaluated for 50 different target data sets generated, as described in Section 4. For each of those data sets, we compute the gradients in (5) and first draw c and &#964; from their priors for different values of the rate parameter &#955;, then sample &#952; i |&#964; &#8764; Normal( &#952; i , &#964; i I). We then sample 20,000 replications of the model output f (x; &#952; ) and approximate the KL divergence from the base model f (x; &#952; ) for each replication to get the empirical distribution of the KL divergence. Figure <ref type="figure">2</ref> plots the cumulative hazard function of the scaled KL divergence d, which should be linear with slope &#955; if the distribution is Exponential(&#955;). The approximation holds near the origin for all &#955; and is tighter for the entire distribution for larger values of &#955;. </p><p>and the target data are generated, for constant k 2 , as</p><p>We set p = 30 covariates, so x i &#8712; R p , &#961; = 0.5, &#963; = 1, k 1 = 15, and k 2 = k 1 + k with k &#8712; {0, 5, 10, 15}, and we generate 1000 synthetic source training observations with a varying number of target training observations n &#8712; {30, 50, 70}. The constant c is set so that the signal-to-noise ratio is 4:1 for the target data (i.e., so the variance of c&#956; 2 (x i ) is 4). If k = 0, then the two data-generating processes are identical, and if k is large, they are dissimilar. For each scenario we simulate 500 data sets and compare predictions on a test set of size n test = 200.</p><p>Both the source and target data are analyzed using the fully-connected model with four hidden layers having widths 24, 16, 12, and 8, respectively. The source data are fit using the optimization scheme provided in Section 2 of the Supplementary Material <ref type="bibr">(Abba et al. (2023)</ref>); this produces estimates &#952; and their variances in the case of VI. We then fit several models to each target data set. The first group are non-Bayesian optimization-based transferlearning "TL" methods. We consider two methods that fix some layers using the source fit and tune the remaining layers using the target data. The first model "TL1" shares no layers and is fit to the target data with no connection to the source data. The second model "TL2" proceeds in two stages; first, the output layer only is trained on the target data while the others are frozen, and next, in the second stage all layers are fine tuned.</p><p>The second group of methods are Bayesian. The first Bayesian model "BNN" ignores the source data by setting the prior &#952; i |&#964; &#8764; Normal(0, &#964; i I) and &#964; i &#8764; InvGamma(2, 1) so that the marginal standard deviation is 1. Although there is no consensus on the default prior choice in Bayesian deep learning, priors with zero mean and unit standard deviation are the most common <ref type="bibr">(Fortuin (2022)</ref>). The second method, "BTL-PCP-PE," fits the Bayesian transfer-learning model with the priors centered at point estimates &#952; alone, as described in Section 3.3. The third model, "Bayes-PCP-VI," uses the PCP prior based on VI, as described in Section 3.2. For both PCP methods, we assume c &#8764; Dirichlet(1 L ) and set &#955; so that the correlation between f (x i ; &#952;) and Y i is 0.5. All Bayesian method are fit using MCMC, as described in Section 3 of the Supplementary Material <ref type="bibr">(Abba et al. (2023)</ref>).</p><p>The results are compared using MSE, and for the Bayesian methods, the coverage and width of 95% prediction intervals for &#956; 2 (x i ) over a target data test set of 200 observations is provided. The results are reported in Table <ref type="table">1</ref>. BLT-PCP-PE outperforms TL1 and TL2 in all cases, perhaps due to the added stability of prior distributions. When the source and target are similar (i.e., k &#8712; {0, 5}), all the transfer-learning methods work well, especially if the number of training samples is small. When the discrepancy between the source and target domain is high, however, the transfer-learning methods do not improve the performance of the models. In fact, the point estimate method "TL-1" outperforms "TL-2," and the Bayesian methods are comparable. An interesting result is the poor performance of the PCP prior for the VI case compared to the other Bayesian methods. It seems that building a PCP prior, based on the mean-field VI posterior approximation, does not encode enough information for the model to learn from small data sets. However, while VI does not perform as well as MCMC, it is much faster than MCMC and still outperforms TL1 and TL2 in most cases and is thus a viable option for large data sets. The average computational time for each method is reprted in Table <ref type="table">2</ref>. Furthermore, when k is large, "BNN" outperforms all the other methods. This is expected since the prior distribution in the PCP has a sharp mode at zero which results in a strong penalizing effect. Thus, when the data sets are dissimilar and the number of target training samples is small, BNN performs better. Perhaps choosing a different distribution for the prior, with heavier tails, on the scaled Kullback-Leibler divergence could reduce this dependence on the source in such cases. That being said, this could also lead to a less sharp mode at the origin and hence less concentration around the true solution when the data sets are similar.</p><p>To mimic the the real data analysis in Section 5, we conduct a second set of simulations with the same generative model as above but with p = 1000 covariates, &#961; = 0.5, &#963; = 0.32, and the constant c = 1 to approximate the 3:1 signal-to-noise in the data analysis. The number of active covariates is determined by k 1 = 900 and k 2 = k 1 + k with k &#8712; {0, 100}; if k = 0, then the two data-generating processes are identical, and if k is large, they are similar but not identical. We generate 10,000 synthetic source training observations and n = 500 target training observations. For each scenario we simulate 100 data sets and compare predictions on a test set of size n test = 10,000. For these larger data sets, we also consider the VI approach of <ref type="bibr">Zhou et al. (2020)</ref>. The results in Table <ref type="table">3 resemble those in Table 1</ref>; that is, the BTL-PCP-PE approach has the smallest MSE and coverage near the nominal level.</p><p>TABLE <ref type="table">1</ref> Simulation study results: The non-Bayesian methods ("TL1-TL2") use transfer learning by fixing different numbers of layers of the network using source data, the Bayesian methods are the Bayesian model without transfer learning ("BNN") or full Bayesian transfer-learning model with point estimate ("BTL-PCP-PE") and VI ("BTL-PCP-VI") in the first stage. <ref type="bibr">Table (a)</ref> gives the mean square prediction error (Monte-Carlo standard errors) over the 500 replicated data sets by the difference between the number of active covariates over tasks, k, and size of the target data set, n. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Real data analysis.</head><p>We apply the proposed transfer-learning methods for band gap prediction of the molecular crystal target data set. For training we consider only subsets of the data with cardinality 1000, 2500, or 5000 samples to represent a typical data set size, a validation set of 10,000 samples, and finally a testing set of 20,000 samples. Since we are dealing with molecules, we first need to preprocess the data and compute descriptors x that can be fed into the DNN. We use the MBTR descriptor method <ref type="bibr">(Huo and Rupp (2018)</ref>) to compute p = 1260 descriptors for every data point in both the source and target data sets. These descriptors are functions of the structure of the material, for example, the types and configuration of its atoms. The architecture of the model will have two hidden layers with 128 and 64 neurons, respectively. First, the model is trained on the source data with 40,000 samples for training set and 10,000 for the validation. The parameters of the best performing model in terms of mean squared error (MSE) are saved and transferred to the target task as &#952; .</p><p>On the target task, we consider four different transfer-learning methods. The non-Bayesian methods differ in the treatment of the hidden layers of the model; we can either freeze the hidden layers and treat them as feature extractors and only fit the output layer to the target task "TL-freeze," or we can fine-tune the hidden layers along with the output layer on the target task "TL-fine-tune." For both Bayesian methods, the priors are &#952; i |&#964; &#8764; Normal( &#952; i , &#964; i I). The two methods differ in the priors on &#964; = (&#964; 1 , &#964; 2 , &#964; 3 ); we compare the PCP with point estimate approach "BTL-PCP-PE" from Section 3.3 with c &#8764; Dirichlet(1, 1, 1) to the uninformative prior approach with &#964; i &#8764; InvGamma(2, 1) "BTL-BNN." Since the point estimate approach outperformed the VI approach in the simulation study, we consider only the point estimate approach in this data analysis. To verify that transfer learning provides benefit over using only the target data, we compare to the state-of-the-art DNN model used in materials science where DNNs have been developed as end-to-end models in the sense that they take as input the molecular representation and learn their own embedding. Two of the leading methods are SHNET <ref type="bibr">(Sch&#252;tt et al. (2017)</ref>) and MEGNET <ref type="bibr">(Chen et al. (2019)</ref>).</p><p>The target data are split into groups of size 5000, 10,000, and 20,000 for training so that each group contains materials of different classes and the band gap distribution stays roughly the same. We train the model for samples of size n &#8712; {1000, 2500, 5000}. Figure <ref type="figure">3</ref> plots the MSE on a test set of size 20,000 for each method and training set, and Figure <ref type="figure">4</ref> plots the observed and predicted values for the BTL-PCP-PE method. As expected, MSE decreases for each method as the size training set increases, and in all cases the BTL-PCP-PE method gives the smallest MSE.</p><p>With a fully Bayesian treatment of all the parameters, we can look at the summary statistics of c, the parameter that controls which layers contain the useful information from the source data and which are irrelevant. For training set size 5000, the posterior means (standard deviation) for c 1 , c 2 , and c 3 are 0.05 (0.02), 0.05 (0.03), and 0.90 (0.15), respectively. Therefore, the first two layers are shrunk toward the source data fits while the output layer varies from the source-model fit. The Bayesian methods also provide prediction intervals. The empirical coverage and average width of 95% prediction intervals for the test set are, respectively, 0.91 and 1.24 for BTL-BNN and 0.94 and 1.16 for BTL-PCP-PE.</p><p>These results are competitive with state-of-the-art methods in the materials community. For a training set of size 5000 (the same 5000 as in Figure <ref type="figure">3</ref>), the MSE for SHNET and MEGNET are 0.48 eV 2 and 1.01 eV 2 , respectively. In fact, using the same data except with a much larger training set of 30,000 observations, the methods achieved MSE of 0.59 eV 2 for SHNET and 0.34 eV 2 for MEGNET.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Conclusions.</head><p>For molecular crystals the computational cost of band gap values can be orders of magnitude higher in comparison to organic molecules. Recently, DNN models reached chemical accuracy levels for band gap prediction on small organic molecules and can now be reliably used as a fast screening method. However, these models often require large data sets for training and can have unstable performance on small data sets. Using transfer learning, we leverage the accuracy of neural networks models on organic molecules to build a data efficient model with accurate predictions and calibrated uncertainty quantification for molecular crystals band gap prediction. Our new transfer-learning methods provide regularization by centering the prior distribution on estimates from an auxiliary source data set, that is, organic molecules. We use the PCP framework to ensure that the prior concentrates around the source model but is allowed to deviate if appropriate. We develop two methods for cases where the source data analysis does and does not provide uncertainty measures for the parameter estimates. We show via simulation that the proposed methods reduce prediction error, compared to standard transfer-learning methods, and unlike standard methods, the Bayesian approach gives reasonable coverage for prediction intervals.</p><p>The accuracy of our method for large molecular crystals matches state-of-the-art models while only requiring a sixth of the training data. The performance on both simulated and real data sets indicate that the methods can be used to guide and optimize experimentation and selection of materials with specific properties without the need for a large training sample, hence reducing the cost associated with DFT calculations. The potential scope of the application of the developed transfer-learning methods goes beyond material science and includes areas of applied statistical learning where data labelling is costly and auxiliary source tasks are available.</p><p>There are many areas of future work. We have developed our method in the simplest case of a continuous response and feed forward network. The prior based on VI in Section 3.2 would apply directly to other networks and response distributions, as the prior is only a function of the approximate Gaussian posterior distribution from the source data analysis. Similarly, the prior based on point estimates in Section 3.3 can be applied without modification to non-Gaussian responses and richer architecture. Changing the network architecture would change the form of the gradients in (5), but the method itself can be used without modification. The method also applies for noncontinuous responses if we view f as a process that spans the real line that is related to the response distribution. For example, for binary data, f in (5) could be the logistic function of the success probability, which spans the real line, and thus the proposed methods could be applied on this scale. It may also be possible to extend the PCP prior from neural networks to other frameworks such as tree-based methods (e.g., <ref type="bibr">Chen and Guestrin (2016)</ref>, <ref type="bibr">Chipman, George and McCulloch (2010)</ref>).</p><p>Next, our method applies an informative prior on the overall variance parameter but a uniform prior on the distribution of the variance across levels, c. If prior information about the transferability of different layers is available, it could be incorporated in the prior for c. For example, it may be reasonable to assume the prior mean of c i increases from the input to the output layer. Lastly, another interesting area of future work is to compare the two-stage analysis that sequentially analyzes the source then target data with a simultaneous analysis of all data sources. Here we have assumed that building a hierarchical model for all data sources is computationally prohibitive, but it would be interesting to compare the efficiency of these two approaches when possible, especially when the source data set is small and thus the parameter estimates are uncertain.</p></div></body>
		</text>
</TEI>
