Microstructure reconstruction of 2D/3D random materials via diffusion-based deep generative models

Microstructure reconstruction serves as a crucial foundation for establishing process–structure–property (PSP) relationship in material design. Confronting the limitations of variational autoencoder and generative adversarial network within generative models, this study adopted the denoising diffusion probabilistic model (DDPM) to learn the probability distribution of high-dimensional raw data and successfully reconstructed the microstructures of various composite materials, such as inclusion materials, spinodal decomposition materials, chessboard materials, fractal noise materials, and so on. The quality of generated microstructure was evaluated using quantitative measures like spatial correlation functions and Fourier descriptor. On this basis, this study also achieved the regulation of microstructure randomness and the generation of gradient materials through continuous interpolation in latent space using denoising diffusion implicit model (DDIM). Furthermore, the two-dimensional microstructure reconstruction was extended to three-dimensional framework and integrated permeability as a feature encoding embedding. This enables the conditional generation of three-dimensional microstructures for random porous materials within a defined permeability range. The permeabilities of these generated microstructures were further validated through the application of the lattice Boltzmann method. The above methods provide new ideas and references for material reverse design.


Introduction
The geometric morphologies of engineering materials play a pivotal role in elucidating their performance characteristics, such as the light-capturing efficiency in silicon solar cells [1], mass transport in porous materials [2] and the electrical properties of polymer nanocomposite [3].Consequently, in the field of high-throughput computational materials science, there has been a notable shift away from traditional trial-and-error methods for material discovery.Instead, there is a growing emphasis on inverse design, focusing on the elucidation of the intricate relationships between processing, structure, and property (PSP) [4].The pursuit of identifying the mapping between PSP enables targeted microstructure design to guide the development of novel materials with desired performance characteristics, which has become a new research framework in the field of material development.
However, the emerging paradigm in materials science has ushered in fresh challenges.
The primary challenges inherent in PSP-based inverse design involve extracting intrinsic metrics from intricate microstructures and achieving their equivalent reconstruction.In response to these challenges, scholars have conducted extensive research on microstructure characterization and reconstruction (MCR) technology to date [5].Specifically, they have commonly utilized statistical descriptors [6], including the two-point correlation function, linear correlation function, and two-point clustering correlation function, among others, as well as the spectral density function [7,8].These quantitative characterization descriptors are essentially statistical in nature, primarily focusing on the low-order statistical aspects of microstructure.For instance, both the two-point correlation function and spectral density function provide the same second-order statistical information.Therefore, it's important to note that they inevitably result in a loss of detailed geometric information pertaining to the microstructure.Correspondingly, reconstruction methods that rely on these descriptors, such as the Yeong-Torquato (YT) algorithm [9] based on spatial functions or the parameterized random field based on spectral density functions, generate microstructure samples that are not a complete description of the distribution of the original data.Additionally, it has been noted by some scholars [10] that in certain heterogeneous materials, even when the microstructure shares identical low-order statistical information (e.g., two-point correlation function), the morphology and macroscopic properties can exhibit significant variations.
These highlight the critical importance of incorporating high-order statistical information in reconstruction methods, not only for accurate material identification but also for revealing the profound influence of microstructures on shaping macroscopic properties.To overcome the limitation of insufficient morphological information in the YT method, many studies have indicated [11,12,13] that enhancing the accuracy of reconstruction can be achieved by incorporating multiple statistical functions into the energy function.For instance, constructing the energy function by amalgamating the two-point correlation function, linear correlation function, and two-point clustering correlation function has been shown to be effective.However, it is essential to recognize that the YT method fundamentally operates as an iterative optimization algorithm.This approach necessitates the continual exchange of pixel points or voxel blocks within the initial configuration, followed by a comparison of the quantitative representation differences between the intermediate image and the real image in each iteration to minimize the energy function.The computational cost of this method increases with the complexity of the energy function, and the quality of the reconstruction largely depends on the careful choice of the characterization function.To sum up, the pursuit of a fast and efficient reconstruction method with high order statistical information applicable to diverse material systems remains a direction in need of exploration and focused research efforts.
In essence, the pixel (2D) or voxel representation (3D) of microstructures can be conceptualized as a complex probability distribution governed by ultra-high-dimensional random variables.Deep learning, one of its primary objectives and functions, is to learn the manifold structures and probability distributions within data [14,15], and inherently possesses a formidable capability to manipulate such high-dimensional probability distributions.Consequently, with the advent of deep learning in recent years, there has been a growing interest in leveraging deep learning for the description of high-dimensional probabilities associated with microstructures [16,17,18].This method is essentially an unsupervised generation model, and its goal is to generate new sample generation models with the same distribu-tion as the training set, and achieve mapping between manifolds through the nonlinear mapping ability of neural networks.More specifically, its core issue is probability density estimation, which is mainly divided into explicit probability density estimation and implicit probability density estimation [19].Explicit probability density estimation models, such as PixelRNN or PixelCNN, employ the chain rule of probability to reframe image generation as a sequence generation task, representing it as a product of joint conditional probabilities.
While successful applications of reconstructing microstructures have been achieved in some materials [20], it requires a predetermined order for pixel generation, and the generation speed is often excessively slow.Conversely, the approximate explicit probability estimation model-variational autoencoder (VAE) [21] and the implicit probability density estimation model-generative adversarial network (GAN) [22] are widely used in the field of microstructure reconstruction in the past decade.VAE transforms the challenge of probability density estimation into one of function approximation.It achieves this by employing maximum likelihood estimation to bring a mixed Gaussian distribution closer to the true underlying distribution.Scholars [23,24] have successfully reconstructed sandstone materials, inclusion materials, metamaterials, etc. using VAE.However, VAE itself faces the challenge of the "maximum likelihood training paradigm", which can lead to the generation of blurry images [25].In contrast to VAE, GAN achieve Nash Equilibrium between generator and discriminator through adversarial training, resulting in superior generation performance.
Many scholars [26,27,28,16,29] have proposed various data-driven microstructure reconstruction algorithms based on GANs.These approaches have been successfully applied in reconstructing microstructures in materials like polycrystalline grains, perovskite, carbon fiber rods, and rocks.Nevertheless, GAN training can be unstable due to the adversarial nature of the loss functions [30,31].Additionally, GANs are vulnerable to modal collapse, a situation in which they repetitively generate the same image.These limitations also impede the practical application of GANs.
Recently, the diffusion model has emerged as the frontrunner in the field of AI-generated content (AIGC), surpassing both VAE and GAN.The most advanced text-to-image model, such as OpenAI's DALL•E 2 and Google's Imagen, are built upon the diffusion model.The inspiration behind the diffusion model stems from non-equilibrium thermodynamics and can be concisely characterized as a layered VAE.In contrast to GANs, the diffusion model operates without the need for adversarial training, bringing with it added advantages in terms of training efficiency, scalability, and parallelism.In terms of generative capabilities, in addition to achieving state-of-the-art image quality, diffusion models exhibit a robust ability to encompass various patterns and generate diverse outputs.Beyond image generation, diffusion models have demonstrated significant potential in a wide array of fields, including computer vision [32,33,34,35], natural language processing [36,37] , time series modeling [38,39], multimodal modeling [40,41], and more.
Encouragingly, diffusion models have also shone brightly in the fields of material synthesis and structural reconstruction.However, it mainly focuses on biomaterials or medical imaging [42,43], such as protein modeling and cell shape prediction [44,45,46].There are only a few studies dedicated to examining the reconstruction of the microstructures of composite materials.For example, some scholars [47,48,49] successfully reconstructed the microstructure of polycrystalline alloys, carbonates, ceramics, fiber composites, and other materials based on diffusion model, and have verified the statistical similarity between the generated microstructure and the original microstructure.It is worth noting that the above reconstruction confined to two-dimensional microstructures, and there is also no sufficient discussion on the morphological characteristics and the latent space of the diffusion model.
In another study, Nikolaos and Sun [50] achieved the generation of microstructures with target performance by introducing context feature vectors.However, this research was confined to the mechanical MNIST dataset, featuring 28 × 28 pixel images.There is a dearth of evaluation for random materials characterized by higher resolution and more intricate microstructures.Vlassis et al. [51] utilizes VAE to reduce the dimensionality of 3D point cloud structures to a low dimensional latent space, and reconstructs the 3D structure of sand particles after training the diffusion model in the latent space.Nevertheless, this approach only generates individual particles and lacks the incorporation of multi-scale features in microstructure generation.
Therefore, this study proposes an end-to-end microstructure reconstruction method based on data-driven denoising diffusion probability diffusion model (DDPM) for heterogeneous engineering materials in two and three dimensions.Initially, the microstructure datasets were established for various composite materials, including regular inclusions, chessboard structures, spinodal decomposition materials, and random materials.The above microstructures with resolutions of 64 × 64 and 128 × 128 were reconstructed successfully by DDPM, and the statistical descriptors such as two-point correlation function and linear correlation function are used to evaluate the quality of generated microstructures.Meanwhile, Fourier descriptor also was used in this study to verify the morphological similarity between the both.On this basis, this study fully explores and utilizes the latent space of diffusion models through the deterministic generation of denoising diffusion implicit model (DDIM), achieving the regulation of the randomness of generated microstructures.Following this, the study extended the two-dimensional DDPM reconstruction method to encompass three-dimensional conditional generation, which was verified to generate three-dimensional random porous materials with a specific range of permeability.

