1. Introduction
Particleboard is a composite material made by blending wood, or other lignocellulosic materials. Both sides are made of fine wood fibers, which are formed by drying and hot pressing [
1,
2]. Defects appear on the surface of particleboard due to chemical composition, raw material ratios, technical processes, etc. Surface defects will seriously affect the stress strength of the plate, and cause difficulties in subsequent bonding. Up to now, the product classification of particleboard production lines still relies on manual experience to determine defects, and manual inspection has problems such as high labor intensity, low inspection efficiency and high false detection rate. Therefore, the development of an accurate and efficient real-time inspection system for particleboard surface defects is an effective measure to improve the quality of particleboard production [
3,
4].
Nondestructive inspection methods for wood panels include machine vision, ultrasonic, stress wave, and X-ray [
5]. Zhang tested cedar wood using ultrasound and used two mathematical function models to regress the defect size on the ultrasound propagation velocity [
6]. Only the quantitative relationship between ultrasonic propagation velocity and hole diameter was determined, but the defect types were not identified and classified. Wang utilized a defect detection classification method that combines stress wave technology with SVM to effectively distinguish defects such as insect eyes, knots and cracks, but it was difficult to distinguish between defective areas with less decay and normal areas of wood [
7]. Qi also utilized X-ray detection of wood to obtain internal images and used artificial neural network algorithms to identify wood defects. However, the artificial neural network modeling process is complex, with many training parameters, and time-consuming [
8].
The development of deep learning-based techniques has been accompanied by rapid advancements in computing power over the past few decades. Defect detection methods based on deep learning are divided into two main categories: object detection and semantic segmentation. An important application of computer vision is object detection, which finds and recognizes target objects in a scene and determines where the objects are located. For instance, Girshick proposed two-stage detectors, such as R-CNN (Region-CNN) [
9]. R-CNN transforms the problem of object detection into a classification problem by employing CNN algorithms for the extraction of features and classification of objects. To alleviate the time-consuming problem caused by the RCNN, Faster R-CNN introduces RPN (Region Proposal Networks) that share convolutional layers with object detection networks. The marginal cost for computing proposals is small due to the sharing of convolutions during the test-time phase. [
10] Furthermore, the one-stage methods mostly include YOLO [
11,
12,
13,
14], SSD (Single Shot MultiBox Detector) [
15] and RetinaNet [
16]. The YOLO method unifies object classification and localization into a regression problem; the detection speed has been greatly increased. YOLO has been successfully applied in the fields of medicine, traffic, remote sensing, agriculture, education and building construction. The YOLO series has been updated in five versions. A semantic segmentation task is defined as the problem of determining the semantic categorization between each pixel of an image. U-Net and DeepLab will be explored as the current representations of the best segmentation network for visible semantic segmentation [
17,
18]. The DeepLab model was first proposed by Google in 2015 for image semantic segmentation, based on fully convolutional networks. The DeepLab series has been updated four times since 2015 [
19,
20,
21,
22]. In the DeepLab series, a more successful ASPP structure was the output feature resolution can be accurately controlled by changing the atrous rates in order to effectively improve the segmentation accuracy.
Gradually, many researchers have investigated the detection of different surface defect objects on solid wood boards and rotary veneers using images [
7,
8,
23,
24,
25,
26]. However, there are still many open issues that remain challenging. Fan et al. used Faster R-CNN for the detection of defects in solid wood panels, and the correct rate of detecting wormhole defects in solid wood panels was 95%. However, the two-stage detection algorithm based on Faster R-CNN sacrifices the premise of real-time, thus improving the correctness of the algorithm, which does not meet the actual real-time demand [
27]. Ye et al. utilized the LBP feature extraction algorithm to detect rotten knots, insect eyes and indentation defects on solid wood panels’ surfaces. The detection frame areas obtained were subject to misclassification and omission. The LBP algorithm was relatively single, and the overly tedious operations still led to poor real-time performance [
28]. Some researchers have constructed a glance multi-channel mask regional convolutional neural network-integrated model, which includes glance network and multi-channel mask R-CNN, but the detection real-time performance needs to be enhanced [
29]. Specifically, the surface of the particleboard is composed of fine particles, and the distribution of gray value in defects is completely different from that of the above boards. At the same time, after field research on the production site, it is concluded that the defect area only accounts for 0.2% of the total surface area of particleboard, and the difficulty lies in the simultaneous consideration of target detection at different scales, and the features of small-scale objects are difficult to identify. Furthermore, many existing studies have examined localization or proximity measurement techniques based on stereovision or marker-based methods. However, many previous detection models have been difficult to directly adopt in order to achieve high performance, balancing accuracy, and efficiency [
30,
31,
32,
33,
34,
35,
36,
37].
To address these issues, a real-time and multi-scale detection model based on particleboard surface defects is proposed. The first section is the proposal of a YOLO v5-Seg-Lab-4 model, which is the first employed for a fusion of object detection and semantic segmentation for particleboard surface defect detection. This enables the model to obtain more information on semantic features without compromising on real-time. The second section is the proposal of the RASPP (Reduced ASPP) and FCAM (Fusion Channel Attention Mechanism) modules, which effectively improve the feature characterization capabilities of the network. The model is able to identify information about small target objects more accurately and save computing time in order to achieve accurate identification of surface defects in particleboard. The model has been implemented in a particleboard factory in Huizhou. The application of the YOLO v5-Seg-Lab-4 model has solved the difficulties of small defect misjudgment and poor real-time inspection, resulting in increased economic advantages and labor savings for the company.
4. Results
Since the shallow feature layer output in the Backbone Seg+ module significantly impacts the accuracy of the detection of the model, this study conducted several trials and ultimately selected No.4 in the backbone network of YOLO v5s as the shallow feature layer output. The No.4 and No.19 in the YOLO v5s backbone network are YOLO v5-Seg-Lab-4 and YOLO v5-Seg-Lab-19.
4.1. Training Results
The loss value represents the difference between the predicted value and the true value [
40,
41,
42], and the size of the value inversely relates to the recognition effect of the predicted box. The training loss and validation loss for YOLO v5-Seg-Lab-4, YOLO v5-Seg-Lab-19 and YOLO v5s are depicted in
Figure 6. With regard to convergence speed and the loss values experienced during training, the YOLO v5-Seg-Lab-4 model outperforms YOLO v5s. The final loss values for training and validation for YOLO v5-Seg-Lab-4 were 0.149 and 0.164, respectively, while the training and validation convergence losses for YOLO v5s were 0.178 and 0.182. The confidence score and predicted true class probability of each bounding box prediction increased significantly as the loss value of the YOLO v5-Seg-Lab-4 model decreases. It was found that YOLO v5-Seg-Lab-4 displayed a high rate of convergence during training for 30 epochs, which decreased between 30 and 90 epochs, and the loss curve converged after 150 epochs.
As illustrated in
Figure 7, the precision, recall and mAP curves of the algorithm in this paper have been compared with those of the YOLOv5s network, with a higher value for each metric indicating a higher performance of the model. During the training process, the evaluation index curve of the algorithm presented in this paper exhibits a flat rise. Four evaluation indexes of the YOLO v5-Seg-Lab-4 are higher than those of the YOLO v5-Seg-Lab-19 and YOLO v5s. A total of 92.15, 91.08% and 89.04% were for precision, 93.38, 87.76% and 86.93% for recall, and 93.32, 89.27% and 85.53% for mAP, respectively. Since shallow feature layers are responsible for identifying areas with large targets, they require a small receptive field. Therefore, the YOLO v5-Seg-Lab-19 model has a large receptive field, which results in decreased model detection.
4.2. Recognition Results of YOLO v5-Seg-Lab-4
According to
Figure 8 and
Figure 9, the recall accuracy curves and F
1 score curves are plotted for the five particleboard surface defects included in the test dataset, with the area occupied by the curves proportional to the model detection effect. As a result, Soft and OilPollution occupy the largest areas, with easy identification due to their homogeneous geometry, the significant differences in gray scale values between these defects and other defects, and the low level of misjudgment rate that are observed. Furthermore, due to the random nature of the sizes of BigShavings, GlueSpot and SandLeakage in the production line, the recognition rate found in the dataset is lower than that of Soft and OilPollution. Grayscale values between SandLeakage panels and particleboard panels are not significantly different, which may make the recognition more difficult.
The results of the YOLO v5-Seg-Lab-4 model for the detection of five particleboard flaws were assessed using four evaluation metrics, including accuracy, recall, F1 score, and mAP, with a correct average rate of 92.4%, 89.8%, 91.1% and 93.2%, respectively, as shown in
Table 3. In this instance, mAP is a crucial indicator of the effectiveness of defect detection. It is the sum of the average accuracy of all categories divided by all categories. The findings demonstrate that the YOLO v5-Seg-Lab-4 model performs superbly in detecting particleboard defects, particularly for Soft, with mAP results reaching 97.9%. With mAP results reaching 94.9%, the OilPollution detection impact is likewise excellent. The correct detection rates of the other three defects are above 90%, indicating that the YOLO v5-Seg-Lab-4 model, with the introduction of the attention mechanism, has an excellent performance in extracting particleboard defect information and improving defect detection accuracy under complex scene conditions.
4.3. Comparison of Different Algorithms
In this paper, the currently popular deep learning algorithms were applied to particleboard surface defects; the representative algorithms included YOLO v5s, YOLO v3, YOLO v4, DeepLab v3+ (MobileNet), DeepLab v3+ (Xception) and U-Net. By default, the weight file with the best training effect is saved as the weight file, which is used at testing time. The experimental results are shown in
Table 4 and
Table 5. The main information involved in the comparison includes model mAP value, mIoU value, single-image recognition time, number of parameters and FPS.
Compared with the YOLO v5s, YOLO v3 and YOLO v4 model, the mAP of the proposed YOLO v5-Seg-Lab-4 model has improved by 2.4%, 5.6% and 12.5%, respectively, and it is a significant improvement. The sensitivity of the SELayer-enhanced model to channel and spatial features was added. The features of useful information and suppression of useless features were emphasized to improve the adaptive ability of the model to the receptive field. Moreover, which mainly benefits SELayer by light architecture, the remarkable improvement in the inspection performance of the YOLO v5-Seg-Lab-4 does not sacrifice the detection speed. The average recognition speed of YOLO v5-Seg-Lab-4 is 56.02 fps (frames per second), and the average detection speed of each image is 17.85 ms, which is 3.95 and 5.02 times higher than the network efficiency of YOLO v4 and YOLO v3, respectively, which shows the potential of YOLO v5-Seg-Lab-4 in the case of limited hardware.
The mIoU of the YOLO v5-Seg-Lab-4-based approach was 5.72%, 3.98% and 10.66% higher in segmentation as compared to DeepLab v3+ (MobileNet), DeepLab v3+ (Xception) and U-Net. The average inference time for each image for the other three models was almost 14.39, 11.95 and 10.19 times slower than YOLO v5-Seg-Lab-4. This suggests that YOLO v5-Seg-Lab-4 is more favorable when high precision and real-time are required. Moreover, which mainly benefits RASPP and FCAM by innovating, the remarkable improvement in the small target defect inspection performance of the YOLO v5-Seg-Lab-4 does mean network detection time is accelerated.
On the original image, the mask map obtained from testing was applied to achieve the segmentation results. Since the particleboard surface defects are in the form of small targets, the defective ROI portion of the segmentation results is intercepted, as shown in
Table 6. The table shows that the segmentation map generated by YOLO v5-Seg-Lab-4 closely matches the ground truth image, and the defect features extracted from the image are considerably enhanced. The fused attention mechanism module in the network is able to focus on pixel points with small target defects, thus filtering out complex interference information from the particleboard surface. Meanwhile, it increases the efficiency and accuracy of the calculation of the model, and it indicates with greater accuracy the distribution position of defects on the particleboard surface with good segmentation results. However, DeepLab v3+ (MobileNet), DeepLab v3+ (Xception) and U-Net failed to capture the edges of small target defects during segmentation. Due to the high similarity between the background of the particleboard and the grayscale values of SandLeakage, a higher percentage of defective pixels were lost from the U-Net. Furthermore, some of the smaller regions in the table that represents defect are not adequately captured by the segmentation models other than YOLO v5-Seg-Lab-4.
5. Discussion
The YOLO v5-Seg-Lab-4 algorithm as a surface defect detection method is applied to particleboard continuous press generation equipment, which is located in Huizhou Fenglin Yachuang particleboard plant, as shown in
Figure 10. Particleboard is moved along the production facility’s conveyor belt at a speed of 1500 mm/s. The JAI SP-5000M-CXP4-USB 3.0 camera is mounted above the conveyor belt, along with a series of LED lights that emit uniform light. The photoelectric sensor is activated when the chipboard moves beneath the light, and the camera then records an image of the chipboard’s surface. The algorithm marks defects in the image and uses them for particleboard defect analysis and categorization determination.
The system was run continuously for 8 h, during which time 8762 particleboards were inspected, each for between 183 and 208 milliseconds, thus meeting the real-time needs of the production line. However, manual inspection takes more than 2000 ms per particleboard, which is nearly ten times slower than the real-time detection of this research method. The detection rates of surface defects for the five particleboard types are shown in
Table 7. Because the particleboard surface was sanded unevenly, the gray values in the under-sanded areas in the middle were significantly lower than the gray values in the surrounding over-sanded areas, leading to the system mistaking low gray values for defects.
Results of the field tests are presented in
Figure 11, where both Soft and GlueSpot detected results between 0.95 and 0.98. Meanwhile, OilPollution, BigShavings, and SandLeakage, although located near the edges of the particleboard, were all accurately identified, unaffected by the size, grayscale unevenness, etc., with detection results between 0.88 and 0.95. The results suggest that the proposed model in this paper can locate small target defects accurately, and the task of determining the defect type and binning can be completed within the specified time for each particleboard. Moreover, the model achieves a lightweight application on mobile devices, meeting the practical needs of particleboard defect detection.
6. Conclusions
According to the characteristics and application requirements of particleboard surface defects, this paper puts forward the defect detection method of YOLO v5-Seg-Lab-4. YOLO v5-Seg-Lab-4 uses FCAM-based fusion of deep and shallow features to recover spatial information and produce sharper segmentation features, and the feature aggregation results in the advantage of multi-rate parallel atous convolution to extract features from different scales. This aforementioned method improves the adaptability of the receptive field, enhances the accuracy and efficiency of five kinds of defect detection, and realizes the detection, segmentation and marking of small target defects on the surface of large-format particleboards. The YOLO v5-Seg-Lab-4 algorithm, as a surface defect detection method, has been put into use in the Huizhou particleboard factory, realizing the classification and board grading of SandLeakage, BigShavings, GlueSpot, OilPollution and Soft. The defect detection accuracy rate reaches 98.2%, the time required for detection is between 183 ms and 208 ms, and the particleboard detection is accurate and efficient. In the future, the method is required to be expanded to several particleboard manufacturers and the algorithm optimized according to the usage environment to solve the problem of particleboard surface defect detection and segmentation in more complex scenarios.