Automatic Image Segmentation for Material Microstructure Characterization by Optical Microscopy

This work shows the microstructure characterization utility for the analysis of material properties. To achieve this purpose, digital image segmentation is used on microscopic images of materials to extract the number of phases and their proportion present in the material to obtain a quantitative description of material properties and to better control product quality. In this way, we present here an automated method for segmenting the phases present in microscopic scanning images of metallographic samples using a multiphase level set with Mumford Shah formulation. Experience shows that the proposed model successfully detects phase regions for a variety of real micrographic images


Introduction
The rate of ferrite in steel has a direct effect on its functional properties (yield strength, toughness, hardness, corrosion resistance, weldability, mouldability, embrittlement, magnetism). Its control and measurement are consequently very important. For this microstructures are used to determine the properties of materials. A full description of microstructures means giving a description of the size, shape and distribution of grains and second phase particles and their composition. This is why it is essential to establish the link between phenomena occurring at the microstructural scale and the properties of the material [1][2][3][4][5]. The microstructures are made up of a set of elements organized in the microscopic scale. Their observation and thus their characterization require the use of microscopic techniques. The phases differ from each other by their crystalline, semi crystalline or amorphous structure. Morphologies are observed by the optical or electronic microscope.
The microstructures formed in the materials depend not only on the composition or on the chemical structure of the material but also on the existence of gradients of temperature or on concentration inside this one during its transformation. The microstructures are also strongly influenced by the energy needed for the creation of the new interfaces. Most of the microstructures which are formed during the solidification are crystalline in nature. The glass is always less stable than the crystal if it can form. In a number of cases, however, an amorphous (vitreous) structure appears during a fast cooling. Let us note that it is because of the absence of microstructure that lenses have their transparency. Some materials have a very irregular molecular structure and are not capable of developing a stable crystalline structure.
They exist, in the solid state, only under a glassy shape, whatever are the conditions of cooling (atactiques polymers). The microstructure of the organic polymers is largely controlled by their chemical structure. If macromolecules have a regular molecular structure, the crystallization occurs generally. Note that the crystallization of polymeric materials is never complete (semi-crystalline structure) and form spherulites.
The kinetic characteristics of phase transformations allow leading, by adequate heat treatments (temperingannealing), very different microstructures, which have generally a nonhomogeneous composition and which are almost always metastable at the temperature of use. In the case of metals and their alloys, heat treatments combined with mechanical treatments, as the lamination, have reached a very high degree of sophistication. Ceramics are often obtained by sintering of powder which explains the presence of pores that are an important part of their microstructure.
A variation of the microstructure over time during use entrains an important modification of its properties (aging phenomenon). Several works have been done in this subject. Furthermore, a study has been made around the development of microstructure and grain border character distribution at different temperatures [6]. Moreover, studies were made in the domain of segmentation of the materials micrographic images for the extraction of grains/phases which are fundamental to realize the microstructure descriptions. An automated algorithm used for segmenting the phases present in the scanning electron microscopic images of dual phase steel [7][8][9]. A level set segmentation model was proposed to analysis the images of particle to overcome the drawback of sensitivity to weak boundaries and curve's initial position [10]. In this way, we thus propose a different approach for image segmentation which is based on using a multiphase level set Mumford and Shah to segment the phases present in the scanning microscopic images of metallographic samples. To achieve this goal, we have to face in several complex problems such as the images quality and the presence of noises.
The paper is organized as follows: Section 2 presents the materials and methods; in this section we divide the work into two parts: the first one is devoted to the description the material studied with all the necessary steps of preparation and acquisition of images used in this work. In the second part we describe and analyze the Mumford and Shah model used for image segmentation (multiphase case). Section3 shows the main contribution of this work which is the automatic distinguish between phases. We will illustrate the experimental results. Finally, conclusions are reported in Section 4.