Denoising diffusion probability model
The DDPM comprises two primary components: the forward diffusion process and the reverse diffusion process, analogous to the encoding and decoding phases in VAE.In the forward diffusion process, Gaussian noise is incrementally introduced to the original image tensor, ultimately transforming it into a noise image conforming to a standard normal distribution.Conversely, the reverse diffusion process entails the continuous removal of noise.A neural network, trained for this purpose, progressively eliminates noise from a given Gaussian noise image, ultimately restoring the original image from its noisy counterpart, as shown in Figure 1.
In contrast to the single-step mixed Gaussian distribution to approximate the original data distribution in VAE, the diffusion model employs a normal distribution to approximate incremental changes at each step.This approach enables the diffusion model to overcome the limitations typically associated with the fitting capacity of traditional single-step VAE.Specifically, in the forward process, Gaussian noise ε is continuously added to the given initial data distribution x 0 ∼ q(x), and the variance sequence of noise is β t , which gradually increases with time steps.Each additional step of noise generates a new latent variable x t with a distribution of q (x t |x t−1 ).
Based on the Markov chains, as t progresses, the final data distribution x T converges towards an anisotropic independent Gaussian distribution.The probability density evolution in the forward process is shown in Figure 2.Meanwhile, leveraging the characteristics of the Gaussian distribution, it can be inferred that at any given point during the forward process, it can be directly derived from x 0 and β t , where α t := 1 − β t and ᾱt := t i=0 α i .In the reverse process, it can be demonstrated that q (x t−1 |x t ) also converges to a Gaussian distribution [52].Consequently, a parameterized distribution (a trainable neural network) p θ (x t−1 |x t ) is established to estimate the Gaussian distribution for the reverse diffusion, thereby, Combining the Bayesian formula with the forward diffusion formula Eq. 2, the posterior diffusion conditional probability can be explicitly expressed as: The mean and variance are, It becomes clear that, under the conditions x 0 , the mean of the posterior conditional Gaussian distribution relies solely on noise distribution ε t .Consequently, the parameterized distribution model merely requires the prediction of noise distributions for each time step to obtain the denoising map for each time interval during the reverse diffusion process.The detailed derivation of the above process can be referred to [53].

