<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>ORCID:</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Software Using Neural Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Tatyana Sivkova</string-name>
          <email>sivkova@siams.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aleksandr Gusev</string-name>
          <email>aogusev@siams.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Artem Syropyatov</string-name>
          <email>artems@siams.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>SIAMS Ltd</institution>
          ,
          <addr-line>Kominterna, 16, office 604, Ekaterinburg, 620078</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ural Federal University, Technical Physics Department</institution>
          ,
          <addr-line>19 Mira St., Ekaterinburg, 620002</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>analysis</institution>
          ,
          <addr-line>GraphiCon, SIAMS software, GOST 3443-87</addr-line>
        </aff>
      </contrib-group>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>The paper covers key issues of metal and alloys' microstructure control using cast iron microstructure examples, and ways of resolving these issues by integration of neural networks into algorithms of SIAMS software. Paper lists key specifics of using the technology and training neural network, aimed at improving algorithm reproducibility, analysis acceleration and simplification. The method for training neural network models as part of the SIAMS software includes functionality for assessing the quality of training. The described method allows you control the model error using the value of the loss function. Developed algorithms in form of ready solutions were integrated into the SIAMS software package, and can be recommended for serial microstructure control in industrial laboratories. Microstructure control, comparison with reference scales, cast iron microstructure evaluation, microstructure image segmentation, neural network for microstructure</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Materials microstructure control is a complex process that requires special skills and knowledge
from a specialist. However, the necessity to provide quantitative and qualitative description of
microstructure in question requires a professional to make a decision on material compliance or
noncompliance with requirements.</p>
      <p>In order to simplify decision making, most of regulatory documents referring to quality control of
metallurgy products include variants of microstructures that can appear in finished products under
certain conditions, including certain range of chemical component content, processing stages, and heat
treatment. Russian GOST standards include reference charts where images are arranged in ascending
or descending order with regard to the number of phases, number of inclusions, or dimensional
characteristics for the objects of interest. These references really assist in decision making; however, it
is impossible to preselect and preliminarily evaluate all versions of microstructures that can occur in
course of production. Thus, reference scales include limited number of variants, and it is not always
possible to find a suitable image.</p>
      <p>
        Besides that, tightening quality requirements for metallurgy products and operational characteristics
of the goods, require production technology changes that cause new microstructures not covered by
standards. As there is no systematic work in the field of actualizing national standards [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ], standard
reference scales are not enough for metallographic control.
      </p>
      <p>
        For example, according to GOST 3443-87 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] it is necessary to assess shares for each graphite type
in cases where cast iron microstructure contains several types of graphite. Figure 1 demonstrates results
      </p>
      <p>
        2021 Copyright for this paper by its authors.
of comparing grey cast iron sample microstructure with reference scale 1A “Shape of graphite
inclusions” from GOST 3443-87 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. One can see that it is hard to pick the best match.
a
b
c
d
e
      </p>
      <p>
        Analytical method using reference scales is considered to be a semi-quantitative method. In order to
improve precision of metallographic analysis, companies implement image analysis systems featuring
automated quantitative analysis methods. These methods include software-aided identification of
structural contents with following computation of necessary parameters [
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
        ]. Image analysis
systems are doing well in the field of calculating necessary quantitative characteristics of the structure
and inclusion, including number, size, area, shares, form factors and microstructure grades according
to a given standard.
      </p>
      <p>
        Figure 2 demonstrates results of automated graphite microstructure description performed for grey
