Microstructure Characterization and Reconstruction in Python: MCRpy
간접 관련 엔지니어링 플라스틱 · (23) 컴파운드 (10) 아라미드(21) 에폭시수지
기본 정보
- 저자
- DOI
- 10.1007/s40192-022-00273-4
- 저널
- Integrating materials and manufacturing innovation
- 발행년도
- 2022
- 발행기관
- Springer Nature
- 피인용수
- 39
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1007/s40192-022-00273-4
- 토픽
- Electron and X-Ray Spectroscopy Techniques
- OpenAlex ID
- W4295953229
평가 내용
- 관련도
- 간접 관련
- 사업분야
- 엔지니어링 플라스틱 · (23) 컴파운드
- 부 분야
- (10) 아라미드, (21) 에폭시수지
- R&D 측면
- 분석·모델링
- 확신도
- 0.70
- 근거 용어
- Microstructure characterization, reconstruction, computational materials engineering, heterogeneous media, optimization problem
- 판단 근거
- 이 논문은 재료의 미세구조를 분석하고 재구성하는 소프트웨어 플랫폼(MCRpy)에 관한 연구로, 특정 제품을 다루지는 않으나 소재의 물성을 예측하는 계산 재료 공학의 핵심 도구입니다.
- R&D 활용 포인트
- 아라미드, 에폭시 수지, 컴파운드 등 복합 소재의 미세구조를 모델링하여 물성 및 내구성을 예측하는 R&D 분석 기법으로 활용 가능합니다.
- 평가 입력
- 초록 1,466자
초록
본문 39,275자
본문 펼치기
섹션 본문 52문단 · 37,819자
(제목 없음)
1Microstructure characterization and reconstruction (MCR)is an important prerequisite for empowering and accelerating integrated computational materials engineering. Much progress has been made in MCR recently, however, in absence of a flexible software platform it is difficult to use ideas from other researchers and to develop them further. To address this issue, this work presents MCRpy for easy-to-use, extensible and flexible MCR. The software platform that can be used as a program with graphical user interface, as a command line tool and as a Python library. The central idea is that microstructure reconstruction is formulated as a modular and extensible optimization problem. In this way, any descriptors can be used for characterization and any loss function combining any descriptors can be minimized using any optimizer for reconstruction. With stochastic optimizers, this leads to variations of the well-known Yeong-Torquato algorithm. Furthermore, MCRpy features automatic differentiation, enabling the utilization of gradient-based optimizers. In this work, after a brief introduction to the underlying concepts, the capabilities of MCRpy are demonstrated by exemplarily applying it to typical MCR tasks. Finally, it is shown how to extend MCRpy by defining a new microstructure descriptor and readily using it for reconstruction without additional implementation effort.
Introduction
2Establishing and inverting process-structure-property (PSP) linkages is a central goal in integrated computational materials engineering (ICME) in order to accelerate the development of new materials. With increasing computational resources and much development in data processing and machine learning, data-centric workflows for microstructure design receive more and more attention [1]. These workflows rely on large databases that are created using numerical simulations. One central aspect to consider in this context is how to choose and create the microstructures to simulate from the extremely big set of possible structures. To avoid extremely time-consuming and cost-intensive experimental campaigns, an efficient microstructure characterization and reconstruction (MCR) tool is * Contact: markus.kaestner@tu-dresden.de https://github.com/NEFM-TUDresden/MCRpy therefore a key ingredient to making large-scale ICME workflows feasible. A very brief introduction to MCR is given in the following and the reader is kindly referred to [2] for an in-depth review.
3Microstructure characterization, the first aspect of MCR, is required to handle the stochasticity of the microstructures: Two distinct image sections of the same microstructure are similar from a visual and statistical perspective, but completely different in terms of a pixel-based representation. Thus, for operations like quantitative comparisons, it is reasonable to map the pixel-based microstructure to a translation-invariant, stationary descriptor that allows for these operations. Therefore, is a reasonable choice for representing structures in PSP linkages. Furthermore, it provides a possibility to explore the microstructure space in data-driven materials development workflows.
4Microstructure reconstruction, the second aspect of MCR, can be regarded as the inverse operation to microstructure characterization: The goal is to find a microstructure such that the corresponding descriptor equals the given value. Microstructure reconstruction allows to (i) create a plausible 3D volume element from a 2D slice like a microscopy image, (ii) create a set of similar microstructures given one realization and (iii) interpolating between microstructures in terms of descriptors.
5These two aspects of MCR, namely characterization and reconstruction, can be treated independently, for example using spatial correlations as descriptors and modern machine learning-based techniques for reconstruction. However, automatic ICME workflows for complex materials highly benefit from a principled exploration of the descriptor space, where microstructures are selected for reconstruction, simulation and homogenization in a way that maximizes the expected information gain for the PSP linkage [3]. Therefore, it is important to combine characterization and reconstruction so that given any combination of descriptors and their values, the reconstruction can be triggered from these descriptors. Furthermore, recent research indicates that there is no single best descriptor for microstructure reconstruction [4] and for PSP linkages [5], but that it is reasonable to choose descriptors based on the structure at hand. For this purpose, we present MCRpy, a modular and extensible open-source tool that facilitates easy microstructure characterization and reconstruction based on arbitrary descriptors.
6Free open-source platforms are a great way of harness-ing the advantages of digitization and modern computational infrastructure. The free accessibility allows researchers to quickly test each others' ideas and to develop them further. The open-source nature of such a platform enables it to become a collaborative project, considerably leveraging its potential. Especially in complex scientific disciplines, such collaboration is indispensable. As an example, consider the field of machine learning, specifically neural networks [6]. In the beginning of research on neural networks, newcomers had to implement relatively complex procedures like back-propagation before being able to reproduce results from the literature, let alone to develop them further. Later, easy-to-use open-source libraries like TensorFlow and pyTorch have greatly lowered the hurdle, allowing more researchers to enter the field easily. This surely contributed to the rapid progress in the last decades and to the plethora of neural network architectures and applications that is observed today. The digital infrastructure of the materials science community has grown considerably as a consequence of the materials genome initiative [7] and similar projects. Despite the rapidly growing number of tools for materials innovation in general, MCR specifically is in a comparable position now as machine learning was 20 years ago: A great variety of methods exists, but in absence of a common platform and interface, every newcomer in the field has to implement fundamental technologies like the lineal path function and the Yeong-Torquato algorithm by hand. This is a big hurdle and thwarts any rapid progress. Thus, the goal of this contribution is to accelerate MCR research by providing MCRpy as an easy-to-use, extensible and flexible software solution that aims at realizing a seamless workflow by providing various interfaces to new and established techniques.
7The work starts with Section 2, where the current digital infrastructure is reviewed and it is outlined how MCRpy integrates into it. Then, MCRpy is presented in Section 3. Typical application workflows are presented in Section 4 and finally, a conclusion is drawn in Section 5.
Current Digital Infrastructure
8After President Barack Obama announced the US-American Materials Genome Initiative [7] that provided substantial funding for accelerated materials development, collaborative projects and digital frameworks were initiated all over the world. A non-exhaustive list includes the European NOMAD-CoE [8] and its platform described in [9] and the Swiss NCCR MAR-VEL [10] with its AiiDA platform [11] described in [12]. The extremely popular and often-cited pymatgen library [13] can be mentioned as an early contribution to open-source materials science software infrastructure. This trend continues, as can be seen with the recent example radonpy [14]. However, much of this research is focused on deriving material properties from considerations on the atomistic length scale.
9On the continuum length scale, the Python Materials Knowledge System (pyMKS) [15] is a notable open-source framework. Its efficient FFT-based implementation of the spatial two-point correlation 2 facilitates easy microstructure characterization. However, in pyMKS, microstructure characterization is lim-ited to 2 and no further descriptors are available. Moreover, pyMKS does not allow for microstructure reconstruction, only characterization. A strong focus lies on efficient homogenization [16] and direct coupling to an internal finite element solver, SfePy [17,18]. This is very convenient for simple problems like elasticity. For advanced techniques like crystal plasticity, external software like the Düsseldorf Advanced Materials Simulation Kit (DAMASK) [19] can be used. Furthermore, pyMKS provides an easy interface for dimensionality reduction of the descriptor space and for establishing structureproperty-linkages based on the reduced descriptors and the corresponding homogenized properties. In summary, pyMKS acts as an overarching framework to implement ICME workflows.
10For numerical simulation of microstructures, many opensource tools are available, ranging from general and easy-to-use packages like SfePy [17,18] to special-purpose software like DAMASK [19], which comes with a highly optimized Fourierbased crystal plasticity solver. Furthermore, current research on FFT-based homogenization [20] is making remarkable progress that might lead to an open-source tool soon. Thus, with pyMKS as an overarching framework and numerous tools and progress for numerical simulation and homogenization, an open-source MCR software package can be identified as a final component of ICME workflows.
11To the authors' best knowledge, the only widely-used software tool for MCR is DREAM.3D [21], a long developed and full-fledged program. Its roots date back around 20 years to the early works of Michael Groeber and the Carnegie Mellon University microstructure builder. Despite this long history, DREAM.3D still enables numerous current research activities in materials innovation and ICME, see for example [22]. This success is empowered by the many features, robustness, efficiency and easy user interface of DREAM.3D, which may be partially attributable to its open-source core. Thus, DREAM.3D can be highly recommended for the workflows it implements. However, the internal microstructure representation and the available pipelines in DREAM.3D are mainly intended for certain material systems and microstructure descriptors. The internal data format as well as the provided characterization and reconstruction algorithms are centered around classical descriptors like grain size distribution functions and orientation distribution functions. This makes DREAM.3D excellent at reconstructing geometric inclusions like ellipses and texture as in metallic materials, but multi-phase materials with complex morphology as shown in Figure 8 cannot be realized. Furthermore, DREAM.3D is written in c++, which is not common among engineering researchers due to its complexity. In recent research, new microstructure descriptors or reconstruction algorithms are sometimes provided as Python or Matlab code in a GitHub repository, but are hardly ever implemented in c++ as a DREAM.3D pipeline. Even if that was the case, then these descriptors could not be readily used for reconstruction since the DREAM.3D reconstruction pipelines are tailored towards specific descriptors and would need to be re-implemented. Thus, DREAM.3D is an excellent and robust program, but it is mainly suited for specific practical applications and for certain Preprint submitted to Springer arXiv materials.
12In contrast, the present work aims at creating a flexible research platform for multiphase materials of high morphological complexity. Thus, MCRpy clearly differs from DREAM.3D regarding the targeted audience and the scope of materials systems. As a Python package, it integrates naturally with numerous tools for numerical simulation, machine learning or materials science workflows Especially pyMKS can act as an overarching ICME framework, where the present work provides an MCR solution. In summary, MCRpy attempts to fill a striking gap in the ICME software landscape. A theoretical understanding of MCRpy is provided in Section 3, followed by an illustration of typical workflows in Section 4. A schematic overview is given in Figure 1: The main functionalities of MCRpy, characterization and reconstruction, are explained in Sections 3.1 and 3.2 respectively. Furthermore, additional functions are provided to manipulate the microstructures and descriptors and to visualize data. A complete set of the available operations is given in Table 1. The core idea of MCRpy is its extensibility in that any descriptors can be used for characterization and any loss function combining any descriptors can be minimized using any optimizer for reconstruction. This is outlined in Section 3.3.
Characterization
13The characterization function
14assigns a given pixel-based microstructure to a set of corresponding descriptors . These descriptors quantify the microstructural morphology in a statistical and translationinvariant manner. Hereby, a microstructure with p different phases is represented as a set of indicator functions
15For example, the volume fraction f of a microstructure is a very simple descriptor. Of course, the volume fraction captures some but not all information needed to describe the microstructure. Several other quantities matter, for example the size and shape of inclusions and the degree to which distinct phases are spatially clustered. Besides these classical descriptors, in the light of increasing computational resources, recent research has been focused on more universal high-dimensional descriptors that are less dense in information, but have higher descriptive capabilities in total. As an early example for highdimensional descriptors, spatial correlations [23] have proven to be a versatile tool that is still used today [2]. A good introduction can be found in [24]. A differentiable generalization of spatial correlation is presented in [25] and used in this work. Spatial correlations have inspired a range of conceptually similar descriptors like the lineal path function [26], cluster correlation function [27] and polytope function [28]. The reader is referred to [2] for a comprehensive overview. Finally, the Gram matrices of the feature maps of pre-trained convolutional neural networks have been shown to contain relevant microstructural information [29]. Remarkable results in microstructure reconstruction have been achieved using such Gram matrices alone [30,31] and in combination with other descriptors [32,4].
16Finding a microstructure description that is both dense and contains all relevant information is an active field of research [2]. Examples are the recently developed entropic descriptors [33] or polytope functions [28]. Thus, besides the currently available descriptors listed in Table 2, any researcher can add a descriptor plugin to MCRpy. If the descriptor plugin is defined with an indicator function as input, it is applied to the indicator function of each phase separately. Furthermore, a 2D descriptor is automatically applied on and averaged over 2D slices of a 3D structure. The only requirement posed on new descriptors is that they must be computable on a pixel or voxel geometry. More details on extensibility can be found in Section 3.3. Any of the available and added descriptors can be used from microstructure reconstruction, which is discussed in the following section.
Reconstruction
17In MCRpy, microstructure reconstruction is fundamentally regarded as an optimization problem
18where the reconstructed microstructure rec minimizes a loss function L. The loss function depends on different descriptors { } =1 and quantifies the distance between their current and desired values. Herein, ( ) denotes the value of the -th descriptor associated with the current microstructure and its desired value des . Naturally, as in the characterization step, any descriptors can be used, for example the volume fractions f , the spatial correlations or the Gram matrices . For the loss function L, a simple choice is a weighted sum over the mean squared error norm. Different loss functions are available in MCRpy and the user can implement additional ones. Finally, given a set of descriptors and a loss function, an optimization problem emerges as a special case of Equation 3. This optimization problem can be solved using an optimizer, [25,4]. Otherwise, the choice is limited to gradient-free optimizers like simulated annealing.
19As a simple example, if only the spatial two-point correlation 2 is used as a descriptor and the loss function is formulated as a mean squared error norm of the descriptor difference, the following optimization problem emerges:
20If simulated annealing is chosen as an optimizer, MCRpy effectively performs the well-known Yeong-Torquato algorithm as used in [36]. As a more recent example, if the Gram matrices of the feature maps of the VGG-19 CNN are chosen as a descriptor [29] for the same loss function, the emerging optimization problem
21allows for a gradient-based optimizer. If L-BFGS-B [35] is chosen for this purpose, MCRpy effectively performs the approach of Li et al. [30], which is a special case of differentiable MCR [25].
22As a final example, the differentiable three-point correlations 3 , the above-mentioned Gram matrices and the normalized total variation V are combined. The loss function accumulates the weighted mean squared error norm, where denotes the weight of the -th descriptor. If the resulting optimization problem
23is solved using the gradient-based L-BFGS-B optimizer, MCRpy effectively performs the differentiable MCR algorithm as used in [4]. As can be seen, different parameter settings allow to recreate well-known reconstruction algorithms as well as to try out new ones by simply changing the arguments. As an overview, all descriptors, optimizers and loss functions are listed in Table 3.
Extensibility
24The central advantage of MCRpy is its extensibility in that descriptors, loss functions and optimizers can be easily provided by anyone. For example, new optimization-based reconstruction algorithms like the work of Cecen at al. [42] can be implemented as an optimizer plugin to combine them with all the available microstructure descriptors. This is achieved by a plugin architecture, which is sketched in Figure 2. In this section, we explain the underlying software pattern, whereas exact instructions and an example on how to write a plugin are given in Section 4.4. In the following, the plugin architecture is explained for the case of descriptors. The same idea is employed for loss functions and optimizers.
25Preprint submitted to Springer arXiv A descriptor plugin can be written by simply inheriting from the abstract Descriptor class. Consequently, the available descriptor plugins are not known at the time of writing the MCRpy core code, so they must be loaded dynamically as soon as the characterization or reconstruction module demands the plugin. This is done by means of a loader module based on importlib. Upon import, a descriptor plugin registers itself at a descriptor factory. After that, the descriptor factory can be queried to create descriptor instances from the plugin. The descriptor factory then returns a callable which computes the descriptor value given a microstructure. This callable can now be used to characterize microstructures, compose loss functions, compute gradients using automatic differentiation and to reconstruct microstructures.
26Thus, adding a descriptor plugin to MCRpy merely consists of adding a file with the plugin definition to the right directory, while the rest of the code does not need to be changed. The descriptor immediately becomes available for characterization and for reconstruction in combination with any other descriptors, any loss function and any optimizer.
Typical MCRpy workflows
27Typical use-cases and workflows of MCRpy are illustrated in this section by means of three representative examples. First, in Section 4.1, a plausible 3D volume element is reconstructed from a 2D microstructure slice. This very relevant, since 3D information can be very time-and cost-intensive to obtain experimentally. Secondly, in Section 4.2, a statistically similar set of small volume elements is generated from a single example. This greatly reduces the computational effort for numerical homogenization. Thirdly, in Section 4.3, descriptor values are directly manipulated and used for reconstructing novel structures. Techniques like this may be explored in the future to augment data sets and explore PSP linkages. These three examples are demonstrated in the three modes of operating MCRpy, namely via a GUI, as a command line tool and as a Python library, respectively. Note that this order is chosen for demonstration purposes only and it is possible to execute all three workflows with all three modes of operation. Finally, in Section 4.4, it is demonstrated how to add a custom descriptor to MCRpy and how to use it for characterization and reconstruction. The original structures are taken from pyMKS [15] for Sections 4.1 to 4.3 and from [30] for Section 4.4.
Obtaining a 3D domain from a 2D microstructure
28slice As a first example, MCRpy is used to reconstruct a plausible 3D volume element given a segmented 2D slice. This is a common task since experimental observations are often available only in 2D. The 3D volume element can be used for example for numerical simulations. From an algorithmic perspective, this goal is achieved by computing the descriptor on the given slice and prescribing it on every slice of the microstructure, details cf. [4].
29This task is solved using the MCRpy GUI as shown in Figure 3. A simple approach would be characterization and immediate reconstruction, but as mentioned in Table 1, MCRpy provides a shortcut for this in the match function. After selecting the match-action on the left, the relevant options can be set in the center. The name of each option is identical to the command line and the Python library, allowing users to easily switch interfaces. By default, a 2D structure is reconstructed in 2D. However, by using the option add_dimension, the extent of the reconstructed structure in -direction is set to the desired value. The differentiable three-point correlations˜3 as proposed in [25] are chosen as descriptor. Furthermore, as discussed in [4], the variation V is employed as a descriptor in order to suppress noise in the 3D reconstruction. The weights of˜3 and V are empirically set to 1 and 100, respectively . Finally, the role of the setting limit_to needs to be discussed. The parameter is introduced in [25] as and and quantifies the length in pixels up to which spatial correlations are computed with the highest-possible precision. All longer-ranged correlations are computed on a lower-resolution version of the structure in order to save computational resources, cf. [25]. With a default of 16, it allows a flexible trade-off between accuracy and efficiency. In this example, it is lowered to 8 in order to accelerate the computations. After setting all options, the reconstruction can be started and the results can be viewed from the GUI by selecting the view-action on the left. 2D microstructures are plotted directly, whereas 3D structures are exported to and opened in ParaView [43]. The original 2D slice and the reconstructed 3D volume are shown in Figure 4.
30In addition to the final microstructure, a convergence data file is written, which can be viewed interactively with MCRpy as shown in Figure 5. On the left, the loss is plotted over iterations along with blue dots indicating intermediate results. The user can click on any of these dots to have the corresponding microstructure displayed on the right. For 3D structures, only one slice is plotted and the user can scroll through the microstructure using the mouse wheel. For displaying the raw phase indicator functions of multiphase structures and other functionalities, the user is referred to the documentation. In summary, the MCRpy GUI constitutes an easily accessible solution for microstructure reconstruction.
Obtaining a set of similar volume elements
31As a second example, a statistically similar set of volume elements is created from a single microstructure example. In numerical homogenization, a volume element can only be called representative if it is large enough for the stochasticity of the microstructure to have no effect on the effective properties. In practice, this requirement can imply unfeasible computational effort. If smaller volume elements are used, it is still possible to quantify the effective behavior by using sufficiently many smaller volume elements and statistically aggregating the results. An example for structure-property linkages based on this idea can be found in [44]. From an MCR perspective,
32The role of the weights is discussed in [4]. If the weight of the variation is too small, the noise is not suppressed well enough. If it is too large, the optimization problem becomes harder to solve and more iterations are needed for convergence. this requires characterizing the given structure and reconstruct different random realizations from it .
33This task is solved using MCRpy as a command line tool as shown in Listing 1. First, the original 2D microstructure stored as ms_slice.npy is characterized using the same parameters as in Section 4.1 (line 1). Then, 9 different 3D structures are generated by a simple loop over the reconstruction script (lines 2-7). Note that the extent of the reconstructed structures in voxels is set independently of the original slice (line 5). Furthermore, the loop index is passed to the reconstruction script in order to have it added to all result filenames and prevent to overwrite previous results (line 5). Because the chosen descriptors are differentiable, the standard optimizer L-BFGS-B [35] can be used, allowing to harness the computational efficiency of DMCR [25,4]. On an Nvidia A100 GPU, the reconstructions take around 25 minutes per structure for 500 iterations. The original structure and the results can be seen in Figure 6. In summary, the command line interface is analogous to the GUI and allows for easy automation and large-scale application.
Manipulating the descriptor space
34As a third example, the explicit availability of the descriptor is exploited by directly manipulating it. Specifically, MCRpy is used to interpolate between two given microstructures in a morphologically meaningful way. Consider two microstructures that could stem from different sets of process parameters. It can be interesting to create a morphology that is a mix between these two structures. For example, if numerical simulations and homogenization of the interpolated structure predict favorable effective properties, it might be worth to fine-tune the process parameters or try to establish a PSP linkage to manufacture these structures. Direct interpolation of the microstructures in terms of pixel values is meaningless. As a simple alternative, we interpolate linearly in the descriptor space and reconstruct microstructures from the interpolated descriptors.
35This task is solved using MCRpy as a Python library as shown in Listing 2. After defining the settings (lines 4-10),
36In [25], the reconstruction was shown to converge to the exact same microstructure that was used for characterization. The same can be seen for some cases in Figure 8. However, this only happens in 2D reconstruction (not in 3D) and only for certain descriptors and microstructures. In these cases, the desired descriptor prescribed for reconstruction needs to be varied statistically in order to create a diverse set of microstructure realizations. This aspect is not considered in the following because in application, it is most useful to reconstruct 3D structures. the original 2D microstructure slices are loaded (lines [13][14] and characterized (lines [17][18]. For reconstructing elongated 3D structures, the 2D descriptors need to be combined such that different descriptors are used in different directions. The order thereby matters and mistakes can lead to geometrically unrealizable descriptors . In order to avoid confusion and mistakes, MCRpy provides the function merge for this task. The merged descriptors (lines 21-22) are then interpolated in 5 steps including start and end (line 25). Each descriptor is used For example, consider the three planes − , − and − . Structures that are elongated in -direction can be created by prescribing horizontally elongated descriptors in planes 1 and 2 and an isotropic descriptor in plane 3. However, if the same horizontally elongated descriptors are prescribed in planes 1 and 3, the structure cannot be realized: Plane 1 requires elongations in the -direction, whereas plane 3 requires the elongations to be in the -direction and not in . for a 3D reconstruction, which returns the convergence data and the final microstructure (line 29). The convergence data is viewed in an interactive window as shown in Figure 5 Figure 7. It can be confirmed that linear interpolation in the descriptor space leads to a visually reasonable transition between the corresponding microstructures.
Defining a custom descriptor
37MCRpy can be easily extended by adding custom plugin modules. In this section, the procedure is demonstrated by means of a descriptor plugin. Similar concepts apply to loss functions and optimizers. First, the implementation of a descriptor plugin is discussed for the volume fraction f . Secondly, a differentiable approximation to the lineal path function is developed and tested.
38Listing 3 shows the plugin source code for the volume fraction f . Like all descriptors in MCRpy, the volume fraction must inherit from the abstract Descriptor class (line 5). This base class provides (i) a wrapper that applies descriptors defined for single phases to the indicator function of each phase,
39(ii) a wrapper to compute multigrid descriptors as discussed in [25] and In this case, it is reasonable to define the descriptor for a single phase and let the superclass handle the generalization to multiple phases. For this purpose, the subclass function make_singlephase_descriptor is defined (line 9). This function receives information about the microstructure, like the resolution, which is not needed in this case and therefore summarized via **kwargs. It returns a callable which computes the descriptor given the indicator function of a phase (line 12). In order to allow for automatic differentiation of the descriptor with respect to the microstructure, this callable needs to be implemented in TensorFlow. In contrast, a nondifferentiable descriptor would be implemented in Numpy and integrated into the computation graph by MCRpy using the TensorFlow function tf.py_function. Finally, the plugin is required to register itself at the descriptor factory using its class name (lines [16][17].
40In the following, the same procedure is applied to a differentiable approximation˜to the lineal path function , which is developed in Appendix A. Naturally, the code for definingĩ s much longer than Listing 3 and is not given in this paper. Instead, the reader is referred to the GitHub repository for high-dimensional descriptors are reshaped to an approximately quadratic array and plotted as a heatmap. This behavior can be overwritten for each descriptor subclass separately. viewing the code. After adding the descriptor definition to the mcrpy/descriptors directory, it is accessible for characterization and reconstruction via the MCRpy GUI, the command line interface and the Python library.
41In the Yeong-Torquato algorithm, the lineal path function is often employed to compensate for the shortcomings of the twopoint correlation 2 alone [23,2]. As an alternative approach to enriching 2 , the differentiable three-point correlations˜3 are used in [25]. Furthermore, Gram matrices have become a common descriptor recently [30,31,4,32]. In order to determine a best-practice for gradient-based reconstruction, 3 is compared to and a combination of˜2 and˜in Figure 8. It can be seen that˜3 yields perfect reconstructions except for the copolymer, which can only be reconstructed well from . In contrast, yields acceptable results for all structures. The combination of˜2 and˜performs very poorly for the alloy and the copolymer and is relatively noisy for the carbonate and ceramics. However, it outperforms for the polymer composite. In summary, the results in Figure 8 indicate that including higher-order information to˜2 via˜3 is more promising for gradient-based reconstruction than via the newly proposed differentiable approximation to the lineal path function˜.
42The more relevant aspect, however, is how easily new de- scriptors can be assessed using MCRpy. After defining a plugin as shown in Listing 3, it can be used for characterization and reconstruction and evaluated seamlessly. This extensibility facilitates quick and easy experimentation, allowing researchers to assess new MCR techniques easily and provide them to their colleagues.
Conclusions and Outlook
43MCRpy is a powerful and extensible open-source Python library and toolkit for microstructure characterization and reconstruction. Besides these core features, MCRpy provides a plethora of convenient tools for inspecting and comparing descriptors, analyzing reconstruction results and controlling the descriptor space. It be easily applied via a GUI and brought to automated large-scale application on high-performance computers through a command line interface. For advanced and custom operations in the descriptor space, MCRpy can be imported and used as a Python module with direct access to the structures and descriptors. Typical workflows for these interfaces are presented in this work by means of different MCR tasks.
44A central design aspect in MCRpy is its extensibility in that descriptors, loss functions and optimizers can be provided by the community as simple plugin modules. An example for a simple plugin is given in this work. We hope that the open source nature of the code and the plugin architecture will make MCRpy an international collaborative project with contributions from numerous researchers. This growth can leverage the potential of the presented tool to facilitate faster and easier MCR research and ultimately help accelerating materials development.
Listing 3:
45Simple definition of a descriptor plugin for computing the volume fraction f . This descriptor is differentiable with respect to each pixel in the microstructure, so it is implemented in TensorFlow to allow for automatic differentiation. Non-differentiable descriptors can be implemented in Numpy.
A Differentiable approximation to lineal path function
46The lineal path function is a well-established microstructure descriptor [26] that is often used in the Yeong-Torquato algorithm to compensate for the shortcomings of the two-point correlation 2 alone [23,2]. Given a vector ì = ( , ), it yields the probability that ì lies entirely within a single phase if it is placed randomly in the structure. In contrast to 2 , which considers only the start and end point of the vector, incorporates information about the connectedness of the phases. In this section,˜is presented as a differentiable approximation to .
47The lineal path function is approximated using a convolvethresholdreduce pipeline similarly to [25]. For this purpose, the vector or line ì is discretized to a pixel grid as shown in Figure 9 and divided by the length of the line. In this work, the Bresenham line algorithm [45] is used, but alternative approaches like the Xiaolin Wu line algorithm [46] might be equally viable options that can be investigated in future works. In the convolve step, the discretized line from Figure 9 is used as a mask for a convolution with periodic boundary conditions. The output of the convolution is an image where each pixel corresponds to the discretized line being placed at the pixel's location. The pixel value is 0 if no part of the line lies in phase 1 and 1 if the line lies completely in phase 1. If only parts of the line are in phase 1, the value is between 0 and 1. These pixels can be set to zero by thresholding the image with a value , where 1/(1 − ||ì|| ∞ ) < < 1. The threshold step thus yields an image which can be interpreted as an ensemble of realizations, where each pixel takes the value 0 or 1. In the reduce step, this ensemble is averaged to obtain the probability of a randomly placed line being entirely in phase 1.
48To make the convolvethresholdreduce pipeline differentiable, only the thresholding needs to be modified. The hard thresholding is therefore approximated using a scaled and shifted differentiable sigmoid function as shown in Figure 10. This introduces errors, because the ensemble to average does not contain only ones and zeros but also intermediate values.
49Unlike in [25], where a similar error for˜could be eliminated by deriving a correction step, the difference between andc an not be quantified easily. Thus, it is clear that˜is only an approximation to , not a generalization. This is not problematic if the same descriptor is used for characterization and reconstruction.
50To the author's best knowledge, this concludes the first differentiable approximation to the lineal path function.
B Underlying technologies
51MCRpy is programmed in Python and based on very common packages like Numpy, Scipy, Matplotlib and TensorFlow. While simulated annealing is implemented from scratch, the gradient-based optimizers are taken from Scipy and TensorFlow. Furthermore, TensorFlow is used for automatic differentiation of the loss function and the descriptors as well as for just-in-time compilation via AutoGraph. This allows MCRpy to run highly optimized code on GPUs despite being written entirely in Python. As optional dependencies, the Gooey is required to run the MCRpy GUI and pyMKS is used in a descriptor plugin for FFT-based 2-point correlations. A summary of required and optional dependencies and their versions is given in Table 4.
52We use the same function as in [25]. : A discretization of the vector ì to a discrete pixel grid using Bresenham's method [45].
참고문헌 36건
- ParaView: An End-User Tool for Large-Data Visualization Elsevier eBooks · Elsevier BV · 2005 10.1016/b978-012387582-2/50038-1
- AiiDA: automated interactive infrastructure and database for computational science Computational Materials Science · Elsevier BV · 2015 10.1016/j.commatsci.2015.09.013
- Modeling heterogeneous materials via two-point correlation functions: Basic principles Physical Review E · American Physical Society · 2007 10.1103/physreve.76.031110
- Entropic descriptor of a complex behaviour Physica A Statistical Mechanics and its Applications · Elsevier BV · 2009 10.1016/j.physa.2009.10.013
- Python Materials Genomics (pymatgen): A robust, open-source python library for materials analysis Computational Materials Science · Elsevier BV · 2012 10.1016/j.commatsci.2012.10.028
- The Materials Genome Initiative, the interplay of experiment, theory and computation Current Opinion in Solid State and Materials Science · Elsevier BV · 2014 10.1016/j.cossms.2014.02.003
- A superior descriptor of random textures and its predictive capacity Proceedings of the National Academy of Sciences · National Academy of Sciences · 2009 10.1073/pnas.0905919106
- Newton-Type Minimization via the Lanczos Method SIAM Journal on Numerical Analysis · Society for Industrial and Applied Mathematics · 1984 10.1137/0721052
- Lineal-path function for random heterogeneous materials Physical Review A · American Physical Society · 1992 10.1103/physreva.45.922
- Formulation and calibration of higher-order elastic localization relationships using the MKS approach Acta Materialia · Elsevier BV · 2011 10.1016/j.actamat.2011.04.005
- Reconstructing random media Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1998 10.1103/physreve.57.495
- Generating random media from limited microstructural information via stochastic optimization Journal of Applied Physics · American Institute of Physics · 1999 10.1063/1.371225
- DREAM.3D: A Digital Representation Environment for the Analysis of Microstructure in 3D Integrating materials and manufacturing innovation · Springer Nature · 2014 10.1186/2193-9772-3-5
- Algorithm for computer control of a digital plotter IBM Systems Journal · Institute of Electrical and Electronics Engineers · 1965 10.1147/sj.41.0025
- Characterization and reconstruction of 3D stochastic microstructures via supervised learning Journal of Microscopy · Wiley · 2016 10.1111/jmi.12441
- Inferring low-dimensional microstructure representations using convolutional neural networks Physical review. E · American Physical Society · 2017 10.1103/physreve.96.052111
- Materials Knowledge Systems in Python—a Data Science Framework for Accelerated Development of Hierarchical Materials Integrating materials and manufacturing innovation · Springer Nature · 2017 10.1007/s40192-017-0089-0
- Computational microstructure characterization and reconstruction: Review of the state-of-the-art techniques Progress in Materials Science · Elsevier BV · 2018 10.1016/j.pmatsci.2018.01.005
- DAMASK – The Düsseldorf Advanced Material Simulation Kit for modeling multi-physics crystal plasticity, thermal, and damage phenomena from the single crystal up to the component scale Computational Materials Science · Elsevier BV · 2018 10.1016/j.commatsci.2018.04.030
- A Transfer Learning Approach for Microstructure Reconstruction and Structure-property Predictions Scientific Reports · Nature Portfolio · 2018 10.1038/s41598-018-31571-7
- A Stochastic Quasi-Newton Method for Large-Scale Optimization SIAM Journal on Optimization · Society for Industrial and Applied Mathematics · 2016 10.1137/140954362
- An efficient antialiasing technique ACM SIGGRAPH Computer Graphics · ACM SIGGRAPH · 1991 10.1145/127719.122734
- Reconstruction of 3D Microstructures from 2D Images via Transfer Learning Computer-Aided Design · Elsevier BV · 2020 10.1016/j.cad.2020.102906
- Generating three-dimensional structures from a two-dimensional slice with generative adversarial network-based dimensionality expansion Nature Machine Intelligence · Nature Portfolio · 2021 10.1038/s42256-021-00322-1
- Reconstructing random heterogeneous media through differentiable optimization Computational Materials Science · Elsevier BV · 2021 10.1016/j.commatsci.2021.110455
- Adaptive active subspace-based efficient multifidelity materials design Materials & Design · Elsevier BV · 2021 10.1016/j.matdes.2021.110001
- Accessing pore microstructure–property relationships for additively manufactured materials GAMM-Mitteilungen · Wiley · 2021 10.1002/gamm.202100012
- A Generalized and Modular Framework for Digital Generation of Composite Microstructures Journal of Composites Science · Multidisciplinary Digital Publishing Institute · 2021 10.3390/jcs5080211
- An efficient optimization based microstructure reconstruction approach with multiple loss functions arXiv (Cornell University) · Cornell University · 2021 10.1016/j.commatsci.2021.110709
- Novel Hierarchical Correlation Functions for Quantitative Representation of Complex Heterogeneous Materials and Microstructural Evolution SSRN Electronic Journal · Social Science Electronic Publishing · 2019 10.2139/ssrn.3397269
- How important is microstructural feature selection for data-driven structure-property mapping? MRS Communications · Springer Nature · 2022 10.1557/s43579-021-00147-4
- Data Centric Design: A New Approach to Design of Microstructural Material Systems Engineering · Elsevier BV · 2022 10.1016/j.eng.2021.05.022
- A Comparison of Statistically Equivalent and Realistic Microstructural Representative Volume Elements for Crystal Plasticity Models Integrating materials and manufacturing innovation · Springer Nature · 2022 10.1007/s40192-022-00257-4
- Descriptor-based reconstruction of three-dimensional microstructures through gradient-based optimization Acta Materialia · Elsevier BV · 2022 10.1016/j.actamat.2022.117667
- FFT-based homogenization at finite strains using composite boxels (ComBo) Computational Mechanics · Springer Science+Business Media · 2022 10.1007/s00466-022-02232-4
- RadonPy: automated physical property calculation using all-atom classical molecular dynamics simulations for polymer informatics npj Computational Materials · Nature Portfolio · 2022 10.1038/s41524-022-00906-4