Denoising diffusion implicit model
In DDPM, both forward and backward process are defined as a Markov chain.However, in the derivation of reverse diffusion process, only the edge distribution q (x t |x 0 ) is required.
This implies that the inference distribution in the reverse process is not necessarily required to follow Markov chains.Therefore, in the DDIM, the distribution of reverse process is directly defined as [54], Among them, σ 2 t is an uncertain real number, so q σ (x t−1 |x t , x 0 ) is a series of inference distributions.It can be proven through mathematical induction that for all t, By eliminating the Markov chain hypothesis in the reverse process, during the sampling, a larger step can be set to accelerate the generation process.According to Eq. 7, the following equation can be employed to facilitate sampling from x t to x t−1 during the reverse diffusion process.
The equation above decomposes the generation process into three components: the first is directly predicted x 0 by x t , the second is the part pointing towards x t , and the third entails random noise ϵ t .The unknown parameter σ t is defined as follows: When η = 1, the variance setting in DDIM aligns with that in DDPM.Conversely, when η = 0, random noise is absent, resulting in deterministic sampling.Specifically, once the initial random noise is established, DDIM's sample generation becomes a deterministic process.Considering that there is a continuity mapping between the latent space and the real data in DDIM, continuous sampling in the latent space can induce the dynamic evolution continuously of the real microstructure.This evolution also forms the foundation for subsequent regulation of randomness and the generation of gradient materials.

