Surface defect detection algorithm of sawnlumber based on YOLOv5
Surface defect detection in sawn lumber is crucial for maintaining high-quality standards in the lumber industry.By detecting surface defects,the industry can ensure that only high-quality lumber reaches the market.This contributes to better overall product quality and customer satisfaction.With the development of science and technology,the demand for higher quality sawn timber has increased.Although the development of deep learning and convolution neural networks has allowed more objective algorithms to be used for the detection of surface defects,the current detection algorithms are slow and poor accuracy.Therefore,improving the accuracy and detection speed of sawn timber surface defect detection algorithms is a crucial challenge.In this study,an improved object detection model was designed based on YOLOv5 with a re-parameterized backbone network to improve the detection speed.A clustering algorithm for YOLOv5 was also proposed to obtain anchors that was suitable for the two datasets.In addition,this study improved the loss function by introducing the SIoU loss function to enhance the accuracy of the prediction boxes and used several data augmentation methods to improve the detection accuracy of the model.Finally,the detection header was decoupled to calculate the prediction box coordinates,confidence,and category probabilities,respectively.Using the NVIDIA RTX3090 graphics processing unit,the improved algorithm achieved a mean accuracy percentage(mAP)of 98.02%and 98.37%on the two sawn lumber surface defect datasets,which were 1.73%and 1.72%higher compared to the original algorithm.The detection times were 6.79 ms and 6.58 ms,which were reduced compared to the speeds of 1.74 s and 1.44 s using the original algorithm.The improved algorithm in this paper was compared with the previous algorithm and common algorithms such as Faster R-CNN and YOLOv3,and the results showed that the improved YOLOv5 in this study had significantly improved speed and accuracy.In addition,the two datasets used in this study were fused,and the improved algorithm achieved a mAP of 94.88%on the fused dataset,with a detection time of 6.89 ms,which had a significant advantage over other comparative algorithms.Finally,the related research results were discussed,revealing that the improved algorithm in this study had a great advantage in detection speed,which also verified the effectiveness of the improved algorithm.
deep learningobject detectionYOlOv5surface defects detectionre-parameterization