<!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>Automatic Wood Log Detection Based on Random Decision Forests Learning Algorithm and Histogram of Oriented Gradients</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yuriy V. Chiryshev</string-name>
          <email>iurii.chiryshev@mail.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anastasiya S. Atamanova</string-name>
          <email>s050567@yandex.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ural Federal University</institution>
          ,
          <addr-line>Yekaterinburg, Russia, 620004</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this article the results of the round wood image recognition problem have been stated. This task is very important in woodworking industry. The paper provides a brief overview of existing solutions of round wood recognition, highs and lows of these approaches are shown. The pattern recognition technique feature for round timber is described. This technique is based on the histogram of oriented gradients (HOG) and random decision forests classifier. Based on the experiments, the optimal number of trees for round timber recognition is found. The analysis of results shows that from 64 trees there is no more appreciable difference between the forests using 128 trees or more. Experimental results have demonstrated a detection rate as high as 95.4% with a false-positive rate 10-3.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>transformation [6] or its modifications [9] and are used to detect cuts of logs on an image in the form of circles or
ellipses. The shortcomings of such methods include the low degree of automation of the detection process, which
ultimately affects the objectivity of the measurement results. The reasons for this are the well-known shortcomings of the
Hafa transformation:
 sensitivity to geometric distortions of objects and noise;
 lack of a priori information about the size of objects in the image;
 computational complexity of the algorithm.</p>
      <p>Such limitations, in our opinion, do not allow to fully use these methods and to obtain high quality of detection for the
problem of log recognition. Nevertheless, the authors of one of these studies managed to achieve an average detection
probability of 95.7% [3].</p>
      <p>Under the conditions of this task, methods based on machine learning are the most promising and preferable from the
point of view of the computational complexity and the requirements for distortions of objects. To search for log cuts on
images, it is suggested to use the approach proposed in [7], but with some modifications. In this work, a classical HOG
detector is implemented that uses the support vector method (SVM) as a classifier. The authors of this paper consider the
implementation of the HOG detector using the ensemble of decision trees [8] and investigate the dependence of its work
on the input parameters.
3</p>
    </sec>
    <sec id="sec-2">
      <title>Description of the Method</title>
      <p>Histograms of directed gradients is a method of an indicative description characterizing the shape of an object. Initially,
this method was used for the detection of people on images, but subsequent studies have shown its effectiveness for
many other classification problems [12,13].</p>
      <p>The implementation of the indicative description of the logs in this paper is based on the general scheme for
describing the HOG- descriptor based on counting the number of gradient directions in the image cells, as described in
[7]. Figure 1 shows a diagram of such a partitioning into cells and calculations of the histogram of gradients for the
problem of log detection.</p>
      <p>Analysis of a set of more than 7000 images of log bundles [14] has shown that the characteristic features of images
are subject to many factors, such as lighting, shape deformation, partial overlapping of trunk sections, a different view
angle and scale of images, and require the use of special methods for fast and accurate calculation of logs features. In
order to overcome these limitations of the initial data, the following solutions are used in the work:
 to quickly calculate HOG descriptors, gradients of input images were previously presented in integral form. This
technique is based on the discrete Green theorem and allows you to quickly calculate histograms of directed gradients in
the area of interest (cells) of the image in a few simple arithmetic operations [15], while the calculation time does not
depend on the area of the image.
 to ensure invariance to scale, HOG descriptors are computed in a sliding window with a minimum step on several
scales of the original image. This solution allows you to search for images of logs sections in a wide range of their sizes
(radii).
 the unevenness of log lighting is partially compensated by increasing the contrast of the original image [7].</p>
      <p>As a classifier, the learning random decision algorithm (Random Forest) [8] is used in the work. His main idea is to
build an ensemble of decision trees, while the classification - the assignment of a new object to a particular class is made
by voting: each tree classifies the object to one of the classes, and the winner is the class that is voted for by the most
trees. The pluses of this method are:
 high classification accuracy;
 high scalability and parallelizability;
 the ability to efficiently process data with a large number of attributes and classes;
 the ability to assess the importance of individual characteristics.</p>
      <p>There are also disadvantages, such as:
 the algorithm is prone to retraining, especially on noisy data;
 large size of the resulting models.</p>
      <p>a)
