1 Introduction

Dual Phase steels (DP steels) have shown high potential for many applications due to their remarkable combination of high strength and good formability.

Here we consider a sample of steel formed by martensite and ferrite. The relative position and geometric structure of the two phases are responsible for the mechanical properties of the material, thus it is particularly important to provide statistical models which may reproduce the main geometric characteristics of the two phases. Our results are based on images of about 150 tomographic sections taken from a lab sample of steel.

The formation of the two phases of the material starts after a cooling phase of the melted alloy of iron and carbon, during which austenite is formed, followed by a rolling phase, transforming slabs of steel into thin metal foils.

A further cooling phase follows the rolling; during this phase the formation of ferrite starts. Crystals of ferrite nucleate mainly from the interfaces of the rolled (and thus deformed) austenite, and grow up to impinge on other crystals of ferrite, driven by the evolving field of carbon concentration. After a fixed time interval the formation of ferrite is stopped by a sudden quenching, during which the material that is still not transformed into ferrite, becomes martensite. The final result is a dual phase steel formed by ferrite and martensite, having a stochastic geometric structure.

In order to define a dynamical model able to reproduce the complete geometric structure of the material, a stochastic birth and growth process coupled with the evolution of the carbon field, the temperature evolution and the mechanical stresses due to rolling should be used (see [1] for similar models applied to polymer crystallization). A first model which goes in this direction, though facing the problem at only a macroscopic scale, neglecting the microscopic geometry, has been studied in [2].

The problem of building a random geometric model, at the microscopic level, for DP steels has already been faced in [3, 4]. In these papers the results were based on measurements taken on a 3D reconstruction of the material, obtained by means of a large number of 2D tomographic sections of a real sample. Since taking sections is expensive, here we aim to build a 3D model using methods for parameters identification applicable also in case of a lower number of available sections, in order to reduce the industrial experimental costs.

Furthermore in [3, 4] the material has been considered homogeneous, even though anisotropies in the real sample are present in one direction. In order to take such anisotropies into account, we here propose a different germ-grain model, with an higher number of unknown parameters, and based on more detailed measurements. In such situation the common Mahalanobis distance, used in the previous papers, is computationally expensive to be used for the parameters estimation, since the sample covariance matrix becomes singular in presence of small samples. Thus we here introduce a new metric, the \(\mathcal{N}\)-distance, which is convenient in geometric problems, as mentioned in [5].

As from a confidentiality agreement with Nippon Steel & Sumitomo Metal, who provided the real data, the images of the real sample will not be shown.

2 Structure of the austenite phase

We first considered the geometric structure of the interfaces of austenite after rolling, since nucleation of ferrite happens mainly on such interfaces, so that the location of the final ferrite and martensite crystals depends on the location of such interfaces.

The shape of the crystals of austenite before rolling is quite close to a 3D Voronoi tessellation, but after the deformation due to rolling, the interfaces between different crystals can be approximated by parallel planes, with random levels, as discussed in [3, 4] and supported by previous studies [6].

Thus we have modelled the interfaces of austenite as parallel horizontal planes, i.e. parallel to direction XZ, as shown in Figure 1. Their levels, along the Y axis, have been included in the parameters of the model, which need to be estimated. See also Figure 2 for the names of the three main directions that we will adopt throughout the paper.

Figure 1
figure 1

Simulated parallel planes, from which the nucleation of ferrite starts.

Figure 2
figure 2

The rolling direction and the direction of sectioning in the considered real sample.

In Figure 3 a simulated sample of the two phases which resembles the real one is reported. The black region, occupied by martensite, can be represented as the free space between different crystals of ferrite at the moment of quenching. Since the crystals of ferrite nucleate on the parallel planes representing the interfaces of austenite, martensite will have a tendency to be concentrated in between two adjacent parallel planes.

Figure 3
figure 3

A simulated sample of the two phases: the region occupied by martensite is depicted in black, while ferrite is in white.

3 Morphological analysis of the martensite

In order to set up a geometrical model which may realistically represent the material, we first described quantitatively the geometrical structure of the martensite via a morphological analysis of the real sample. The morphology of a random set may be characterized [7, 8] by the densities of the relevant Minkowski functionals (the interested reader might see [9] for the definition and [1012] for properties and examples of applications). Since the about 150 sections of our real sample have been taken at a distance equal to the side of a pixel, the real sample can be regarded either as a collection of (correlated) 2D sections, each represented by an image composed by 2D pixels, or as a 3D sample of the material, represented by a parallelepiped composed by 3D voxels, obtained by piling the sections one over the other. Thus we can either consider the three-dimensional densities of Minkowski functionals, that is densities of Hausdorff measures per unit volume at different dimensions (volume density or volume fraction \(V_{V}\), volumetric surface density \(S_{V}\), volumetric density of average breadth \(B_{V}\) and volumetric density of Euler-Poincaré characteristics \(E_{V}\)) on the whole 3D sample, or we may consider the two-dimensional Minkowski functionals, that is densities of Hausdorff measures per unit area (volume fraction \(V_{A}\), areal surface density \(S_{A}\), and areal density of Euler-Poincaré characteristics \(E_{A}\)), when we consider every single 2D section.

In general all these functionals are constant in space only if the random set under study is isotropic and stationary, i.e. its distribution is invariant under rigid motions.

