<!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>V. Tkachuk);</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>method of detection wood defects using YOLOv8 model⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vitalii Tkachuk</string-name>
          <email>tkachukv.p@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sava Kostiuk</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Olga Pavlova</string-name>
          <email>pavlovao@khmnu.edu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vitalii Alekseiko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mariia Kostiuk</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Khmelnytskyi National University</institution>
          ,
          <addr-line>Institutska str., 11, Khmelnytskyi, 29016</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <volume>000</volume>
      <fpage>9</fpage>
      <lpage>0009</lpage>
      <abstract>
        <p>Today, there are a significant number of materials for the manufacture of various technological and design solutions. The most common were decorative elements made of wood of various species: welt elements, decorative consoles, wooden furniture facades, frames for paintings and mirrors, icons, curly legs, details of artistic cutting, souvenirs. Handicrafts are valued more than the machine, but are very expensive to manufacture. The easiest way to do this is to use numerical control (CNC) machines. Currently, decorative milling is carried out on pre-prepared workpieces with a given fiber orientation, and milling modes are selected experimentally or from previous experience. The paper proposes a method of wood milling with optical recognition of workpiece defects and subsequent adjustment of cutting modes. The proposed method takes into account the recommended cutting modes for machining wood, namely feed speed and cutter speed, taking into account the anisotropy of the workpiece structure and mechanical properties. The proposed method differs in that it allows you to adjust the parameters of machining depending on the quality of the workpiece and is based on the basic principles of the theory of automatic control, modeling of milling and turning proceses, including simulation modeling, methods of processing the results of experiments using machine learning.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Milling</kwd>
        <kwd>decorative milling</kwd>
        <kwd>machine learning</kwd>
        <kwd>computer vision 1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Modern production of products with decorative elements is characterized by high requirements
for the quality of products and the technical level of production, made of solid wood. When
decorative wood milling on CNC machines, the cutter moves in space along a complex
trajectory with a simultaneous change from two to five coordinates. When processing wood,
chips, scuffs or other defects are formed due to various technological parameters and local
structures of the workpiece, which lead to defects or require additional efforts to correct defects.
The most pronounced are defects made of wood, which has low mechanical properties and
significant structural heterogeneity.</p>
      <p>Recently, there has been a significant demand for products with knots that are aesthetically
valuable. Knotted areas of wood are particularly sensitive to machining. The proposed adaptive
milling technology makes it possible to increase the productivity of the technological process,
reduce surface roughness, increase machining accuracy, reduce the time for harvesting
operation and reduce the percentage of defects.</p>
      <p>Milling of decorative elements is an extremely complex technological process that has a
number of requirements for the geometric parameters of the tool, rotational speed, feed,
positioning accuracy and discreteness of tool movements. To facilitate the machining process,
preliminary preparation of workpieces is carried out with the orientation of the fibers strictly
in one direction, which reduces decorative processing to linear milling with profile cutters.
Technological parameters are selected experimentally, or they use the experience already
gained, which leads to constant adjustment of parameters. However, due to the anisotropy of
the structure, the quality of the surface treatment is different along and across the fibers (Figure
1).</p>
      <p>Due to the pronounced symmetry along the axis of the tree trunk, the presence of annual
layers is observed, which entails a significant difference in the properties of wood in the
longitudinal, radial and tangential directions. Another indicator worth paying attention to is
the moisture content of the raw materials. It should be borne in mind that products made of the
same type of wood, made from blanks of different humidity, will have different quality of the
finished product.</p>
      <p>Wood differs in: color, pattern and texture, density and ability to split. Also, the processing
of wood on CNC machines is influenced by factors such as the age of the tree and the place of
its growth.</p>
      <p>The main properties of wood of different species are given in Table 1.</p>
      <p>Analysis of the data given in Table 1 shows that the strength of wood along the fibers is
approximately several times greater than the strength across the fibers. In the transverse
direction, the strength is greater than in the radial direction. Conifers have significantly lower
tensile strength compared to deciduous ones. For most types of wood, there is no difference
between the hardness of the radial and tangential planes, but for species with well-developed
core rays (oak, beech), the hardness in the radial plane is 5–10% higher than the hardness in the
tangential plane. The resistance of wood to splitting also depends on the orientation of the
surface. For species such as (white acacia, beech, oak, birch, linden), the resistance to splitting
varies significantly depending on the radial or tangential planes - by 20-40%.</p>
      <p>At hu1m2%idity Completely dry Conditional
