计算机工程与应用 ›› 2024, Vol. 60 ›› Issue (17): 158-166.DOI: 10.3778/j.issn.1002-8331.2305-0475

• 图形图像处理 • 上一篇    下一篇

基于改进的YOLOv5s刨花板表面小目标缺陷检测算法

查健,陈先中,王文财,关淯尹,张洁   

  1. 1.北京科技大学 自动化学院,北京 100083
    2.北京建筑材料科学研究总院有限公司,北京 100041
  • 出版日期:2024-09-01 发布日期:2024-08-30

Small Defect Detection Algorithm of Particle Board Surface Based on Improved YOLOv5s

ZHA Jian, CHEN Xianzhong, WANG Wencai, GUAN Yuyin, ZHANG Jie   

  1. 1.School of Automation and Electrical Engineering, University of Science and Technology Beijing, Beijing 100083, China
    2.Beijing Building Materials Academy of Science Research, Beijing 100041, China
  • Online:2024-09-01 Published:2024-08-30

摘要: 针对目前刨花板缺陷检测在小目标检测上精度不佳的问题,提出了一种改进的YOLOv5s刨花板表面小缺陷检测算法YOLOv5s-ATG。对刨花板缺陷存在小目标及尺度变化较大缺陷的问题,将原有检测头与自适应空间特征融合网络(ASFF)相结合,以获得更好的特征融合,提高尺度变化较大情况下小目标检测的精度;在主干网络中引入Transformer模块,利用多头自注意力机制捕获全局空间关系,提升网络的特征提取能力;考虑到平衡模型精度和复杂度,在网络的主干和颈部加入Ghostv2模块,去提升算法的实时性。实验结果表明,改进的算法在实际刨花板缺陷数据集上平均精度(mAP)能够达到0.901,与原始YOLOv5s算法相比,mAP提高了0.046;而对于小目标缺陷类型胶斑,mAP提高了0.138。

关键词: 刨花板表面缺陷检测, YOLOv5s, 深度学习, 小目标检测, 特征融合

Abstract: An improved algorithm YOLOv5s-ATG for defecting particle board defects, based on YOLOv5s, is proposed to address the problem of poor precision in small target detection of particle board defect detection at present. To overcome the issue of particle board defects with small targets and large-scale changes, the original detector head is combined with the adaptive spatial feature fusion (ASFF) network to obtain better feature fusion. Transformer module is introduced into the backbone network, which uses a multi head self-attention mechanism to capture global spatial relationships and enhance the feature extraction capability of the network. For balancing the accuracy and complexity of the model, the Ghostv2 module is added to the backbone and neck of the network to improve the real-time performance of the algorithm. The experimental results show that the mean average precision (mAP) of the improved algorithm in the actual particle board defect data set can reach 0.901, which is 0.046 higher than the original model; for small target defect Gluespots, mAP is increased by 0.138.

Key words: particle board surface defect detection, YOLOv5s, deep learning, small target detection, feature fusion