In recent years, deep learning has made significant progress in wood panel defect detection. However, there are still challenges such as low detection , slow detection speed, and difficulties in deploying embedded devices on wood panel surfaces. To overcome these issues, we propose a lightweight wood panel defect detection method called YOLOv5-LW, which incorporates attention mechanisms and a feature fusion network.Firstly, to enhance the detection capability of acceptable defects, we introduce the Multi-scale Bi-directional Feature Pyramid Network (MBiFPN) as a feature fusion network. The MBiFPN reduces feature loss, enriches local and detailed features, and improves the model's detection capability for acceptable defects.Secondly, to achieve a lightweight design, we reconstruct the ShuffleNetv2 network model as the backbone network. This reconstruction reduces the number of parameters and computational requirements while maintaining performance. We also introduce the Stem Block and Spatial Pyramid Pooling Fast (SPPF) models to compensate for any accuracy loss resulting from the lightweight design, ensuring the model's detection capabilities remain intact while being computationally efficient.Thirdly, we enhance the backbone network by incorporating Efficient Channel Attention (ECA), which improves the network's focus on key information relevant to defect detection. By attending to essential features, the model becomes more proficient in accurately identifying and localizing defects.We validate the proposed method using a self-developed wood panel defect dataset.The experimental results demonstrate the effectiveness of the improved YOLOv5-LW method. Compared to the original model, our approach achieves a 92.8\% accuracy rate, reduces the number of parameters by 27.78\%, compresses computational volume by 41.25\%, improves detection inference speed by 10.16\%
翻译:近年来,深度学习在木材板材缺陷检测领域取得了显著进展,但仍面临检测精度低、检测速度慢及在嵌入式设备上部署困难等挑战。为克服这些问题,我们提出了一种轻量级木材板材缺陷检测方法YOLOv5-LW,该方法融合了注意力机制与特征融合网络。首先,为提升对可接受缺陷的检测能力,我们引入多尺度双向特征金字塔网络(MBiFPN)作为特征融合网络。MBiFPN能减少特征损失,丰富局部与细节特征,从而增强模型对可接受缺陷的检测能力。其次,为实现轻量化设计,我们重构了ShuffleNetv2网络模型作为主干网络。该重构在保持性能的同时,减少了参数数量和计算需求。我们还引入了Stem Block与空间金字塔池化快速模块(SPPF),以补偿轻量化设计可能带来的精度损失,确保模型在计算高效的条件下保持检测能力。第三,我们通过引入高效通道注意力机制(ECA)增强主干网络,提升网络对缺陷检测关键信息的聚焦能力。通过关注重要特征,模型能更精准地识别和定位缺陷。我们使用自建的木材板材缺陷数据集对提出的方法进行验证。实验结果表明,改进后的YOLOv5-LW方法效果显著:与原始模型相比,我们的方法达到了92.8%的准确率,参数数量减少27.78%,计算量压缩41.25%,检测推理速度提升10.16%。