The functionals have been computed according to the estimators described in [13], using the Matlab codes which can be downloaded from [14], both in their 2D or 3D versions.

The advantage of performing a volumetric study of the real sample is that in this way we may understand if the material presents some anisotropy or non stationarity in specific directions, and take these features into account in the construction of the model. By the way, since the industrial aim is to reduce the number of sections needed to set up a reasonable model, in the parameter estimation phase we need to use the 2D Minkowski functionals. Indeed they can be computed also in the case of a smaller number of available sections, even not equally spaced, and taken at distances bigger than those of our real sample.

3.1 Study of 3D Minkowski functionals

In order to study the stationarity and the isotropy of the real sample in the three main directions, we first performed a morphological closing of the martensite, in order to eliminate some porosity which is not relevant for our morphological study (see [4] for a discussion). We then computed the densities of the Minkowski functionals of the martensite, by sectioning the sample into slices of 10 voxels of width in the directions of the three main axes, as labelled in Figures 2, 3. The results are reported in Figure 4.

Figure 4
figure 4

The densities of the Minkowski functionals computed along the three main directions on the real sample after a 3D closure with a sphere of radius 5 voxels. The directions have been named as in Figures 2, 3.

The functionals show a very low variability along the directions Z and X, while they show a sort of periodicity along the direction Y. This fact is confirmed by a visual inspection of the real sample, which shows a ‘striped’ structure along the direction Y, which is reasonable since the direction of rolling is parallel to the XZ plane.

We will use the Minkowski functionals of the closed real image as a reference in the procedure of parameter identification of the geometrical model reproducing the material, described in the following sections.

3.2 Study of the covariance and autocorrelation functions

The covariance function of a random closed set is related to the second order properties of the set and gives information on the stationarity and isotropy of the object under study [10, 11].

Other techniques to investigate the presence of anisotropies in a material are present in literature (see e.g. [15]), that we don’t apply here, since we are investigating only the presence of main sources of anisotropy, to build a first (and maybe rough) geometric model, but with a few unknown parameters. Anyway such techniques could be used in the future to refine the model.

Definition

The covariance function \(C(x,x+h)\) of a random closed set \(A\subset\mathbb{R}^{d}\) is

$$C(x,x+h)=P[x\in A, x+h\in A],\quad x,h\in\mathbb{R}^{d}. $$

For a stationary random set, \(C(x,x+h)=C(h)\). If in addition A is ergodic [10], \(C(h)\) can be estimated from the volume fraction of \(A\cap A_{-h}\), i.e.

$$C(h)=V_{V}(A\cap A_{-h}), $$

where \(A_{-h}=\{x-h |x\in A\}\). For a stationary and ergodic random set, \(\lim_{h\to\infty }C(h)=(V_{V})^{2}\), which means that the covariance function has a sill coinciding with the square of the volume fraction.

In Figure 5 the estimate of the covariance function of the martensite, computed in the three main directions, is reported.

Figure 5
figure 5

The covariance function computed along the three main directions of the closed real sample. The theoretical value of the sill is also reported.

The plot shows that in direction Y there is a tendency to clustering, since the covariance function in direction Y is lower than those in the other directions and, at scales bigger than \(h=25\), \(C(h)\) is also below the prescribed sill value. This confirms the striped structure of the martensite that had been already noticed by a visual inspection of the sample. On the other side, the shape of the covariance function in the directions X and Z confirms that the material is stationary in such directions.

In order to confirm the results obtained by the analysis of the covariance function, we also computed the autocorrelation function of the Minkowski functionals in the three main directions. Let us reinterpret the Minkowski functionals as time series \(\{X_{t}\}\), where t is varying along the slices of the sample in the different directions. The autocorrelation function of \(\{X_{t}\}\) is defined as [16]

$$\rho(h)=\operatorname{Corr}(X_{t+h},X_{t}), $$

where h is called lag and in our case is varying in \(\mathbb{N}\). The empirical counterpart of the autocorrelation function gives information on the presence of periodicities in the stochastic process \(\{X_{t}\}\). In particular, if the estimated \(\rho(h)\) falls out at some lag from a confidence band built under the hypothesis that \(\{ X_{t}\}\) is a white noise, then \(X_{t}\) and \(X_{t+\bar{h}}\) are significantly correlated and there is a periodicity in the process \(\{ X_{t}\}\), with period or half-period equal to .

The results of the estimate of the autocorrelation function of the Minkowski functionals along the three main directions are reported in Figure 6.

Figure 6
figure 6

The empirical autocorrelation functions of the Minkowski functionals along the three main directions, and 95% confidence bands computed under the assumption of white noise, i.e. of no correlation.

Again we observe the presence of a significant (negative) autocorrelation only in direction Y, at lag 3, of the first three Minkowski functionals, revealing thus a periodicity of the material only in direction Y, with half period equal to 3 lags, that is 30 voxels.

Since the four Minkowski functionals are not independent, we also applied a Bonferroni correction to the confidence bands in direction Y, as reported in Figure 7, but the results are unchanged.

Figure 7
figure 7

The empirical autocorrelation function of the Minkowski functionals in direction Y and confidence bands computed with the Bonferroni correction, i.e. dividing by 4 the significance α used in Figure  6 .

The results obtained with both the covariance and the autocorrelation functions are consistent with the experimental conditions, which are schematically depicted in Figure 2: the anisotropies in the material are due to the rolling phase and thus in order to avoid to loose relevant information on its structure, the sections must be taken in a direction parallel to the Y axis; for example, as in our case, in direction orthogonal to Z.