b)
c)
d)
e)</p>
      <p>To estimate the generalizing ability of the classifier, a k-block cross-check is used [16], when the entire sample of
data is randomly divided into k non-intersecting blocks of the same size. Each block in turn becomes a test sample, while
training is performed on the remaining k-1 blocks. The result of such testing is the average error in the control sample of
the data. This method gives an unbiased estimate of the probability of error, and therefore, it makes it possible to detect
the retraining of the classifier (Table 1).
4</p>
    </sec>
    <sec id="sec-3">
      <title>Experimental Results</title>
      <p>To evaluate the proposed solutions, a number of experiments were conducted, designed to assess the quality of
classification on real data for various parameters of the HOG descriptor construction and classifier. As the test data,
11068 marked images with 4632 "positive" logs and 6436 images with "negative" samples were used. Examples of
images of the training sample are shown in Figure 2.</p>
      <p>In the first experiment, the dependence of the predictive ability effectiveness of decision trees on the input parameters
of this classifier was investigated. Figure 3 shows a comparison of models trained using a different number of random
decision trees (16, 32, 64, 128, 256 and 512).</p>
      <p>Analysis of performance curves (ROC) indicates that with the increase in the number of trees from 16 to 64, the
quality of recognition is significantly improved (the area under the curves is increasing). With a further increase in the
number of trees from 128 to 512, quality growth practically ceases. Thus, according to the results of the experiment, it
can be assumed that the optimal number of trees for the problem of log recognition lies in the range between 64 and 128.
For this reason, further studies used classifiers consisting of only 64 trees.</p>
      <p>a)
b)
Within the framework of the second experiment, the results of the classifiers work trained on six different sets of
characteristics were investigated. The parameters of the HOG descriptors under investigation and the corresponding
characteristics of the detectors trained using 64 trees are given in Table 1. In order to understand how and to what extent
the performance characteristics of the classifiers vary depending on the parameters of the HOG descriptors, comparison.
Visualization of the classifiers performance is represented by two graphs: curves of the operating characteristic
-off curve (Fig. 4b). The obtained curves quite clearly
characterize the predictive ability of the constructed models. Figure 4 shows that the curve closest to the lower-left corner
of the coordinate system corresponds to a descriptor with 9 histogram cells and a window size of 64 pixels. The same
descriptor corresponds to a curve with a maximum area of 0.9972 (Fig. 4a). This means that the classifier with such a
descriptor has the best predictive power. These conclusions are supported by the calculated characteristics: the descriptor
named HOG64-9 has the maximum values from the presented values of completeness, accuracy and precision of the
classifiers (Table 1).</p>
      <p>Thus, from the results of experiments it can be concluded that the set of features of HOG64-9 is the best among those
considered. Such a classifier is able to detect positive examples (logs) with a probability of 95.4% at a false positives
level of 10-3 (Fig. 4b). An illustration of the detection algorithm operation is shown in Figure 5</p>
      <p>Fig 5.Log cut detection
5</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>The experiments results have showed that the proposed HOG detector based on the training of random decision trees
achieves higher quality indices compared to methods based on linear classifiers (SVM + HOG, accuracy 77.9% [4]) and
cascades of weak classifiers (AdaBoost + Haar, Accuracy of 95.1% with the value of false positives 4.9 ∙ 10-3). However,
it is inferior to these methods, when the latter is strengthened by several combined attributes and information on the color
of logs (LBP + HOG + GMM, accuracy of 99.3% for false positives 3.6∙10-3 [4]).</p>
      <p>A further line of research presented in the paper is the development of effective algorithms for contour analysis and
