1. Introduction
Material microstructural characterisation using various microscopes, surface profilers, and wave diffractions results in the production of thousands of images every year. Processing these images can reveal the geometric characteristics of materials at the multiscale, which are closely linked to their properties and processing conditions. Using systematic varied processing parameters, the corresponding changes in the observed microstructure inform of the processing–microstructure relationships. An example can be seen in our recent paper about the effect of various electric processing parameters (current density, frequency, and loading duration) on the phase distribution and grain morphological evolution in cast mould flux [
1], where quantitative microstructure interpretation plays an important role in characterising the processing-microstructure relationship. On the other hand, different microstructures give rise to different material properties. Although experimental measurement is the ultimate route to determine the microstructure–property relationship, numerical calculation of a material’s properties from the observed microstructure can provide in-depth knowledge about microstructure–property relationships. Examples include the prediction of the fracture behaviours in brittle materials from their known configuration of phases and compositions using numerical calculation [
2,
3]. Precise interpretation of the observed microstructural pattern is again the key procedure to identify microstructure–property relationships.
In experimentally obtained microscopic images, such as those obtained from scanning electron microscopes (SEM), the brightness profile reveals morphological information of various phase fields. The contrast in those images is influenced by the interaction between the electron beam and the local surface of the sample. Roughness, chemical composition, and defect density all contribute to the distribution of contrast. Although sample preparation, such as the appropriate polishing and etching, can generate different roughness for different phases and hence improve the contrast, it is often observed that the contrast changes smoothly rather than sharply from one phase to another in these images. This imposes a challenge to the accurate interpretation of the microstructure, e.g., the critical greyscale value to separate two phases. The aim of the current work is to provide a computational and parameterising method to tackle the problem.
The microstructural images obtained from numerical simulations, however, are different from those obtained experimentally regarding the problem described earlier. In numerical calculations, such as those in phase-field simulation [
4,
5], the physical status of each pixel in the image is fully traced using a phase-field order parameter (
ϕ), and its value is always known throughout the computation. For example,
is frequently used to represent a liquid,
is frequently used to represent a solid, and
is frequently used to represent the interface in the simulation of solidification. In experimentally obtained microstructural images, however, the physical status of each pixel is represented by a greyscale value and its meaning needs further identification. The different etching times and accelerating voltage for electrons and facilities can cause the greyscale to alter drastically. Sometimes, comparison of microscopic images at the same location using different characterisation methods can help to clarify the physical status. Examples include the use of both SEM and electron backscatter diffraction (EBSD) images to determine whether two pieces of crystals belong to the same grain according to both their morphological characteristics and their crystallographic orientations. However, this is not always economic or available. This has driven the development of many numerical methods to solve microstructural problems. For example, machine learning using convolutional neural networks has led to some methods to count the number of grains with classified geometric shapes. An example of such a method is the widely used Image J software [
6], which was originally developed for biological and medical research to count the number of different types of bacteria and cells in microscopic images. The variation autoencoder is another powerful tool that can convert complex image information into several latent parameters, which can be used to generate artificially similar microstructures to aid material design by varying the values of latent parameters [
7]. This can also help quantify the long-standing argument regarding the similarity of microstructural images obtained at different positions in the same sample.
Although it is true that some phases in materials exhibit unique topological morphologies due to atom arrangement and processing conditions (such as undercooling-induced interface instability leading to dendrite formation [
8], crystal structure-related interface anisotropy leading to cubic [
9] or hexagonal surface formation [
10], and displacement transformation-induced plate-shaped martensite [
11]), many grains lose these characteristics during subsequent thermomechanical processing, such as deformation [
12] and recrystallisation [
13]. On the other side, new requirements arise for microstructural representation and interpretation. For example, in heterogeneous materials [
14,
15], the gradient distribution of grain size, rather than the average grain size, can improve both strength and toughness simultaneously. Conversely, the largest defect, rather than the average size or volume fraction of cracks, inclusions, and pores, is primarily responsible for their detrimental effect on materials [
16]. Additionally, the alignment of morphological anisotropic grains, without changes to the size and morphology of any individual grain, can completely alter the materials’ electromagnetic properties [
17]. To accurately describe the microstructure of materials, more sophisticated methods beyond conventional statistical analysis are required. Knowledge about the computational phase diagram could be integrated into microstructural calculation to enhance its interpretation. Some microscopic images suffer from high-amplitude noise. This makes it difficult to extract accurate information about the microstructure. Although there are various mathematical algorithms available, such as Bayesian inference [
18] and neural networks, they may not always provide fast and reliable solutions. In this work, we implement a cubic spline interpolation and develop a simple search algorithm to fulfil the task. The method helps to denoise images quickly with minimal loss of microstructural information. It is suitable for analysing images obtained from slags, ceramics, and other materials that are too brittle to polish, as well as certain metallic phases, such as the ferritic phase in steels, which are difficult to etch. The developed mechanism for extracting microstructural information in this work aids in predicting the properties of the materials.
2. Modelling and Algorithm
The value of a physical quantity (
, e.g., mass density, chemical composition, momentum, etc.) at a position (
in a continuous space can be calculated by its spatial distribution using the following equation [
19,
20]:
where
is called the kernel or weight function, and
is called the smoothing length. In a limit of
,
, Equation (1) becomes the following trivial format:
where
for
and
everywhere else. When the space is discretised into elements, Equation (1) becomes the following discrete format [
19]:
where
is the volume of the element
. In such a mathematical frame, the gradient of a property can be obtained by the gradient of the weight function rather than the gradient of the quantity itself [
19].
where
is one of the coordinate axes. There are several formats available for the weight function. The most commonly used format is the cubic spline kernel [
19,
20], which is based on Schoenberg’s piece-wise continuous functions [
21]. This kernel gives a weight function for the contribution of a quantity at the radial direction with a distance
as follows:
where
is dimension. The coefficient
takes a value of
,
, and
for one-dimensional (1D), two-dimensional (2D) and three-dimensional systems (3D), respectively. Equation (5) introduces a truncation radius that limits the contribution of distant elements to the calculation of the values at a given position. This allows the summation in Equations (3) and (4) to be calculated efficiently using the values at the position and its surrounding neighbours only, thereby reducing computing time.
A microscopic image, regardless of its dimensions, is formed by a bunch of discrete pixels with each pixel being represented by a greyscale value. Different phases have different brightness ranges due to their different chemical constitutions, crystal structures, corrosion behaviours during etching, etc. Those pixels greyscale in the same greyscale range represent a phase. Different phases have their greyscale values falling in different ranges. This type of classification agrees with metallurgical practise. Once the critical greyscale values to separate different phases are defined, one can convert the greyscale distribution to a phase-field order parameter distribution. The interface between different grains can be calculated according to the well-established marching square method. The total interface area and fraction of each phase can be obtained. Using visualisation software such as MatVisual, one can immediately see the phase distribution, grain distribution, and grain morphological characteristics. To know the number of grains and the size of each grain, the following simple grain searching algorithm was developed in the present work. The algorithm starts to search a small unit and then scans the image unit-by-unit to find grains. If a pixel does not belong to any found grains, a new grain is created. As scanning progresses, the previously independent grains that are found to be linked are merged into the same grain. After scanning, the total number of grains in each phase is found, and the number of pixels in each grain represents the volume of the corresponding grain. The spatial configuration of each grain’s pixels provides information about grain morphology, while the length of the outskirt of each grain corresponds to the interface. This procedure provides the required information in the image accurately and efficiently.
3. Application, Parameterisation, and Validation
Figure 1a shows an SEM image (obtained from a Zeiss Supra 55VP FEG SEM manufactured by Carl Zeiss AG) of an as-cast C-27.82CaO-19.87SiO
2-7.64Na
2O-7.51Al
2O
3-6.56F-5.9MnO-0.96Fe
2O
3-0.79MgO-0.31TiO
2-0.14K
2O (wt.%) slag [
1], which was obtained from the solidification of mould powders. The red lines in the images were added artificially to show the computational frame. This is to avoid including the areas with labels and notations in the SEM images. During sample preparation, the as-received mould powders were heated to 1173 K and maintained for 4 h to remove vapours, carbonaceous and other volatile constituents before being melted in a graphite crucible using an induction furnace. After the induction furnace’s heating was turned off, the molten mould flux was allowed to air cool in ambient conditions. The solidified samples were cut along the longitudinal section, polished, and examined via optical scanning electron microscopy. The image contained three phases: pores (darkest colour), cuspidine (2SiO
2·3CaO·CaF
2) primary dendrites (lightest colour), and a mixture of cuspidine, nepheline (NaAlSi
2O
4), and other residual elements (colour in between) [
22]. Each pixel’s brightness is represented by a greyscale integer ranging from 0 (black) to 255 (white) according to the regulations in computer graphics. A visualisation code package, MetallTools, was developed to pick up greyscale value at each phase, which provides greyscale value for the point that was just mouse-clicked. A random click in a pore, the residual phase, and primary dendrites, separately, gave greyscale values of 11, 123, and 202, respectively. These values can be changed slightly if different locations are clicked. The code package has the functionality to set these values manually. When the critical greyscale value to separate two phases is assumed to be in the middle of two adjacent phases, the pores are in a greyscale range between 0 and 66, those of the residual phase are between 67 and 161, and those of the primary dendrites are between 162 and 255. The interface was calculated using the marching square method and is plotted in
Figure 1b.
Figure 1a shows significant noise in each of the three phases. The interface shown in
Figure 1b demonstrates the intensity of the noise. For example, the residual phase labelled by arrows in
Figure 1a is hardly recognisable in
Figure 1b due to the greyscale value fluctuation. Although the phases in
Figure 1a are recognisable by the naked eye, it is difficult for a computer to recognise the pattern and perform statistical calculations of the microstructural characteristics without numerical treatment. For this purpose, Equation (3) with
and the kernel format in Equation (5) were implemented to recalculate the greyscale values in each pixel in
Figure 1a. The result is shown in
Figure 1c and the corresponding interface is shown in
Figure 1d. The grain morphology in
Figure 1c is much smoother than that in
Figure 1c, and all three phases are recognisable in
Figure 1d.
Figure 1e,f shows the results with
. It can be seen that the image is over-smoothed, and the fractions of dendrite and residual phases are clearly changed by the smoothening calculation. More different smoothing lengths with
and
were tested.
gives the best result.
Figure 2 shows the volume fraction of the pixels and the greyscale value relationship.
Figure 2a was obtained from the original image of
Figure 1a, and
Figure 2b is for those processed images in
Figure 1c,e and the other unpresented ones. Instead of the expected three peaks corresponding to the three phases and the area under each peak equalling the corresponding phase’s volume fraction,
Figure 2a contains not only high-amplitude noise but only two peaks instead of three.
Figure 2b shows that the noise in the smoothed image has been effectively suppressed for all
calculations. In the calculations with
and
, some missing peaks caused by noise reappear, as indicated by the arrows. In contrast, excess smoothing lengths with
smears out some peaks again and moves the peaks toward the average greyscale value in the image, which should be avoided.
After setting of the smoothing length with
, the next group of parameters to be defined is the critical greyscale values. As can be seen in
Figure 2b with the curve at
, different critical values will give rise to different amounts of phases. To obtain a more precise microstructure description, it is important to set the critical greyscale values correctly so that the amounts of phases represented in the image is correct. However, the peaks in the greyscale distributions shown in
Figure 2b are not sharp enough, and the volume fraction of greyscale is not well converged between neighbouring peaks. This raises a need to establish reliable critical greyscale values to obtain precise volume fractions of each phase. To address this,
Figure 3 displays the calculated relationship between (a) the volume fraction of primary dendrites and the critical greyscale values and (b) the volume fraction of pores and the corresponding greyscale values in the smoothed image. The figure demonstrates a clear monotonic relationship between the critical greyscale values and the volume fraction of each phase. If the volume fraction of each phase is provided, the critical greyscale values can be calculated straightforwardly using the algorithms proposed in this study and the numerical results presented in
Figure 3. To this end, one suggests using the volume fraction of phases provided by computational thermodynamics [
23], phase diagram calculations [
24], and experimental techniques like X-ray diffraction. By such means, the computational algorithms developed in this study can directly achieve a quantitative assessment of material microstructure.
The importance of the accurate implementation of the volume fraction of phases to determine the critical greyscale values is demonstrated in
Figure 4, where the critical greyscale value between pores and the residual phase is set to 67, while that between the residual phase and primary dendrites is set to (a) 150, (b) 155, (c) 160, and (d) 165. Two grains are highlighted: one at the residual phase in pink (around the top-right) and another dendrite grain in blue (around the bottom-right). Both have significantly different sizes from
Figure 4a–d. This imposes an important impact on the prediction of the mechanical and physical properties of materials [
25]. For example, the crystal phase has better heat conductivity than the other phases [
26], where a large-scale crystal skeleton forms a percolation path to conduct heat, while the intersected dendrite by the residual phase is unable to do so.
Figure 4 demonstrates another important fact. When the volume fraction of the dendrite drops slightly, the chance for the grains in the residual phase to link to each other to form a larger interconnected area is increased drastically. The grain in the pink color in
Figure 4a occupies only a small corner. However, it spreads to cover a majority area in
Figure 4b and becomes dominant in
Figure 4c,d. The grain searching algorithm reveals the following information for primary dendrites in
Figure 4: (1) the volume fractions are: (a) 0.54, (b) 0.49, (c) 0.44, and (d) 0.39. (2) The largest dendrite grain occupies an area of (a) 113,538 μm
2, (b) 28,942 μm
2, (c) 11,511 μm
2, and (d) 2476 μm
2. (3) The number of dendrites of significant size is (a) 1, (b) 10, (c) 26, and (d) 173, where a significant size means that the grain area is not in the smallest region if the grain areas between the largest and smallest ones are divided into 10 equal regions. For the residual phase in
Figure 4, the maximum domain area is (a) 18,322 μm
2, (b) 91,090 μm
2, (c) 143,294 μm
2, and (d) 189,491 μm
2, respectively. Although the grain searching algorithm counted the total number of grains and the total grain area in each phase, we avoided mentioning the average grain size in the present case because lots of grains are not fully visible in the image scope. However, it can be used in other images where most of the grains are fully displayed in the view scale. In oxide materials with the chemical constitution discussed in the present work, electrical conduction is carried out by the motion of the cations and anions. The conductivity of the solidified phase is negligible due to the rigid bonds between atoms and molecules. Those residual liquid phase domains entirely entrapped by the solidified phase areas do not contribute to the overall material’s electric conductance. It is well known that electropulsing retards the growth of the phase with high electrical resistance. The reduced amount of dendrite enables the residual liquid phase to form a network and conduct electricity. This partially explains the experimentally observed high conductivity up until a very low temperature.