Loss function
Consistent with the fundamental objective of deep learning, the essence of DDPM resides in learning the underlying manifold structure from data and establishing parameter expressions.Building upon these objectives, it becomes crucial to minimize the Kullback-Leibler (KL) divergence between the parameterized probability distribution and the probability distribution of real images as effectively as possible.However, for the diffusion model, which operates across T time steps, it is necessary to extend the Evidence Lower Bound (ELBO) as used in VAE into a chain representation, which can be expressed as follows: The first item is independent of trainable parameters θ , and the ultimate objective is to optimize the KL divergence between two Gaussian distributions, q (x t−1 |x t , x 0 ) and p θ (x t−1 |x t ).Due to the existence of a closed form solution for the KL divergence of the multivariate Gaussian distribution, thus, The final loss function can be simplified as, Indeed, this observation corroborates the conclusion made in the section 2.1.During the forward process, Gaussian noise is continuously injected into the clean image.Conversely, in the reverse process, neural networks are utilized to learn and progressively remove the noise.
This iterative denoising process ultimately yields an image that adheres to the authentic data distribution.

Conditional diffusion model
The previously introduced DDPM and DDIM are essentially unconditional generators capable of producing microstructures resembling those in the original dataset in terms of morphology.However, in the realm of materials inverse design, the objective is to generate microstructures with specific functions or properties.As such, this study also introduces a conditional diffusion model designed to generate microstructures with predefined physical properties.
In the literature pertaining to diffusion models [55,56], Classifier Guidance has demonstrated efficacy in employing explicit classifiers to steer conditional generation.Nevertheless, this approach requires additional training of the image classifier which quality also can impact the effectiveness of conditional generation.Moreover, updating images through gradients can lead to adversarial attack effects, where generated images may deceive classifiers via imperceptible details.
Hence, in this study, we adopt the Classifier-Free Guidance scheme introduced by Google in 2022 to circumvent the aforementioned issues [57].The crux of Classifier-Free Guidance involves substituting the explicit classifier with an implicit one, eliminating the need for direct calculations of the explicit classifier and its gradients.
More specifically, in addition to time feature encoding, this study incorporated supplementary feature encoding embeddings into the diffusion model, enabling control over various physical attributes, as shown in Figure 5 and Figure 6.To leverage feature vectors for conditional generation, this study designate the reverse diffusion process, as defined in Eq.3, as a corresponding conditional probability distribution.
The parameterization of the mean is expressed as, The loss function for training is, Here, y represents the feature embedding corresponding to the physical attribute, effectively serving as the label for microscopic physical attributes, such as elastic modulus or permeability.Consequently, the conditional generation described above essentially constitutes a form of supervised learning.the number of input channels does not match the number of output channels, a Conv3d is employed to adjust the number of channels in the input feature map to match the output feature map.If the input and output channel numbers are equal, identity mapping is directly used as the output of the shortcut connection.