Sample preparation and image acquisition
The acquisition and the information on different micrographic images that we used in this work are obtained from the NIKON optical microscope (Eclipse I.V 100 ND) figure 1 with camera equipped by an acquisition system (LV-LH50PC 12V50W Precentered Lamphouse Bright/darkfield switch and linked aperture stop (centerable),), it is possible to visualize all types of surfaces with a magnification up to 1500 times. The base metal that we used for the realization of this work is a stainless steel two-phase austeno-ferritic (duplex) of nuance 2205.
Besides, the image processing which allows transforming easily the raw data into exploitable information, it is therefore possible to perform microscopic studies. For this a careful preparation are several successive steps for observation at the optical microscope: Starting with the coating of the samples in a hot phenolic resin, then the mechanical polishing under water and on an abrasive paper more and more fine (paper 320, 400, 500, 800, 1000, 1200, 2400, 4000), then the polishing of finishing by Felt sheet with use of diamond paste. Finally, after finishing of polishing is performed a chemical at-tack (H2O + HF) of the surface to reveal the microstructure. In our work, we used the three micrographic images at 200 magnification of 2205 duplex stainless steel heattreated at temperatures respectively:800•C, 850•C and 950•C. Clearly and obviously, after observing the Figure 1, we notice that the three micrographic images of steel contain three different zones: Ferrite, austenite and the third zone known as sigma phase [11][12]; with 30 atoms per mesh (Fig 2).
In addition to iron, the sigma phase contains chromium and molybdenum which it draws from the matrix, thus causing a reduction in the corrosion resistance of Fe-Cr-Ni systems. Moreover, this phase, which is formed in the temperature range between 600 and 1000 C., causes a dramatic loss of the toughness of the stainless steels [13]. Precipitation of the sigma phase depends not only on the chemical composition of the steel [14]. Indeed, other factors influence its formation such as the size of the grains. Also, the sigma phase is more easily formed in high energy regions such as grain boundaries and interfaces. The solution temperature also affects precipitation in two ways: • The high dissolving temperatures induce grain enlargement, which reduces the rate of sigma phase formed. • On the other hand, at high temperatures, the ferrite content is increased, which at first glance encourages the precipitation of the sigma phase during the aging treatments.
The sigma phase appears preferentially in the Austenite/Ferrite phase joints, but it can also appear in the grain boundaries Ferrite/Ferrite and Austenite/Austenite. It germinates in the Ferrite/Austenite interfaces and then grows inside the ferritic grains. An illustrative diagram of the precipitation of σ is given in Fig. 2 and 3. The formation of the σ phase, which is rich in Ferrite elements, causes the adjacent ferritic regions to become depleted in these elements, leading to the transformation of this ferrite into the secondary austenite. In this case, formation of the sigma phase takes place in the vicinity of the chromium nitride

Level set formulation
Mumford and Shah have proposed a variational model that defines image segmentation as a problem of joint detection of homogeneous zones and contours [15]. The Mumford formulation model is based on the minimization of an energy function E where u represents our image with value bounded in Ω from R 2 to R and Γi the contour of each region Ri on which the image is approached by a function gi minimizing functional can be written as: 2 2 ( , , ) Where λ and µ are positive real parameters for weighting the data fidelity term and long-term contours respectively. In the simple case where the functions gi are constants, the solution always exists. It can then be shown that the value of the gi on region Ri is the average denoted ci of u restricted to Ri. In this framework, energy can therefore be rewritten as follows: In this formalization, the curve C is represented by the level line zero of a lipschitzienne function Φ such as So in this approach the unknown is not any more C but Φ. If we introduce the function of Heaviside H and its derivative δ0 in the sense of the distributions defined by We have then: And From there, the energy functional can be written: ( 1 , 2 , ) = ∫ 0 ( )| ( )| To minimize E (c1, c2, Φ) we write the equation of Euler-Lagrange for Φ. This amounts to canceling the differential in Φ of energy. We obtain: If one then performs a gradient descent by introducing a parameter of time, we get an evolution of Φ which is given by the following equation:

