PEER-REVIEW ARTICLE PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4964 Timber Knot Detector with Low False-Positive Results by Integrating an Overlapping Bounding Box Filter with Faster R-CNN Algorithm Wenping Chen,a Jing Liu,a Yiming Fang,a,* and Jianyong Zhao b Knot detection is an important aspect of timber grading. Reducing the false-positive frequency of knot detection will improve the accuracy of the predicted grade, as well as the utilization of the graded timber. In this study, a framework for timber knot detection was proposed. Faster R- CNN, a state-of-the-art defect identification algorithm, was first employed to detect timber knots because of its high true-positive frequency. Then, an overlapping bounding box filter was proposed to lower the false positive frequency achieved by Faster R-CNN, where a single knot is sometimes marked several times. The filter merges the overlapping bounding boxes for one actual knot into one box and ensures that each knot is marked only once. The main advantage of this framework is that it reduces the false positive frequency with a small computational cost and a small impact on the true positive frequency. The experimental results showed that the detection precision improved from 90.9% to 97.5% by filtering the overlapping bounding box. The framework proposed in this study is competitive and has potential applications for detecting timber knots for timber grading. DOI: 10.15376/biores.18.3.4964-4976 Keywords: Timber knot detection; Faster R-CNN; False positive results; Overlapping bounding box filter Contact information: a: School of Mechanical and Electrical Engineering, Shaoxing University, Shaoxing 312000, P. R. China; b: School of Computer Science and Technology, Hangzhou Dianzi University, Hangzhou 310037, P. R. China; *Corresponding author: ymfang@usx.edu.cn INTRODUCTION Grading is one of the most crucial procedures in timber manufacturing process (Gazo et al. 2018; Olofsson et al. 2021). The assigned grades provide an efficient way to define the timber quality and help buyers estimate the cost and possible waste in the subsequent manufacturing processes. In many timber grading rules, such as EN 14081-1, Nordic timber grading rules, the number and size of knot defects are import parameters that determine the final results because knot defects reduce the usability of timber (Fang et al. 2021). Therefore, scientists have been investigating the non-destructive identification methods of timber knots over the past decades. This form of identification provides a promising way to predict the correct grade for sawn timber and enables the correct choice of timber for various wooden products (Qu et al. 2019). Traditionally, non-destructive knot defect identification has been performed manually by trained inspectors, which is tedious, time-consuming, and labor-intensive. In addition, detection with high repeatability and accuracy is not guaranteed. With the development of computer techniques, machine vision is currently becoming an effective way to replace manual inspection due to its low cost and degree of automation. The PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4965 accuracy of this method depends on the methods that are employed to identify knots from the timber images. Various algorithms in the field of target recognition have been introduced to address barriers to improving accuracy. Earlier methods consisted of feature extraction and classifiers, which were both designed manually (Hwang et al. 2021). However, the performance of these approaches was affected by material variations. When the tree species or surface condition changes, the texture and color of the timber vary dramatically (He et al. 2019). Some methods did not present a universal and sufficiently robust solution with respect to the number of samples, along with the extent of the presented dataset (Kryl et al. 2020). With the development of machine learning, deep learning technology has been widely used because of its ability to solve image-classification problems (Wang et al. 2021). Many convolutional neural network (CNN)-based models have been proposed in recent years, such as AlexNet, VGG, GoogLeNet, ResNet, DenseNet, and EfficientNet (Tulbure et al. 2022). Further, many of these have been utilized to inspect timber surfaces (Shi et al. 2020; Anam 2021). In a pioneer study, the performances of AlexNet, GoogLeNet, VGG-16, and ResNet-50 in detecting mechanical damage in sawn timbers were compared (Rudakov et al. 2018; Anam 2021). Hu et al. (2020) employed MASK R- CNN to identify dead knots, live knots, and insect holes on the surface of poplar veneers. Liu et al. (2020) tested the validity and reliability of YOlO-v3 for detecting timber cracks. A Gaussian function to YOLO-v3 to model the coordinates of bounding boxes was introduced and later replaced the IoU loss function with the CIoU loss function. Then, the modified YOLO-v3 procedure was applied to two datasets of timber surface images to identify timber surface defects (Tu et al. 2021). Ding et al. (2020) replaced the VGG16 network in the SSD model with DenseNet121 and used the modified SSD framework to detect wood knots, dead knots, and check for defects. Through constructing a novel CNN- based architecture (Mix-FCN), He et al. (2019) located wood defects and identified their types from wood surface images. All the above-mentioned authors claimed that their approaches achieved successful applications. The Faster R-CNN model is one of the most popular methods for defect detection. It employs the region proposal network (RPN) method to identify a region of interest in the image and utilizes a classifier to identify bounding boxes. It provides guidance for medical image analysis (Su et al. 2021), intelligent transport (Jiang and Shi 2021), semantic segmentation (Jiang et al. 2021), and defect detection (Chen et al. 2022). Faster R-CNN with data augmentation and transfer learning strategies is also a state-of-the-art approach for timber defect detection. Urbonas et al. (2019) employed Faster R-CNN to identify four types of defects on wood veneer surfaces. The authors reported that the most successful model based on ResNet152 achieved an accuracy of 96.1%. In a previous study, the authors investigated the application of Faster R-CNN to detect timber knots and achieved a high true-positive frequency (Fang et al. 2021). However, there was a problem that a small number of knots were labelled several times, resulting in the increase of the false positive results (Fang et al. 2021). In fact, similar problems have been reported by many researchers in the literature (Nguyen et al. 2021; Trier et al. 2021; Tu et al. 2021). The number of surface knots is an important factor for predicting the timber grade in automatic wood grading. If a knot is identified several times, it reduces the timber grade and consequently its commercial value. Therefore, there is an urgent need to address this issue. Nguyen et al. (2021) proposed a ResNet model to improve the performance of Faster R-CNN by reducing the false positive frequency. In another investigation, an image classification network was PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4966 integrated into the probabilistic Faster R-CNN to lower the false positive results at the object level (Yi et al. 2021). It may seem that all the listed studies achieved good results. However, they were not able to strike a good balance between detection speed and accuracy. Some algorithms require much more computation than the non-maximum suppression (NMS) algorithm that is used in the standard Faster R-CNN to remove the overlapping bounding boxes. In this study, the spatial distribution characteristics of timber knots were analyzed, and a simple algorithm was proposed to reduce false positives in the application of Faster R-CNN when detecting timber knots. The main advantage of this algorithm is that it can remove repeated bounding boxes at a small computational cost and it significantly improves detection accuracy. EXPERIMENTAL Materials A dataset containing 305 timber images with sizes ranging from 70 kB to 3354 kB was used in this study. The images were collected from sawn timber with sanded surfaces purchased from a local sawmill. The species of some timbers was Metasequoia glyptostroboides, and the other species was Pinus koraiensis. Both are common and are widely used in China. Figure 1 illustrates some typical timber images. Fig. 1. Some typical images in the image dataset Generally, timbers of different species show various texture and color, which poses a challenge for knot identification. A good knot identification method should not be influenced by the issue of species. In the present work, like many other studies (Hu et al. 2020; Liu et al. 2020; Fang et al. 2021), the timbers were not divided into different classes in terms of species. First, Adobe Photoshop software (San Jose, CA, USA) was used to process the raw images to ensure that each image contained at least one knot. Experienced inspectors then annotated all the images using the open-source software LabelImg (https://github.com/tzu PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4967 talin/labelImg). All the knots are labelled with red rectangular boxes. The annotation results are also depicted in Fig. 1. Finally, annotations were saved as XML files in the PASCAL VOC format. Architecture of the Method When a tree continues to grow normally, the crown usually shades the older and lower branches, which tend to die off and are overtaken by the increasing girth of the trunk. Knots then emerge around these branches. In other words, knots are wood found inside the branches growing out of the tree trunk. Because only one branch can grow at any specific position on the trunk, there are usually no overlapping knots appearing on the timber images. Motivated by this, the authors proposed a simple framework, as illustrated in Fig. 2, to reduce false positives and improve precision in detecting knots on timber images. It consists of two main parts: The first is Faster R-CNN, which identifies the knots and labels them with bounding boxes, and the second is a bounding box filter that reduces the number of false positives by removing overlapping bounding boxes. Fig. 2. Illustration of the overall architecture of the proposed framework Faster R-CNN Figure 3 depicts the scheme of Faster R-CNN (Hou et al. 2020). It consists of four parts: a CNN-based feature extractor, region proposal network (RPN), region of interest (RoI) pooling, and classifier network. First, the input images were represented in the form of 3-dimensional tensors with shape (height, width, and depth) and applied to a pre-trained CNN model to generate condensed feature maps. After the feature extractor, the RPN estimates the possible regions (bounding boxes) using a sliding window across the feature map. Bounding boxes are often called region proposals or RoI. Then, RoI pooling collects the feature maps obtained from the CNN-based feature extractor and RoIs, synthesizes the Image collection Manual annotation Faster R-CNN Training Final Result Input image Trained Faster R-CNN Overlapping Bounding Boxes Filter Output of Faster R-CNN PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4968 information, and generates proper feature maps. Finally, the classifier network classifies the (RoI-pooled) RoIs as either objects or backgrounds and generates detection outputs, that is, bounding boxes and class probabilities/scores. Fig. 3. Schematic representation of Faster R-CNN CNN-based Feature Extractor MobileNet, ResNet, and Inception are usually employed as feature extractors for Faster R-CNN (Zhang et al. 2019). Among them, ResNet is easier to optimize and achieves a higher accuracy. Additionally, the bottleneck design utilized in ResNet is an effective way to solve the vanishing gradient issue using skip connections in the network. The design also reduces the time complexity of the network caused by the increasing number of layers in the deep network architecture (Elpeltagy and Sallam 2021). Therefore, the ResNet-50 pre-trained model was chosen as the feature extractor of Faster R-CNN in this study. Figure 4 shows a detailed description of the architecture (Kim et al. 2021). Fig. 4. Architecture of ResNet-50 employed in this study RPN Network As shown in Fig. 5, the RPN network uses the feature map output from the CNN- based feature extractor as the input and scans the maps using a sliding window approach (Ren et al. 2017). A convolution with a size of 3 × 3 × 256 is applied to each window position, and the output lower-dimensional features are then fed into two sibling 1 × 1 convolutional layers (for 𝑟𝑒𝑔 and 𝑐𝑙𝑠, respectively). Suppose that 𝑘 region proposals of different shapes and sizes are generated at each sliding window location, the 𝑐𝑙𝑠 layer estimates 2𝑘 probabilities for two categories (object or not) and the 𝑟𝑒𝑔 layer outputs 4𝑘 coordinates for the 𝑘 bounding boxes. Feature Map cls-pre bbox-reg Input I Feature extraction Feature RPN network ROI poolingFully connected layerOutput O block 1 7 × 7 c o n v 3 × 3 p o o l 1×1, 64 3×3, 64 1×1, 256 ×3 Residual block 1 1×1, 128 3×3, 128 1×1, 512 ×4 Residual block 2 1×1, 256 3×3, 256 1×1, 1024 ×6 Residual block 3 1×1, 512 3×3, 512 1×1, 2048 ×3 Residual block 4 PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4969 RoI Pooling RoI pooling is a concept introduced by Fast R-CNN, an earlier version of Faster R- CNN. It functions as a data shape normalizer. Every RoI from the input list is divided into equal-sized sections, standard mass pooling is applied independently to each section, and the maximum values are copied to the output buffer. The dimension of the RoI pooling output does not rely on the size of the region proposals or the size of the input feature map. The exclusive determinant is the number of sections into which the proposal is divided. Fig. 5. Structure of RPN Overlapping Bounding Boxes Filter The filter identifies the overlapping bounding boxes and replaces them with a maximum-enclosing rectangle. Assume 𝑅𝑖 and 𝑅𝑗 are two bounding boxes output by Faster R-CNN model. They are said to overlap if they overlap in both 𝑥 and 𝑦 directions. This can be expressed by Eq. 1, If max(𝑥𝑖1, 𝑥𝑗1) < min(𝑥𝑖2, 𝑥𝑗2) and max(𝑦𝑖1, 𝑦𝑗1) < min(𝑦𝑖2, 𝑦𝑗2) then 𝑅𝑖 ∩ 𝑅𝑗 (1) where (𝑥𝑖1, 𝑦𝑖1) is the upper-left corner of 𝑅𝑖 and (𝑥𝑖2, 𝑦𝑖2) is the lower-right corner. (𝑥𝑗1, 𝑦𝑗1) and (𝑥𝑗2, 𝑦𝑗2) denote the corresponding corners of 𝑅𝑗 respectively. Given 𝑁 overlapping bounding boxes, the maximum enclosing rectangle 𝑅 is used to replace them. The upper left corners (𝑥𝑅1, 𝑦𝑅1) of 𝑅 can be determined using Eq. 2: { 𝑥𝑅1 = min{𝑥𝑖1} 𝑦𝑅1 = min{𝑦𝑖1} , 𝑖 = 1, 2, ⋯ , 𝑁 (2) The lower-right corner (𝑥𝑅2, 𝑦𝑅2) can be obtained according to Eq. 3: { 𝑥𝑅2 = max{𝑥𝑖2} 𝑦𝑅2 = max{𝑦𝑖2} , 𝑖 = 1, 2, ⋯ , 𝑁 (3) sliding window feature map intermediate layer 256-d 4k coordinates2k scores cls layer reg layer k anchor boxes PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4970 Evaluation Metrics To quantitatively evaluate the performance, the commonly used metrics of 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛, 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒, and overall accuracy 𝐹 − 𝑆𝑐𝑜𝑟𝑒 were introduced in this study. They are defined as follows (Goutte and Gaussier 2005), 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 (%) = 𝑇𝑃 𝑇𝑃 + 𝐹𝑃 × 100 (4) 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 (%) = 𝑇𝑃 𝑇𝑃 + 𝐹𝑁 × 100 (5) 𝐹 − 𝑆𝑐𝑜𝑟𝑒 (%) = 2 × (𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒) (𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒) × 100 (6) where 𝑇𝑃 (true positive) is the number of correctly detected knots, 𝐹𝑃 (false positive) refers to the number of detected results, which were marked as knots but actually did not exist on the timber surface, and 𝐹𝑁 (false negative) indicates the number of undetected knots (omission error). According to Eq. 4, 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 is the ratio of correct detections to all detection results. From Eq. 5, it can be inferred that the 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 is an indication of omission errors. 𝐹 − 𝑆𝑐𝑜𝑟𝑒 is essentially the harmonic mean of 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 . It combines the two indicators into a single indicator that captures both properties. A higher 𝐹 − 𝑆𝑐𝑜𝑟𝑒 indicates a more accurate model. RESULTS AND DISCUSSION Experimental Configuration All the experiments were conducted using a Windows 10 64-bit operation system, along with CUDA 10.2 and Cudnn 7.6.5 under Python 3.7.6. The hardware platform is built using a server with an Intel I5-7500 3.4 GHz quad-core processor, 16 GB memory, and an NVIDIA GeForce RTX 2060 6 GB card. The dataset was randomly divided into three parts: training, validation, and testing sets. The training set contained 80% of the images of the dataset and was used to train Faster R-CNN. The validation and testing sets each contained 10% of the images and were used for validation and testing, respectively. The end-to-end mode was used to train Faster R-CNN. The batch size of the training was set to four because of the limitations of the GPU. Training was optimised using a stochastic gradient descent algorithm. The momentum was set to 0.9. A learning rate scheduler is employed to accelerate the convergence of the training. Initially, a learning rate of 0.001 was selected. After 40000 iterations, the learning rate was changed to 0.0001 and was further adjusted to 0.00001 after 80000 iterations. Training was complete after 100000 iterations. The weights are saved and used to verify the proposed framework. Detection Results of Faster R-CNN The images in the testing set were applied to the trained Faster R-CNN model. In the output images, the detected knots were labelled with a bounding box. Figure 6 shows the typical detection results. The confidence coefficient is shown near the box with an arrow. PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4971 Evidently, most knot defects can be detected accurately. Some knots featured a distinctly different color or a different grain pattern, as shown in Fig. 6(a). Faster R-CNN could detect them with high confidence coefficients. Moreover, Faster R-CNN can achieve good performance in detecting sound knots, pin knots, and edge knots, as shown in Figs. 6(b) to 6(e). (a) (b) (c) (d) (e) (f) (g) (h) Fig. 6. Some typical detection results of Faster R-CNN However, there are shortcomings while detecting some special knots only using Faster R-CNN. The torn grain of timber was sometimes marked as a knot, as illustrated in Fig. 6(f). Additionally, one actual knot is often labelled two or more times, as shown in Figs. 6(g) and 6(h). The number of surface knots is an important factor for predicting the timber grade in automatic wood grading. If a knot is identified several times, it will lead to a decline in the grade and commercial value of the graded timber. Table 1 presents the results of the quantitative assessment. Consistent with the visual evaluation, Faster R-CNN correctly identified most knots. 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛, 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒, and 𝐹 − 𝑆𝑐𝑜𝑟𝑒 were high for all three sets. However, the false positives lead to a significant performance drop in 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛. In the test set detection experiment, four false positives appeared, and 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 was only 90.9%. As mentioned before, false positives have a significant negative impact on the grade and commercial value of the graded timber. Therefore, reducing false positives of knot detection becomes an urgent problem for the timber grading. Table 1. Detection Performance of Faster R-CNN Model Data Set TP FP FN 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 𝐹 − 𝑆𝑐𝑜𝑟𝑒 Training set 285 20 2 93.4% 99.3% 96.3% Validation set 42 2 5 95.5% 89.4% 92.3% Testing set 40 4 4 90.9% 90.9% 90.9% 1.00 1.00 1.00 1.00 1.00 0.99 0.88 1.00 1.00 0.99 1.00 0.82 0.67 PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4972 Results of the Overlapping Bounding Box Filter The output of Faster R-CNN was applied to the aforementioned filter, together with the original image. Figure 7 shows the results of the images shown in Figs. 6(f) to 6(h). As expected, the overlapping bounding boxes were removed. Each knot was labelled once. Visual evaluation indicated that the proposed method is effective. Table 2 lists the quantitative evaluation of the filter’s performance. Compared with Table 1, the false positives were reduced significantly when overlapping boxes were merged. When the filter was applied to the intermediate results of the training set, the false positives reduced from 20 to 1. Similar phenomena can be observed in the experiments on the other two sets. As a result, the values of 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 and 𝐹 − 𝑆𝑐𝑜𝑟𝑒 on three data sets were improved significantly. 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 for the training, validation, and test sets increased 6.75%, 4.71%, and 7.26%, respectively. (a) Figure 6(f) (b) Figure 6(g) (c) Figure 6(h) Fig. 7. Three typical results of the overlapping bounding box filter Table 2. Detection Performance of the Overlapping Bounding Box Filter Data Set TP FP FN 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 𝐹 − 𝑆𝑐𝑜𝑟𝑒 Training set 285 1 2 99.7% 99.3% 99.5% Validation set 42 0 5 100% 89.4% 94.4% Testing set 39 1 5 97.5% 88.6% 92.8% However, the number of false positives presented in Table 2 was still not equal to zero. This means that the proposed filter was not able to eliminate all false positives even though it can effectively reduce the number. The filter proposed in this study is not effective for false positives that are caused by grain distortion or rough surfaces, because these false positives have no bounding boxes intersecting with other real knots. For example, the boxes on the left and right in the image shown in Fig. 8 cannot be removed, even when they are applied to the proposed filter with the original image. It also can be seen that the number of false negatives on the testing set changed to five after the filter process. This implies that the filter may omit more real knots. If two knots are sufficiently close, their Faster R-CNN bounding boxes may overlap, as shown in Fig. 9. The filter merges the two overlapping bounding boxes. This merging decreased the recall rate from 90.9% to 88.6% when the experiment was conducted on the test set. However, because the filter removed many false positives, the 𝐹 − 𝑠𝑐𝑜𝑟𝑒 increased from 90.9% to 92.8%. PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4973 Fig. 8. Illustration of false positives caused by texture distortion or rough surface Fig. 9. Illustration of false negative caused by two close knots Comparisons with YOLO Models The results of the proposed approach were also compared with the results of two state-of-the-art methods, YOLO-v3 SPP and YOLO-v5m (Fang et al. 2021). Table 3 lists their results in terms of 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 , 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 , and 𝐹 − 𝑆𝑐𝑜𝑟𝑒 of the detection experiments conducted on the testing set. Evidently, the performance of YOLO-v5m was better than that of YOLO-v3 SPP and Faster R-CNN. YOLO-v3 SPP achieved performance similar to that of Faster R-CNN. The 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 of Faster R-CNN was slightly lower than that of YOLO-v3 SPP, but the values of 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 and 𝐹 − 𝑆𝑐𝑜𝑟𝑒 were higher than those of YOLO-v3 SPP. When the algorithm of the overlapping bounding boxes filter was applied, the metrics changed significantly. The value of 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 reached 97.5%, which was higher than those of YOLO-v3 SPP and YOLO-v5m. At the same time, the 𝐹 − 𝑆𝑐𝑜𝑟𝑒 was also the highest among the three methods, even though the 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 was slightly lower than those of the other two YOLO-based methods. Table 3. Results of YOLO-v3 SPP and YOLO-v5m Data Set 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 𝑅𝑒𝑐𝑎𝑙𝑙 𝑅𝑎𝑡𝑒 𝐹 − 𝑆𝑐𝑜𝑟𝑒 YOLO-v3 SPP 91.7% 89.2% 90.4% YOLO-v5m 91.7% 91.7% 91.7% PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4974 CONCLUSIONS 1. Through introducing the proposed overlapping bounding box filter to Faster R-CNN, knot defects detection is achieved with low false positives, which then tackles the drop in the precision of the detection and the commercial value of timbers. The experimental results showed that the proposed framework can improve the detection precision of Faster R-CNN from 90.9% to 97.5%. In comparison with YOLO-v3 SPP and YOLO- v5m models, the proposed method also achieved the best performance. 2. The advantage of this approach is that it can remove repeated bounding boxes at a small computational cost and significantly improves the detection accuracy. Several comparison operations are needed rather than additional training, which is time- consuming and needs more hardware support. 3. A disadvantage of this method is that the filter cannot remove commission errors caused by the torn grain or rough surface. More efforts are needed to address this problem by investigating transformed-based networks, which are reported to have the ability to achieve better performance than the CNN-based models. 4. If knots are spatially close to each other, the filter may merge the overlapping bounding boxes output by Faster R-CNN. This leads to omission errors and a decrease in the Recall Rate. In the future, the authors plan to introduce object identification algorithms to the image within the maximum enclosing rectangle to determine the actual number of knots. ACKNOWLEDGMENTS The authors are grateful for the support of the Key Research and Development Program of Zhejiang Province (Grant No. 2020C01031) and MOE (Ministry of Education in China) Project of Humanities and Social Sciences (Grant No. 22YJAZH017). REFERENCES CITED Anam, M. (2021) " Evaluate machine learning model to better understand cutting in wood," Uppsala Univeristy, URL: https://www.essays.se/essay/fb993bc5c9/ Chen, M., Yu, L., Zhi, C., Sun, R., Zhu, S., Gao, Z., Ke, Z., Zhu, M., and Zhang, Y. (2022). "Improved Faster R-CNN for fabric defect detection based on Gabor filter with genetic algorithm optimization," Computers in Industry 134, article 103551. DOI: 10.1016/j.compind.2021.103551 Ding, F., Zhuang, Z., Liu, Y., Jiang, D., Yan, X., and Wang, Z. (2020). "Detecting defects on solid wood panels based on an improved SSD algorithm," Sensors 20, article 5315. DOI: 10.3390/s20185315 Elpeltagy, M., and Sallam, H. (2021). "Automatic prediction of COVID−19 from chest images using modified ResNet50," Multimedia Tools and Applications 80, 26451- 26463. DOI: 10.1007/s11042-021-10783-6 Fang, Y., Guo, X., Chen, K., Zhou, Z., and Ye, Q. (2021). "Accurate and automated detection of surface knots on sawn timbers using YOLO-v5 model," BioResources PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4975 16(3), 5390-5406. DOI: 10.15376/biores.16.3.5390-5406 Gazo, R., Wells, L., Krs, V., and Benes, B. (2018). "Validation of automated hardwood lumber grading system," Computers and Electronics in Agriculture 155, 496-500. DOI: 10.1016/j.compag.2018.06.041 Goutte, C., and Gaussier, E. (2005). "A probabilistic interpretation of Precision, Recall and F-score, with implication for evaluation," in: Proceedings of 27th European Conference on Information Retrieval Research Santiago de Compostela, Spain, pp. 345-359. DOI: 10.1007/978-3-540-31865-1_25 He, T., Liu, Y., Xu, C., Zhou, X., Hu, Z., and Fan, J. (2019). "A fully convolutional neural network for wood defect location and identification," IEEE Access 7, 123453- 123462. DOI: 10.1109/ACCESS.2019.2937461 Hou, Z., Liu, X., and Chen L. (2020). "Object detection algorithm for improving non- maximum suppression using GIoU," in: Proceedings of IOP Conference Series: 2nd International Conference on Communication, Network and Artificial Intelligence Grangzhou, China, 790: article ID 012062. DOI: 10.1088/1757-899X/790/1/012062 Hu, K., Wang, B., Shen, Y., Guan, J., and Cai, Y. (2020). "Defect identification method for poplar veneer based on progressive growing generated adversarial network and MASK R-CNN model," BioResources 15(2), 3041-3052. DOI: 10.15376/biores.15.2.3041-3052 Hwang, S., Lee, T., Kim, H., Chung, H., Choi, J., and Yeo, H. (2021). "Classification of wood knots using artificial neural networks with texture and local feature-based image descriptors," Holzforschung 76, 1-13. DOI: 10.1515/hf-2021-0051 Jiang, D., Li, G., Tan, C., Huang, L., Sun, Y., and Kong, J. (2021). "Semantic segmentation for multiscale target based on object recognition using the improved Faster-RCNN model," Future Generation Computer Systems 123, 94-104. DOI: 10.1016/j.future.2021.04.019 Jiang, Z., and Shi, X. (2021). "Application research of key frames extraction technology combined with optimized Faster R-CNN algorithm in traffic video analysis," Complexity 2021, article ID 6620425. DOI: 10.1155/2021/6620425 Kim, M., Kim, H., Lee, C., and Kang B. (2021). "Detection of pneumoperitoneum in the abdominal radiograph images using artificial neural networks," European Journal of Radiology Open 8, article ID 100316. DOI: 10.1016/j.ejro.2020.100316 Kryl, M., Danys, L., Jaros, R., Martinek, R., Kodytek, P., and Bilik, P. (2020). "Wood recognition and quality imaging inspection systems," Journal of Sensors 2020, article ID 3217126. DOI: 10.1155/2020/3217126 Liu, Y., Hou, M., Li, A., Dong, Y., Xie, L., and Ji, Y. (2020). "Automatic detection of timber-cracks in wooden architectural heritage using YOLOv3 algorithm," in: Proceedings of International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences, Safranbolu, Turkey, pp. 1471-1476. DOI: 10.5194/isprs-archives-XLIII-B2-2020-1471-2020 Nguyen, C. C., Tran, G. S., Nguyen, V. T., Burie, J.-C., and Nghiem, T. P. (2021). "Pulmonary nodule detection based on Faster R-CNN with adaptive anchor box," IEEE Access 9, 154740-154751. DOI: 10.1109/ACCESS.2021.3128942 Olofsson, L., Broman, O., Oja, J., and Sandberg, D. (2021). "Product-adapted grading of Scots pine sawn timber by an industrial CT-scanner using a visually trained machine- learning method," Wood Material Science & Engineering 16(4), 279-286. DOI: 10.1080/17480272.2021.1955298 PEER-REVIEWED ARTICLE bioresources.com Chen et al. (2023). “Timber knot detector with R-CNN,” BioResources 18(3), 4964-4976. 4976 Qu, H., Chen, M., Hu, Y., and Lyu, J. (2019). "Effect of trees knot defects on wood quality: A review," in: Proceedings of International Conference on Energy, Chemical and Materials Science-IOP Conference Series: Materials Science and Engineering Malacca, Malaysia, Article ID 012027. DOI: 10.1088/1757-899X/738/1/012027 Ren, S., He, K., Girshick, R., and Sun J. (2017). "Faster R-CNN: Towards real-time object detection with region proposal networks." IEEE Transactions on Pattern Analysis and Machine Intelligence 39, 1137-1149. DOI: 10.1109/TPAMI.2016.2577 031 Rudakov, N., Eerola, T., Lensu, L., Kälviäinen, H., and Haario, H. (2018). "Detection of mechanical damages in sawn timber using convolutional neural networks," in: Proceedings of German Conference on Pattern Recognition Stuttgart, Germany, pp. 115-126. DOI: 10.1007/978-3-030-12939-2_9 Shi, J., Li, Z., Zhu, T., Wang, D., and Ni, C. (2020). "Defect detection of industry wood veneer based on NAS and multi-channel Mask R-CNN," Sensors 20, article ID 4398. DOI: 10.3390/s20164398 Su, Y., Li, D., and Chen, X. (2021). "Lung nodule detection based on Faster R-CNN framework," Computer Methods and Programs in Biomedicine 200, article ID 105866. DOI: 10.1016/j.cmpb.2020.105866 Trier, Ø. D., Reksten, J. H., and Løseth, K. (2021). "Automated mapping of cultural heritage in Norway from airborne lidar data using faster R-CNN," International Journal of Applied Earth Observation and Geoinformation 95, article ID 102241. DOI: 10.1016/j.jag.2020.102241 Tu, Y., Ling, Z., Guo, S., and Wen, H. (2021). "An accurate and real-time surface defects detection method for sawn lumber," IEEE Transactions on Instrumentation and Measurement 70, article ID 2501911. DOI: 10.1109/TIM.2020.3024431 Tulbure, A.-A., Tulbure, A.-A., and Dulf, E.-H. (2022). "A review on modern defect detection models using DCNNs - Deep convolutional neural networks," Journal of Advanced Research 35, 33-48. DOI: 10.1016/j.jare.2021.03.015 Urbonas, A., Raudonis, V., Maskeliunas, R., and Damaševičius, R. (2019). "Automated identification of wood veneer surface defects using faster region-based convolutional neural network with data augmentation and transfer learning," Applied Sciences 9(22), 4898-4918. DOI: 10.3390/app9224898 Wang, Y., Zhang, W., Gao, R., Jin, Z., and Wang, X. (2021). "Recent advances in the application of deep learning methods to forestry," Wood Science and Technology 55, 1171–1202. DOI: 10.1007/s00226-021-01309-2 Yi, D., Su, J., and Chen, W. (2021). "Probabilistic Faster R-CNN with stochastic region proposing: Towards object detection and recognition in remote sensing imagery," Neurocomputing 459, 290-301. DOI: 10.1016/j.neucom.2021.06.072 Zhang, Z., Wang, Y., Zhang, J., and Mu, X. (2019). "Comparison of multiple feature extractors on Faster RCNN for breast tumor detection," in: Proceedings of 8th IEEE International Symposium on Next-Generation Electronics Zhenzhou, China, pp. 1-4. DOI: 10.1109/ISNE.2019.8896490 Article submitted: January 31, 2023; Peer review completed: April 21, 2023; Revised version received and accepted: May 1, 2023; Published: May 26, 2023. DOI: 10.15376/biores.18.3.4964-4976