1. Introduction
Wood plays a significant role in various industries, such as furniture and construction, due to its naturally renewable, resilient, high strength-to-weight ratio, and lightweight properties. However, its surface inevitably contains defects like live knot, dead knot, resin, knot with crack, and crack [
1]. These defects affect wood properties such as toughness and strength during the wood processing stage, significantly reducing the utilization of wood as a raw material [
2]. Before further processing, it is necessary to cut off the wood surface defects according to their type and location to maximize the rate of wood yield. Therefore, wood defect detection is essential for the improvement of wood utilization and quality. Some of the defect images are shown in
Figure 1. On the one hand, some classes have large intra-class differences; as seen in
Figure 1a,b, the scale of the live knots varies greatly. On the other hand, inter-class distinctions are relatively minor. For example, in
Figure 1c,d, the difference between a live knot and knot with crack is primarily based on whether a crack exists within the knot’s boundary, which is difficult to recognize by the human eye. In conclusion, the detection of wood defects is rather challenging.
Traditionally, surface inspection has been performed manually. This process is a subjective evaluation and therefore time-consuming and labor-intensive. Research by [
3] showed that accuracy rates of 70% were usually difficult to achieve because the human eye was easily fatigued and distracted during the inspection process. Another study indicated that human errors in wood defect inspection result in 22% of waste, reducing the total yield of wood products from 63.5% to 47.4%. As a result, wood was unable to fully realize its potential, and its overall utilization efficiency remains low [
4]. Therefore, the detection of wood defects is gradually being replaced by machines and shifting towards automation in order to enhance its comprehensive utilization.
In the early stages, the automation of wood defect detection mainly relied on methods such as stress waves, X-rays, and ultrasonic waves [
5,
6,
7]. The non-destructive assessment of the mechanical properties of wood using stress wave technology is primarily accomplished by measuring the velocity of stress waves. Stress waves propagate in three main forms: axial waves, transverse waves, and surface waves in wood. Among these, axial waves exhibit exceptionally high propagation speeds, and their velocity is closely related to the fundamental transmission speed of wood. However, this equipment demands a relatively high level of environmental control during practical testing, as it necessitates secure attachment to the surface of the wood. The detection of defects in the examined wood by utilizing the X-ray fluorescence imaging effect relies on discerning differences in X-ray intensity after passing through the object under examination. This method effectively distinguishes defects such as dead knots, insect holes, and cracks. The images obtained after irradiating the human body with X-rays tend to exhibit relatively poor quality, resulting in low visual contrast and limited sensitivity in defect identification. This makes it challenging to analyze and identify internal flaws within the wood. The propagation velocity of ultrasonic waves varies in different mediums, and the elastic modulus of wood can be calculated based on the propagation medium. The advantage of ultrasonic technology lies in its ability to reveal the condition of defects both inside and outside the wood. However, ultrasonic waves are susceptible to external influences, which can result in instability.
In recent years, artificial intelligence has gradually emerged and rapidly developed. Machine learning methods that utilize manually selected features have been extensively applied to wood defect detection. Feature extraction is the process of dimensioning an image using mapping or transform projection to reduce redundancy and avoid overfitting. Effective feature extraction can significantly impact the performance of a model. By analyzing the characteristics such as texture, color, and shape within wood defects, feature extraction algorithms select representative subsets of features. This process can effectively enhance the accuracy of subsequent defect detection. Currently, machine learning methods applied to wood defect detection mainly include techniques like Gray Level Co-occurrence Matrix (GLCM), image segmentation, Support Vector Machines (SVM), and wavelet neural network [
8]. These detection algorithms provide an automated approach for wood surface defect detection, effectively avoiding the numerous steps of manual and machine detection [
9,
10]. However, these algorithms require manual extraction of wood defect features, followed by classification and recognition of defects, which can slow down the actual detection speed. Additionally, these algorithms heavily rely on the quality of manually extracted features, leading to poor reusability.
Deep learning techniques can automatically extract image features, which largely reduces the complexity of traditional machine learning algorithms that require manual feature extraction. By integrating detection and classification, it introduces a novel approach to wood defect detection. Researchers have successfully applied Convolutional Neural Networks (CNNs) to wood defect detection and have achieved promising research outcomes. CNNs show remarkable robustness and self-learning capabilities in identifying wood defect patterns. They are not only free from the limitations of human subjectivity and variability, but also eliminate the need for manual feature selection. Currently, two types of CNN architectures are widely used in object detection: two-stage algorithms and one-stage algorithms. Two-stage object detection algorithms mainly include R-CNN, Fast R-CNN, Faster R-CNN, and Mask R-CNN [
11,
12,
13]. Firstly, the candidate regions within the image, followed by the classification and bounding box regression of these candidate regions to obtain the final object detection results. Due to the above two steps, two-stage methods typically require more computational resources and time compared to one-stage detection methods. One-stage detection frameworks mainly consist of the SSD and YOLO series [
14,
15,
16]. They omit the Region Proposal Network (RPN) step and directly obtain classification and local information. In contrast to two-stage methods, one-stage methods are generally easier to implement and deploy. In practical application scenarios, it is important to consider accuracy and efficiency simultaneously. Thus, in this paper, we chose the YOLOv5 detection framework as our baseline. Although YOLO has achieved success in tasks like face detection and pedestrian detection, it still has limitations in wood defect detection scenarios. Due to its difficulty in capturing features from shallow network layers and contextual information, its accuracy noticeably decreases when detecting smaller defects.
To address these challenges, this paper proposed a YOLO-based wood defect detection model utilizing SGN (SGN-YOLO). Furthermore, an enhanced backbone architecture is developed to enhance feature extraction capabilities and overcome the accuracy limitations due to large-scale variations in traditional object detection algorithms. Our main contributions are summarized as follows:
We design a semi-global network to replace the C3 module, which focuses on local information and integrates global information simultaneously.
We combine the E-ELAN with the depth model to learn more diverse features without disrupting the gradient pathways. Additionally, we improve the loss function by introducing a smoothing term to address the issue of offset and imprecise localization in object detection.
We propose a unified framework (SGN-YOLO) for accurate defect detection and conduct extensive experiments on public datasets. Our approach achieved 86.4% in the mean average precision (mAP) metric, surpassing many existing models.
6. Conclusions
The detection of wood defects is a major step before wood products are processed. The SGN-YOLO modules were used to detect wood defects, which improved the efficiency and economy of detection. It focuses mainly on the overall design and performance improvement of the network. First, the SGN model was introduced into the backbone to solve the problems of large variations in defect scales and poor detection of small defects. In addition, E-ELAN was introduced to improve the learning ability, which made the network learn more diverse features, and finally, EIOU enhanced the convergence speed in training. Experimental results on an open wood defect dataset showed that SGN-YOLO achieved 86.4% mAP, which is 3.1% higher than the baseline model. The average detection time is 0.015 seconds. We also conducted ablation studies to validate the effectiveness of the improvement modules. Notably, the proposed SGN module contributed the largest accuracy gain (3% increase in mAP, 2.7% increase in precision, and 3.9% increase in recall). Due to its low time consumption and high accuracy, the proposed model can be applied to embedded systems. However, there is still room for improvement in terms of method accuracy. In the future, we aim to reduce detection time further and enhance the accuracy of the algorithm on small defects. Due to the limited availability of open-source wood datasets, validation was performed on a single dataset. In future work, the model will undergo external validation further to enhance the assessment and validation of our model.