Training and sampling
The training process, illustrated in the Figure 5, commences with the extraction of x 0 from the training dataset.Following this, a random time step is selected from the time series.The noisy image x t at this chosen time step is calculated using Eq. 2 and serves as the input for the model.Subsequently, the model generates the predicted noise at the corresponding time step.The loss function is defined as the mean square error (MSE) between the predicted noise and the noise introduced during the forward process at the same time step, as depicted in Eq. 14.The model in this study underwent 500 training iterations on computer with NVIDIA GeForce RTX 4070 Ti and was optimized using the Adam optimizer.In the case of the trained model, when pure noise is provided as input, it initially generates the noise that was added during the forward process at time step 't'.Subsequently, it progressively denoises this noise to produce an image that conforms to the original data distribution.The detailed process is visually illustrated in the Figure 6.

Two-point correlation function
The spatial correlation function, as an important descriptor for microstructure characterization, provides a reasonable quantitative description of the morphology of heterogeneous materials.Considering a two-phase random heterogeneous material, the definition of the indicator function is given as follows, where V i ∈ R d is the space occupied by the phase i.The statistical characterization of the spatial variation in two-phase materials, specifically the computation of the n-point correlation function, is described as follows [58]: The angle brackets ⟨•⟩ denote the average across all instances where n points appear simultaneously in phase i, while P {x 1 , x 2 , ..., x n } represents the probability of n points, denoted as x 1 , x 2 , ..., x n randomly occurring at different positions within same phase i.
While the effectiveness of higher-order statistical descriptors in capturing collective microstructure phenomena is recognized, it's worth noting that their calculations can pose analytical and numerical challenges [59].Thus, the most commonly used is the two-point correlation function S 2 (r).For uniformly isotropic random materials, considering the translation and rotation invariance of the joint probability density distribution of the random field, the two-point correlation function disregards the position and direction information between points and is solely influenced by the relative distance between each point, r ij = x j − x i .
Therefore, particularly for statistically uniform and isotropic materials, the two-point correlation function can be further simplified as 2 (|r|) [60].It examines the correlation between the two endpoints of a vector within the same phase, and its form encapsulates crucial overarching characteristics of the microstructure [58].

Linear correlation function
Another method for the statistical description of microstructures is the linear path function, which serves as a statistical function employed to characterize aggregation within microstructures.From a probabilistic standpoint, it quantifies the probability of randomly placing a line on a microstructure image in such a way that the entire line falls within phase i.Specifically, it measures the extent of clustering along straight lines within a microstructure [5].This function is defined as a lower-order descriptor derived from a more complex fundamental function λ i which can capture specific information about phase connectivity and places greater emphasis on short-range correlation [61].The basic function λ i is defined as follows: For uniformly isotropic random materials, the above functions can be further simplified as,

Fourier descriptor
Material properties are influenced not only by the spatial correlation between different phases but also by the morphology of phase boundaries.Factors such as the rate of dissolution/deposition are intimately linked to attributes like specific surface area and curvature [62].In order to further quantify the similarity between the generated microstructure phase profile and the original material phase profile, this study proposes the Fourier descriptor.
This descriptor involves utilizing the Fourier transform of object boundary information, shifting contour characteristics from the spatial domain into the frequency domain, and extracting frequency domain information as the image's feature vector.
The boundaries between different phases in microstructure can be represented as coordinate sequences, s (k) = [x (k) , y (k)], k = 0, 1, 2...K − 1.In addition, each coordinate can be represented by a complex number, Perform Discrete Fourier Transform (DFT) on a one-dimensional sequence s (k).
Where u = 0, 1, 2...K − 1.The complex coefficient a (u) is called the Fourier descriptor of the boundary, which can be used to describe boundary shape features in the frequency domain.

Generation of datasets
To assess the efficacy of diffusion models in microstructure reconstruction with varying levels of complexity and randomness, this study initially established a database comprising various types of composite materials.These included fiber inclusion materials, texture materials, random materials, spinodal decomposition materials, chessboard structures, and Voronoi structured materials.Each microstructure in the database has the size of 64 × 64 × 1000 (image size=64).Additionally, to evaluate the reconstruction performance of the model at different resolutions, the database of circular inclusion materials and fractal noise materials with a resolution of 128 × 128 has also been established.The database size for these materials was also 1000 samples.
Various reconstruction algorithms were employed to generate microstructures in the database.These algorithms encompassed random field methods based on random harmonic functions and reconstruction methods grounded in physical descriptors.

