Detection of wood surface defects using YOLOv5-LW model
In order to solve the problems of manual defect detection such as low efficiency,high cost,and high detection error rate of small defects on the surface of wood,and difficulty in deploying embedded devices by the traditional visual detection algorithms,a deep machine learning model,i.e.,deep learning network model YOLOv5-LW,was used in this study to achieve the rapid and accurate detection of different defects in the wood processing process.By reconstructing the S3Net(ShuffleNetV2+Stem+SPPF)network model as the backbone network,the number of parameters and computation time of the model were greatly reduced and the loss of accuracy after lightweighting was deduced.The combination of the backbone network and the ECA attention mechanism improved the network's capability to focus on key information.The feature fusion network MBiFPN was introduced to reduce the feature loss,enrich the local and detail features,and improve the detection capability of fine defects.In this study,the four values of accuracy,detection speed,number of parameters,and floating-point computation were used as the evaluation indexes of the model's performance,and eight sets of experimental data were obtained through the training of the homemade wood defects dataset,and the comparative analysis before and after the enhancement of the model was performed.The experimental results demonstrated that the improved YOLOv5-LW model achieved an accuracy of 92.8%compared with the original model before the improvement,reduced the number of parameters by 27.78%,compressed the computation time by 40.51%,and improved the speed of detection inference by 10.16%.The model accuracy rates for the identification of dead knots,live knots,knots sandwich and cracks were 91.8%,87.8%,96.8%and 94.9%,respectively.The detection accuracies of two types of small defects,dead knots and cracks,were also improved,showing 0.2%and 1.6%,respectively.The recognition effect was better than the other six types of classical detection models,which improved the recognition capability of small wood defects and reduced the errors of detection.Therefore,the model proposed in this study was more suitable to be deployed to embedded devices for real-time detection of wood defects.