pixel segmentation and the research of these methods for the problem of accurate measurement of log cuts applied to
their photo images.
4. Herbon C., Tönnies K., Stock B. Detection and segmentation of clustered objects by using iterative classification,
segmentation, and Gaussian mixture models and application to wood log detection // Pattern Recognition. Springer
International Publishing, (2014), pp. 354-364.
5. Gutzeit E., Voskamp J. Automatic segmentation of wood logs by combining detection and segmentation //</p>
      <p>International Symposium on Visual Computing. pp. 252–261 (2012).
6. Galsgaard B., Lundtoft D. H., Nikolov I., Nasrollahi K., Moeslund T. B. Circular Hough Transform and Local
Circularity Measure for Weight Estimation of a Graph-Cut Based Wood Stack Measurement // IEEE Winter
Conference on Applications of Computer Vision, Waikoloa, HI, 2015, pp. 686-693.
7. Dalal N., Triggs B. Histograms of oriented gradients for human detection // IEEE Computer Society Conference on</p>
      <p>Computer Vision and Pattern Recognition (CVPR'05), San Diego, CA, USA, 2005, pp. 886-893 vol. 1.
8. Breiman L. Random forests // Machine Learning, 45(1): 5–32, 2001.
9. Loy G., Zelinsky A. Fast radial symmetry for detecting points of interest // PAMI, vol. 25, pp. 959–973, August
2003.
10. Viola P., Jones M. Rapid object detection using a boosted cascade of simple features // Proc. Int. Conf. on Computer</p>
      <p>Vision and Pattern Recognition. 2001. № 1. P. 511−518.
11. Ojala T., Pietikainen M., Harwood D. Performance evaluation of texture measures with classification based on
Kullback discrimination of distributions // Proceedings of the 12th IAPR International Conference on Pattern
Recognition, 1994, vol. 1 - Conference A: Computer Vision &amp; Image Processing, vol. 1, pp. 582–585, Oct 1994.
12. Déniz O., Bueno G., Salido J., De la Torre F. Face recognition using Histograms of Oriented Gradients // Pattern</p>
      <p>Recogn. Lett. 32, 12 (September 2011), 1598-1603.
13. Misra A., Takashi A., Okatani T., Deguchi K. Hand Gesture Recognition Using Histogram of Oriented Gradients
and Partial Least Squares Regression // MVA2011, IAPR Conference on Machine Vision Applications; 2011; Nara,
Japan.
14. Herbon С. The HAWKwood Database // CoRR abs/1410.4393 (2014): n. pag.
15. Wang X., Doretto G., Sebastian T.B., Rittscher J., Tu P.H. Shape and Appearance Context Modeling // Proceedings
of IEEE International Conference on Computer Vision (ICCV) 2007.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Knyaz</surname>
            ,
            <given-names>V. A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Maksimov</surname>
            ,
            <given-names>A. A.</given-names>
          </string-name>
          <string-name>
            <surname>Photogrammetric Technique</surname>
          </string-name>
          for Timber Stack Volume Contol // Int. Arch. Photogramm. Remote Sens.
          <source>Spatial Inf. Sci., XL-3</source>
          ,
          <fpage>157</fpage>
          -
          <lpage>162</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Knyaz</surname>
            <given-names>V.A.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Vizilter</given-names>
            <surname>Yu</surname>
          </string-name>
          .V.,
          <string-name>
            <surname>Zheltov</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Yu</surname>
          </string-name>
          .
          <article-title>Photogrammetric techniques for measurements in woodworking industry // International Archives of the Photogrammetry</article-title>
          ,
          <source>Remote Sensing and Spatial Information Sciences Proceedings. V. XXXIII. Part B5/2</source>
          . P.
          <volume>42</volume>
          -
          <fpage>47</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Kruglov</surname>
            ,
            <given-names>A. V.</given-names>
          </string-name>
          <article-title>Development of the rounded objects automatic detection method for the log deck volume measurement //</article-title>
          <source>Proc. SPIE 10011</source>
          , First International Workshop on Pattern Recognition,
          <volume>1001104</volume>
          (
          <issue>July</issue>
          11,
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>