Reconstruction of 2D random materials based on DDPM
In this section, the microstructures of random fiber inclusion materials, texture materials, random materials, spinodal decomposition materials, chessboard structures, and Voronoi structured materials, circular inclusion and fractal noise materials were successfully reconstructed based on DDPM. Figure 7 provides a comparison between the original microstructure and the reconstructed microstructure, revealing no noticeable visual distinctions.To verify the diversity of DDPM, random sampling reconstruction was performed on fiber inclusions, circular inclusions, metamaterials and chessboard structures.On the other hand, this also suggests that DDPM has the capability to prevent the emergence of pattern collapse problems.The results are shown in Figure 10.
This study also employs Fourier descriptors to compare the original random microstruc-     As previously discussed, DDIM exhibits the capability to flexibly adjust the variance during sampling.Following the elimination of variance, the reverse process of the diffusion model transforms into a deterministic procedure which means that starting from a certain noise, only a unique microstructure can be achieved.Consequently, the adjustability of the DDIM sampling process not only governs the randomness of microstructure generation through variance manipulation but also allows for the exploitation of deterministic sampling to comprehensively explore the latent space of the diffusion model.This dual capability presents a promising avenue for controlling microstructure characteristics.

Reconstruction considering manufacture deviation based on DDIM
As demonstrated above, diffusion models have the capacity to learn both compact and diverse microstructures, expanding the design space for material optimization.This, in turn, significantly enhances the performance of microstructure design optimization [63].
In practical applications, additive manufacturing technology is often employed for the realization of such microstructures.However, the inherent complexities and uncertainties associated with the manufacturing process introduce unpredictability.Factors like the precision of 3D printing and equipment wear can influence the outcome of the manufacturing process, potentially deviating from the expected performance of the theoretically optimal microstructure.Hence, it becomes imperative to investigate the impact of random defects that may arise during the manufacturing process on the mechanical behavior of materials [64,65].
DDIM offers an inherent means to quantitatively assess the uncertainty stemming from manufacture deviation.As evident from the discussion in section 2.2, when η = 0, DDIM's variance setting aligns with that of DDPM, and every step of denoising in the reverse process contains randomness.However, when η = 0, no random noise is present, resulting in deterministic sampling without manufacturing deviation.The value of η is intricately tied to the degree of randomness in microstructure reconstruction, essentially indicating the extent of deviation from deterministic reconstruction.
As depicted in Figure 12, this concept is illustrated by introducing varying levels of randomness in metamaterial reconstruction.As the parameter η increases, the degree of deviation in manufacturing is also gradually increasing.Specifically, the four black rectangles located on the diagonal gradually deviate from their regular shapes, adopting irregular forms.A similar effect can be observed in the black square positioned at the center of the microstructure.
Randomness in diffusion model is the guarantee of diversity.Conversely, removing this randomness from diffusion models yields a deterministic path for microstructure generation.
Nevertheless, during real-world manufacturing processes, errors are inevitable, and the degree of control over randomness within diffusion model precisely offers a means to quantify uncertainty in the actual formation of microstructures.The diffusion model can be seen as a multi-layer VAE.Similar to VAE, the diffusion model encodes raw data into a latent space and subsequently utilizes a decoder to map the samples from the latent space back to the original data space.However, the key distinction lies in the fact that the diffusion model doesn't involve dimensionality reduction operations.
Instead, it establishes an equal-dimensional mapping between the latent space distribution and the original data distribution, where the latent space represents the noise distribution.
Furthermore, since the diffusion model transforms discrete original image data into a continuous manifold structure, the mapping described above is inherently continuous as well.
Building on this foundation, the diffusion model is capable of achieving the dynamic evolution of two microstructures by continuously interpolating between two noise distributions.
This capability not only allows for the control of microstructure randomness but also offers a quantifiable design space for the inverse design of random materials through distance measurements in latent spatial interpolations [17].
It is worth noting that DDIM is sensitive to noise distribution.When linear interpolation is employed, λz 1 + (1 − λ) z 2 deviates from a normal distribution due to the superposition of normal distributions.Therefore, in this study, spherical interpolation was adopted [66,54], which can be expressed as follows: T , where θ = arccos T ||z T || , and z follows standard normal distribution.
Figure 13a and 13b illustrate the continuous interpolation decoding in the latent spaces of two microstructures, achieving dynamic evolution from random materials to texture materials and from random materials to circular inclusion materials, respectively.This method offers the potential to characterize and regulate the randomness within microstructures.
The interpolation distance between different microstructures in the latent space serves as a measure of randomness, and various levels of randomness can be controlled in the microstructure by adjusting the distance from a state of complete randomness.This also provides a foundation for the controllable application of randomness in material design.
Using the method outlined above, it also becomes possible to create gradient structures without the need for direct generation.Instead, gradient structures can be generated by combining intermediate structures from an extensive dynamic evolution process.Figure 13c generates gradient metamaterials based on continuity decoding in latent space.The comparison between the original three-dimensional microstructure and the generated three-dimensional microstructure is shown in the Figure 14.
Material performance is intricately tied to its three-dimensional microstructure.This connection allows for the intentional design of microstructures to achieve desired performance objectives.In this study, the permeability of random porous materials serves as an illustrative example.Leveraging the mapping relationship between microstructure and permeability, conditional generation was performed on three-dimensional random materials within a specific permeability range.Specifically, the permeability of three-dimensional materials is divided into six ranges as number label, each of which serves as a feature encoding embedding combined with image and time encoding.The framework of the network is shown in the section 3.1.The conditional diffusion model employed in this study has proven effective in generating three-dimensional microstructures with permeability falling within six specific ranges: (0, 0.2), (0.2, 0.5), (0.5, 1.5), (1.5, 3.0), (3.0, 5.0), and (5.0, 5.0+).The specific results are shown in Figure 15.
The verification of the permeability of random porous materials is carried out through the lattice Boltzmann numerical method,  (f)permeability=10.93