iron with SIAMS 800 software [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In this case automated analysis prevails over the semi-quantitative
assessment based on comparison due to calculation of necessary parameters with minimum of
subjective assessment. At the same time precision of results obtained with automated methods directly
depends upon the recognition quality for microstructure objects that are further assessed for quantitative
characteristics.
      </p>
      <p>
        Object recognition in image analysis is performed using various segmentation types [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ], where
the simplest one is binary thresholding. In complex cases correct object selection is possible only using
adoptive segmentation or graph-based image segmentation. Publications [
        <xref ref-type="bibr" rid="ref10 ref9">9, 10</xref>
        ] describe the use of said
methods in SIAMS 800 software.
      </p>
      <p>Despite positive results of applying the said segmentation algorithms, they are not universal and are
unsuitable for solving more complex image analysis problems. It is often necessary to recognize (select)
of classify objects on the same image that are similar in terms of brightness and color, texture and
internal gradients, and also in terms of shape and size, while not having visible separation boundaries.
Such microstructures can be referred to as “complex” in terms of automated image analysis. In an
example shown on figure 3 it is necessary to select graphite particles from pearlite matrix, and
distinguish structurally free cementite from ferrite and lamellar cementite present in pearlite.
2.1.</p>
    </sec>
    <sec id="sec-2">
      <title>Use of neural networks in SIAMS software</title>
    </sec>
    <sec id="sec-3">
      <title>Examples of using neural networks, results and discussion</title>
      <p>
        In order to analyze “complex” microstructures, SIAMS software uses semantic segmentation
method using neural network [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Recognition criteria used by neural network imitate image
recognition performed by humans.
      </p>
      <p>Figures 4-6 show fragments of cast iron microstructure after chemical etching. Graphite particles
are barely visible upon the pearlite background (figures 4, 5). Arrows show fragments, where there are
no visible boundaries separating phases. One can see that cementite particles are identical to ferrite
fragments in terms of brightness (figure 6). Color contours show results of automatically separating
structural components, demonstrating that the models are performing well.</p>
      <p>Figure 7 shows microstructure of Ni-resist type cast iron, with metal matrix consisting of austenite
with particles of excess cementite, after mild etching. Cementite particles have similar brightness
parameters with austenite and are barely distinguishable. Automated recognition task was further
complicated by excluding phase of final polishing, and image was captured with disabled equalization
of microscope illumination. That caused increase in brightness gradient for objects belonging to both
phases. Figure 7b demonstrates that the change in specimen preparation and capturing conditions did
not cause degradation of recognition results. Figure 7c demonstrates results of simultaneous selection
of graphite and cementite particles from the soft austenitic matrix with remaining sample preparation
scratches and stains.</p>
      <p>Final results of recognizing cast iron structural components are satisfactory and suitable for further
calculation of quantitative characteristics required by standards. Analytical algorithms used in the
examples were integrated in the SIAMS software solutions package and can be recommended for serial
microstructure control in industrial laboratories.</p>
    </sec>
    <sec id="sec-4">
      <title>Evaluating quality of training neural network models</title>
      <p>Mechanism for training neural network models used in SIAMS to perform automated recognition of
structural elements includes functionality for assessing training quality. Quality is assessed by
measuring trained system recognition bias with the value of loss function. Minimum value of the loss
function indirectly informs about minimum bias of analysis results for a model.</p>
      <p>Figures 8 and 9 show dependency graphs for loss function upon the number of training epochs that
were formed in course of training with training and validation sets.</p>
      <sec id="sec-4-1">
        <title>Number of training epochs</title>
      </sec>
      <sec id="sec-4-2">
        <title>Number of training epochs</title>
        <p>Graph for a training set (figure 8) demonstrates that value of loss function decreases while the
number of epochs grows, and the model learns to recognize specific cases. When the number of epochs
exceeds 50, the decrease in the value of loss function becomes insignificant.</p>
        <p>
          Minimum for distribution of loss function built using validation set (figure 9) is located in the
region close to 10 learning epochs, which demonstrates that model ends generalization of useful data
and starts analyzing specifics for a given set [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], which lowers model stability with regard to image
variations.
        </p>
        <p>Analysis of the graphs allows understanding that it makes no sense to continue training a given
model after a certain number of epochs. Long-term training allows improving object-of-interest
recognition for similar cases, but change of conditions (i.e., specifics of specimen preparation, etching,
and image capturing) causes increaseв number of errors. Therefore, the training mechanism for models
used in SIAMS allows both determining an optimal point to end training, and returning system to the
conditions of minimum bias.
2.3.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Specifics of integrating neural network into SIAMS software</title>
      <p>
        After complex efforts aimed at integration of neural network technology into SIAMS software, the
following applicable practical results were obtained:
 stability of algorithms with regards to instability of external factors [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]: microscope
illumination, etching duration, camera settings, presence of image artefacts (i.e., scratches, pores,
particles of different phases, etc.);
 ability to fast-train algorithm using minimum number of images, which is not typical for the
majority of software solutions using neural networks;
 iterative approach to training procedure that allows multifold decrease in the number of errors
for each following iteration;
 acceptable image processing speed (close to 2 seconds per 4 megapixels);
 taking into account image scale, which is extremely important for using algorithm within a
measurement tool, including equipment set built around an optical microscope and equipped with
SIAMS software.
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>Paper demonstrates microstructure specifics for high-tensile cast iron, grey cast iron, and alloyed
cast iron of Ni-resist type that require use of novel image analysis approaches, and create new
opportunities to control quality of different materials.</p>
      <p>The use of described methods for cast iron microstructure analysis creates the following advantages
for SIAMS software users:
 ready solution of a specific task in form of a trained algorithm that is stable with regards to
conditions of specimen preparation, etching, and image capture;
 lack of necessity to customize sensitivity thresholds that are usually used in major segmentation
methods;
 ability to use one-step analysis instead of two-step one (graphite analysis before etching and
metal matrix analysis after etching);
 shortened analysis process duration due to abovementioned factors.</p>
      <p>Complex approach to research used by developers in order to integrate neural networks into SIAMS
software along with development of universal tools for developing new models (or algorithms) allows
extending the number of problems solved in the area of image analysis.</p>
      <p>Analytical algorithms used to demonstrate solutions on examples used in this paper were integrated
into SIAMS software solutions package, and can be recommended for mass control of cast iron
microstructure in industrial laboratories.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S.</given-names>
            <surname>Andreeva</surname>
          </string-name>
          ,
          <article-title>Improving quality of metal products on the basis of developing new improving existing methods of quantitative metallography</article-title>
          , Saint Petersburg State Polytechnic University, Thesis abstract, Saint-Petersburg, Russia,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Vakunov</surname>
          </string-name>
          ,
          <article-title>Development and research of multiscale algorithms for image processing and analysis in industrial quality control systems</article-title>
          , Thesis abstract, Vladimir State University, Russia, Vladimir,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <source>[3] GOST 3443-87</source>
          ,
          <article-title>Cast iron castings with graphite of different form, Methods of structure determination</article-title>
          , Moscow,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>SIAMS</given-names>
            <surname>Ltd</surname>
          </string-name>
          <article-title>(site)</article-title>
          , URL: https://siams24.ru/solutions.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>[5] Olympus company (site), URL: https://www.olympus-ims.com/ru/microscope/stream.</mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Zeiss</surname>
          </string-name>
          <article-title>: (site)</article-title>
          , URL: https://zeiss-solutions.ru/equipment/mikroskopy/programmnoeobespecheniye/zeiss-zen.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Bauman</given-names>
            <surname>National</surname>
          </string-name>
          <string-name>
            <surname>Library</surname>
          </string-name>
          ,
          <article-title>Osnovnye tipy metodov segmentatsii izobrazheniy (in Russian), Key types of image segmentation methods</article-title>
          , URL: https://ru.bmstu.wiki.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>R.</given-names>
            <surname>Gonzales</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Woods</surname>
          </string-name>
          , Digital image processing,
          <source>Third Edition</source>
          , University of Tennessee.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T.</given-names>
            <surname>Sivkova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gubarev</surname>
          </string-name>
          , Computer-aided Metals'
          <article-title>Microstructure Analysis, A non-standard approach to image analysis</article-title>
          ,
          <source>in: Proceedings of GraphiCon</source>
          <year>2019</year>
          , Bryansk State Technical University, Bryansk,
          <year>2019</year>
          , pp.
          <fpage>255</fpage>
          -
          <lpage>259</lpage>
          , URL: https://www.graphicon.ru/conference/2019/proceedings.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>T.</given-names>
            <surname>Sivkova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gubarev</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Kamenin</surname>
          </string-name>
          , Computer-aided Metals'
          <article-title>Microstructure Analysis, Analysis of images with sample preparation defects</article-title>
          ,
          <source>in: Proceedings of GraphiCon</source>
          <year>2020</year>
          , Saint-Petersburg,
          <year>2020</year>
          , pp.
          <fpage>15</fpage>
          -
          <lpage>26</lpage>
          , URL: https://www.graphicon.ru/node/211.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>O.</given-names>
            <surname>Ronneberger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Fischer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Brox</surname>
          </string-name>
          , U-Net:
          <article-title>Convolutional Networks for Biomedical Image Segmentation, Computer Science Department and BIOSS Centre for Biological Signalling Studies</article-title>
          , University of Freiburg, Germany,
          <year>2015</year>
          , URL: https://arxiv.org/pdf/1505.04597.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>L.</given-names>
            <surname>Prechelt</surname>
          </string-name>
          , Early Stopping - but when? Faculty for Computer Science; University of Karlsruhe D76128 Karlsruhe, Germany, URL: https://page.mi.fuberlin.de/prechelt/Biblio/stop_tricks1997.pdf
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>C.</given-names>
            <surname>Shorten</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.M.</given-names>
            <surname>Khoshgoftaar</surname>
          </string-name>
          ,
          <article-title>A survey on Image Data Augmentation for Deep Learning</article-title>
          ,
          <source>Journal of Big Data</source>
          <volume>6</volume>
          (
          <issue>60</issue>
          ) (
          <year>2019</year>
          ).
          <source>doi: 10.1186/s40537-019-0197-0.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>