Description of the Piecewise-Constant model (Multiphase case)
It is common to keep the model of Mumford-Shah piecewise constant with respect to the level set. In other words, the resulting image is approximated by a finite number of constants which represent the means of the intensity at the inside and the outside of each of the curves. Multiphase segmentation is better because it can characterize objects differently. It consists in making several level set functions. In Figure 4 by using two functions of level set [16][17][18], we can identify the following four regions: . 11 ( 1 , 2 ) = mean(u 0 )in{x: 1 < 0, 2 < 0} The resolution by the associated Euler-Lagrange equation [17] leads to the evolution equations formulated by Φ1, Φ2: In Figs 5 and 6 present respectively the segmentation steps and automatic detection of phases of our proposed method for synthetic image

The conventional micrographic measurement approach
The conventional approach to measuring ferrite in steel is by counting on a micrographic cup. The sample, prior to measurement, requires prior preparation. First of all, it must be small in size (cut-out of the part). The sample must then be coated (to make it easier to hold and eliminate edge effects). Then, the specimen must be polished (mirror polished and free of scratches that could hinder observation). Finally, the preparation requires acid etching (to reveal ferritic and austenitic structures). Analyses are to be carried out according to ISO 9042 standards. For this norm, the method for determining the volume fraction of a constituent consists first of all in choosing the grid of points (dimensions and number of points) according to the constituent to be studied. Then, the chosen grid of points is superposed on the metallographic cup. An enlargement will be chosen to show the delimitation between the phases. Next, the number of points of the grid included in the component whose rate must be determined is counted. Finally, its volume fraction is deduced (Table 1). When counting, the values found in the fields are entered in an Excel table (which includes the calculations of the norm). When a field has been analyzed, the sample must be moved to observe another area. There are also other values calculated such as the 95% confidence interval. This method is relatively time-consuming because the sample has to be prepared before the analysis begins. In addition, it is destructive.
It also requires special attention on the part of the user. Indeed, a parallax error can lead to a bad count. The choice of magnification can also influence the measured phase rate. These errors can be limited by increasing the number of observed fields. Phase rate analysis by image analysis [18] can be used.   Figure 7 illustrates the results of some of the steps to the segmentation of material microstructure images using a multi-circle type initialization of the initial contour with µ = 0.25 10−5, N = 50 iterations and Ot = 0.5. To confirm the role of the segmentation step in the information analysis for the microstructure characterization, we have plot the histogram of micrographic image before segmentation step and after segmentation ( figure 8). From this result we can say that after segmentation application we can used a simple thresholding to separate the phases in image, which he is not the case before segmentation step.

Phases rate calculation
For the characterization of the compositions of microstructure scale, it is really difficult to make the difference between the phases in order to calculate the phase rate using a micrographic image. In this work, we have proposed an automatic thresholding after segmentation application to detect the number of the phases as well as their percentage. The idea consists in the application of the segmentation multiphase followup by a histogram to separate the phases by a threshold which is the average value of every phase. To separate the phases we used an automatic thresholding, the idea is based on the calculation of the average between the maximum values of each phase in Figure 9: We present in Figures 9 and 10 the results that have been obtained by applying our proposed segmentation method on different micrograph images with no a priori knowledge about the number of phases of each image. This method makes the automatic detection of the number of phases of each image followed by a percentage of each phase representing the surface of the image. Three colours: yellow, green and blue represent respectively the phases: austenite, ferrite and σ phase.

Conclusion
Our contribution in this paper consists of determining automatically the number of phases and their proportion in a sample of metallic materials from a micrographic image. To reach this goal we used the variational approaches. The results obtained show that we have arrived to calculate the phase rates in an automatic way without the intervention of experts; we have applied this method on several images to validate the algorithm, and offer the expert a better micrographic image processing, which allows a reliable and reproducible results.