Figure 1 :
Figure 1: The forward noising process and reverse denoising process in diffusion model

Figure 2 :
Figure 2: Probability density evolution in forward process

3. 1 .
3D U-NetNeural networks in DDPM and DDIM are tasked with taking noisy images as input and producing predicted noise, both of which have the same size as the image.Given these requirements, the primary network architecture employed in diffusion model is the U-Net network.In addition to making corresponding adjustments to binary microstructure images, this study further extends the two-dimensional diffusion model into three-dimensional framework.As a result, this section primarily centers on the introduction of the proposed three-dimensional U-Net network, as shown in Figure3.Specifically, U-Net adopts an encoder D ∈ N (x; θ) = N D (I; θ D ) -decoder U ∈ N (x; θ) = N U (z; θ U ) structure, with the network's architecture resembling the shape of the letter ′ U ′ .The encoder maps the image to the feature space z, while the decoder maps the representation in the feature space back to the image space I. Additionally, U-Net incorporates skip connection, connecting the output of the encoder to the corresponding decoder, facilitating feature fusion and enhancing gradient flow.

Figure 3 :
Figure 3: 3D U-Net network architecture in diffusion model

Figure 4 :
Figure 4: Schematic diagram of residual block structure

Figure 5 :
Figure 5: The training process in diffusion model

Figure 6 :
Figure 6: The sampling process in diffusion model

Figure 10 :
Figure 10: Diversified generated microstructures based on diffusion model

Figure 11 :
Figure 11: The feature distribution of Fourier descriptors

5. 4 .
Conditional generation of 3D random materials based on DDPMIn microstructure reconstruction of composite, this study extends the diffusion model framework to 3D, and successfully achieves 3D reconstruction of spherical inclusion materials, ellipsoidal inclusion materials, and random materials, all with sizes of 64 × 64 × 64.

( a )
Random materials to directed random materials (b) Random material to circular inclusion material (c) Generated gradient material

Figure 13 :
Figure 13: Randomness control and gradient materials based on DDIM