<!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 />
    <article-meta>
      <title-group>
        <article-title>Methods for emotions, mood, gender and age recognition</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>D D Pribavkin</string-name>
          <email>pribavkindenis@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>P Y Yakimov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Image Processing Systems Institute of RAS - Branch of the FSRC "Crystallography and Photonics" RAS</institution>
          ,
          <addr-line>Molodogvardejskaya street 151, Samara, Russia, 443001</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Samara National Research University</institution>
          ,
          <addr-line>Moskovskoe Shosse 34А, Samara, Russia, 443086</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>542</fpage>
      <lpage>548</lpage>
      <abstract>
        <p>Recognition on images not only of shapes, but also of metadata is becoming increasingly popular among researchers in the field of convolutional neural networks and deep learning. This article provides an analytical overview of modern software solutions that recognize the images of emotions, mood, gender and age of a person. Enthusiasts invent all new and new architectures of convolutional neural networks, allowing to solve the tasks with considerable recognition accuracy.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>2. Review of existing solutions</title>
      <sec id="sec-1-1">
        <title>2.1. Emotion recognition using Deep Convolutional Neural Networks</title>
        <p>A solution that is a trained neural network that recognizes real-time emotions on a human face
recognized from the input video stream.</p>
        <p>
          It was built using the TFLearn programming library for the python programming language, based