Therefore, application of computer vision for the optimization of milling process is an urgent
and relevant task in order to automate the process of selecting the milling mode.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Literature Review</title>
      <p>In the case of study, we conducted an analysis of the recent publication in the field of
mechanical engineering and information technologies.</p>
      <p>Paper [1] introduces an enhanced approach for detecting defects in ceramic products within
an industrial setting by employing a computer vision system powered by deep learning models.</p>
      <p>Study [2] offers an innovative method that utilizes Convolutional Neural Networks (CNNs)
combined with image processing techniques to transform the way damage in wooden structures
is evaluated through digital imagery.</p>
      <p>The objective of [3] was to create an automated inspection system based on machine vision,
featuring a robust algorithm capable of identifying minor defects in hardwood flooring during
the manufacturing process. In [4], the YOLOv5 convolutional neural network is employed for
wood defect detection, with adaptations made to both YOLOv5n and YOLOv5m variants.</p>
      <p>Research [5] aims to tackle a key quality control issue in robotic-based manufacturing
processes within the field of industrialized construction.</p>
      <p>In [6], the authors introduce a novel method for detecting wood planks on a fast-moving
conveyor and using a convolutional neural network (CNN) to segment surface defects in
realtime.</p>
      <p>The paper [7] provides an overview of the main wood defects affecting wood quality,
introduces techniques for detecting and identifying wood defects using different technologies,
highlights commonly used image recognition techniques for identifying surface defects in wood
and introduces three advanced pieces of equipment for detecting and classifying such defects.</p>
      <p>Work [8] presents a computer vision-based solution for object detection and tracking in
forested environments.</p>
      <p>In [9], an intelligent automated production system for solid wood is introduced, aiming to
advance the adoption of automated industrial production methods for sawn timber in the wood
structure construction sector. It also fosters deeper integration of artificial intelligence, internet
technologies, and the broader wood processing industry, driving the transition of wood-based
building materials toward intelligent manufacturing.</p>
      <p>Paper [10] proposes an enhanced modeling approach based on ResNet-50 to improve the
accuracy and efficiency of wood surface defect detection.</p>
      <p>In works [11-12] we propose application of YOLOv8 CNN model for the purposes of different