3.3 Study of 2D Minkowski functionals

Since in the parameter estimation procedure we will use the estimates of the 2D Minkowski functionals on the sections of the material, we report here a preliminary study of these functionals.

The sections are orthogonal to direction Z, thus on each section we can study only the behaviour of the functionals in the directions X and Y. We divided each section of the real sample, after the closure operation, into stripes of 10 pixels of width each, both orthogonally to direction Y and to direction X. In each stripe we computed the 2D Minkowski functionals and we plotted them for all the sections, in Figure 8.

Figure 8
figure 8

The Minkowski functionals computed along the directions X and Y on each of the about 150 sections taken orthogonally to direction Z . Each curve corresponds to a different section. The black curve is the mean over all sections.

Also in this case, as expected, the mean of the Minkowski functionals over the sections is oscillating more in direction Y than in direction X. Furthermore we note an increased local variability of the functionals in direction Y with respect to direction X.

4 A germ-grain model

In order to set up a statistical model able to reproduce the mean geometric structure of the real sample of steel, we propose a germ-grain model with spherical grains, depending on a small set of unknown parameters. The model will reproduce the structure of the ferrite phase, neglecting the interfaces between different crystals, so that the martensite will be represented by the empty space between different grains of the model.

A germ-grain model is a random closed set \(\varXi \subseteq\mathbb{R}^{d}\) defined as

$$\varXi =\bigcup_{i\in\mathbb{N}} \varTheta _{i} \oplus x_{i}, $$

where \(\{x_{i}\}\) are points in \(\mathbb{R}^{d}\) forming a locally finite point process, called germs; \(\varTheta _{i}\) are independent identically distributed (i.i.d.) uniformly bounded random closed sets (usually containing the origin) called grains, and ⊕ denotes the Minkowski sum between sets, thus \(\varTheta _{i} \oplus x_{i}=\{ y+x_{i} | y\in \varTheta _{i}\}\) (for more details see [8, 10]).

We modelled the point process of germs as a clustered point process of Neyman-Scott type, taking into account that ferrite nucleates in the surrounding of parallel planes, and also observing that martensite in the real sample exhibits a ‘striped’ structure.

The Neyman-Scott point process ([10], Section 5.3) is obtained by generating a spatial Poisson point process of parents having intensity \(\lambda_{p}(x)\) and then surrounding the parents by a random number of daughter points, scattered independently and identically distributed around the parents. The parents are then removed and the Neyman-Scott process is formed just by the daughter points.

Hence the germs are generated according to the following algorithm.

Algorithm 1

Input:

\(n_{\text{planes}} = \text{number of parallel planes}\);

\([z_{1},\ldots, z_{n_{\text{planes}}}]= \text{levels of the parallel planes}\);

