首页|改进Yolov5s的木材表面缺陷实时检测方法

改进Yolov5s的木材表面缺陷实时检测方法

扫码查看
提出了一种改进Yolov5s的木材缺陷实时检测方法,该方法首先替换了Yolov5s网络中计算量开销占比较大的主干结构,实现了轻量化改进,提升了网络速度.其次,对网络颈部中的C3模块进行双通道注意力机制改进,有效提升了模型对缺陷部位的关注度,减少了背景的干扰.成功构建了一种重颈部轻主干的轻量化模型LW-Yolov5.最后,通过构建损失函数,使用双重知识蒸馏策略对新模型进行训练.结果表明:新模型的计算量和参数量分别减少了52.8%和49.5%,CPU推理速度提高了31.6%,检测速度为20.4 FPS,GPU检测速度达到了137 FPS,模型体积仅为7.1 MB,更易于部署,且快速性优于当前主流的单阶段检测网络.在大规模木材缺陷数据集上的平均检测精度mAP为82.5%,检测精度较高.
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.

Wood defectsDefect detectionYolov5 algorithmLightweight networkKnowledge distillation

荣强、田启川、谭润

展开 >

北京建筑大学电气与信息工程学院,北京 100044

北京建筑大学建筑大数据智能处理方法研究北京市重点实验室,北京 100044

木材缺陷 缺陷检测 Yolov5算法 轻量化网络 知识蒸馏

2025

林产工业
国家林业局林产工业规划设计院 中国林产工业协会

林产工业

北大核心
影响因子:0.702
ISSN:1001-5299
年,卷(期):2025.62(1)