objects recognition. The same model will be applied in this research for the method of wood
defects detection.</p>
      <p>Also it was analyzed some neural networks approaches for other applications [13, 14, 15, 16,</p>
    </sec>
    <sec id="sec-3">
      <title>3. Research Methodology</title>
      <sec id="sec-3-1">
        <title>3.1. Dataset</title>
        <p>Large scale image dataset of wood surface defects [18] from Kaggle was used as a basis for
model training. Original dataset contains 4000 images of wood surface defects. The domain
analysis [19, 20] made it possible to determine the most common wood defects. The dataset was
analyzed by the number of images with the following defects: Quartzity, Live Knot, Marrow,
Resin, Dead Knot, Knot with Crack, Knot missing and Crack.</p>
        <p>Figure 2 shows class distribution of the original training dataset. Thus, this dataset is
imbalanced. However, firstly it was analyzed the whole images of dataset. Then the dataset was
balanced.</p>
        <p>Each image corresponds to a file with a description, indicating the coordinates of the
corresponding defect, or the absence of any defects. An example of images from the training
dataset is shown in Figure 3.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Metrics</title>
        <p>The YOLOv8 model was used in the study. To evaluate the model it was used the following
metrics [21]:
– Precision;
– Recall;
– mAP50;
– mAP50-95.</p>
        <p>Precision measures the proportion between true positives and all detected objects:
P =</p>
        <p>TP</p>
        <p>,</p>
        <p>TP + FP
R =</p>
        <p>TP</p>
        <p>,</p>
        <p>TP + FN
Where:
P – precision;
TP (true positives) – correctly detected objects;
FP (false positives) – incorrectly detected objects.</p>
        <sec id="sec-3-2-1">
          <title>Where:</title>
          <p>
            (
            <xref ref-type="bibr" rid="ref1">1</xref>
            )
(
            <xref ref-type="bibr" rid="ref2">2</xref>
            )
FN (false negatives) – missed objects.
          </p>
          <p>Average precision (AP) is calculated as the area under the precision-recall curve. For task of
wood defects detection it can be calculated as:
(3)
(4)</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>Where:</title>
          <p>n – number of IoU thresholds.</p>
          <p>APi,k – the average precision for class i at IoU threshold k.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results and Discussion</title>
      <p>During the development of the model, experiments were conducted to determine the most
optimal parameters for training.</p>
      <p>The original dataset was splited into training and validation sets. Since the values of the
metrics were not satisfactory, the balancing of the dataset was carried out and the removal of
classes for which there was insufficient data. This made it possible to speed up the operation of
the model from 104.1 to 0.78 ms per image. This result allows to use the model for real -time
image analysis.</p>
      <p>According to the per-class analysis, it can be concluded that Live Knot and Dead Knot have
precision over 0.8. The best value was observed for Live Knot – 0.868. Compared to the initial
values, it was possible to increase recall, although its value is still insufficient, especially for
Resin.</p>
      <p>Thus, Resin and Live Knot still have slightly lower performance in terms of recall and
mAP50-95 compared to Dead Knot. The model demonstrates the best recognition results for
Dead Knot, which is due to the large number of images with this defect in the dataset. Figure 4
shows work of the model on the validation set.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions</title>
      <p>Milling is a complex process, and therefore requires a comprehensive approach. Defects in wood
directly affect the efficiency of processing, therefore, determining the type of defect plays a key
role and has a direct impact on product quality.</p>
      <p>The research proposed a method of detecting wood defects in real time using the YOLOv8
model. The evaluation of the metrics allows to conclude that the application of image analysis
technology can significantly improve the milling process. The proposed model allows to
determine Live Knot, Dead Knot and Resin. At the same time, there is a need for further research
to improve the accuracy of identifying individual defects as Quartzity, Marrow, Crack and
other.</p>
      <p>The limitations of the conducted research are determined by the lack of images for certain
types of defects in the dataset. However, sufficiently high indicators of metrics for classes that
are present in sufficient numbers in the dataset testify to the effectiveness of the chosen
approach and the feasibility of further research. In future work, we consider it advisable to
conduct research with an expanded dataset to classify a larger number of defects.</p>
    </sec>
    <sec id="sec-6">
      <title>Declaration on Generative AI</title>
      <p>During the preparation of this work, the authors used Grammarly in order to: grammar and
spelling check; DeepL Translate in order to: some phrases translation into English. After using
these tools/services, the authors reviewed and edited the content as needed and take full
responsibility for the publication’s content.
[3] Xia, J., Jeong, Y., &amp; Yoon, J. (2023). An automatic machine vision -based algorithm for
inspection of hardwood flooring defects during manufacturing. Engineering Applications
of Artificial Intelligence, 123, 106268.
[4] Xu, J., Yang, H., Wan, Z., Mu, H., Qi, D., &amp; Han, S. (2023). Wood surface defects detection
based on the improved YOLOv5-C3Ghost with SimAm module. IEEE Access.
[5] Xie, C., Tehrani, B. M., &amp; Alwisy, A. A Framework for Automated Quality Control of
Wood-Framed Panels in Robotic-Based Manufacturing Using Computer Vision and Deep
Learning. In Construction Research Congress 2024 (pp. 456-465).
[6] Mohsin, M., Balogun, O. S., Haataja, K., &amp; Toivanen, P. (2023). Convolutional neural
networks for real-time wood plank detection and defect segmentation. F1000Research, 12,
319.
[7] Chen, Y., Sun, C., Ren, Z., &amp; Na, B. (2023). Review of the Current State of Application of</p>
      <p>
        Wood Defect Recognition Technology. BioResources, 18(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ).
[8] Wells, L. A., &amp; Chung, W. (2023). Real-Time computer vision for tree stem detection and
tracking. Forests, 14(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ), 267. https://doi.org/10.3390/f14020267.
[9] Ji, M., Zhang, W., Diao, X., Wang, G., &amp; Miao, H. (2023). Intelligent automation
manufacturing for Betula solid timber based on machine Vision detection and optimization
grading system applied to building materials. Forests, 14(7), 1510.
[10] Wang, R., Liang, F., Wang, B., &amp; Mou, X. (2023). ODCA-YOLO: An omni-dynamic
convolution coordinate attention-based YOLO for wood defect detection. Forests, 14(9),
1885.
[11] Pavlova O., Rudyk I., Bouhissi H.E.L. Post-processing of video surveillance systems alarm
signals using the YOLOv8 neural network. CEUR Workshop Proceedings. 2024, 3675, pp.
196–207.
[12] Pavlova O., Hovorushchenko T., Kuzmin A., Isayev T., Bouhissi H.E.L. Method of early
landfill fire detection using the YOLOv8 neural network. CEUR Workshop Proceedings.
2024, 3736, pp. 186-200.
[13] S. Svystun, O. Melnychenko, P. Radiuk, O. Savenko, A. Sachenko, A. Lysyi (2024). Thermal
and RGB Images Work Better Together in Wind Turbine Damage Detection. International
Journal of Computing, 23(4), 526-535. https://doi.org/10.47839/ijc.23.4.3752
[14] V. Golovko, A. Kroshchanka, E. Mikhno, M. Komar, A. Sachenko (2021). Deep
Convolutional Neural Network for Detection of Solar Panels. In: T. Radivilova, D. Ageyev,
N. Kryvinska (eds) Data-Centric Business and Applications. Lecture Notes on Data
Engineering and Communications Technologies, vol 48. Springer, Cham.
https://doi.org/10.1007/978-3-030-43070-2_17
[15] J. Arcila-Diaz, D. Altamirano-Chavez, L. Arcila-Diaz, , &amp; C. Valdivia (2024). Real-time
Identification of Rice Leaf Diseases using Convolutional Neural Networks. International
Journal of Computing, 23(4), 709-714. https://doi.org/10.47839/ijc.23.4.3773
[16] M. Komar, V. Golovko, A. Sachenko and S. Bezobrazov, "Development of neural network
immune detectors for computer attacks recognition and classification," 2013 IEEE 7th
International Conference on Intelligent Data Acquisition and Advanced Computing
Systems (IDAACS), Berlin, Germany, 2013, pp. 665-668, doi:
10.1109/IDAACS.2013.6663008.
[17] F. A. Azis, H. Suhaimi, &amp; E. Abas (2023). Real-Time Face Mask Classification with
Convolutional Neural Network for Proper and Improper Face Mask Wearing. International
Journal of Computing, 22(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ), 184-190. https://doi.org/10.47839/ijc.22.2.3087
[18] Large scale image dataset of wood surface defects. (2022, February 14). Kaggle.
https://www.kaggle.com/datasets/nomihsa965/large-scale-image-dataset-of-woodsurface-defects/data.
[19] Kodytek, P., Bodzas, A., &amp; Bilik, P. (2022). A large-scale image dataset of wood surface
defects for automated vision-based quality control processes. F1000Research, 10, 581.
https://doi.org/10.12688/f1000research.52903.2.
[20] Özcan, U., Kiliç, K., Kiliç, K., &amp; Doğru, İ. A. (2024). Using deep learning techniques for
anomaly detection of wood surface. Drvna Industrija, 75(3), 275–286.
https://doi.org/10.5552/drvind.2024.0114.
[21] Ultralytics. (2024, October 1). YOLO Performance Metrics. Ultralytics YOLO Docs.
https://docs.ultralytics.com/guides/yolo-performance-metrics.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Cumbajin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rodrigues</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Costa</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Miragaia</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Frazão</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Costa</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , ... &amp;
          <string-name>
            <surname>Pereira</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2023</year>
          ).
          <article-title>A real-time automated defect detection system for ceramic pieces manufacturing process based on computer vision with deep learning</article-title>
          .
          <source>Sensors</source>
          ,
          <volume>24</volume>
          (
          <issue>1</issue>
          ),
          <fpage>232</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Ehtisham</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qayyum</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Camp</surname>
            ,
            <given-names>C. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plevris</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mir</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khan</surname>
            ,
            <given-names>Q. U. Z.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Ahmad</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2024</year>
          ).
          <article-title>Computing the characteristics of defects in wooden structures using image processing and CNN</article-title>
          . Automation in Construction,
          <volume>158</volume>
          ,
          <fpage>105211</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>