\(\sigma_{\text{vert}}= \text{standard deviation of the daughters' distribution in the vertical direction}\);

\(\sigma_{\text{hor}}=\text{standard deviation of the daughters' distribution in the horizontal direction}\);

\(\lambda=\text{mean number of germs to be generated}\).

  • Step 1: locate parallel planes, from which ferrite nucleates, into positions \(z_{1},\ldots, z_{\text{planes}}\);

  • Step 2: generate the number \(N_{g}\sim \operatorname{Poisson}(\lambda )\) of germs to be located in the 3D space;

  • Step 3: fix the number of parent germs to \(0.03\cdot N_{g}\);

  • Step 4: distribute the parent germs uniformly on the parallel planes;

  • Step 5: distribute the \(N_{g}\) daughter germs around the parents according to a 3-variate normal distribution having diagonal covariance matrix given by

    $$\varSigma =\operatorname{diag}\bigl(\sigma_{\text{hor}}^{2}, \sigma_{\text{hor}}^{2}, \sigma_{\text{vert}}^{2}\bigr). $$

We used the results of preliminary analyses of the model in order to reduce the number of parameters to be estimated: the proportion of parents, fixed to the 3% of the daughter germs, has been obtained by applying the optimisation technique described in [4] and by including the proportion of parents between the parameters to be estimated.

The number of parallel planes from which the germ process originates has been fixed to 7, since again this was the optimal estimate for this quantity in [4]. The seven levels of the planes \([z_{1},\ldots, z_{7}]\) are among the parameters to be estimated.

The grains have been modeled as independent spheres of random radius \(R=L\cdot\rho\), where \(L=25\) is a constant representing the maximum possible radius of the spheres (it has again been fixed to 25 because this was the optimal value for this parameter obtained in [4]) and ρ is a random variable distributed as a \(\operatorname{Beta}(3,b)\) distribution, where b is a parameter to be estimated. In previous works [3, 4] the random radii of the spheres had a distribution obtained by a mixture of two Beta’s, one favouring small radii and the other favouring big radii, but results of parameters estimation proved that the two estimated distributions were not much different. Thus, in this work we used only a single distribution in order to reduce the number of parameters to be estimated.

In order to avoid edge effects, the simulation of the model has been performed in a window of observation enlarged by L on each side, and, then, only the central portion of the window with dimensions equal to the real sample has been considered.

Thus the germ grain model is based on the following 11 parameters:

$$ \bigl([z_{1},\ldots, z_{7}], \sigma_{\text{hor}}, \sigma_{\text{vert}}, b,\lambda\bigr)\in\mathbb{N}^{7}\times \mathbb{R}_{+}\times\mathbb {R}_{+}\times [0,+\infty )\times(0,+\infty). $$
(1)

Note that \([z_{1},\ldots, z_{7}]\) are integers since they are expressed in number of voxels.

5 Parameters estimates

For each set of the parameters \(\underline{p}=( [z_{1},\ldots, z_{7}], \sigma_{\text{hor}}, \sigma_{\text{vert}}, b,\lambda)\) we performed 10 simulations of the germ grain model, each producing a 3D binary sample with the same dimensions as the real one. Each simulated sample was then cut orthogonally to the Z direction, obtaining the same number of sections available from the real sample. On each section we estimated the volume, surface, and Euler characteristic areal densities, i.e. the densities of 2D Minkowski functionals. The parameters can be estimated by minimising a suitable distance between the values of the densities estimated on the sections of the (closed) real sample and the densities estimated on the sections of the simulated germ-grain model.

In [3, 4] the Mahalanobis distance has been used, but since here we want to take into account the inhomogeneities of the material in direction Y, we need to measure the Minkowski functionals more in detail in this direction. As will be clear in the following, this implies that our data will be random vectors of rather high dimension (at least 72), and the estimate of the corresponding covariance matrix, to be used in the Mahalanobis distance, would need a very high number of simulated experiments, increasing thus too much the computational costs. We then looked for other metrics which are more computationally efficient also in presence of high dimensional data.

5.1 The \(\mathcal{N}\)-distance

A suitable distance to compare geometric descriptors of different random closed sets has been proven to be the \(\mathcal{N}\)-distance (see [5, 17]).

Definition 1

Let \((\mathcal{X,U})\) be a measurable space and let μ and ν be two probability measures defined on it. Let \(\mathcal{L}\) be a strongly negative definite kernel on \(\mathcal {X}^{2}\) satisfying

$$\mathcal{L}(x,y)=\mathcal{L}(y,x)\quad \mbox{and}\quad \mathcal{L}(x,x)=0\quad \mbox{for all } x,y\in\mathcal{X}. $$

Then

$$\begin{aligned} \bigl(\mathcal{N}(\mu,\nu)\bigr)^{1\over 2} :=& \biggl(2 \int_{\mathcal {X}} \int_{\mathcal{X}} \mathcal{L}(x,y)\, d\mu(x)\, d\nu(y) \\ &{}- \int_{\mathcal{X}} \int_{\mathcal{X}} \mathcal {L}(x,y)\, d\mu(x)\, d\mu(y) - \int_{\mathcal{X}} \int_{\mathcal{X}} \mathcal{L}(x,y)\, d\nu(x)\, d\nu(y) \biggr)^{1\over 2} \end{aligned}$$

is a distance called \(\mathcal{N}\)-distance between the measures μ and ν.

Definition 2

Let X, Y be two independent random variables with associated probability measures \(\mu,\nu\) respectively. Denote by \(X'\), \(Y'\) two independent copies of X, Y respectively, i.e. X and \(X'\) are identically distributed, Y and \(Y'\) are identically distributed, and all X, \(X'\), Y, \(Y'\) are mutually independent. Then we can write

$$\mathcal{N}(X,Y):= \mathcal{N}(\mu,\nu)=2E\mathcal{L}(X,Y) - E\mathcal{L} \bigl(X,X'\bigr) - E\mathcal{L}\bigl(Y,Y'\bigr), $$

and \((\mathcal{N}(X,Y))^{1/2}\) is called \(\mathcal{N}\)-distance between the random variables X and Y.

For the discussion on the properties of the \(\mathcal{N}\)-distance the interested reader may see [5, 17], while in [18] an example of application can be found.

We describe here shortly how the \(\mathcal{N}\)-distance will be applied in the context of our application.

Assume that m geometrical quantities \(\underline{X}=[X_{1}, \ldots, X_{m}]'\) are measured for each available section of the simulated material. If k sections are available, the measurements will be collected in a data matrix \({\mathcal{X}}\) having dimension \(m\times k\). Note that in our case, if the sections are not sufficiently far apart, the measures of the geometrical quantities can not be considered independent, and thus the columns of \({\mathcal{X}}\) do not form an i.i.d. sample of size k of a multivariate random variable \(\underline{X} \in\mathbb{R}^{m}\). The independence of the columns of the data matrix unfortunately is essential to the theoretical proof of many properties of the \(\mathcal{N}\)-distance. We will disregard this problem for a moment.

The same m geometrical quantities are also measured on the same number k of sections of the real sample material, forming thus a data matrix \({\mathcal{Y}}\), again having dimensions \(m\times k\).

The empirical counterpart of the \(\mathcal{N}\)-distance (see expression (2) in [18], or [17]) is given by

$$\bigl(N({\mathcal{X}}, {\mathcal{Y}})\bigr)^{1\over 2}=\frac{1}{k} \Biggl[\sum_{i=1}^{k}\sum _{j=1}^{k} \bigl(2\mathcal{L}(\underline{X}_{i}, \underline{Y}_{j}) -\mathcal{L}(\underline{X}_{i}, \underline{X}_{j}) - \mathcal {L}(\underline{Y}_{i}, \underline{Y}_{j}) \bigr) \Biggr]^{1\over 2}, $$

where \(\underline{X}_{l}\), \(\underline{Y}_{l}\) are the lth column of \({\mathcal {X}}\) and \({\mathcal{Y}}\), respectively, and \(\mathcal{L}(\underline{S}, \underline{T})=\|\underline{S}-\underline{T}\|\) is the Euclidean distance between vectors \(\underline{S}\), \(\underline{T}\), which can be proven [5, 17] to be a strongly negative definite kernel. Note that with this choice the \(\mathcal{N}\)-distance is a sort of mean of the Euclidean distance between the two samples, with two penalty terms due to the intrinsic variability of both samples.

In our application, we considered two approaches in the construction of the data matrices \({\mathcal{X}}\), \({\mathcal{Y}}\): the first one gives more emphasis to direction Y, which is the one with bigger variability, the second one gives equal emphasis both to directions Y and X.

Since inhomogeneities in direction Y are present in the real sample, as was confirmed by the morphological analyses reported in Section 3, in both approaches we decided to divide each considered 2D section of the sample into stripes in direction Y, as reported in Figure 9, so that in each stripe the material can be considered homogeneous and the Minkowski functionals can be locally approximated by constants. In the second approach for the data matrices construction we applied the same division into stripes also to direction X, to check if, by taking into account local variations in both directions, the parameter identification results more accurate, in spite of the variance inflation.

Figure 9
figure 9

The division into stripes in direction Y of a section of the simulated material. In each stripe the three 2D Minkowski functionals are computed. We used 24 stripes, each formed by \(10\times200\) pixels.

Each section both of the real and the simulated material is represented by an image having dimension \(200\times240\) pixels in directions \(X\times Y\).

Case 1. Construction of \(\mathcal{Y}\): in order to ‘increase the independence’ of the elements of our sample, along Z direction we considered only one section out of two. As already mentioned, this choice does not guarantee that the theoretical properties of the \(\mathcal{N}\)-distance hold, but enforces the possibility that they are anyway satisfied. The study of the autocorrelation functions of the Minkowski functionals in direction Z, reported in Figure 6, suggests that a good choice to obtain (almost) uncorrelated sections would be to consider one section out of 20, since the autocorrelations of the first three functionals are almost null at lag 2 (note that each lag corresponds to 10 sections), but in this way we would reduce too much our sample.

For each considered section l of the real sample we built the vectors \(\underline{Y}_{l}\) (i.e. the columns of \(\mathcal{Y}\)) containing (see Figure 9)

  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[V^{\text{real}}_{1},\ldots, V^{\text{real}}_{24} \bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[S^{\text{real}}_{1},\ldots, S^{\text{real}}_{24} \bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[E^{\text{real}}_{1},\ldots, E^{\text{real}}_{24} \bigr]_{|\text{section } l}. $$

Thus \(\underline{Y}_{l}=[V^{\text{real}}_{1},\ldots, V^{\text{real}}_{24}, S^{\text{real}}_{1},\ldots, S^{\text{real}}_{24}, E^{\text{real}}_{1},\ldots, E^{\text{real}}_{24}]'_{|\text{section } l} \in\mathbb{R}^{72}\).

Construction of \(\mathcal{X}\): let us fix the vector \(\underline{p}\) of unknown parameters of our germ-grain model. We then performed 10 simulations of the germ-grain model with parameters \(\underline{p}\) and for each simulated sample we considered one section out of two, like in the real material. On each considered section l and for each simulation \(r=1,\ldots, 10\) we computed

  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[V^{\text{sim}}_{1}(\underline{p},r),\ldots, V^{\text{sim}}_{24}(\underline{p},r)\bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[S^{\text{sim}}_{1}(\underline{p},r),\ldots, S^{\text{sim}}_{24}(\underline{p}, r)\bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[E^{\text{sim}}_{1}(\underline{p}, r),\ldots, E^{\text{sim}}_{24}(\underline{p},r)\bigr]_{|\text{section } l}. $$

Thus

$$\begin{aligned} \underline{X}_{l}(\underline{p}, r) =&\bigl[V^{\text{sim}}_{1}( \underline{p},r),\ldots, V^{\text{sim}}_{24}(\underline{p},r), S^{\text{sim}}_{1},\ldots, S^{\text{sim}}_{24}( \underline{p},r), \\ & E^{\text{sim}}_{1}(\underline{p},r),\ldots, E^{\text{sim}}_{24}( \underline{p},r)\bigr]'_{|\text{section } l} \in\mathbb{R}^{72}. \end{aligned}$$

The columns of \({\mathcal{X}}={\mathcal{X}}(\underline{p})\) (in our case the data matrix of the simulated sample will depend on the choice of the parameters of the model) have been obtained by averaging \(\underline{X}_{l}(\underline{p}, r)\) over the simulations, thus

$${\mathcal{X}} (p)= \bigl[\underline{\bar{X}}_{l}(\underline{p}) \bigr]_{l=1}^{\text{n. of sections}}, $$

where \(\underline{\bar{X}}_{l}(\underline{p})={1\over 10}\sum_{r=1}^{10} \underline{X}_{l}(\underline{p},r)\).

The parameters of the model are then estimated by minimising the empirical \(\mathcal{N}\)-distance between \({\mathcal{X}}(\underline{p})\) and \(\mathcal{Y}\):

$$\underline{\hat{p}}=\arg \min_{\underline{p}} N\bigl({\mathcal {X}}( \underline{p}), {\mathcal{Y}}\bigr). $$

Case 2. Construction of \(\mathcal{Y}\): in order to ‘increase the independence’ of the elements of our sample, along Z direction we again considered only one section out of two, like in Case 1. For each considered section l of the real sample we built the vectors \(\underline{Y}_{l}\) (i.e. the columns of \(\mathcal{Y}\)) containing (see Figure 10)

  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[V^{Y,\text{real}}_{1},\ldots, V^{Y,\text{real}}_{24} \bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[S^{Y,\text{real}}_{1},\ldots, S^{Y,\text{real}}_{24} \bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[E^{Y,\text{real}}_{1},\ldots, E^{Y,\text{real}}_{24} \bigr]_{|\text{section } l}; $$
  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[V^{X,\text{real}}_{1},\ldots, V^{X,\text{real}}_{20} \bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[S^{X,\text{real}}_{1},\ldots, S^{X,\text{real}}_{20} \bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[E^{X,\text{real}}_{1},\ldots, E^{X,\text{real}}_{20} \bigr]_{|\text{section } l}. $$

Thus

$$\begin{aligned} \underline{Y}_{l} =&\bigl[V^{Y,\text{real}}_{1},\ldots, V^{Y,\text{real}}_{24}, S^{Y,\text{real}}_{1},\ldots, S^{Y,\text{real}}_{24}, E^{Y,\text{real}}_{1},\ldots, E^{Y,\text{real}}_{24}, \\ & V^{X,\text{real}}_{1},\ldots, V^{X,\text{real}}_{20}, S^{X,\text{real}}_{1},\ldots, S^{X,\text{real}}_{20}, E^{X,\text{real}}_{1},\ldots, E^{X,\text{real}}_{20}, \bigr]'_{|\text{section } l} \in\mathbb{R}^{132}. \end{aligned}$$
Figure 10
figure 10

The division into stripes in direction Y and direction X of a section of the simulated material. In each stripe in the two directions the three 2D Minkowski functionals are computed. We used 24 ‘horizontal’ stripes in direction Y, each formed by \(10\times200\) pixels, and 20 ‘vertical’ stripes in direction X, each formed by \(240 \times10\) pixels.

Construction of \(\mathcal{X}\): as in Case 1, let us fix the vector \(\underline{p}\) of unknown parameters of our germ-grain model. We then performed 10 simulations of the germ-grain model with parameters \(\underline{p}\) and for each simulated sample we considered one section out of two, like in the real material. On each considered section l and for each simulation \(r=1,\ldots, 10\) we computed

  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[V^{Y,\text{sim}}_{1}(\underline{p},r),\ldots, V^{Y,\text{sim}}_{24}(\underline{p},r)\bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[S^{Y,\text{sim}}_{1}(\underline{p},r),\ldots, S^{Y,\text{sim}}_{24}(\underline{p}, r)\bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction Y,

    $$\bigl[E^{Y,\text{sim}}_{1}(\underline{p}, r),\ldots, E^{Y,\text{sim}}_{24}(\underline{p},r)\bigr]_{|\text{section } l}; $$
  • the area densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[V^{X,\text{sim}}_{1}(\underline{p},r),\ldots, V^{X,\text{sim}}_{20}(\underline{p},r)\bigr]_{|\text{section } l}; $$
  • the perimeter densities of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[S^{X,\text{sim}}_{1}(\underline{p},r),\ldots, S^{X,\text{sim}}_{20}(\underline{p}, r)\bigr]_{|\text{section } l}; $$
  • the density of Euler-Poincaré characteristics of martensite computed in each 2-dimensional stripe of 10 pixels along direction X,

    $$\bigl[E^{X,\text{sim}}_{1}(\underline{p}, r),\ldots, E^{X,\text{sim}}_{20}(\underline{p},r)\bigr]_{|\text{section } l}. $$

Thus

$$\begin{aligned} \underline{X}_{l}(\underline{p}, r) =&\bigl[V^{Y,\text{sim}}_{1}( \underline{p},r),\ldots, V^{Y,\text{sim}}_{24}(\underline{p},r), S^{Y,\text{sim}}_{1},\ldots, S^{Y,\text{sim}}_{24}( \underline{p},r), \\ & E^{Y,\text{sim}}_{1}(\underline{p},r),\ldots, E^{Y,\text{sim}}_{24}( \underline{p},r), \\ & V^{X,\text{sim}}_{1}(\underline{p},r),\ldots, V^{X,\text{sim}}_{20}( \underline{p},r), S^{X,\text{sim}}_{1},\ldots, S^{X,\text{sim}}_{20}( \underline{p},r), \\ & E^{X,\text{sim}}_{1}(\underline{p},r),\ldots, E^{X,\text{sim}}_{20}( \underline{p},r)\bigr]'_{|\text{section } l} \in\mathbb{R}^{132}. \end{aligned}$$

Also in this case the columns of \({\mathcal{X}}={\mathcal {X}}(\underline{p})\) have been obtained by averaging \(\underline{X}_{l}(\underline{p}, r)\) over the simulations, thus

$${\mathcal{X}} (p)= \bigl[\underline{\bar{X}}_{l}(\underline{p}) \bigr]_{l=1}^{\text{n. of sections}}, $$

where \(\underline{\bar{X}}_{l}(\underline{p})={1\over 10}\sum_{r=1}^{10} \underline{X}_{l}(\underline{p},r)\).

The parameters of the model are then again estimated by minimising the empirical \(\mathcal{N}\)-distance between \({\mathcal{X}}(\underline{p})\) and \(\mathcal{Y}\):

$$ \underline{\hat{p}}=\arg \min_{\underline{p}} N\bigl({\mathcal {X}}( \underline{p}), {\mathcal{Y}}\bigr). $$
(2)

Note that, as anticipated, in this second case we have given the same importance to the directions Y and X, but the dimension of the space on which we perform the minimisation is almost doubled.

6 Numerical results

Since parameters \([z_{1},\ldots, z_{7}]\) are integers while the other parameters are real numbers, we needed to apply an optimisation algorithm to a function which is not expressed in algebraic form and depending upon mixed integer and real parameters, so that we decided to apply a genetic algorithm for the minimisation procedure stated in (2).

All the simulations and the optimisation procedure have been performed using Matlab R2015a. In order to speed up the execution of the genetic algorithm, the Parallel Computing Toolbox has been used to parallelise the algorithm on a parallel machine using up to 30 simultaneous workers. Anyway the computational time of the optimisation procedure is about 48 hours.

The results of parameters estimate building the data matrices as described in Case 1 are reported in Table 1, while the parameters estimated with the procedure described in Case 2 are reported in Table 2. Note that in both cases the levels of the parallel planes may be bigger than the number of sections in the Z direction because the window of simulation has been enlarged to avoid edge effects.

Table 1 Optimal values of the parameters obtained with the procedure described in Case 1
Table 2 Optimal values of the parameters obtained with the procedure described in Case 2

The numerical values of the estimated parameters seem to be quite similar, but techniques to validate and compare quantitatively the two models will be applied in the next section.

In Figure 11 the results of simulations of the martensite-ferrite sample performed with the parameters estimated both in Case 1 and Case 2 are reported. Both figures, when rotated, show the ‘horizontal stripes’ structure which is present in real sample.

Figure 11
figure 11

Simulations of the optimal models. Left: the result of a simulation with optimal parameters obtained from Case 1. Right: the result of a simulation with optimal parameters obtained from Case 2. If the figures are rotated around the Y axis, the horizontal bandwidth structure of the martensite is visible in both cases (see the corresponding animations in Additional files 1 and 2).

7 Models comparison and validation

7.1 Validation based on confidence bands

In order to validate the models obtained with the two approaches described in the previous sections we simulated both models 100 times each, and on each simulated sample we computed the 2D Minkowski functionals on the same number of sections orthogonal to Z direction considered in the optimisation procedures. We then averaged the Minkowski functionals along the Z direction, obtaining thus a set of 100 curves for each functional in directions X and Y. We computed 90% confidence bands for the functionals by cutting the top 5% and bottom 5% of the data. We also computed the mean of the functionals. The Minkowski functionals computed on the real sample, again averaged with respect to the sections, have then been plotted and compared with the confidence bands. The results are reported in Figures 12 and 13.

Figure 12
figure 12

Confidence bands obtained using the optimal parameter estimated in Case 1. The mean and the maximum relative deviation of the mean of the simulated Minkowski functionals and the ones computed on the real sample is also reported.

Figure 13
figure 13

Confidence bands obtained using the optimal parameter estimated in Case 2. The mean and the maximum relative deviation of the mean of the simulated Minkowski functionals and the ones computed on the real sample is also reported.

The results reveal that both models may capture some insights of the overall variability of the true sample, in terms of the location and amplitude of the oscillations of the functionals in direction Y. By comparing the relative deviations between the mean of the functionals computed on the simulations and the mean of the functionals computed on the real sample, we observe that the strategy stated in Case 2 produces a very small gain in precision of the agreement along direction X, but also a big loss along direction Y. This fact suggests that the strategy stated in Case 1 should be preferred.

In order to test empirically the properties of our estimation method we simulated the model with the optimal parameters obtained in Case 1, we used the simulation as a reference test sample, and we applied our minimization procedure to estimate one parameter at a time, fixing all the others to the optimal values. As an example, the results for the estimate of \(\sigma_{\text{vert}}\) and \(\sigma_{\text{hor}}\) and the comparison with their true values are reported in Figure 14.

Figure 14
figure 14

Optimal values of \(\pmb{\sigma_{\text{vert}}}\) and \(\pmb{\sigma_{\text{hor}}}\) obtained while the optimization procedure is progressing, using as reference sample a simulated model with the optimal parameters obtained in Case 1. The red horizontal lines correspond to the true values of \(\sigma_{\text{vert}}\) and \(\sigma_{\text{hor}}\) used in the reference sample. The plots must be read from right to left, for decreasing values of the \(\mathcal{N}\)-distance.

We observe that the scatter in the estimates is reducing while the optimization procedure progresses, but our estimators are biased. The bias may be related to the small number of simulations that we perform at each iteration of the genetic algorithm, or to the correlation present between different sections of the sample, which does not guarantee the optimality properties of the \(\mathcal{N}\)-distance. It must be further investigated how to reduce such bias.

Note that the confidence bands shown in Figures 12 and 13 are built using pointwise confidence intervals at each spatial lag; they thus provide information only on the ‘marginal’ distribution of the Minkowski functionals at each lag. We then introduced the functional boxplots which provide bands which take into account the ‘joint’ distribution of the Minkowski functionals at different lags, by regarding them as continuous functions.

7.2 Validation based on functional boxplots

Functional boxplots have been introduced in Functional Statistics as an instrument to detect and identify the presence of possible outliers in a dataset where each datum is represented by a function. Functional boxplots are based on the definition of band depth (BD) measures, or modified band depth (MBD) measure introduced in [20], where each function in the sample is ordered and ranked from the center outward and, thus, it is possible to define functional quantiles and the centrality or outlyingness of an observation. The construction of functional boxplots, as well as the associated outlier detection rule are described in [19]. In the same paper, a simulation study comparing the performance of functional boxplots with other techniques present in literature for functional outliers detection is also reported, showing that functional boxplots provide a very reliable instrument to detect outliers in a functional dataset.

An example of functional boxplot is reported in Figure 15, computed on a toy simulated example taken from [19]. The purple band represents the 50% of the data and the borders of the band are an envelope of the functions which are ranked in the first 0.5-quantile. The black function is the deepest curve in the sample, i.e. the functional median. The blue fences of the boxplot are obtained, as in usual univariate boxplots, by inflating the envelope of the 50% central region by 1.5 times the range of the 50% central region. Any curves outside the fences are flagged as potential outliers and are represented by dashed red lines.

Figure 15
figure 15

Functional boxplot computed on a simulated toy example, corresponding to Model 2 in [ 19 ]. Left: functional dataset; right: functional boxplot. The outliers are depicted in red. Simulations and functionals boxplots have been produced using R 3.2.0, with the package FDA.

In order to validate the results of our model, we perfomed 100 simulations of the optimal model obtained in Case 1, which from the previous analysis proved to be preferable to the model obtained in Case 2, we computed the Minkowski functionals on each simulation along directions X and Y, averaging the functionals over the considered sections in direction Z, and we added the functionals computed with the same procedure on the real sample. Thus for each functional and for each direction we have a sample of 101 functions, of which 100 are simulated and one is real. For each sample we computed the corresponding functional boxplot. The results are reported in Figure 16. Since the functionals corresponding to the real sample are never detected as outliers, this means that the distribution of the model (in terms of distribution of the Minkowski functionals) fits with the real data, in spite of the bias in the estimation procedure. This confirms that the optimal model obtained in Case 1 is able to capture the overall variability of the real sample, and can then be used as an approximation of the real material.

Figure 16
figure 16

Functional boxplots obtained from the Minkowski functionals computed over 100 simulation of the optimal model obtained in Case 1, plus the Minkowski functionals computed on the real sample, along directions X and Y . The functionals have been averaged along direction Z. The functionals obtained from the real data are plotted with a thin dashed-dotted line. The functional datasets are stored in data matrices where the real sample is always contained in the first column of the matrix. The only case in which some outliers are detected is for the volume density in direction Y, but they correspond to two curves obtained from the simulations, not to the functionals computed on the real sample.

Note also that the almost total absence of outliers in the functionals reveals that the distribution of the Minkowski functionals has a tendency to be concentrated around the (functional) median, without showing long or heavy tails. This is a remarkable property in univariate statistics, since statistics having distributions without heavy tails give usually origin to robust parameter estimators.

8 Conclusions

In this paper we faced the problem of building a realistic stochastic geometric model for ferrite-martensite dual phase steel, based on the availability of about 150 sections of one sample of the material. After a morphological analysis of the given real sample, we proposed a germ-grain model with germs scattered around some nucleation planes, and spherical random grains, depending on a set of 11 unknown parameters. Since the distribution of the random variables involved in the model are very difficult to be theoretically retrieved, classical statistical methods for parameters estimation, like maximum likelihood, could not be applied to this case. Thus we based our parameter estimation technique on the minimization of a suitable distance (the \(\mathcal{N}\)-distance) between the Minkowski functionals of the real data and the mean of the simulated data. This choice was motivated by the fact that the Minkowski functionals characterize the morphology of a random set. Two different ways to estimate the Minkowski functionals have been tested and the best method (that is the one described in Case 1, in Section 5) has been selected, on the basis of a comparison between the results of the simulations of the model and the real data. The model validation has been performed by building confidence bands and functional boxplots for the Minkowski functionals.

Unfortunately a simulated test revealed that the parameter estimators are biased, but since the functionals computed on the real sample are always included in the confidence bands, and are not identified as outliers in the functional boxplots, we conclude that the proposed model is coherent with the overall variability of the real data, and can thus be used to reproduce the geometric characteristics of the real sample. Methods to correct the bias should anyway be studied to improve the results.

The advantage of our method is that the parameters of the model can be estimated starting from any number of available sections of the real material, thus they can be identified also when the industrial sampling costs need to be reduced. Obviously the reduction in the number of sections would lead to an increase of the variability of the estimated parameters. Such increase could be quantified for example by computing the mean increase in the \(\mathcal{N}\)-distance between the Minkowski functionals of the real data and of the simulated optimal model, or by comparing the amplitude of the confidence bands reported in Figure 12 with the analogous ones obtained via the optimal model estimated reducing the number of sections, or via other evaluations of the fitting between the real data and the simulated optimal model.

Such comparisons would give indications to the industry on the minimum number of sections needed to avoid a dramatic increase in the uncertainty in the estimation procedure.