Improved Yolov5 s Wood Surface Defect Real-Time Detection Method
Aiming at the problems of slow detection speed and poor real-time performance in current wood defect detection algorithms,an improved Yolov5s wood defect real-time detection method was proposed in this paper.Firstly,the proposed method replaced the backbone structure of Yolov5s network,which had a large computational cost,to achieve lightweight improvement and improve network speed.Secondly,the dual-channel attention mechanism is improved for C3 module in the neck of the network,which effectively improved the model's attention to the defective parts and reduced the background interference.A lightweight model LW-Yolov5 with heavy neck and light trunk was implemented.Finally,by constructing a new loss function,the new model was trained by using the dual knowledge distillation strategy.The results showed that the calculation and parameter number of the new model reduced by 52.8%and 49.5%,respectively,the CPU inference speed increased by 31.6%,the detection speed was 20.4 FPS,the GPU detection speed was 137 FPS,and the model volume was only 7.1 MB,which was easier to deploy and faster than the current mainstream single-stage detection network.The average detection accuracy mAP on the wood defect data set was 82.5%,which exhibited higher detection accuracy.