融合HGnetv2和注意力机制的钢材表面缺陷检测方法
DOI:
CSTR:
作者:
作者单位:

1.武汉科技大学信息科学与工程学院武汉430081;2.宝信软件(武汉)有限公司武汉430080

作者简介:

通讯作者:

中图分类号:

TP391.4;TN98

基金项目:

国家自然科学基金(62372343)项目资助


Detection method of steel surface defects with fusion of HGnetv2 and attention mechanism
Author:
Affiliation:

1.School of Information Science and Engineering, Wuhan University of Science and Technology, Wuhan 430081,China; 2.Baosight Software(Wuhan)Co., Ltd, Wuhan 430080,China

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    针对多尺度、多类型和复杂背景的钢材表面缺陷检测精度低的问题,设计一种融合HGnetv2和注意力机制的改进YOLOv5算法。首先,基于HGnetv2网络结构引入注意力机制作为骨干层,提升对小目标缺陷的特征提取能力。然后,在特征融合层中,将注意力机制和Involution操作结合,实现对浅层边缘信息和深层语义信息的有效聚合。其次,采用CBME_C2f替换了原模型的C3_Bottleneck,提供了更丰富的梯度流信息。此外,使用一种新的预测框损失VCIoU,通过计算预测框和目标框顶点和两者中心点之间的位置信息特征,提高了边界框回归精度。最后,引入了MetaAconC激活函数,自适应地调整每个特征图通道激活的非线性程度,提高从复杂背景中提取特征信息的性能。实验结果表明,此方法在NEU-DET数据集上平均精度mAP50指数达到了81.4%,相较于YOLOv5s算法提高了5.4%,mAP@50:95指数达到了44.1%,相较于YOLOv5s算法提高了2.8%。除此之外,针对此数据集中的微小缺陷Crazing,平均检测精度达到了55.4%,相比原YOLOv5s提高了18.1%,同时检测速度为80.6 fps。与其他主流的缺陷检测算法对比,该算法在满足对钢材表面检测实时性要求的条件下,提高了检测精度。

    Abstract:

    Addressing the low accuracy problem in detecting multi-scale, multi-type steel surface defects within complex backgrounds, this paper designs an improved YOLOv5 algorithm that integrates HGnetv2 with an attention mechanism. First, the HGnetv2 network incorporates an attention mechanism as a backbone layer to enhance feature extraction capabilities for small target defects. Second, in the feature fusion layer, attention mechanisms and involution operations are combined to achieve effective aggregation of edge features in shallow layers and semantic information in deep layers. Besides, CBME_C2f replaces the C3_Bottleneck module to improve gradient flow. Additionally, a new bounding box loss function, VCIoU, is used to calculate positional features between the vertices and center points of the prediction and target boxes, enhancing bounding box regression precision. Finally, MetaAconC is introduced to adaptively adjust the non-linearity of activation for each feature map channel, improving the ability to extract feature information from complex backgrounds. Experimental results on the NEU-DET dataset show that the proposed method achieves an mAP50 of 81.4% and an mAP@50:95 of 44.1%, which is 5.4% and 2.8% better than YOLOv5s respectively. For the small defects such as crazing in this dataset, the detection accuracy reaches 55.4%, representing an 18.1% improvement over YOLOv5s, while maintaining a detection speed of 80.6 fps. Compared to other mainstream defect detection algorithms, this algorithm improves accuracy while meeting the real-time demands of steel surface defect detection.

    参考文献
    相似文献
    引证文献
引用本文

张航,周毅,邱宇峰.融合HGnetv2和注意力机制的钢材表面缺陷检测方法[J].电子测量与仪器学报,2025,39(1):36-49

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2025-04-03
  • 出版日期:
文章二维码