{'fraction_non_alphanumeric': 0.031626367564585825, 'fraction_numerical': 0.008856608746284208, 'mean_word_length': 5.031792975970425, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Improving Direct Physical Properties Prediction of Heterogeneous Materials from Imaging Data via Convolutional Neural Network and a Morphology-Aware Generative Model

Direct prediction of material properties from microstructures through statistical models has shown to be a potential approach to accelerating computational material design with large design spaces. However, statistical modeling of highly nonlinear mappings defined on high-dimensional microstructure spaces is known to be data-demanding. Thus, the added value of such predictive models diminishes in common cases where material samples (in forms of 2D or 3D microstructures) become costly to acquire either experimentally or computationally. To this end, we propose a generative machine learning model that creates an arbitrary amount of artificial material samples with negligible computation cost, when trained on only a limited amount of authentic samples. The key contribution of this work is the introduction of a morphology constraint to the training of the generative model, that enforces the resultant artificial material samples to have the same morphology distribution as the authentic ones. We show empirically that the proposed model creates artificial samples that better match with the authentic ones in material property distributions than those generated from a state-of-the-art Markov Random Field model, and thus is more effective at improving the prediction performance of a predictive structure-property model.


Introduction
Direct prediction of material properties through predictive models has attracted interests from both material and data science communities. Predictive models have the potential to mimic highly nonlinear physics-based mappings, thus reducing dependencies on numerical simulations or experiments during material design, and enabling tractable discovery of novel yet complex material systems [1,2,3]. Nonetheless, the construction of predictive models for nonlinear functions, such as material structure-property mappings, is known to be datademanding, especially when the inputs, e.g., material microstructures represented as 2D or 3D images, are high-dimensional [4]. Thus, the added value of predictive models quickly diminishes as the acquisition cost increases for material samples. We investigate in this paper a computational approach to generate artificial material samples with negligible cost, by exploiting the fact that all samples within one material system share similar morphology. More concretely, we define morphology as a style vector quantified from a microstructure sample, and propose a generative model that learns from a small set of authentic samples, and creates an arbitrary amount of artificial samples that share the same distribution of morphologies as the authentic ones.
The key contribution of the paper is the introduction of a morphology constraint on the generative model that significantly improves the morphological consistency between the artificial and authentic samples from benchmark generative models. To demonstrate the utility of the proposed model, we run a case study on the prediction of the Young's modulus, the diffusion coefficient and the permeability coefficient of sandstone microstructures. We show that the generated artificial samples from the proposed model can improve the prediction performance more effectively than those from a state-of-the-art Markov Random Field (MRF) model.
As an overview, the proposed model follows the architecture of a variational autoencoder [5] that learns to encode material microstructures into a lower-dimensional latent space and to decode samples from the latent space back into microstructures. Both the encoder and the decoder are composed of feed-forward convolutional neural networks for extracting and generating local morphological patterns, and are jointly trained to minimize the discrepancy between the artificial and authentic samples. The target morphology is quantified from the authentic samples by an auxiliary network. The idea of quantifying material morphology through a deep network is inspired by the style transfer technique originally developed for image synthesis [6].
The rest of the paper is structured as follows: In Sec. 2 we review related work on material representations and reconstruction, based on which we delineate the novelty of this paper. We then introduce background knowledge on variational autoencoder and style transfer. Sec. 3 elaborates on the details of the proposed model. Sec. 4 presents a case study on the prediction of sandstone properties, where we demonstrate the superior performance of the proposed model against the benchmarks, in both microstructure generation, and the resultant property prediction accuracy. In Sec. 5 we summarize findings from the case study and propose potential future directions. Sec. 6 concludes the paper.

Data science challenges in computational material science
Incorporating data science into material discovery [1] and design [7] faces unique challenges with high dimensionality of material representations and the lack of material data due to high acquisition costs. We review existing work that address these challenges to some extent.
Challenge 1: Mechanisms for understanding material representations. A common approach to addressing the issue of high dimensionality is to seek for a representation, i.e., an encoderdecoder pair, for a material system: The encoder transforms microstructures to their reduced representations, and the decoder generates (i.e., reconstructs) them back from their representations. A good encoder-decoder pair should both achieve significant dimension reduction, and good matching between the data distribution (i.e., the distribution of authentic samples) and the model distribution (i.e., the distribution defined by the decoder). This is often feasible for material systems with consistent and quantifiable morphologies among their samples, as reviewed below.
Decoding of representations, i.e., generation of microstructure through existing physical and statistical representations, involves optimization in the microstructure space: For physical representations and N-point correlation functions, a microstructure is searched to minimize its difference from the target descriptors. For random fields, the generation can be done by maximizing the joint probability through Markov chain Monte Carlo simulations [35,36]. While it is shown that material generation through these representations is feasible [18,22,8,11], the computational costs for the optimization through gradient [32,11] and non-gradient [28,39,40,41] methods are often high.
In addition to the difficulties in decoding, the existing encoders are not universally applicable, especially to material systems with complex morphology. More specifically, matching in the representation space does not guarantee the match in the microstructure space. An example can be found in Fig. 1, where we compare two-point correlation functions of Ti64 alloy samples and three sets of artificial images (see details from [35,42,43]). The visually more plausible set has worse match to the target with respect to the Euclidean distance in the discretized 2-point correlation space.  [35], samples generated by a hybrid model with deep belief network and Markov random field [43], and samples generated by a deep belief network [42]. Better matching in the discretized 2-point correlation space does not indicate better microstructure generations.
These existing difficulties leads to the need for new mechanisms to define material representations. We propose four metrics for evaluating the utility of a material representation: interpretability, dimensionality, expressiveness, and generation cost: Physical descriptors and correlation functions are designed to be interpretable and relatively low dimensional, yet may not be expressive enough to capture complex morphologies and requires optimization during generation; random fields are relatively expressive (and some permit fast generation [35]), but are often high-dimensional and less interpretable. Both categories of representations are material specific, i.e., new representations need to be manually identified for new material systems. Cang et al. [42] proposed to learn statistical generative models from microstructures to automatically derive expressive, low dimensional representations that enables fast microstructure generation. They showed that a particular type of generative model, called Convolutional Deep Belief Network (CDBN) [44], can produce reasonable microstructures for material systems with complex morphologies, by extracting morphology patterns at different length scales from samples, and decode an arrangement of these patterns (the hidden activation of the network) back into a microstructure. Nonetheless, CDBNs are trained layer-by-layer, and thus require additional material-dependent parameter tuning to achieve plausible generations.
Different from [42], this paper proposes a model that directly enforces the matching of the artificial microstructures to the authentic ones, thus avoiding additional parameter tuning. Our model is also fully differentiable, making it much easier to train than CDBNs and scalable to deep architectures. Lastly, the introduction of the morphology constraint further refines the artificial microstructures under a small amount of training data. With all these improvements, the proposed model is generally applicable to the extraction of low dimensional material representations, and is expressive for generating microstructures with morphologies of decent complexity.
Challenge 2: Effective material data acquisition methods. Unlike scenarios in contemporary machine learning where a large quantity of data is available, in computational material design tasks we may only have a limited amount of microstructure and property samples, and the acquisition cost for additional samples is usually high. This challenge calls for the incorporation of active learning methods into the design. The key idea of active learning is to minimize the data acquisition cost for learning a model (e.g., generative models for capturing microstructure distributions, or discriminative models for predicting processstructure-property mappings), by optimally controlling the balance between data exploitation and exploration [45,46]. In computational material science, such techniques have been adopted to accelerate the process of material discovery for desired properties [47,48]. While this paper does not focus directly on active learning, we demonstrate that the quality of the microstructure data, along with its quantity, can significantly influence the prediction performance of a statistical structure-property mapping, and thus justify the value of the proposed generative model.

Preliminaries on predictive and generative models
This paper will involve three networks: The generative network for creating artificial material microstructures, the auxiliary convolutional network for quantifying material morphologies, and another convolutional network for structure-property prediction. We provide technical backgrounds for these models below.
Generation through Variational Autoencoder. Variational autoencoders (VAE) [5] are extensions of autoencoders [49]. An autoencoder (Fig. 2a) is composed by two parts: an encoder z = f (x) converts the input x to a hidden vector z, and a decoder produces a reconstruction x = g(z). An AE is trained to minimize the discrepancy between inputs x and their corresponding reconstructionsx. Variants of autoencoders (e.g., Sparse [50], denoising [51], and contractive [52]) have been proposed to improve the learning of more concise representations from high-dimensional input data, and are widely used for data compression [53], network pre-training [54], and feature extraction [55]. However, conventional autoencoders are prone to generating implausible new outputs, see Fig. 7b for examples, as they do not attempt to match the model distribution (the distribution of images generated from the decoder) with the data distribution (the distribution of input images). VAE (Fig. 2b) was introduced to address this issue [5], by constraining the distribution of the latent variables z encoded from the input data to that used for output generation, thus indirectly forcing the match between the distributions of the model outputs and the data.
The VAE model. We start with the decoder, which defines the output distribution, p θ (x|z), conditioned on the latent vector z, and is parameterized by θ. Let the input data be , which defines a data distribution p(x), and let p(z) be the pre-specified sampling distribution in the latent space. The goal is to train a model that matches the marginal distribution p θ (x) to the data distribution p(x). In the following, we show that this is indirectly achieved by matching the posterior p θ (z|x) to p(z). First, the marginal is defined as Matching the model and data distributions requires maximizing the likelihood Π x∈X p θ (x) with respect to θ. This maximization problem, however, is often intractable due to the numerical integral and the complexity of the decoder network. Nonetheless, it is noted that for a given x, most samples in the latent space will have p θ (x|z) ≈ 0, as these latent samples do not generate outputs close to x. This leads to the idea of introducing another distribution q φ (z|x) (the encoder) that takes an x and outputs z values that are likely to reproduce x. Ideally, the space of z that are likely under q will be much smaller than that under p(z), making the computation of E z∼q p θ (x|z) relatively cheap. However, E z∼q p θ (x|z) is not the same as p(x), as q φ (z|x) does not necessarily match to p(z). The relation between the two is derived below. We start by deriving the Kullback-Leibler divergence between the encoded latent distribution q φ (z|x) and the posterior p θ (z|x): By rearranging Eq. (2), we get Note that the right hand side of Eq. (3) can be maximized through stochastic gradient descent: The first term E z∼q [log p θ(x|z) ] measures the reconstruction error, i.e., the expected difference between an input x and its reconstructions drawn from the decoder conditioned on the latent variables, which are further drawn from the encoder conditioned on the input. The second term D KL (q φ (z|x)||p(z)) measures the difference between the encoded distribution of z and the modeled latent distribution p(z). Since the encoding and decoding processes involved in these terms are modeled as feedforward networks, the gradients are readily available for backpropagation. Specifically, we model q φ (z|x) = N (z|µ(x; φ), Σ 2 (x; φ)) as a normal distribution parameterized by the mean µ(x; φ) and the diagonal variance matrix Σ 2 (x; φ). µ and Σ are the outputs of the encoder network. We similarly model p θ(x|z) = N (x|f(z; θ), σ 2 I) with mean f(z; θ) and variance σ 2 . The function f(z; θ) is the decoder network; σ determines the importance of the reconstruction of x during the training of a generative model, and is set to 1 in the proposed model. The prior of the latent distribution, p(z), is often assumed to be standard normal. This is because the transformation from this simple distribution to the potentially highly nonlinear data distribution p(x) can often be achieved by a sufficiently deep decoder.
The left hand side of Eq. (3) contains the objective log p θ (x) that we want to maximize, and the KL-divergence D KL (q φ (z|x)||p θ (z|x)) > 0 that should ideally reach 0. Thus, minimizing will maximize a lower bound of p(x).
Prediction through Convolutional Neural Network (CNN). We build a predictive structureproperty model using CNN (Sec. 3). A CNN is often composed of one or more convolutional layers followed by fully connected layers. A convolutional layer consists of a set of image filters, each as a set of network edges connecting the input image to a hidden channel, see Fig. 3. Scanning the input image with a filter requires the network weights to be shared, thus reducing the total number of weights to be trained. A max-pooling layer further reduces the dimension of a hidden layer [56]. Style transfer (ST). ST was first introduced to integrate the content of one image with the style of another [6]. To perform ST, a "style vector" is first computed for an image, that consists of the variance-covariance matrices of the hidden states of a pre-trained CNN (we use a VGG Net [57] in this paper) activated by the input image. A new image can then be created by minimizing the difference between its style vector and the target one. One can also preserve the image content, i.e., the hidden states of the deepest layers, by adding an additional loss on the content difference.
As will be discussed in Sec. 3, the proposed method extends ST to a generative setting, by directly adding a style (morphology) penalty to the training loss of a VAE. There are two major difference in comparison: First, the standard ST generates images by minimizing the style loss with respect to a high-dimensional image space, while our model is learned to directly generate style-consistent images, thus is significantly faster than standard ST; second, the standard ST uses a single style vector as a target, while our model can encode a distribution of styles in its latent space, and thus is more expressive as a generator.

Network specifications
The generative model. The proposed generative model is composed of two networks, a VAE for image encoding and decoding, and an auxiliary network for computing the style vector (G). See model summary in Fig. 4a. For the VAE, its encoder has convolutional layers of a fixed filter size (4 × 4), max-pooling layers after each other convolutional layers, and two fully-connected layers of sizes 256 and 16, respectively. Each pooling layer is of stride 2, i.e., it is composed with filters of size 2 × 2 applied to the hidden layers, downsampling these layers by a factor of 2 along both width and height. Together, the encoder reduces the dimension of the input from 128 × 128 to 16 × 1. The architecture of the decoder is symmetric to that of the encoder. The predictive model. A CNN is built to predict material properties from microstructures. A schematic of the predictive model is in Fig. 4b. We use four convolutional layers with filter size 3 × 3, and max-pooling layers with stride 2.
The morphology style model. To acquire a rich set of morphology patterns and make this acquisition process general, we propose to use a VGG network [58] as the morphology model. A VGG is trained on over a million images [59] to learn a rich set of feature representations. The schematic for the proposed morphology-aware VAE is shown as Fig. 5.
where L RECON + L KL are the standard reconstruction and KL divergence losses for VAE (see Sec. 2.2), L ST is the style loss, and L MC is an additional loss to prevent mode collapse (introduced below). The reconstruction loss measures the reconstruction error of all pairs of authentic microstructures (x i ∈ X ) and their reconstructions. The KL divergence loss measures the difference between the encoder distribution q φ (z|x i ) and the prior p(z). The style loss measures the total style difference between two sets of N images with indices s and p, representing the generated and the authentic ones, respectively. Given a morphology style model, the Gram matrix G s,l of image s at the lth hidden layer is defined through elements G s,l i,j = k f s,l i,k f s,l j,k , where feature element f s,l i,k represents the hidden activation corresponding to the ith convolutional filter at spatial location k. || · || F is the Frobenius normal. We note that the definition of feature maps will affect the outcome of style transfer. In general, deeper layers capture styles at larger length scales. We use the first four layers of a standard VGG net. This definition of features is empirical.
Lastly, the mode collapse loss is introduced to prevent the model from producing clustered samples [60], by forcing the generated samples to be different in terms of their activations in the style network. The loss is defined as: where the style vector s contains the concatenated and vectorized Gram matrices as defined above.
The training of the generative model. The generative model is trained to minimize the loss defined in Eq. (5) with respect to model parameters θ and φ through stochastic gradient descent. To approximate the gradient of the loss, ∇ θ,φ (L RECON + L KL + L ST + L MC ), we randomly sample 20 authentic material microstructures from X and generate another 20 artificial microstructures in each training iteration. The artificial microstructures are needed to calculate ∇ θ,φ (L ST + L MC ). To prevent neighbouring latent samples to be matched to drastically different style (morphology) targets, we propose to create artificial microstructures by the following procedure: We take each authentic sample x and pass it through the encoder to get µ(x; φ) and Σ(x; φ). We then draw a random sample z from the latent space following the normal distribution N (z|µ(x; φ), Σ(x; φ)), and derive its decoded microstructure x = f (z; θ) to pair with x. By matching the style of x and x , we ensure that samples close to each other in the latent space will have similar morphologies. We demonstrate the necessity of this treatment in Fig. 6, where we show the generation results from an alternative method where microstructures from a standard normal distribution are randomly paired with the authentic ones for style loss calculation, leading to averaged morphology across all random generations (Fig. 6b). We use Adam optimizer [61] for training, with 200K iterations and a learning rate of 0.001.
The training of the predictive model. We divide the raw data into training, validation, and test sets. The loss function for training the predictive structure-property model is the mean square error of the predicted properties of the training data. Prediction performance of the model on the validation set is monitored to prevent the model from overfitting. The performance of the model is then measured by R-square value of the test data. We use Adam for training with a learning rate of 0.001.

Case Study and Results
In this section, we demonstrate key contributions of the proposed model through a case study: (1) By incorporating the style loss, the proposed generative model creates material microstructures with better visual and statistical similarity to the authentic ones than a state-of-the-art Markov random field (MRF) approach; and (2) we can improve the prediction of material properties more effectively by using the artificial data generated from the proposed model than by those generated from a MRF. The case study uses a set of sandstone microstructures and their properties, including Young's modulus, diffusivity, and fluid permeability. Details of this material system are introduced as follows.

A case study on the sandstone system
Sandstones are a class of important geological porous materials in petroleum engineering. In the simplest form, a mono-mineral sandstone is composed of a solid (rock) phase and a pore (void) phase, both of which are typically percolating. Extensive research work has been carried out to model the microstructure and physical properties of such porous materials [62,63,64,65,66,67,68,69,70,30]. For example, a fast and independent architecture of artificial neural network has been developed for accurately predicting fluid permeability [71].
We will focus on three different material properties: Young's modulus (stiffness) E, diffusivity D and fluid permeability k. These properties are respectively sensitive to distinct microstructural features of the materials. In particular, E is mainly determined by the morphology and volume fraction of the rock phase. The diffusivity D is most sensitive to the local pore size distribution. The fluid permeability k depends on the degree of connectivity of the pore phase as well as the pore/rock interface morphology. Thus, successfully improving the prediction accuracy for all three material properties poses a stringent test for our morphology-aware generative model for effectively populating the microstructure sample space.
Physics-based material property calculations. The material properties used to train the network model are first computed using the effective medium theory [8]. The Young's modulus can be written as where K e and G e are respectively the bulk and shear modulus of the materials. We use analytical approximations of K e and G e obtained by truncating the associated strong-contrast expansions after the third order term [72], which are respectively given by and where φ 1 and φ 2 are respectively the volume fraction of the rock phase and void phase (i.e., porosity); d is the spatial dimension of the material system; K p and G p are respectively the bulk and shear modulus of phase p; and the scalar parameters κ pq and µ pq (p, q = 1, 2, e) are respectively the bulk and shear modulus polarizability, i.e, and The quantities χ and η 2 are the microstructural parameters associated with the void (pore) phase involving the three-point correlation functions S 3 and two-point correlation functions S 2 of the pore phase, i.e., and where t = (r 2 + s 2 − 2rs cos θ) 1/2 , and P 2 and P 4 are respectively the Legendre polynomials of order two and four, i.e., In our system, the void phase possesses zero elastic moduli, i.e., K 2 = G 2 = 0, and the moduli of the rock phase are respectively K 1 = 4.3 GPa and G 2 = 3.8 GPa. The three-point parameters χ and η 2 are computed by first evaluating the correlation functions S 3 and S 2 of the void phase from the microstructure data and then evaluating the integrals. In the reported results, the overall Young's modulus of the sandstone is re-scaled with respect to that of the rock phase. Similar to the elastic moduli, we use an analytical approximation [73,74] obtained by truncating the strong-contrast expansion of the effective diffusion coefficient D after the third order term: where φ 1 and φ 2 are respectively the volume fraction of the rock and pore phases. The polarization parameter β 12 is given by where D 1 and D 2 are respectively the diffusivity of the rock and pore phases. In our sandstone system, the rock diffusivity is typically negligibly small compared with the pore phase diffusivity, and thus D 1 /D 2 ≈ 0. The three-point parameter χ for the rock phase is given by Eq. (15), in which the correlation function S 3 and S 2 are computed from the microstructural data for the rock phase (instead of the pore phase as in the case of elastic moduli). The computed D values are normalized with respect to D 2 in the reported data. Finally, the fluid permeability is computed using the approximation [75] where φ 2 is the volume fraction of the pore phase and S 2 is the associated two-point correlation function.

Results
The effect of style loss on material generation. In Fig. 7, we show that a standard VAE has undesirable generation performance with a small training set (200 samples), and that the incorporation of the style loss can effectively improve the generation quality under the same sample size. Further, the proposed approach also produces more plausible microstructures than the MRF method [35], as one can observe the scattering of unrealistically small particles of the "stone" phase from the latter.
Structure-property predictions. Here we investigate how the prediction accuracy of a structureproperty model improves with the additional training data, acquired through the proposed method and the MRF. To do so, we start by deriving baseline models (for all three structureproperty mappings) using 100 data points for training and another 100 for validation. The baseline prediction performance is evaluated using a third set of 100 test data points. The true property values are calculated following Sec. 4.1, and normalized for training. Two sets of artificial microstructures, 1000 samples each, are created using the proposed method and the MRF, respectively. The true properties of these samples are computed. We then use these additional samples to improve the performance of the predictive models. Specifically, an increasing number of additional data points (from 50 to 1000) from the two sets are randomly added to the original training set to update the predictive model. We perform 10 independent random draws for each size of the additional data, and report the means and variances of the resultant test R-squares. The exception is with data size 1000, where all data points are used all together.
Results are presented in Fig. 8 and summarized as follows. (1) Microstructures generated from the proposed method have property distributions similar to those of the authentic samples, while those generated from MRF have significantly smaller variances (Fig. 8a). While the MRF method ensures variance in the microstructure space, as is evident from Fig. 7, the lack of variance in the volume fraction of its generations may cause the observed small variances in the properties. It is worth noting that while a modified MRF approach that considers variance in volume fraction may improve its generation quality, our approach does not require human identification or design of such features, as variances in morphology are directly learned through the generative model. (2) The statistical difference in properties observed in (1) may explain the significant gap in the prediction performance of the resultant structure-property models, as seen in Fig. 8b. The narrow distribution of properties of the MRF method also explains the drop in model performance from 800 to 1000 samples: By feeding the network data from one distribution while asking it to predict on those drawn from another, we may encounter deteriorated performance even with an increased training data size.

Discussion
Utilities of the proposed method. The prposed generative model captures low-dimensional representations of data points distributed in high-dimensional spaces. The model can be used to facilitate more cost-effective design of optimal and feasible microstructures by providing extra data to improve predictive structure-property models. This value could be particularly significant when the bottleneck of the design task is the high acquisition cost of microstructure data. It is also worth noting that the model may also help to reduce the cost of structure-property mappings, through its identification of low-dimensional material representations. For example, during the training of a predictive structure-property model, one may adopt an active learning strategy to only sample microstructures with high uncertainties in their property predictions, thus improving the predictive model cost-effectively. The model and the learning algorithm are also generally applicable, as they are independent from any specific material system, except that minor model architecture tuning may be needed to incorporate different morphological complexities.

Physics-based generative model
The successful application of style loss in this paper inspires future investigation on whether physics-based loss can be applied to further improve the quality of microstructure generations through a generative model with limited data. Specifically, instead of using a style loss, we can measure the similarity between input and output microstructures based on their properties. For example, for microstructures that satisfy certain equilibrium conditions (governed by the underlying process-structure mapping), we can train the generative model to minimize the violation of these conditions, and thus enforcing the artificial samples to be physically meaningful.

Conclusions
This paper proposed a method for generating an arbitrary amount of artificial microstructure samples with low computation cost and a small amount of training samples. The key contribution is the incorporation of a style loss into the training to significantly improve the quality of the artificial microstructures. For verification, we applied the proposed method to generating sandstone samples. Results showed that our method is more data-efficient at improving the prediction performance of a structure-property mapping than a state-of-the-art Markov Random Field method. The findings from this paper inspired future investigation into physically meaningful generative models for accelerating microstructure-mediated material design.