on the well-known TensorFlow machine learning framework developed by Google in 2015 [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. This
framework simplifies the development of the network, as it requires describing only the layers
themselves instead of describing each neuron separately, and also simplifies network training by
providing real-time process feedback and learning accuracy. Moreover, the library allows you to save
the result of a trained model to use it later.
        </p>
        <p>The resulting neural network model is shown in Figure 1.</p>
        <p>
          In each frame of the video stream, an attempt is made to recognize a human face (s). This is
achieved using the OpenCV open library recognition method [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Then, if a face was recognized in the
image, that face is cut out and scaled to a size of 48x48 pixels. Only after that it is fed to the input of
the neural network. Thus, we get optimized software that affects neural network resources only if there
is at least one human face in the frame.
        </p>
        <p>The model was trained with the help of dataset FERC-2013, which has about 20,000 images
containing examples of the following emotions: anger, fear, happiness, sadness, surprise, indifference
and disgust. The density of the distribution of emotions in this data is reflected in Figure 2.</p>
        <p>According to the results of training, the accuracy of recognition of emotions was achieved in 67%.
2.2. SSR-Net
This solution is an original neural network with soft stepwise regression (soft stagewise regression
network) for recognizing age and sex. The network recognizes age and gender according to the
following principle: images of 64x64 pixels are fed to the input of the network, a multi-level
classification is made from several classes, where each level serves to refine the previous result, and
then the result of the classification is processed using a regression.</p>
        <p>The model itself is very compact and takes only 0.32 MB. But in spite of its compact dimensions,
the performance of SSR-Net is close to the characteristics of the most modern methods, the sizes of
models of which are 1500 times larger.</p>
        <p>A model of this neural network with three levels and a pool size of 2 is shown in Figure 3.</p>
        <p>For training this model, such datasets as IMDB, WIKI and Morph2 [11] were used. About 80% of
randomly selected images from datasets were used to train the network, and the remaining 20% were
used for testing.</p>
        <p>An example of dependence of the number of SSR-Net, MobileNet and DenseNet network
recognition errors trained in Morph2 data on the number of epochs is presented in Figure 4.</p>
      </sec>
      <sec id="sec-1-2">
        <title>2.3. Face classification and detection from the B-IT-BOTS robotics team</title>
        <p>
          It is a real-time classifier of emotions and gender of a person, based on the convolutional neural
network and the open image processing library openCV [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. The model of this neural network is
shown in Figure 5 and contains 600,000 parameters.
        </p>
        <p>
          This model was trained in IMDB dataset, which has about 460,723 RGB images, each of which
belongs to one of the classes: male or female [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. At this dataset, recognition accuracy of 96% was
achieved. Also, this model was validated on dataset FER-2013, which includes 35,887 images in gray
tones, each of which belongs to one of the classes of emotions: anger, disgust, fear, joy, sadness,
surprise and indifference. At this dataset, 66% accuracy was achieved.
        </p>
      </sec>
      <sec id="sec-1-3">
        <title>2.4. Age and gender estimation</title>
        <p>This solution is the implementation of a convolutional neural network for recognizing the sex and age
of a person from the input image. The basis for the VGG-16 network architecture was taken due to its
depth and controllability. This network accepts 256x256 pixel images as input.</p>
        <p>
          The training was carried out on IMDB-WIKI datasets, and recognition accuracy of 64% was
achieved [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ].
        </p>
      </sec>
      <sec id="sec-1-4">
        <title>2.5. General comparison of implementations</title>
        <p>
          As a result of the analytical review, the decisions contained in the publications [
          <xref ref-type="bibr" rid="ref6 ref7">6, 7</xref>
          ] were selected:
1. A solution that recognizes a person's age, trained in dataset IMDB-WIKI with a recognition
accuracy of 64%.
2. A solution that recognizes the sex of a person, trained in dataset IMDB with a recognition
accuracy of 96%.
3. A solution that recognizes a person's emotions, trained in dataset FER-2013 with a recognition
accuracy of 66%.
        </p>
        <p>The source code of each solution was carefully analyzed and revised so that the digital image was
provided as input to the software, and the result of the prediction of a convolutional neural network
was obtained.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>3. Conducting experimental studies</title>
      <p>At the end of the previous section, software solutions were obtained, the main task of which is to
recognize the age, gender and emotions of a person from a digital face image.</p>
      <p>These solutions were chosen as objects for conducting an experimental study of their performance
on 10 random images of the faces of people from the IMDB-WIKI dataset.</p>
      <p>The following equipment and software were used during the pilot study:
1. Processor: intel Core i5-4570 3.2 GHz.
2. RAM: 8 Gb.</p>
      <p>3. Operation system: Manjaro 18.0.4 «Illyria».
4. Programming language: Python 3.6.5.</p>
      <p>Below (Figures 6–15)are the images used in the pilot study:</p>
      <p>Since the neural network with the same input data always produces the same result, performing
multiple independent attempts at recognition in a row does not have much value, however, to measure
a more accurate execution time of a convolutional neural network in a single digital image.</p>
      <p>Tables 1, 2 and 3 present the results of recognizing age, gender and emotions, respectively, as well
as the average execution time for 5 runs of a convolutional neural network in the next digital image.</p>
    </sec>
    <sec id="sec-3">
      <title>4. Conclusion</title>
      <p>As a result, we can conclude that such tasks as the recognition of emotions, mood, gender and age are
very popular among researchers all over the world. Enthusiasts use different approaches to the
implementation of intelligent systems that can solve such problems and achieve good results in
accuracy of recognition, even with limited resources. The main means of the implementation of the
tasks are convolutional neural networks of various architectures, trained in well-known in the network
dataset images.</p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgements</title>
      <p>This work was partly funded by the Russian Foundation for Basic Research – Project
# 17-29-03112 ofi_m and the Russian Federation Ministry of Science and Higher Education within a
state contract with the "Crystallography and Photonics" Research Center of the RAS under agreement
007-ГЗ/Ч3363/26.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Bibikov</surname>
            <given-names>S A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kazanskiy</surname>
            <given-names>N L</given-names>
          </string-name>
          and
          <string-name>
            <surname>Fursov</surname>
            <given-names>V A</given-names>
          </string-name>
          <year>2018</year>
          <article-title>Vegetation type recognition in hyperspectral images using a conjugacy indicator</article-title>
          <source>Computer Optics</source>
          <volume>42</volume>
          (
          <issue>5</issue>
          )
          <fpage>846</fpage>
          -
          <lpage>854</lpage>
          DOI: 10.18287/
          <fpage>2412</fpage>
          - 6179-2018-42-5-
          <fpage>846</fpage>
          -854
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Shatalin</surname>
            <given-names>R A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fidelman</surname>
            <given-names>V R</given-names>
          </string-name>
          and
          <string-name>
            <surname>Ovchinnikov P E 2017</surname>
          </string-name>
          <article-title>Abnormal behavior detection method for video surveillance</article-title>
          applications
          <source>Computer Optics</source>
          <volume>41</volume>
          (
          <issue>1</issue>
          )
          <fpage>37</fpage>
          -
          <lpage>45</lpage>
          DOI: 10.18287/
          <fpage>2412</fpage>
          - 6179- 2017-41-1-
          <fpage>37</fpage>
          -45
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Shustanov</surname>
            <given-names>A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yakimov P 2017 CNN Design for</surname>
          </string-name>
          Real-Time
          <source>Traffic Sign Recognition Procedia Engineering</source>
          <volume>201</volume>
          <fpage>718</fpage>
          -
          <lpage>725</lpage>
          DOI: 10.1016/j.proeng.
          <year>2017</year>
          .
          <volume>09</volume>
          .594
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Correa</surname>
            <given-names>E</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jonker</surname>
            <given-names>A</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ozo</surname>
            <given-names>M</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stolk R</surname>
          </string-name>
          <article-title>Emotion Recognition using Deep Convolutional Neural Network URL: https://github.com/isseu/emotion-recognition-neural-networks/blob</article-title>
          /master/paper /Report_NN.
          <source>pdf (1</source>
          .
          <fpage>11</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Tsun-Yi</surname>
            <given-names>Y</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yi-Hsuan</surname>
            <given-names>H</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yen-Yu</surname>
            <given-names>L</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pi-Cheng</surname>
            <given-names>Hu</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yung-Yu Ch</surname>
          </string-name>
          SSR-Net:
          <article-title>A Compact Soft Stagewise Regression Network for Age Estimation URL</article-title>
          : https://github.com/shamangary/SSRNet/blob/master/ijcai18_ssrnet_pdfa_2b.
          <source>pdf (14.11</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Arriaga</surname>
            <given-names>O</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plöger</surname>
            <given-names>P G</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valdenegro</surname>
            <given-names>M</given-names>
          </string-name>
          <article-title>Real-time Convolutional Neural Networks for Emotion and Gender Classification URL</article-title>
          : https://github.com/oarriaga/face_classification/blob/master/ report.pdf (
          <issue>8</issue>
          .
          <fpage>10</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Pakulich</surname>
            <given-names>D</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alyamkin</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yakimov</surname>
            <given-names>S 2019</given-names>
          </string-name>
          <article-title>Age estimation using face recognition with convolutional neural networks</article-title>
          <source>Avtometriya</source>
          <volume>55</volume>
          (
          <issue>3</issue>
          )
          <fpage>52</fpage>
          -
          <lpage>61</lpage>
          (in Russian) DOI:
          <fpage>10</fpage>
          .15372/ AUT20190307
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>TFLearn library</surname>
            <given-names>URL</given-names>
          </string-name>
          : http://tflearn.org/ (
          <volume>04</volume>
          .
          <fpage>10</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>OpenCV library</surname>
            <given-names>URL</given-names>
          </string-name>
          : http://opencv.org (
          <volume>04</volume>
          .
          <fpage>10</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <article-title>IMDB-wiki dataset URL: https://data.vision</article-title>
          .ee.ethz.ch/cvl/rrothe/imdb-wiki
          <source>/ (04.10</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>